2016 Aug 24 1:33 PM
Hi SDNites,
I have enhanced EKPO table where the table has quantity custom field as well. So when I am using BAPI_PO_CHANGE, it is not allowing me to do due to the quanity fields in enhanced EKPO table.
In order to achieve the above, I am trying to implement method MAP2I_EXTENSIONIN of BADI ME_BAPI_PO_CUST. Can you please help me how do I convert th quantity field in changing structure CH_STRUC. When I am trying to do the same it is giving a short dump. Can you please advise or provide a sample code.
Regards,
Abhi
2016 Aug 24 1:46 PM
Did you copy from demo class CL_EXM_IM_ME_BAPI_PO_CUST, also did you read the EXTENSIONIN documentation.
If you "played" with numeric data... then look for class on data container like CL_ABAP_CONTAINER_UTILITIES to map data before extensionin and your structure without raising some exception.
Regards,
Raymond
2016 Aug 24 2:02 PM
Thanks Ray for your response.
Yes I have copied from class CL_EXM_IM_ME_BAPI_PO_CUST.
Also when I call BAPI_PO_ChANGE, it will internally call the BADI ME_BAPI_PO_CUST and here within method MAP2I_EXTENSIONIN we get startucture CH_STRUC already populated with EKPO custom fields but without values. Here I have to change the structure itself so that it can hold CHAR values. Can you please suggest. (I feel CL_ABAP_CONTAINER_UTILITIES can convert the values and not the structure).
Regards,
Abhi
2016 Aug 24 2:18 PM
We had a similar requirement to change the value of a Z field added in EKPO table through BAPI_PO_CHANGE.
Here's a code snippet
DATA: ls_extensionin type bapiparex,
ls_ext_po type bapi_te_mepoitem,
ls_ext_pox type bapi_te_mepoitemx
IF wa-zzdel is not initial.
ls_extensionin-structure = 'BAPI_TE_MEPOITEM'.
ls_ext_po-po_item = ebelp
ls_ext_po-zzdel = zzdel
ls_extensionin+30(960) = ls_ext_po.
append ls_extensionin to lt_extensionin.
ENDIF.
2016 Aug 24 2:23 PM
Repeat the same 5lines also for 'BAPI_TE_MEPOITEMX' but pass zzdel flag as 'X' and the next structure would be ls_ext_pox for flags.Rest all remains same.
So you would have 2entries in your lt_extensionin structure.One with values and one with flags.
Pass the table in BAPI.Your Z fields would be updated .
2016 Aug 24 2:27 PM
Thanks Ruchi.
As i mentioned the EKPO custom fields has quantity field due to which I have to convert it to Char before calling BAPI_PO_CHANGE which I have done it.
Within BAPI, the BADI has to be called as enhanced EKPO structure is having quantity field. I am looking after what needs to be written in this BADI to do the necessary structure conversion.
If you have any other approach please let me know.
Regards,
Abhi
2025 Feb 12 5:49 PM
I have same requirement .Could you please let me know how this issue was addressed