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

Posting problem in BAPI : /AFS/BAPI_GOODSMVT_CREATE (MB1C)

Former Member
0 Likes
662

Hi,

  I am facing a problem when uploading an excel file with this BAPI : /AFS/BAPI_GOODSMVT_CREATE. An error occurs "Enter a sales order for special stock E". I don't know, it a configuration problem. There is no error when manually inputing the same datas through MB1C tcode.

   gmcode = 05 - MB1C - Enter Other Goods Receipt

   Fields in gmhead are posting date and document date


call function '/AFS/BAPI_GOODSMVT_CREATE'
   exporting
     goodsmvt_header             = gmhead
     goodsmvt_code               = gmcode
*   TESTRUN                     = ' '
   importing
     goodsmvt_headret            = mthead
*   MATERIALDOCUMENT            =
*   MATDOCUMENTYEAR             =
   tables
     afs_goodsmvt_item           = lt_itabfl
*   GOODSMVT_SERIALNUMBER       =
     return                      = errmsg.

Movement typeStock TypeDocument DatePosting DateSO #li.noSpecial StockPlantStor. Loc.Material FG #SizeQuantityUoMRemark
561E05.09.201305.09.20134000003910E3110RM012000034436 C5 SHORT SHIP
561E05.09.201305.09.20134000003910E3110RM022000034438 C5 SISA PRODUKSI

Thanks/Regards,

Charls.

Hi,

  I am facing a problem when uploading an excel file with this BAPI : /AFS/BAPI_GOODSMVT_CREATE. An error occurs "Enter a sales order for special stock E". I don't know, it a configuration problem. There is no error when manually inputing the same datas through MB1C tcode.

   gmcode = 05 - MB1C - Enter Other Goods Receipt

   Fields in gmhead are posting date and document date


call function '/AFS/BAPI_GOODSMVT_CREATE'
   exporting
     goodsmvt_header             = gmhead
     goodsmvt_code               = gmcode
*   TESTRUN                     = ' '
   importing
     goodsmvt_headret            = mthead
*   MATERIALDOCUMENT            =
*   MATDOCUMENTYEAR             =
   tables
     afs_goodsmvt_item           = lt_itabfl
*   GOODSMVT_SERIALNUMBER       =
     return                      = errmsg.

Movement typeStock TypeDocument DatePosting DateSO #li.noSpecial StockPlantStor. Loc.Material FG #SizeQuantityUoMRemark
561E05.09.201305.09.20134000003910E3110RM012000034436 C5 SHORT SHIP
561E05.09.201305.09.20134000003910E3110RM022000034438 C5 SISA PRODUKSI

Thanks/Regards,

Charls.

2 REPLIES 2
Read only

Former Member
0 Likes
496

Hi,

If you can debug this, then place a watchpoint on SY-MSGNO with the value of this message number.

Kind regards, Rob Dielemans

Read only

venkateswaran_k
Active Contributor
0 Likes
496

Hi Charls,

I assume that you are passing the Sales Order number to BAPI. 

Based on the value you pasted here,  please make sure that Sales order number 40000039  is passed with full length.. ie.. leading Zeros.   0040000039

ie. use conversion_alpha_input ...   to get the valid sales order number  

Regards,

Venkat