03-30-2015 11:46 AM
Dear Expert ,
My requirement is to update a Z field ,which is a header field in VA02 Tcode and i have to update through BAPI .
for that i have written below code but value is not getting update and in return parameter success message is coming . please help to solve me to solve it .
ls_bape_vbak-vbeln = lv_sales_document.
ls_bape_vbak-yyclmstat = 'X'.
ls_extensionin-structure = 'BAPE_VBAK'.
ls_extensionin-valuepart1 = ls_bape_vbak.
APPEND ls_extensionin TO it_extensionin.
CLEAR ls_extensionin.
CLEAR ls_bape_vbak.
ls_bape_vbakx-vbeln = lv_sales_document.
ls_bape_vbakx-yyclmstat = 'X'.
ls_extensionin-structure = 'BAPE_VBAKX'.
ls_extensionin-valuepart1 = ls_bape_vbakx.
APPEND ls_extensionin TO it_extensionin.
CLEAR ls_extensionin.
CLEAR ls_bape_vbakx.
SELECT SINGLE vkorg vtweg spart
INTO (lv_vkorg, lv_vtweg, lv_spart)
FROM vbak
WHERE vbeln = lv_sales_document.
ls_header-sales_org = lv_vkorg.
ls_header-distr_chan = lv_vtweg.
ls_header-division = lv_spart.
ls_header_x-updateflag = 'U'.
ls_header_x-sales_org = 'X'.
ls_header_x-distr_chan = 'X'.
ls_header_x-division = 'X'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = lv_sales_document
order_header_in = ls_header
order_header_inx = ls_header_x
* SIMULATION = ' '
TABLES
return = it_return
* schedule_lines = it_schedule
* schedule_linesx = it_schedule_x
extensionin = it_extensionin.
WAIT UP TO 2 SECONDS.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = lv_wait.
03-30-2015 12:24 PM
Hi,
Instead of passing the direct structure to ls_extensionin-valuepart1, just concatenate the sales doc. no. and custom field value and then pass the concatenated result to that parameter.
Also have you added the structures to VBAKKOZ, VBAKKOZX, BAPE_VBAK, BAPE_VBAKX.
Hope it resolves.
Regards,
Suresh
03-30-2015 12:24 PM
Hi,
Instead of passing the direct structure to ls_extensionin-valuepart1, just concatenate the sales doc. no. and custom field value and then pass the concatenated result to that parameter.
Also have you added the structures to VBAKKOZ, VBAKKOZX, BAPE_VBAK, BAPE_VBAKX.
Hope it resolves.
Regards,
Suresh
03-30-2015 1:43 PM
Dear Sir ,
i am applying all the solution u have mentioned above but still its not getting update .
Regards,
Debesh
03-30-2015 12:25 PM
Hi Debesh,
I hope you can use Extension attribute in FM 'BAPI_SALESORDER_CHANGE.
Kindly refer the following Snote for custom field updation.
143580 - Information on SD BAPIs and customer enhancement concept
Regards
Rajkumar Narasimman
03-30-2015 12:28 PM
Did you append your yy/zz fields to both structures BAPE_VBAK (this one seems to be ok) and VBAKKOZ?
Regards,
Raymond
03-30-2015 1:44 PM
03-30-2015 1:51 PM
03-30-2015 2:07 PM
Also check for any BAdI or SD Exit that manage this field.
Regards,
Raymond
03-30-2015 1:50 PM
Thanks to all ,, i am debugging the BAPI , if i will update here if i got any solution .