Skip to Content
Author's profile photo Jitendra Kansal

Retrieving the Data from SAP Backend using BAPI

Dear All,
Tools used in developing this application are:
S/W Environment: SAP ECC 6.0, NWDS 7.0.
This is very simple application by which you can retreive data from SAP backend using a BAPI.
Here I am using BAPI called Bapi_Customer_Getdetail
You have to pass two parameters: 
1.PNG
When you pass above two parameters you will be getting the entire information about  a particular customer.
Output would be like:
1.PNG
Here is the basic procedure to develop the application.
  1. Design the below structure. Here you are using two views.
1.PNG
2. Create a model to get the information from the SAP backend. Click on Next.
1.PNG
3. Provide useful SAP logon credential to access the BAPI.
4. Give BAPI name as bapi_customer_Getdetail. 
After finishing your model structure look like this
1.PNG
5. Right click on Used Models and add the created model to the list.
1.PNG
6. To follow the flow of dependency to the component controller with model you have to do model binding. For that create a model node Bapi_Customer_Getdetail_Input then right click on it and do model binding.
1.PNG
7. Select all parameters .
1.PNG
8. Create an outbound plug in firstview
and an inbound plug in customerInformationViewfor navigating.
9.  Create an action on firstView

 

10. Create the view’s dependencies to the component controller(go to properties of view’s)

 

1.PNG

 

11. Create a method customer_Details in component controller .Write below code in the action created on first view

 

1.PNG

 

12. Go to method created in component controller. Write following code.

 

1.PNG

 

 

 

 

13. Go to CustomerInformationView and create a model node with name Bapi_Customer_Getdetail_Input and do context mapping with component controller.

14.  Go to layout of the same view,  Insert a label and a text view

 

Give a name to label: Street

 

Bind text view’s text to street as shown below:

 

1.PNG

 

 

15. Repeat step 14 for the below fields and bind with corresponding parameters.

 

1.PNG

 

 

16. Deploy the application. Your firstView looks like below.

 

1.PNG

 

 

17. Click on the button. You will get the required output.

1.PNG
Regards,
Jitendra Kansal

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.