/AFS/BAPI_GOODSMVT_CREATE

Hi All,
  I am trying to use /AFS/BAPI_GOODSMVT_CREATE  this BAPI  for Goods Movement of Movement Type 561.  But i found one input parameter that goodsmvt_code.   Can anyone tell me what is this for?  and for 561 Movement type which code i have to use?
Thanks in Advance!

you will find an answer in V_158G_HELP view. The code depends on transaction (operation) just select it from T158G table.

Similar Messages

  • How to update Prodcution order qty using /AFS/BAPI_GOODSMVT_CREATE

    Hi Friends,
    I need your help desperately,
    I am using the BAPI, '/AFS/BAPI_GOODSMVT_CREATE' its working fine but it gets updated only Inv management / warehouse management perfectly, but my requirement is this return qty to be adjusted against the production order material. (MB1A with movement type '262' - for returns)
    I need to know any other parameters to be included in the BAPI to update the production order also.
    I have attached the code.
    please reply ASAP.
    Thanks
    Shankar
    *Header Structure
      st_gm_code-gm_code          = '03'. "
      st_gm_header-pstng_date     = st_gm_header-doc_date = sy-datum.
      SORT itab BY aufnr matnr j_3asized.
      LOOP AT itab.
        itab_afs_gm_itemx-material     = itab-matnr.
        itab_afs_gm_itemx-plant        = itab-werks.
        itab_afs_gm_itemx-stge_loc     = itab-lgort.
        itab_afs_gm_itemx-batch        = itab-new_charg .
        itab_afs_gm_itemx-stock_cat    = itab-j_4kscat.
        itab_afs_gm_itemx-stck_type    = 'F'.
        itab_afs_gm_itemx-move_type     = '262'.
        itab_afs_gm_itemx-entry_qnt     = itab-j_3aerfmg  .
        itab_afs_gm_itemx-grid_value   = itab-j_3asized.
        itab_afs_gm_itemx-orderid = itab-aufnr.
        APPEND itab_afs_gm_itemx .
      ENDLOOP.
      CALL FUNCTION '/AFS/BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header             = st_gm_header
        goodsmvt_code               = st_gm_code
    IMPORTING
       goodsmvt_headret            = st_gm_headret
       materialdocument            = mat_doc
       matdocumentyear             = doc_year
      TABLES
        afs_goodsmvt_item           = itab_afs_gm_itemx
        return                      = bapi_return .
      IF sy-subrc = 0.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
        itsoh-mat_doc = mat_doc.
        itsoh-doc_year = doc_year.
        APPEND itsoh.
        status = '06'.
      ENDIF.

    u can use  'BAPI_SALESORDER_CHANGE'
    and see the following link
    http://abap.wikiprog.com/wiki/BAPI_SALESORDER_CHANGE
    Edited by: krupa jani on Nov 25, 2008 11:15 AM

  • BAPI --- /AFS/BAPI_GOODSMVT_CREATE --- Goods Issue --- AFS

    I am trying the BAPI for Goods Issue for Production Orders with reference to a reservation in AFS and getting this error message when executed.
    E 8J                   607 Internal error
    I tried the information found in the page BAPI_GOODSMVT_CREATE - GI for GR but it didn't work out.
    I used following fields to send the data to BAPI
    /AFS/BAPI_GOODSMVT_CREATE
    PSTNG_DATE     = 10.01.2008
    DOC_DATE         = 10.01.2008
    PR_UNAME        = USER1
    GM_CODE        = 03
    MATERIAL__________= 2004237
    PLANT_____________= 1000
    STGE_LOC_________= RMPL
    BATCH_____________= 0366M
    GRID_VALUE________= M
    MOVE_TYPE________= 261
    SPEC_STOCK_______= E
    SALES_ORD________= 40003
    S_ORD_ITEM________= 000010
    ENTRY_QNT_________= 10.0
    ENTRY_UOM________= EA
    ORDERID___________= 1046778
    VAL_SALES_ORD____= 40003
    VAL_S_ORD_ITEM____= 000010
    RESERV_NO_________= 0000883202
    RES_ITEM___________= 0003
    RES_TYPE__________= '  '
    Any help is appreciated.

    How did you solve it?

  • In update task & Express document Update was terminated

    Hi all
    Need help!
    Requirement: When i do confirmation through CO11N i have to do GI through a BADI.
    Solution: I have written a wrapper Update module(internally has /AFS/BAPI_GOODSMVT_CREATE) with Start delayed and called that module(in update task) in the method MB_DOCUMENT_BEFORE_UPDATE of the definition MB_DOCUMENT_BADI.
    It works fine when every thing is correct, but if GI fails its still confirms the confimation and "Express document Update was terminated" pops up when i push the back button. I have written a abort statement in the update module if goods movement fails. When i check SM13 it shows the reason for erroring out. But my requirement is to stop the complete transaction if GI fails and put the error message at the bottom of screen(CO11N)
    How can i do this?
    Appreciate any suggestions.

    Hi,
    I don't think that it is possible. It's too late to call rollback. The FM in update task is called after command COMMIT WORK. Here is a quote from ABAP documentation:
    If during the update an error occurs, the update work process executes a database rollback, returns the log record with a note into table VBLOG and informs the user whose program has created the log record by SAPMail. After removing the error cause, the returned log records can be updated again.
    So you should call that module only in case that you are 100% sure that it will be processed correctly.
    Cheers

  • Assign sales document to material document

    Hello experts,
    I had recieved goods with movement type 501.
    Now I am trying to do roll conversion for this material document no.
    For this I am using BAPI '/AFS/BAPI_GOODSMVT_CREATE' which is returning message type 'E' as 'Enter a sales order for special stock E' as no sales order no. is assigned to this material document no.
    So, is there any way that I can assign sales order to this material document no.

    Hi,
    IT is not clear which BAPI you are using
    As the note 307731 states, the fields SALES_ORD and S_ORD_ITEM are
    used to design the account assignment object.
    The fields VAL_SALES_ORD and VAL_S_ORD_ITEM are used to design the
    inventory posting.
    Therefore, please kindly check the way you are currently completing
    the table GOODSMVT_ITEM. If you post the movement type 501 E, for
    example, this should not be:
    MATERIAL    AAA
    PLANT       1000
    STGE_LOC    001
    MOVE_TYPE   501
    SPEC_STOCK  E
    SALES_ORD   1000 <<<
    S_ORD_ITEM  10   <<<
    ENTRY_QNT   1
    ENTRY_UOM   EA
    Instead, this table should be completed as:
    MATERIAL       AAA
    PLANT          1000
    STGE_LOC       001
    MOVE_TYPE      501
    SPEC_STOCK     E
    ENTRY_QNT      1
    ENTRY_UOM      EA
    VAL_SALES_ORD  1000 <<<
    VAL_S_ORD_ITEM 10   <<<

  • Delivery Note Quantity in BAPI

    Dear Gurus,
    I am working in SAP-AFS 6.2 and using BAPI ( /AFS/BAPI_GOODSMVT_CREATE )  for Z-Development of Goods Recepit of RM and FG.
    This BAPI I am using for Goods Receipt against Production Order, Purchase Order( Including Subcontracting Purchase Order).
    I am not able to find the feild for "Delivery Note Quantity" in that BAPI , Can any one help me out ?
    Regards
    Siddharth

    >
    Kishore Kumar Chiluka wrote:
    > Hi
    >
    > This field is not avialbal in the BAPI.
    > LSMNG - Quantity in Unit of Measure from Delivery Note
    >
    > Why do you require this data, i think SAP has not provided this field as you will be receiving this data
    > from interface and the delivery note qty is equal to Qty in unit of entry.
    >
    > Try finding out some enhancement point in this BAPI - hope it will be helpful but i am not sure how we can use that...
    >
    >
    > Thanks & Regards
    >
    > Kishore
    Is it really ok if the LSMNG field is left blank in the MIGO through BAPI_GOODSMVT_CREATE? I mean does it affect any other transaction?
    pk

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document

    Hi Experts,
    I m using 'BAPI_GOODSMVT_CREATE' in my custom report, it takes more time for creating Material documents.
    Please let me know if there is any option to overcome this issue.
    Thanks in advance
    Regards,
    Leo

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • 'BAPI_GOODSMVT_CREATE' takes more time for creating material document for the 1st time

    Hi Experts,
    I am doing goods movement using BAPI_GOODSMVT_CREATE in my custom code.
    Then there is some functional configuration such that, material documents and TR and TO are getting created.
    Now I need to get TO and TR numbers from LTAK table passing material documnt number and year, which I got from above used BAPI.
    The problem I am facing is very strange.
    Only for the 1st time, I am not finding TR and TO values in LTAK table. And subsequent runs I get entries in LTAK in there is a wait time of 5 seconds after bapi call.
    I have found 'BAPI_GOODSMVT_CREATE' takes more time for creating material document with similar issue, but no solution or explanation.
    Note 838036 says something similar, but it seems obsolete.
    Kindly share your expertise and opinions.
    Thanks,
    Anil

    Hi,
    please check if some of following OSS notes are not valid for your problem:
    [Note 838036 - AFS: Performance issues during GR with ref. to PO|https://service.sap.com/sap/support/notes/838036]
    [Note 391142 - Performance: Goods receipt for inbound delivery|https://service.sap.com/sap/support/notes/391142]
    [Note 1414418 - Goods receipt for customer returns: Various corrections|https://service.sap.com/sap/support/notes/1414418]
    The other idea is not to commit each call, but executing commit of packages e.g. after 1000 BAPI calls.
    But otherwise, I am afraid you can not do a lot about performance of standard BAPI. Maybe there is some customer enhancement which is taking too long inside the BAPI, but this has to be analysed by you. To analyse performance, just execute your program via tr. SE30.
    Regards
    Adrian

  • How to get serial number in bapi BAPI_GOODSMVT_CREATE

    hi everyone
    im using the bapi BAPI_GOODSMVT_CREATE to create goods receipt for a PO but its giving me an error 'Maintain serial numbers for total quantity' and I really dont know how to get the serial number data, i know the table GOODSMVT_SERIALNUMBER should be populated with the serial number data but i dont know where to get the data
    can anybody help me plz?

    Hi,
    Please check the following code
    DATA: lw_header         TYPE  bapi2017_gm_head_01,
             lw_headret        TYPE  bapi2017_gm_head_ret,
             lw_goodsmvt_item  TYPE  tw_goodsmvt_item,
             lt_goodsmvt_item  TYPE  tt_goodsmvt_item,
             lw_return         TYPE  tw_return,
             lt_return         TYPE  tt_return,
             lt_zprefg         TYPE  tt_zprefg,
             lw_zprefg         TYPE  tw_zprefg,
             lw_errorlog       TYPE  tw_errorlog,
             lt_zprefg_temp    TYPE  tt_zprefg,
            lw_afs_goodsmvt_sku TYPE /afs/bapi_gm_sku,
            lt_afs_goodsmvt_sku TYPE STANDARD TABLE OF /afs/bapi_gm_sku.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
         EXPORTING
           goodsmvt_header             = lw_header
           goodsmvt_code               = '04'
      TESTRUN                     = ' '
        IMPORTING
          goodsmvt_headret            = lw_headret
      MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
         TABLES
           goodsmvt_item               = lt_goodsmvt_item
      GOODSMVT_SERIALNUMBER       =
           return                      = lt_return
          afs_goodsmvt_sku            = lt_afs_goodsmvt_sku.
    IF sy-subrc EQ 0.
         COMMIT WORK AND WAIT.
       ENDIF.
       LOOP AT lt_return INTO lw_return.
         IF lw_return-type EQ co_msgtyp_e OR
            lw_return-type EQ co_msgtyp_a.
           lw_errorlog-msgtype = lw_return-type.
           lw_errorlog-msgid   = lw_return-id.
           lw_errorlog-msgno   = lw_return-number.
           lw_errorlog-message = lw_return-message.
           APPEND lw_errorlog TO gt_errorlog.
         ELSE.
           UPDATE zprefg FROM TABLE lt_zprefg_temp.
         ENDIF.
       ENDLOOP.
    Pls mark points if helpful
    Line Turbin

  • Bapi for MB1A using the AFS SKU details

    Hi Friends,
    I want to use the BAPI, BAPI_GOODSMVT_CREATE with AFS SKU details.
    my requirement is to post the return qty against the Batch using MB1A with movement type '262' , against the production order, material , SKU details and Batch no.
    please send it to me if u have the BAPI program.
    Thanks
    Shankar

    Hi
    Mostly, we have individual BAPI / FM to complete the setup for creation of Production Order. you may consider the Option of using BDC to create the Order automatically using all master data (instead of manual).
    Thanks
    JK

  • BAPI_GOODSMVT_CREATE throws Valuation Type error for Production Ord and Mvt Type: 101

    Hi,
    I am trying to post a Material Document for a Production order through BAPI_GOODSMVT_CREATE. To the 'AFS_GOODSMVT_SKU' table of the BAPI, the sizes in the production order item are passed and to the 'GOODSMVT_ITEM' table, the respective line for each size is passed.
    Lets say the production order has size 1 (with valuation type: 01 in Material) and size 2 (with valuation type 02 in Material). Inside the BAPI standard code, there is a comparison between Valuation types in Material and Production order. The Production order valuation type is taken as the first found valuation type passed to the BAPI, so in this case it is '01'. In the above case, for the first line there is no comparison error, later for the second line , when comparison happens between '01' and '02' valuation types, the error: M7043 (Valuation Type 01 differs from Valuation type of batch 02) is thrown.
    However when we do the GR grom MB31, this error is not thrown.
    Can someone please throw some light on how to avoid this error when posting the GR for Production Order via the BAPI_GOODSMVT_CREATE ?
    Thanking in Advance.

    I have never seen an AFS system and do not know how this works. There are a few OSS notes on AFS and error M7043, but none to this BAPI. I can't tell you whether this is a bug in SAP or in the way you use this BAPI.
    I am moving this discussion to the Retail space as this is the desired place for AFS related discussions in SCN.

  • AFS sale order - arun report

    Hi!
    I need report similar to /AFS/MD04  AFS stock req list but for  all material of one sale order on onew screen.
    User want to see statuses for allpositions of  order at one time  to make decision about delivery.
    any standart report?
    Andrey Garshin.

    Hi Andrey,
    I don't see a benefit from seeing statuses in a sales order.
    /AFS/MD04 is a stock/requirements list for the MRP conroller.
    It does a complete different calculation than ARUN or ATP.
    It will not help you to determine what can delivered.
    You can have orders in B status and still be able to allocate and deliver it.
    So explain your business requirements. What do you want to see?
    Best Regards,
    Markus
    Edited by: Markus Doerr on Jun 8, 2010 10:16 AM

  • Table for temporarily stock /requirement  for tocde /afs/mdo4

    Dear expart,
    I developed a zreport for display STO number, Production order number, operation etc.
    mainly I use here AFPO,AFRU, MSEG, MCHB & J_3ABDSI Table.
    My problem is, when I compare with Tcode /afs/md04 tab-temporarily stock /requirement  .
    for some MATNR
    data show properly.
    and some MATNR are blank  with message Last MRP run on 04.04.2011 or such date.
    Hhow i can filter the in Z-report which MATNR are not in Tcode /afs/md04 tab-temporarily stock /requirement  .
    my code is.
    SELECT  j_3abdsiaufnr j_3abdsimatnr j_3abdsij_4krcat j_3abdsimbdat j_3abdsi~menge INTO TABLE it_eket FROM j_3abdsi
        FOR ALL ENTRIES IN it_final1
        WHERE
              j_3abdsi~j_4krcat = it_final1-j_4ksca AND
              j_3abdsi~matnr = it_final1-matnr AND
              j_3abdsi~werks = it_final1-werks AND
              j_3abdsi~bdart = 'TB' AND
              j_3abdsi~plart = 'B' AND
              j_3abdsi~bsart = 'UB'.
    Pls help .
    Rayhan
    Edited by: Abu Rayhan on Apr 5, 2011 10:24 AM

    CLEAR i_data1.
      REFRESH i_data1.
      LOOP AT i_mara.
        READ TABLE i_marc WITH KEY matnr = i_mara-matnr  BINARY SEARCH .
        IF sy-subrc = 0 .
          CALL FUNCTION 'J_3AM_DISPOSITION_DISPL'
            EXPORTING
              i_matnr                 = i_mara-matnr
              i_werks                 = p_werks
          I_DIALOG                = ' '
          I_SPERR                 = ' '
          I_AUFRUF                = ' '
          I_BANER                 = ' '
             i_todate                = todate
          I_HEADER_ONLY           = ' '
           IMPORTING
             ex_dbba                 = i_data3
          E_MDKP                  =
          EX_PBBD                 =
          EX_MELD                 =
          E_CM61M                 =
           EXCEPTIONS
             material_gesperrt       = 1
             wbz_fehler              = 2
             material_prgr           = 3
             dispo_gesperrt          = 4
             OTHERS                  = 5
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ELSE.
            IF i_data3[] IS NOT INITIAL.
              LOOP AT i_data3 INTO i_data4 .
                  IF ( i_data4-j_3astat ='A' OR i_data4-j_3astat ='T') AND i_data4-j_3abskz ='C'   .
                    READ TABLE i_t001l WITH KEY lgort = i_data4-lgonr  BINARY SEARCH .
                    IF sy-subrc = 0 .
                      CLEAR i_data1str.
                      i_data1str-matnr = i_data4-matnr.
                      i_data1str-j_3asize = i_data4-j_3asize .
                      i_data1str-lgort = i_data4-lgonr.
                      i_data1str-menge = i_data4-menge .
                      COLLECT i_data1str INTO i_data1.
                    ENDIF.
                  ENDIF.
              ENDLOOP.
            ENDIF.
          ENDIF.
      ENDLOOP.
    Questions
    i_mara  recordset 500 material
    It take more than 3 house to finished this report.
    do changed ?
    do you help me ?
    Think.

  • Error while posting a document using  the  BAPI_GOODSMVT_CREATE

    Hi,
    i was trying to post the Goods Receipt document ( Tcode MB1C) using the bapi  BAPI_GOODSMVT_CREATE
    i am passing the item details and Serial number details.
    the error triggered was Maintain Serial Numbers for Total Quantity
    but i am passing the quantity as 1 ( in item data) and passing one serial number.
    is this error because of data problem or am i missing to pass the value to  some dependent parameter..?
    Please help me out.
    Thanks in advance.
    Sriram

    Hi David,
    i was tring to pass the same.
    in item table we have we have four item details ( below)
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    S_ORD_ITEM - Item Number in Sales Order ( length mismatch with serial  item number)
    PO_ITEM  - Item Number of Purchasing Document ( length mismatch with serial  item number)
    out 4 , 2 are ruled out because of length mismatch. and in the reaming two are
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    this is a Goods receipt document, please let me know which field is required to map with item number in the above two.
    Regards,
    Sriram.

  • BAPI_GOODSMVT_CREATE - Error while posting a Material Document

    Hi Experts,
    We are  trying to do the material document posting using the transaction "MB1C" manually in SAP. The movement type which we are using for the same is "261".  While doing this is, it is asking for a work order number and the Recipient number. We gave the Recipient Number as "123". Material document is created successfully.
    Again using the same transaction  "MB1C" , we are trying to do the reversal of the material document which we posted previously against another work order number for the same material and the serial number if the material is serialised and as well as for the non serialised material.
    Both this case, in SAP the material document is created succesfully. This is done manually in SAP.
    When we are trying to create the material document using the BAPI 'BAPI_GOODSMVT_CREATE', for the above scenario, posting the material document '261' movement type for one work order and the reversal for another work order '262' movement type for the same material (whether it is a serialised or non serialised) we are getting the eror as "RE Qty. transferred exceeded 1 PC: 50,003,695 C001 USED 1200".
    We are passing the following at the item level. MATERIAL Number, Plant, STGE_LOC, ENTRY_QNT, MOVE_TYPE, BATCH, ORDERID, RESERV_NO,  RES_ITEM, ACTIVITY, XSTOB for reversal.
    We are passing the GM_CODE as '05'.
    Please let us know what needs to be changed inorder to create the material document properly without getting errors.
    Thanks in Advance,
    Mohan.

    Hi,
    We fixed this issue by removing the reservation number of the material when we are trying to post the material document with the movement type "262".
    The reason for removing the reservation number for the movement type "262"
    The reservation number is getting created against a work order when we trying to create the work order in IW32. This reservation number is used for validating the stock while we are trying to consume and doing the reversal.
    SAP is allowing us to reverse the consumed quantities only based on the reservartion number and hence we got this error.
    To fix this error, if we are trying to reverse a particular material against a different work order for which it has been consumed previiously, remove the reservation number and item number and try posting the material document.
    Hope this solution will solve your issue:)
    Thanks and Regards,
    Mohan.

Maybe you are looking for

  • Shared external hard no longer visible to other mac running 10.4

    Running 10.4 on iMac G5 and connecting to mac mini running 10.6. The mac mini has a firewire connected drive that I used to mount from my iMac. Suddenly, as of a few days ago, I can no longer mount the volume. When I double click my short-cut, it pro

  • VA01 Item category display only for specific order type

    Hi, I have a requirement to deactivate(display only) item category field in VA01 table item for certain order type . I tried the user exit  MV45AFZZ(USEREXIT_FIELD_MODIFICATION). This is working only if the table item has a value. i.e I could able to

  • Canny edge robolab

    Hello everyone, I am using robolab 2.54 for labview 7.0. I am currently doing a project which need to use Canny Edge Detection. I am wondering who can manually write a Canny Edge Vi? (not using IMAQ) The robolab does not provide Canny Edge Vi, but it

  • Pie chart drill down in bex

    Hi Friends, In my bex report i have pie chart for year 2008. Shall I drill down on this report means if i click on one part of the pie chart will i go to another report or another pie chart. Can any one pls tell me is it possible . Thanks & Regards,

  • How to report a new scam

    We have been getting an occasional pop-up on one of our iPads saying something about a potential Safari security issue and to please call 1-855-569-0240 immediately. It claims to be from http://online-safari-issue.com. I don't remember downloading an