In Web Dynpro ABAP you can use Service calls, Service call is the services provided by the model layer of the WDA Application this is kind of custom controller or component.

We will explain how to use service call in Web Dynpro ABAP to call ALV Grid for displaying data.

1.Go to transaction SE80 and create Web Dynpro Intf/Comp

display-alv-web-dynpro-abap-service-call-1

2.In the second step you need to create context first, this sample we want to display Sales Header data from table VBAK.

display-alv-web-dynpro-abap-service-call-5

Create Function module with parameter is same with context attributes. this function module we will use in the service call.

display-alv-web-dynpro-abap-service-call-14

3.Right clicking on your web dynpro component, and select Create->Service Call.

display-alv-web-dynpro-abap-service-call-2

3.After you click on menu Create->Service call, the Wizard screen will open up. on the second wizard screen, select Use Existent Controller because in this example we dont want create new controller.

display-alv-web-dynpro-abap-service-call-3

4. On the next wizard screen, SAP System provide us with 4 option : Function module, Assistance Class Method, Class Method and Web Service Proxy. In this example we choose Function Module.

display-alv-web-dynpro-abap-service-call-4

5.Enter your function module which you’ve created. In this wizard screen, you need to change Obj Type in your function module parameter from Controller Attribute into Context Node/Attribute.

Click button Continue, the next screen SAP System will generate method automatically. just click Next and complete

display-alv-web-dynpro-abap-service-call-6

6.After finish process, you will see new context node with Importing and Changing as picture below.

display-alv-web-dynpro-abap-service-call-7

7.Now go to MAIN View and drag importing context node to context view.

display-alv-web-dynpro-abap-service-call-8

8. Go to Layout tab in MAIN View and create UI Element Input Field, This layout consist of Label Element, Input Field, Horizontal Gutter for Separation, and ViewContainer ( ALV Table ).

Next create Action GETDATA for Button Get Data.

display-alv-web-dynpro-abap-service-call-9

9. Go to Action tab, double click on GETDATA Action and write ABAP Code. This ABAP Code will call function module in Service Call.

10. Back to Layout tab and click on INP_VKORG ( Input Field ), you need to bind this UI Element to Context View.

display-alv-web-dynpro-abap-service-call-10

11. Add Component SALV_WD_TABLE and enter ALV_TABLE ( UI ViewContainer name ) into Component Use field.

display-alv-web-dynpro-abap-service-call-11

12. Drag and Drop IT_SALES_DATA from Context Node to INTERFACECONTROLLER_USAGE in COMPONENT USAGE->ALV_TABLE.
display-alv-web-dynpro-abap-service-call-12

display-alv-web-dynpro-abap-service-call-13

Incoming search terms:

Leave a Reply

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