01-08-2008 3:14 PM
Hi All,
I have added some custome fields in the table VBAK. Now i want to update these fields using BAPI_SALESORDER_CHANGE which are not present in it currently. So how can i extend BAPI to update the custom fields ???
01-08-2008 4:11 PM
Hi,
first, go to SE37 and check the BAPI's default documentation for the EXTENSIONIN table parameter. There, it explains analytically what you have to do in order to update Z fields that have been appended in VBAK or VBAP through the standard BAPI.
NOTE that you MUST have updated accordingly the tables/structures VBAKKOZ, VBAKKOZX, BAPE_VBAK, BAPE_VBAKX
So, if the sales order number is 1000000001 and your added custom field is named ZZCUST with length 5 chars and you want to set the ZZCUST value to ABCDEm, then append a line in EXTENSIOIN as follows:
EXTENSIONIN-STRUCTURE = BAPE_VBAK
EXTENSIONIN-VALUEPART1 = 1000000001ABCDE
Also, call the BAPI passing the 1000000001 (sales order document number to the SALESDOCUMENT parameter and set the UPDATEFLAG field of the structure ORDER_HEADER_INX to 'X' to make the BAPI actually update the sales document header data (includind the new Z field).
Try it and READ the BAPI's standard documentation!
Reward if it helps,
Regards,
George