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

Custome BAPI - declare ITAB and define the Function Module and Subroutine

Former Member
0 Likes
851

Hello Experts

I want to create a Custom BAPI and it has the following scenario:

1) a Function Module which collects some records into it internal table, say ITAB
2) a Subroutine which moved the records from ITAB to BAPI table

Now, I want to declare ITAB and define the Function Module and Subroutine.
Where and How can I do this?

Plz suggest.

Regards

BD

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
770

Hi,

You can directly use the ITAB as the BAPI table. Assign ITAB under TABLES in the BAPI, and in the code of the BAPI call the function module passing ITAB as the import paramerter of the function module. Thus what ever records the function module is collecting will directly be collected in the BAPI table.

Regards,

Vik

6 REPLIES 6
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
770

Steps to create a BAPI ... search in SCN .... no other method to bet the best solution

Read only

0 Likes
770

Hi Keshu

But this is not with the whole process of creating BAPI.. I just want to have an additional FM and Subroutine. Thats all.

Thanks

Read only

0 Likes
770

those comes under the steps of BAPI creation...:-)

Read only

Former Member
0 Likes
771

Hi,

You can directly use the ITAB as the BAPI table. Assign ITAB under TABLES in the BAPI, and in the code of the BAPI call the function module passing ITAB as the import paramerter of the function module. Thus what ever records the function module is collecting will directly be collected in the BAPI table.

Regards,

Vik

Read only

Former Member
0 Likes
770

Hi,

1) Got to SE37 and create an RFC .

2) Declare the ITAB directly in the TABLES tab of the FM.

3) Inside the FM source Code tab, collect all the data using SELECT query and directly or by using logic, put the data into the

ITAB.

4) Since the data collected is directly put into the itab you dont need a subroutine to be written.

5) If subroutine is a necessity, then just write PERFORM SUB ROUTINE NAME.

AND DEFINE THE FORM ENDFORM OF THE SUBROUTINE AFTER THE ENDFUNCTION OF THE FM

Let me know if any issues....

Regards,

Vimal.

Read only

Former Member
0 Likes
770