Calling BAPI from Webdynpro

Calling BAPI from Webdynpro
In the Wizard: Start the “Web Dynpro Wizard” through menu option create -> service call from context menu of the Web Dynpro component
 
Use existing component controller, – Select all parameters, except EXTENSION_IN and EXTENSION_OUT


– Use Function module: BAPI_FLIGHT_GETLIST


Specify method name: EXECUTE_BAPI_FLIGHT_GETLIST



Map nodes DATE_RANGE, DESTINATION_FROM and DESTINATION_TO to the view context.

Go on the Layout tab, Create a group & Create labels and inputfields and bind the inputfields to the following context attributes:

  • DESTINATION_FROM.CITY
  • DESTINATION_FROM.COUNTR
  • DESTINATION_TO.CITY
  • DESTINATION_TO.COUNTR
  • DATE_RANGE.LOW
  • DATE_RANGE.HIGH
  • Create a “Search” button, which triggers a action to fire a outbound plug. (Create also the action and the plug)

Map node FLIGHT_LIST to the view context.

Go on the Layout tab and create a table UI element for displaying the flight list, Web Dynpro Code Wizard.

Go to the Inbound Plug tab and create an inbound plug

Navigate to the Window tab of the window MAIN and embed the two views. Create a navigation link from the outbound plug of the INPUT_VIEW to the inbound plug of the DISPLAY_VIEW. Set INPUT_VIEW as default.

Navigate to the component controller context and change the cardinality of node DATE_RANGE to 1..n.

Set in the component controller the default values to the following attributes:

DATE_RANGE.SIGN = I

DATE_RANGE.OPTION = BT

Invoke method BAPI_FLIGHT_GETLIST

Navigate to method WDDOINIT of the DISPLAY_VIEW and invoke method BAPI_FLIGHT_GETLIST.

Hint: Use the Web Dynpro Code Wizard

METHOD wddoinit .

wd_comp_controller->execute_bapi_flight_getlist( ).

ENDMETHOD.

Leave a Reply

Your email address will not be published. Required fields are marked *