05-23-2016 6:02 AM
Hi Experts,
I have a requirement where I need to update custom fields of a PO using BAPI extensions. I am filling BAPI_TE_MEPOHEADER and passing it to extensions structure of BAPI_PO_CHANGE. My code works but throws ATC error as "After a structure enhancement, the assignment or comparison may no longer be permitted. syntactically incorrect."
Below are the 3 approaches I am going with, but both gave me same atc error.
code 1 :
MOVE 'BAPI_TE_MEPOHEADER' TO gs_extensionin-structure.
MOVE gs_bapi_te_mepoheader TO gs_extensionin-valuepart1. --> Error here
APPEND gs_extensionin TO gt_extensionin.
Code 2 :
data : lv_value(960).
MOVE 'BAPI_TE_MEPOHEADER' TO gs_extensionin-structure.
MOVE gs_bapi_te_mepoheader TO lv_value. --> Error here
class cl_abap_container_utilities definition load.
call method cl_abap_container_utilities=>read_container_c
exporting
im_container = lv_value
importing
ex_value = gs_extensionin
exceptions
illegal_parameter_type = 1
others = 2.
APPEND gs_extensionin TO gt_extensionin.
Code 3 :
MOVE 'BAPI_TE_MEPOHEADER' TO gs_extensionin-structure.
MOVE gs_bapi_te_mepoheader TO lv_value. --> Error Here
* gs_extensionin-valuepart1 = lv_value+0(240).
* gs_extensionin-valuepart2 = lv_value+240(240).
APPEND gs_extensionin TO gt_extensionin.
Can you please share your experience and expertise if you have faced a similar issue ?
Thanks and Regards,
Anil Supraj
05-23-2016 6:32 AM
05-23-2016 6:42 AM
05-23-2016 7:06 AM
Hi Anil,
It should be a warning. Check the enhancement category of the structure used. If it is 'can be enhanced' then it gives warning that in future if you enhance the structure it might effect the other dependencies and it is not a problem. Else you can make the enhancement category as 'canto be enhanced' and you will not get this warning.
05-23-2016 7:24 AM
Hi Pranay,
Thanks for making me understand the warning.
a small query, when we set the enhancement category as "cannot be enhanced", we will not be able to add new fields I believe(please correct if I am wrong). If that is the case, will the custom fields added to the structure gets deleted after we change the enh category ?
Thanks,
Anil
05-23-2016 7:39 AM
Hi Anil,
The structure 'cannot be enhanced' means you can not add include/append structure to it. However, You can add custom fields to it. and Existing custom fields does not gets deleted after changing enhancement category.
02-02-2022 12:55 PM
Instead of MOVE statement or assignment operator, CONCATENATE the contents of the structure into the corresponding field as required.
02-02-2022 3:10 PM
Use UNICODE compatible syntax
gs_extensionin-structure = 'BAPI_TE_MEPOHEADER'.
cl_abap_container_utilities=>fill_container_c(
EXPORTING
im_value = gs_bapi_te_mepoheader
IMPORTING
ex_container = gs_extensionin+30 ).
12-13-2023 9:51 AM
i am facing this issue while create sale order using BAPI Function module. CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'.
if your are going to enhance the BAPE_VBAK or BAPE_VBAP structure. Like adding append structure.
Use the Enhancement category .
And try the ATC check .
Now Warning or error message will be removed .