Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

create a function module to display data from bapi's

Former Member
0 Likes
1,945

Hi,

I need help to create a function module to  display data from bapi's.

There are 3 bapis:

1-bapi_identificationdetails_get.

2-BAPI_BUPA_CENTRAL_GETDETAIL

3-BAPI_BUPA_ADDRESS_GETDETAIL

Through these bapis: I need to display the following data:

first name, last name, nationality, add1, add2, home no, mobile no, bp no, bp type, bp kind, email id, city, postal code, passport visa details.

Please tell me how to proceed  writing the code.

1 ACCEPTED SOLUTION
Read only

former_member193464
Contributor
0 Likes
1,464

Hi
     Check what are the inputs to these BAPI . I think the output you need is the combined output fields you will get from all three BAPI's. You need to map your output fields to BAPI output fields. Also check what input you need to provide to your F.M. as it should be adequate to run these BAPI. once you have output of all the three BAPI output just combine them to a final table to show your output.

3 REPLIES 3
Read only

former_member193464
Contributor
0 Likes
1,465

Hi
     Check what are the inputs to these BAPI . I think the output you need is the combined output fields you will get from all three BAPI's. You need to map your output fields to BAPI output fields. Also check what input you need to provide to your F.M. as it should be adequate to run these BAPI. once you have output of all the three BAPI output just combine them to a final table to show your output.

Read only

0 Likes
1,464

hi maverick,

you are correct that I need the combined output from all the 3 bapi's, but I have declared 2 output structures in my function module which I have declared in export parameters.

1-e_bp_str1

2-e_bp_str2

The input is bp no which in turn is also a part of str1,  Through this func module I am going to display the bp details of a particular business partner.

In str1 I have included general information as bp no, bp kind, bp type, first name, last name, nationality etc

In str2 I have included contact information such as add1 add2 city postal code, mobile, home  telephone nos etc

My doubt is that I have declared these fields in both the structures with reference to tables such as but000, but0id, adrc , adr2 etc, so should I declare them the same way as it is declared in the bapis or I should continue with my existing declaration.

ALso if you can guide with the use of any  1 of these bapi, I will be grateful.

thanks in advance.

Read only

former_member193464
Contributor
0 Likes
1,464

for output you can keep your field references to table types it will be fine...
but when you are giving input to the BAPI you need to define BAPI input and output parameters. Later you can move your output to your corresponding strings.

for e.g.

pass your bp no. to the below F.M. and you will get details in identification details , check what details you need from this table and pass it to your corresponding string.

Data: lt_ident type standard table of BAPIBUS1006_ID_DETAILS.

CALL FUNCTION 'BAPI_IDENTIFICATIONDETAILS_GET'

   EXPORTING

     BUSINESSPARTNER            = bpno

  TABLES

    IDENTIFICATIONDETAIL       = lt_ident

    RETURN                =       lt_return.