Application Development 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: 

LSMW Methods - BAPI and IDOC - why used together?

Former Member
0 Kudos

Hi,

There are four mathods available in LSMW:

- Direct Input

- BAPI

- IDOC

- BDC

Among these BAPI and IDOC always go hand in hand. In case we choose to go in for IDOC, we will have to enter the partner profile settings for an inbound IDOC. But in case we choose to go with th BAPI method, even then we have to mention the inbound IDOC settings.

I would like to know why is this so; if there is a provision for two separate methods, why do we need to use IDOC if a BAPI is selected.

Please advise.

Regards,

Namrata

2 REPLIES 2

former_member183994
Active Participant
0 Kudos

In LSMW, BAPI method by default uses iDoc as a medium exchange in order to be passed as parameters to it. Actually, a text file is created when you convert the data with iDoc format. From there, you have two options: Either go on with LSMW steps (create idocs from text file, then run idoc transactions) OR go on with SXDA workbench (create a project there and run a job which essentially calls the BAPI).

There are two different methods because SAP developed them at different times. First, they had the ALE layer (as middleware for SAP to SAP/non-SAP communication) that uses the idoc as medium exchange, then at a later time BAPIs were developed as RFC function modules/object methods. Since idoc were already in place, they used that as medium exchange for BAPIs, too.

I hope that is clearer now.

Former Member
0 Kudos

IDOC came in before BAPIs. BAPIs came in an enhanced version of SAP which included the functionality of IDOCs as well.