You are on page 1of 11

Creating a BSP application to retrieve Material information

Business Server Pages (BSP) Creating a BSP application to retrieve Material information

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information


Go to transaction SE80. Select BSP application and input the name of the BSP application that you want to create.

Save and activate the application. Right click on the application name and click create page.

The resultant window appears as follows. Enter the name of the page that you want to create. In this case it is the default.htm that I am creating. Enter the description of the page and click on continue.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information

Click save.

You can observe the pages with flow logic and under that you can find default.htm page in the BSP application tree.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information

Change the code in the layout as shown in the image below or copy and paste the code given below in the layout window.

<%@ page language="abap" %> <html> <body BGCOLOR="#B5E1D2" > <h2> <B> MATERIAL DETAILS </B> </h2> <form method="post"> Material Number <input type=text name="matnr" value="" > <input type=text name="matnr2" value="" > <p> <input type=submit name="onInputProcessing(select)" value="Get Details"> <p> <input type=submit name="onInputProcessing(materials)" value="Get All"> <p> <center> <table border=1> <% data: wa_mara type mara. %> <% if i_mara is not initial. %> <tr> <td><b>MATNR</b></td> <td><b>ERSDA</b></td> <td><b>LAEDA</b></td> <td><b>VPSTA</b></td> </tr>

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information


<% loop at i_mara into wa_mara. %> <tr> <td> <%= wa_mara-matnr %> </td> <td> <%= wa_mara-ersda %> </td> <td> <%= wa_mara-laeda %> </td> <td> <%= wa_mara-vpsta %> </td> </tr> <% endloop. %> <% else. %> <tr> <td><b>MATNR</b></td> <td><b>ERSDA</b></td> <td><b>LAEDA</b></td> </tr> <% loop at it_mara into S_mara. %> <tr> <td> <%= S_mara-matnr %> </td> <td> <%= S_mara-ersda %> </td> <td> <%= S_mara-laeda %> </td> </tr> <% endloop. %> <% endif. %> </table> </form> </body> </html>

Create the page attributes as shown below.

Save, Check and activate the BSP application and execute. Enter the login name and password in the pop-up that appears.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information

The BSP page looks as shown below.

In the Event Handler tab, under OnInputProcessing tab, write the code as shown below or copy and paste the code that is given below.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information

Code under OnInputProcessing. CASE EVENT_ID. WHEN 'select'. NAVIGATION->SET_PARAMETER( 'matnr' ). SELECT * FROM MARA INTO TABLE I_MARA WHERE MATNR BETWEEN MATNR AND MATNR2. WHEN 'materials'. SELECT * FROM MARA INTO TABLE I_MARA. WHEN OTHERS. ENDCASE. Click on the BSP application name and input as shown below.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information


Save, check and activate the BSP application and then execute the application. The page would be displayed as shown below.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information

Enter the material numbers in the textboxes and then click on Get details. The output would be as follows. The output is a result of the select query that we fired selecting the specified set of fields.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information

Click on the Get all button to get the output as follows. Remember, we have fired a select query selecting all the records from the database table MARA and are displaying it.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

Creating a BSP application to retrieve Material information

For Tutorials on various Technical Topics, please visit

All product names are trademarks of their respective companies. SAPTechnical.COM, Inc. is in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver, and and any other SAP trademarks are registered trademarks of SAP AG in Germany and in several other countries. Every effort is made to ensure content integrity. Use information on this site at your own risk.

For more tips, tutorials, Interview questions, certification questions, please visit SAPTechnical.com

You might also like