Creating Sales Scheduling Agreement with Extensions using BAPI

...Previous

·         Enhance Structure VBAPKOZ by appending a structure (ZMSOTC_LIFNR_COM) which contains the two fields – ZZMTLIFNR and ZZMTIDNEX.  

·         Enhance VBAPKOZX by appending structure (ZMSOTC_LIFNR_COMX) containing two flag fields – ZZMTLIFNR (single character) and ZZMTIDNEX (single character). This structure has to be enhanced because the BAPIs work with checkboxes.

  • Adjust the following structures for customer enhancements to table VBAK:

a) VBAKKOZ

b) VBAKKOZX

c) BAPE_VBAK

d) BAPE_VBAKX

  • Adjust the following structures for customer enhancements to table VBEK:

a) VBEPKOZ

b) VBEPKOZX

c) BAPE_VBEP

d) BAPE_VBEPX

  • Now the structural enhancements have been done and the coding part has to be done in this manner :

Populate EXTENSIONIN-STRUCTURE with ‘BAPE_VBAP’.

Populate 11th to 26th character EXTENSIONIN-VALUEPART1 with string which is a concatenation of fields VBAP-POSNR and VBAP-ZZMTLIFNR.

The first 10 characters of EXTENSION-VALUEPART1 are reserved for VBAP-VBELN and the Z fields to be populated are passed to VALUEPART1 as subsequent characters of this field.

 Append this record to table EXTENSIONIN.

Populate EXTENSION-STRUCTURE with BAPE_VBAPX.

Populate 11th to 17th characters of EXTENSIONIN-VALUEPART1 with a string which is a concatenation of fields VBAP-POSNR and ‘X’.

The first 10 characters of EXTENSION-VALUEPART1 are reserved for VBAP-VBELN and the Z fields to be populated are passed to VALUEPART1 as subsequent characters of this field.

Append this record also to table EXTENSIONIN.

    

Now all the parameters that need to be passed to the BAPI have been populated. The BAPI will be called now:

The scheduling agreement that is created is returned in the importing parameter SALESDOCUMENT_EX and if the RETURN table does not have any error messages or abort messages then BAPI_TRANSACTION_COMMIT is called.  

In this manner a Sales Scheduling Agreement with Extensions is created using BAPI.

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