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

how to call 2 function module together

Former Member
0 Likes
7,165

Hi,

How to execute two function modules one after the other.

I am executing the Function module BAPI_INCOMINGINVOICE_CREATE, followed by i need to run the function module BAPI_TRANSACTION_COMMIT. How to do this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,818

Hi,

You can go to se37 and write the BAPI to be tested first.

Then from 'Function MOdule->TEST->TEST SEQUENCES'

Here you can write the FM/BAPI to be executed next.

Hope this helps

Regards

Nishant

5 REPLIES 5
Read only

gopi_narendra
Active Contributor
0 Likes
3,818

just after u call teh first BAPI, u can call the 2nd BAPI

read the BAPIRET into a table and check if TYPE is not error or warning, then call the 2nd BAPI 'BAPI_TRANSACTION_COMMIT

Read only

Former Member
0 Likes
3,818

Hi ,

You can call Function modules one after the other. In your case after calling the Bapi BAPI_INCOMINGINVOICE_CREATE you can check the return table , if there are any entries/messages with Type E or A then you can exit with out calling second BAPI and if there are no messages in return table of type E or A then you can call second bapi as usual.

Hope this helps.

Read only

Former Member
0 Likes
3,818

Hi Preethi,

If you ae using these function modules in any program then you can use directly one after the other. If you want to just try to execute these bapi's then goto Invoice crate BAPI and in the menu's there is option to test the BAPI in sequesnce. There you specify the sequeces of the BAPI's you need to execute. First provide the Invoince BAPi and then the Commit BAPI.

Regards,

ram

Pls reward points if helpful

Read only

Former Member
0 Likes
3,818

Call function 'BAPI_INCOMINGINVOICE_CREATE'

exporting

importing

exceptions.

if sy-subrc = 0.

Call function 'BAPI_TRANSACTION_COMMIT'

exporting

importing

exceptions.

endif.

Read only

Former Member
0 Likes
3,819

Hi,

You can go to se37 and write the BAPI to be tested first.

Then from 'Function MOdule->TEST->TEST SEQUENCES'

Here you can write the FM/BAPI to be executed next.

Hope this helps

Regards

Nishant