‎2011 Dec 20 10:32 PM
Hi I am using the BAPI sd_salesdocument_create to create sales orders and need to pass the field Tax Number 1 (STCD1) for the case of a customer CPD. I'm using the table EXTENSIONIN as follows but not recorded the field.
EXTENSIONIN-STRUCTURE = 'VBPA3KOM'
EXTENSIONIN-VALUEPART1 = ' 000000AG10406707933'
Thanks.
‎2011 Dec 21 2:30 AM
The coding for extension to SD_SALESDOCUMENT_CREATE goes like below. Here, I am populating a new field VBAK-ZZ_FIELD with a value. Later I will pass EXTENSIONIN table to SD_SALESDOCUMENT_CREATE.
You need to do similar coding for the field STCD1 for your structure.
DATA: extensionin LIKE bapiparex OCCURS 0 WITH HEADER LINE.
DATA: ls_bape_vbak LIKE bape_vbak,
ls_bape_vbakx LIKE bape_vbakx.
CLEAR extensionin.
MOVE 'BAPE_VBAK' TO extensionin-structure.
ls_bape_vbak-zz_field = 'Value'.
MOVE ls_bape_vbak TO extensionin-valuepart1.
APPEND extensionin.
CLEAR extensionin.
MOVE 'BAPE_VBAKX' TO extensionin-structure.
MOVE 'X' TO ls_bape_vbakx-zz_field.
MOVE ls_bape_vbakx TO extensionin-valuepart1.
APPEND extensionin.
‎2011 Dec 21 3:45 AM
Hi,
This is discussed no of times in the forum.Please go through this note 143580 .It is in detail.
Regards,
Madhu.
‎2011 Dec 21 3:14 PM
The Note 143580 is for enhancement customer fields, in my case the field Tax Number 1 (SCTD1) exists in the CPD customer screen when registering a sales order. The Tax Number 1 field is stored in the table VBPA3, as I can record this field by SD_SALESDOCUMENT_CREATE BAPI?
Thanks.
‎2013 Dec 10 5:26 PM
Daniel, i have a similar problem, using the bapi.: BAPI_SALESORDER_CREATEFROMDAT2
I use the EXTENSIONIN table as follows, but the data for the fields that we need are empty.
This is my code to fill the EXTENSIONIN table:
Do you see something wrong?
"dato de CPD - si corresponde.
tBapiEXT-structure = 'VBPA3KOM'.
clear tvbpa3kom.
tvbpa3kom-stcd1 = lineas-stcd1.
tvbpa3kom-stkzn = lineas-stkzn.
MOVE tvbpa3kom TO tbapiEXT-valuepart1.
append tBapiExt.
clear tBapiExt.
do yo resolve your problem?
can you help me?
best regards.
Joel
‎2014 Jan 02 8:18 AM
According to documentation parameter EXTENSIONIN can be used to fill fields that belong to tables: VBAK, VBAP, VBEP and VBKD - so it's no surprise that it's not working for other structures.
But the workaround I used to fill fields of VBPA3 when calling SD order BAPIs is as follows:
1. Before calling BAPI fm in your program: export your data - that you want to set in VBPA3 - to ABAP memory - with statement like: "export ... to memory id ..."
2. Implement user exit USEREXIT_SAVE_DOCUMENT_PREPARE in include MV45AFZZ - or if you wish you can implement BAdI instead (BADI_SD_SALES, method SAVE_DOCUMENT_PREPARE).
Within your code of the exit import the data you have exported before ("import ... from memory id ...") and use these data to fill required fields in internal table XVBPA - this internal table contains fields of VBPA3 among others.
That's all.
regards