07-23-2009 10:59 AM
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
07-23-2009 11:09 AM
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
07-23-2009 11:06 AM
Steps to create a BAPI ... search in SCN .... no other method to bet the best solution
07-23-2009 11:08 AM
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
07-23-2009 11:23 AM
07-23-2009 11:09 AM
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
07-23-2009 11:17 AM
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.
07-24-2009 10:46 AM