Modifying BAPI to fit custom requirements in LSMW

By Vani

A Typical Business Scenario:

Consider a scenario where the existing BAPI function module doesn’t cater to your needs and you need to make some changes to the code. You can take a copy of the BAPI function module to achieve the functionality.  In this case we also need to take a copy of the Business object and the steps are as follows.

  1. Copy the original function module and make necessary changes
  2. Take a copy of the Business object and assign the new function module to the corresponding method.
  3. Create ALE interface.
  4. Create Partner Profile

Consider the below example for detailed explanation of all the steps required. 

Example: 

Materials can be uploaded by using a BAPI function module BAPI_MATERIAL_SAVEREPLICA. The corresponding business object is BUS1001006. 

Consider a case The Material Upload LSMW’s that can be created using a BAPI function module (BAPI_MATERIAL_SAVEREPLICA) for creating different material views. Now there is a requirement, which demands for some changes in the function module. Then the following steps are to be implemented. 

Business Object:

1.      Copy the original function module BAPI_MATERIAL_SAVEREPLICA as ZBAPI_MATERIAL_SAVEREPLICA.  Make necessary code changes to the function module code.

2.      Copy the Business Object BUS1001006 as ZMATERIAL using the transaction SWO1 as shown below.

  

3. Now we need to include our custom function module (ZBAPI_MATERIAL_SAVEREPLICA) in the SAVEREPLICA method of the business object as shown below.   

4.      Generate and Release the Business object (ZMATERIAL).

 Generate ALE Interface: 

5.      Goto transaction BDBG to generate ALE interface for the BAPI. Create the interface as shown below. 

 

6.      The message type, IDOC type and the inbound function module are created. 

LSMW: 

7.  Go to transaction LSMW and on the initial screen, click on SETTINGS à iDoc Inbound Processing.  Maintain the Port and Partner Profile by entering the Port and Partner number and Partner Type.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image