BSP Application on using a tree

...Previous

In the ‘Page Attributes, of treepage.htm, enter the attributes as shown below. 

 

We need our application to display the data by giving the input in the inputbox and when the treenode is clicked.

So we write the code in the ‘OnInputProcessing’ event. 

In the ‘Event Handler’ tab of treepage.htm, under ‘OnInputProcessing’ event, write the following code.

 

Code:
* event handler for checking and processing user input and
* for defining navigation
 DATA: event TYPE REF TO CL_HTMLB_EVENT.
  event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
 DATA: MATNO_low TYPE REF TO CL_HTMLB_INPUTFIELD.
 MATNO_low ?= CL_HTMLB_MANAGER=>GET_DATA(
                                REQUEST = RUNTIME->SERVER->REQUEST
                               NAME     = 'inputField'
                               ID       = 'p_MATNR_low'  ).
  DATA: MATNO_high TYPE REF TO CL_HTMLB_INPUTFIELD.
 MATNO_high ?= CL_HTMLB_MANAGER=>GET_DATA(
                                REQUEST = RUNTIME->SERVER->REQUEST
                               NAME     = 'inputField'
                               ID       = 'p_MATNR_high'  ).
      DATA: tree_event TYPE REF TO CL_HTMLB_EVENT_TREE.
 tree_event ?= event.
 node = tree_event->node.
 if matno_low is not initial and matno_high is not initial.
 matnr_low = matno_low->value.
  matnr_high = matno_high->value.
 case node.
   when 'mara'.
       select * from mara into table it_mara where matnr between matnr_low and matnr_high.
   WHEN 'mard'.
  select * from mard into table it_mard where matnr between matnr_low and matnr_high.
       endcase.
       endif.

Save, Check and activate the treepage.htm. Save, check and activate the application. 

Enter the login details in the window to continue executing the application. 

 

The screen looks as shown below. Input the values as shown below and click on the treenode named ‘mara’. 

 

The output looks as follows.

Now click on the treenode ‘mard’ for the storage location data of the materials. 

Now we are done with displaying the table contents using ‘tree’ on the BSP Application pages.

 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image