Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in BAPI_PO_CREATE1 in extension structure while populting data

Former Member
0 Kudos


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


       

7 REPLIES 7

Former Member
0 Kudos

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

0 Kudos

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


0 Kudos

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

0 Kudos

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

0 Kudos

Hi Felipe,

Yes when doing in ME21N manually shipment type value is different.

Also it_extension have different different shipment type.

Regards,

Siba

0 Kudos

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

0 Kudos

Thanks Felipe,

Solved it myself problem in exit(ZXM06U41).

Regards,

Siba