Application Development and Automation 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: 
Read only

Unable to create material document with BAPI_GOODSMVT_CREATE

Former Member
0 Likes
1,307

Hi all,

i am unable to create a material document instead an inbound delivery is getting created by this BAPI. the movement type is 501.

(the requirement is to create stock at a temporary storage location).

Please help me with this.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,111

see the following example

           goodsmvt_item-material   = VALDATAC_Z1-matnr.
         goodsmvt_item-plant           = VALDATAC_Z1-werks.
         goodsmvt_item-stge_loc    = VALDATAC_Z1-lgort.
         goodsmvt_item-batch          = VALDATAC_Z1-charg.
         goodsmvt_item-move_type = '501'.
         goodsmvt_item-val_type     = VALDATAC_Z1-charg.
         goodsmvt_item-entry_qnt   = VALDATAC_Z1-clabs.
         goodsmvt_item-entry_uom = VALDATAC_Z1-meins.
         goodsmvt_item-move_mat = VALDATAC_Z1-matnr.
         goodsmvt_item-move_plant = VALDATAC_Z1-werks.
         goodsmvt_item-move_stloc = VALDATAC_Z1-lgort.
         goodsmvt_item-move_batch = '0000'.
         goodsmvt_item-move_val_type '0000'.
         append goodsmvt_item.

call function 'BAPI_GOODSMVT_CREATE'
   exporting
     goodsmvt_header               = goodsmvt_header
     goodsmvt_code                   = goodsmvt_code
*    TESTRUN                           = ' '
   importing
     MATDOCUMENTYEAR    = MATDOCUMENTYEAR
     materialdocument              = materialdocument
   tables
     goodsmvt_item                  = goodsmvt_item
     return                                   = msg.

Hi all,

i am unable to create a material document instead an inbound delivery is getting created by this BAPI. the movement type is 501.

(the requirement is to create stock at a temporary storage location).

Please help me with this.

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
1,111

I want to re-create MB1C......the goodsmvt_code passed is '05'...

Thanks

Read only

former_member215575
Active Participant
0 Likes
1,111

Hi Kartik,

I have used this BAPI for other Goods movements but not for 501 and it always worked as it should.

I suggest you to first try creating material document manually using MB1C tcode.

If it is created successfully there, note down all the inputs passed in transaction and pass the same to BAPI.

Also suggest you to read the documentation for this BAPI to get any helpful insights.

Regards,

SG

Read only

Former Member
0 Likes
1,112

see the following example

           goodsmvt_item-material   = VALDATAC_Z1-matnr.
         goodsmvt_item-plant           = VALDATAC_Z1-werks.
         goodsmvt_item-stge_loc    = VALDATAC_Z1-lgort.
         goodsmvt_item-batch          = VALDATAC_Z1-charg.
         goodsmvt_item-move_type = '501'.
         goodsmvt_item-val_type     = VALDATAC_Z1-charg.
         goodsmvt_item-entry_qnt   = VALDATAC_Z1-clabs.
         goodsmvt_item-entry_uom = VALDATAC_Z1-meins.
         goodsmvt_item-move_mat = VALDATAC_Z1-matnr.
         goodsmvt_item-move_plant = VALDATAC_Z1-werks.
         goodsmvt_item-move_stloc = VALDATAC_Z1-lgort.
         goodsmvt_item-move_batch = '0000'.
         goodsmvt_item-move_val_type '0000'.
         append goodsmvt_item.

call function 'BAPI_GOODSMVT_CREATE'
   exporting
     goodsmvt_header               = goodsmvt_header
     goodsmvt_code                   = goodsmvt_code
*    TESTRUN                           = ' '
   importing
     MATDOCUMENTYEAR    = MATDOCUMENTYEAR
     materialdocument              = materialdocument
   tables
     goodsmvt_item                  = goodsmvt_item
     return                                   = msg.

Read only

0 Likes
1,111

Thanks for your inputs...