09-10-2014 6:05 PM
Hi,
Getting issue when populating data in custome field through bapi_po_create1.
Requiredment
Need to populate different different shipment type number in every line item ,but when i am using below code it only populating
last shipment type number in every line item while creation of STO.
Please see the below code for populating data in custome field
CLEAR wa_extensionin.
MOVE 'BAPI_TE_MEPOITEM' TO wa_extensionin-structure.
wa_bapi_te_mepoitem-po_item = wa_itab-item.
* wa_bapi_te_mepoitem-zdummy = c_x.
wa_bapi_te_mepoitem-zvsart = wa_itab-shp_type.
CONCATENATE wa_bapi_te_mepoitem-po_item
'X00000000000000000000000000000' wa_bapi_te_mepoitem-zvsart
INTO wa_extensionin-valuepart1.
APPEND wa_extensionin TO ltab_extensionin.
CLEAR wa_extensionin.
MOVE 'BAPI_TE_MEPOITEMX' TO wa_extensionin-structure.
wa_bapi_te_mepoitemx-po_item = wa_itab-item.
wa_bapi_te_mepoitemx-zvsart = 'X'.
CONCATENATE wa_bapi_te_mepoitemx-po_item
'0000000000' wa_bapi_te_mepoitem-zvsart
INTO wa_extensionin-valuepart1.
APPEND wa_extensionin TO ltab_extensionin.
please some one help me how to solve it.
Regards,
Siba
09-10-2014 8:06 PM
Try with this piece of code:
DATA:
wa_bapi_te_mepoitem LIKE bapi_te_mepoitem,
wa_bapi_te_mepoitemX LIKE bapi_te_mepoitemx.
wa_bapi_te_mepoitem-po_item = wa_itab-item.
wa_bapi_te_mepoitem-zvsart = wa_itab-shp_type
wa_extensionin-structure = 'BAPI_TE_MEPOITEM'.
wa_extensionin-valuepart1 = wa_bapi_te_mepoitem.
APPEND wa_extensionin TO ltab_extensionin.
wa_bapi_te_mepoitemX-po_item = wa_itab-item.
wa_bapi_te_mepoitemX-zvsart = 'X'
wa_extensionin-structure = 'BAPI_TE_MEPOITEMX'.
wa_extensionin-valuepart1 = wa_bapi_te_mepoitemX.
APPEND wa_extensionin TO ltab_extensionin.
Regards,
Felipe
09-11-2014 10:37 AM
Hi Felipe,
Thanks for your reply before i was used same logic and checked getting same issue only updating last shipment type number in every line item but i need different different shipment type in each line item while creating STO.
Regards,
Siba
09-11-2014 10:42 AM
Hi,
Is there any enhancement to populate different different shipment data in custom field .
Why i am asking because in bapi extension structure data is going correct then when bapi execution finished it populating last shipment type number in each line item.
Regards,
Siba
09-11-2014 1:50 PM
Yes, there is another option badi ME_BAPI_PO_CUST, method MAP2I_EXTENSIONIN, you can use this thread as example (in the thread the badi used was ME_BADI_PR_CUST):
Have you checked if just before the BAPI execution, the values in lt_extensionin were correct? I mean for each item there was a different ZVSART.
In tcode ME21n are you able to do it?
Regards,
Felipe
09-11-2014 2:58 PM
Hi Felipe,
Yes when doing in ME21N manually shipment type value is different.
Also it_extension have different different shipment type.
Regards,
Siba
09-11-2014 4:15 PM
So, I as suggested try to implement badi ME_BAPI_PO_CUST and check if in the parameter IM_CONTAINER o method MAP2I_EXTENSIONIN the values are correct.
Regards,
Felipe
09-16-2014 1:41 PM
Thanks Felipe,
Solved it myself problem in exit(ZXM06U41).
Regards,
Siba