BAPI_GOODSMVT_CREATE + Transfer posting

Hi All,
I have to move the goods from storage location 110D to 116D.
For that Iu2019m using BAPI: BAPI_GOODSMVT_CREATE with GM_CODE = 4 (Transfer posting)
After executing the BAPI, Iu2019m checking the RETURN value, if there is no error message, Then Iu2019m committing using BAPI_TRANSACTION_COMMIT.
Result of my program:
Before the BAPI is called, the storage location stge_loc is 110D and move_stloc = 116D. Which is correct.
I can see that expected result in MB51 transaction where goods is moved from storage location 110D to 116D, which is correct. But when I runned IW32 with that order, Iu2019m seeing the goods moved to different location, which is incorrect.
Using MB51, when i checked, the storage location from(110D) and to(116D), both are showing correctly and it is correctly updated in MSEG table. But in RESB table, it is still showing 110D 
So, could you pls suggest me where I went wrong and suggest me any other logic.
Thanks & Regards,
Harsha Ramaiah
Edited by: Harsha Ramaiah on Jun 30, 2010 8:11 AM

Hi,
Data in RESB is Reservation data(Tcode:MB21/22/23), it has no actual effect on storage(means that the movement is not actually happened), so in your case , maybe you need to change the reservation , not to do transfer posting.
regards,
Pole

Similar Messages

  • Batch input for BAPI_GOODSMVT_CREATE - Transfer posting

    Hi all,
    I'm now trying to do a batch input in this program for transfer posting of stocks.
    Am i able to upload the input through an external source for example, Excel spreadsheet?
    May i know how do i indicate in the program the source of my batch input?

    Hello Calibertto,
    You can upload excel file for batch input or bapi.
    Firstly : Upload to excel file.
    Secondly : Append itab from excel file.
    Thirdly : Make loop at itab.
    Finally : Fill batch input/bapi for every itab record.
    Best regards.

  • BAPI_GOODSMVT_CREATE error - Duplicate Transfer Posting

    Hello,
    I'm using BAPI_GOODSMVT_CREATE for transfer posting with GM Code 04 and Movement Type 311.
    But the posted material document is incorrect. Instead of 2 lines only, the line items becomes 4.
    Could anyone please help me?
    Thanks in advance!

    Hi Gold Yap,
          I have done the Transfer posting by using BAPI_GOODSMVT_CREATE.
         Below i added my sample code. Please go through.
    Report XYZ.
    TABLES : mslb , mchb .
    DATA : BEGIN OF i_stock OCCURS 0 ,
           matnr LIKE mslb-matnr ,
           werks LIKE mslb-werks ,
           charg LIKE mslb-charg ,
           sobkz LIKE mslb-sobkz,
           lifnr LIKE mslb-lifnr ,
           lblab LIKE mslb-lblab ,
           END OF i_stock .
    DATA : BEGIN OF i_batch OCCURS 0 ,
           matnr LIKE mchb-matnr ,
           werks LIKE mchb-werks ,
           lgort LIKE mchb-lgort ,
           charg LIKE mchb-charg ,
           clabs LIKE mchb-clabs ,
           END OF i_batch .
    DATA: BEGIN OF it_mess OCCURS 10,
          charg LIKE mslb-charg ,
          lgort LIKE mchb-lgort,
          lifnr LIKE mslb-lifnr,
          err LIKE bapiret2-message,
          flag,
          END OF it_mess.
    DATA match.
    DATA :  header LIKE bapi2017_gm_head_01 . "OCCURS 0 WITH HEADER LINE .
    DATA :  code LIKE bapi2017_gm_code .  " OCCURS 0 WITH HEADER LINE .
    DATA :  item LIKE bapi2017_gm_item_create OCCURS 0 WITH HEADER LINE.
    DATA : i_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE .
    DATA : matdoc LIKE bapi2017_gm_head_ret .
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME .
    SELECT-OPTIONS : s_matnr FOR mslb-matnr .
    PARAMETERS : p_werks LIKE mslb-werks DEFAULT 'TPFB' .
    SELECTION-SCREEN END OF BLOCK b1 .
    AT SELECTION-SCREEN OUTPUT .
      LOOP AT SCREEN .
        IF screen-name = 'P_WERKS' .
          screen-input = '0' .
          MODIFY SCREEN .
          CLEAR screen .
        ENDIF.
      ENDLOOP .
    START-OF-SELECTION .
      CLEAR: i_stock[],i_stock.
      CLEAR: it_mess[],it_mess.
      CLEAR: i_batch[],i_batch.
      SELECT matnr werks charg sobkz lifnr  lblab
      FROM mslb INTO TABLE i_stock
      WHERE matnr IN s_matnr
        AND werks = p_werks.
      DELETE i_stock WHERE sobkz <> 'O'.
      DELETE i_stock WHERE lblab <= '0.000'.
      IF i_stock[] IS INITIAL .
        MESSAGE 'NO Data Available In MSLB Table' TYPE 'S' .
      ELSE.
        DELETE i_stock WHERE charg = 'COMMON' .
        IF i_stock[] IS INITIAL .
          MESSAGE 'Already Transfer Posting to Common Batch' TYPE 'S' .
        ENDIF.
      ENDIF .
      SELECT matnr werks lgort charg clabs
      FROM mchb
      INTO TABLE i_batch
      WHERE matnr IN s_matnr
        AND werks = p_werks .
      DELETE i_batch WHERE clabs <= '0.000'.
      IF i_batch[] IS INITIAL .
        MESSAGE 'NO Data Available In MCHB Table' TYPE 'S' .
      ELSE .
        DELETE i_batch WHERE charg = 'COMMON' .
        IF i_batch[] IS INITIAL .
          MESSAGE 'Already Transfer Posting to Common Batch' TYPE 'S' .
        ENDIF.
      ENDIF .
      CLEAR : header,code,matdoc  .
      header-pstng_date  = sy-datum.
      header-doc_date    = sy-datum.
      header-pr_uname    = sy-uname.
      header-header_txt  = 'Transfer Posting'.
      code-gm_code       = '04'.
      SORT i_batch BY matnr werks charg.
      LOOP AT i_batch.
        CLEAR: item[],item.
        item-material        = i_batch-matnr.
        item-plant           =  i_batch-werks.
        item-batch           = i_batch-charg.
        item-entry_qnt       =  i_batch-clabs .
        item-stge_loc        = i_batch-lgort .
        item-move_type       = '309'.
        item-move_batch = 'COMMON'.
        APPEND item .
        CLEAR item .
        match = 'X'.
        PERFORM bapi_run USING match.
      ENDLOOP.
      LOOP AT i_stock .
        CLEAR: item[],item.
        item-material        = i_stock-matnr.
        item-plant           =  i_stock-werks.
        item-batch           = i_stock-charg.
        item-vendor          =  i_stock-lifnr .
        item-entry_qnt       =  i_stock-lblab .
        item-move_type       = '309'.
        item-spec_stock      =  'O'.
        item-move_batch = 'COMMON'.
        APPEND item .
        CLEAR item .
        match = 'Y'.
        PERFORM bapi_run USING match.
      ENDLOOP.
      IF i_stock[] IS NOT INITIAL OR i_batch[] IS NOT INITIAL .
        IF it_mess[] IS INITIAL.
          MESSAGE 'Transfer Posted Successfully' TYPE 'S' .
        ELSE.
          SORT it_mess BY charg err.
          WRITE:/2 'Batch',11'Location',20'Vendor'.
          LOOP AT it_mess.
            AT NEW charg.
              SKIP.
            ENDAT.
            IF it_mess-flag = 'X'.
              WRITE: /2 it_mess-charg COLOR 6, it_mess-lgort COLOR 3
                     INTENSIFIED OFF,it_mess-lifnr COLOR 2 INTENSIFIED OFF.
            ENDIF.
            WRITE: /10 it_mess-err.
          ENDLOOP.
        ENDIF.
      ENDIF .
    *&      Form  bapi_run
          text
    -->  p1        text
    <--  p2        text
    FORM bapi_run USING match .
      CLEAR: i_return[],i_return.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header = header
          goodsmvt_code   = code
        TABLES
          goodsmvt_item   = item
          return          = i_return.
      IF i_return[] IS INITIAL.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
      ELSEIF i_return[] IS NOT INITIAL.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        LOOP AT i_return WHERE type = 'E'.
          it_mess-charg = i_stock-charg.
          IF match = 'X'.
            it_mess-lgort = i_batch-lgort.
          ELSEIF match = 'Y'.
            it_mess-lifnr = i_stock-lifnr.
          ENDIF.
          it_mess-err   = i_return-message.
          IF sy-tabix = 1.
            it_mess-flag = 'X'.
          ENDIF.
          APPEND it_mess.
          CLEAR  it_mess.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " bapi_run
    Regards,
    S.C.K

  • How to use the BAPI_GOODSMVT_CREATE for Transfer posting Sales order

    Hi Friends,
    How to use the Bapi BAPI_GOODSMVT_CREATE for transfer posting sales order to sales order.
    pls, send the list of parameteres to pass to the bapi, if program avail please send it to me.
    Thanks in advance
    Shankar

    You have to pass Header and GM code as the INput parameters for uing this BAPI....GM code would be structure.
    Also you have to pass the INternal table Item for the goods mvt cxreate which will contains
          BATCH.
          MOVE_TYPE.
          ENTRY_QNT.
          MOVE_PLANT.
          MOVE_STLOC.
          MOVE_BATCH.
          MOVE_REAS
    these parameters.
    Regards,
    Sushil.

  • BAPI_GOODSMVT_CREATE: move 309 for transfer posting - change of sales order

    Hello Experts,
    I'm trying to use BAPI_GOODSMVT_CREATE to transfer the material from one sales order to another.
    But that doesn't seem to work.
    ls_goodsmvt_header-pstng_date = sy-datum.
          ls_goodsmvt_header-doc_date   = sy-datum.
          ls_goodsmvt_code-gm_code      = '04'.
          ls_goodsmvt_item-material    = ls_outtab_l-matnr.
          ls_goodsmvt_item-plant       = ls_outtab_l-werks.
          ls_goodsmvt_item-stge_loc    = ls_outtab_l-lgort.
          ls_goodsmvt_item-move_mat    = ls_outtab_l-matnr.
          ls_goodsmvt_item-move_plant  = ls_outtab_l-werks.
          ls_goodsmvt_item-move_stloc  = ls_outtab_l-lgort.
          ls_goodsmvt_item-move_type   = '309'.
          ls_goodsmvt_item-mvt_ind     = ''.
          ls_goodsmvt_item-entry_qnt   = ls_outtab_l-kalab.
          ls_goodsmvt_item-entry_uom   = 'EA'.
          ls_goodsmvt_item-spec_stock  = 'E'.
          ls_goodsmvt_item-val_sales_ord  = ls_outtab_l-vbeln.
          ls_goodsmvt_item-val_s_ord_item = ls_outtab_l-posnr.
          ls_goodsmvt_item-sales_ord   = ls_outtab_r-vbeln.
          ls_goodsmvt_item-s_ord_item  = ls_outtab_r-posnr.
    "      ls_goodsmvt_item-sched_line  = '000'.
          APPEND ls_goodsmvt_item TO lt_goodsmvt_item.
          CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              goodsmvt_header  = ls_goodsmvt_header
              goodsmvt_code    = ls_goodsmvt_code
              testrun          = ''
            IMPORTING
              goodsmvt_headret = ls_goodsmvt_headret
              materialdocument = lv_materialdocument
              matdocumentyear  = lv_matdocumentyear
            TABLES
              goodsmvt_item    = lt_goodsmvt_item
              return           = lt_return.
    Right now i supply val_sales_ord with destination order number, and sales_ord with source. But I'm not really sure about that, which is the destination, and which is source sales order number parameter in itemline, val_sales_ord or sales_ord? Or maybe it doesnt work like that?
    Thanks for any help,

    So after some time i found out where the flow of bapi and migo differ, this is also, where the field KDAUF gets reseted, and the cause of not posting material document correctly:
    Starts in line 59 of MM07MFU0_UMLAGERUNG_PRUEFEN:
    * The old fieldselection (T156B) is not valid for a transfer posting
    * from MIGO
      IF NOT vm07m-xstor = zwei AND xmigo <> x.
        IF dm07m-fausw+55(1) = minus.
          CLEAR mseg-ummat.
        ENDIF.
        IF dm07m-fausw+56(1) = minus.
          CLEAR mseg-umwrk.
        ENDIF.
        IF dm07m-fausw+57(1) = minus.
          CLEAR mseg-umlgo.
        ENDIF.
        IF dm07m-fausw+64(1) = minus.
          CLEAR mseg-umcha.
        ENDIF.
        IF NOT vm07m-kzbwa = kzbwa-01 AND
           NOT vm07m-kzbwa = kzbwa-05 AND
           NOT vm07m-kzbwa = kzbwa-07.
          CLEAR: mseg-umbar.
        ENDIF.
    " the condition below is the source of my problems
        IF dm07m-fausw+60(1) = minus.
          CLEAR: mseg-kdauf, mseg-kdpos.
        ENDIF.
        IF dm07m-fausw+62(1) = minus.
          CLEAR mseg-ps_psp_pnr.
        ENDIF.
      ENDIF.
    I changed the value minus '-' of dm07m-fausw+60(1) to a dot '.', and the bapi worked like a charm. I am just not sure if I can change the records of T156B just like that, I guess not a good idea.
    Still i have no solution...

  • Automatic transfer posting after Purchase order creation

    I tried searching a solution for my pbm in this forum, but could not find any and hence posting a new thread. Hope to find an answer.
    I have a requirement of doing the automatic MB1B transfer posting of the PO when the PO is created and saved using ME21n.
    I initially used the BADI ME_PURCHDOC_POSTED for this purpose, in which i am calling BAPI_GOODSMVT_CREATE.
    But when i debug and see this BAPI returns an error saying that the PO doesnot exist.
    Which means, The PO is not yet created when it reaches this BADI.
    Is there any other BADI/user exit/ehancement spots? where the PO is already created and i can do the transfer posting?

    Hello K ,
    better to have a custom program to create PO & GR at the same time, u cannt create GR at the time of PO creation or change,u may get same kind of errors , ie. PO doent exists or PO locked by USER XXXX.
    regards
    Prabhu

  • Error in Transfer posting for movement type 303

    Hi Sir,
    I am getting following error while doing Transfer posting for movement type 303 thru BAPI_GOODSMVT_CREATE
    Error in Function:
    Order    not found or not permitted for Goods Movement.
    I am passiing all mandatory parameter for it as per BAPI Documentaion in tcode BAPI
    Transfer posting
    Transfer posting without reference to a reservation
    The following fields must be populated:
    Material number
    Plant
    Storage location
    Movement type
    Movement indicator
    Quantity in unit of entry
    ISO code unit of measurement for unit of entry
    If I am doing manually by MB1B tcode, it is successfully done.......here its not asking any ORDER No...
    Please help me .........
    Regards,
    Krishan

    I'm not sure what you're system set up is...   So I'd suggest looking at everything you enter on the screen and then checking to make sure you are passing all the information in the BAPI.
    With that said our system does require posting date, and batch.  You might check that.   Also check that you've included all the required information in the header.
    Did you use the same data when you tried to process the BAPI that you used when you tried to do MB1B manually?

  • Mb1b Transfer posting problem (urgent)

    hello
    i m using movement type 309.
    in the second screen they are entering batch..so based on that batch i m getting matnr and quantity in that batch.
    In my ZBAPI ..
    SELECT matnr clabs FROM mchb
                           INTO TABLE it_mb1b
                           WHERE werks = plant      
                           AND   lgort = send_stloc 
                           AND   charg = batch.    
    In the second line item..They are entering scrap material which the data has to get from MARD table. There is no batch exists for this second line item.
    i m writing query to get the data from mard like this:-
      SELECT matnr labst FROM mard
             INTO CORRESPONDING FIELDS OF TABLE it_mard
                           WHERE matnr LIKE '%-SCRAP'
                           AND   werks = plant     
                           AND   lgort = '2200'. 
    So, how to fill this second line item in BAPI.
    For the first line item i m using it_gmitem-entry_qnt in the BAPI item list.  This is for the first item in second screen.
    Similarly how to fill the second line item in BAPI_GOODSMVT_CREATE.

    FUNCTION zbapi_mb1b_new.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(MOVE_TYPE) LIKE  BAPI2017_GM_ITEM_CREATE-MOVE_TYPE DEFAULT
    *"       '309'
    *"     VALUE(PLANT) LIKE  BAPI2017_GM_ITEM_CREATE-PLANT DEFAULT '2000'
    *"     VALUE(SEND_STLOC) LIKE  BAPI2017_GM_ITEM_CREATE-STGE_LOC
    *"     VALUE(RECV_STLOC) LIKE  BAPI2017_GM_ITEM_CREATE-MOVE_STLOC
    *"     VALUE(MOVE_PLANT) LIKE  BAPI2017_GM_ITEM_CREATE-MOVE_PLANT
    *"       DEFAULT '2000'
    *"     VALUE(BATCH) LIKE  BAPI2017_GM_ITEM_CREATE-BATCH
    *"     VALUE(QUAN_MEASURE) LIKE  BAPI2017_GM_ITEM_CREATE-QUANTITY
    *"  EXPORTING
    *"     VALUE(MAT_DOC) LIKE  BAPI2017_GM_HEAD_RET-MAT_DOC
    *"  TABLES
    *"      RETURN STRUCTURE  BAPIRET2
      DATA : ls_quan1 TYPE p DECIMALS 3,
             ls_quan2 TYPE p DECIMALS 3,
             ls_quan3 TYPE p DECIMALS 3,
             ls_quan4 TYPE p DECIMALS 3,
             ls_quan5 TYPE p DECIMALS 3,
             ls_quan6 TYPE p DECIMALS 3.
      DATA : it_mard LIKE mard OCCURS 0 WITH HEADER LINE.
      gmhead-pstng_date = sy-datum.  "Posting date defaulted to system date
      gmhead-doc_date   = sy-datum.  "Document date defaulted to system date
      gmcode-gm_code    = '04'.       "Transfer Posting (MB1B)
      SELECT matnr clabs FROM mchb
                           INTO TABLE it_mb1b
                           WHERE werks = plant       "Plant
                           AND   lgort = send_stloc  "Storage location
                           AND   charg = batch.      "Batch Number
      SELECT matnr labst FROM mard
                           INTO CORRESPONDING FIELDS OF TABLE it_mard
                           WHERE matnr LIKE '%-SCRAP'
                           AND   werks = plant      "Plant
                           AND   lgort = '2200'.    "2094 in production
      LOOP AT it_mb1b INTO wa_mb1b.
        ls_quan2 = ( 5 / 100 ) * wa_mb1b-clabs.
        ls_quan3 = wa_mb1b-clabs + ls_quan2.
        ls_quan4 = wa_mb1b-clabs - ls_quan2.
        IF ( quan_measure EQ wa_mb1b-clabs ).
          ls_quan6 = wa_mb1b-clabs.
       ELSEIF ( quan_measure > wa_mb1b-clabs AND quan_measure <= ls_quan3 ).
          ls_quan5 = quan_measure - wa_mb1b-clabs.  "difference
          READ TABLE it_mard WITH KEY matnr0(3) = wa_mb1b-matnr0(3).
          IF sy-subrc EQ 0.
            it_mard-labst = it_mard-labst - ls_quan5.
            MODIFY it_mard TRANSPORTING labst WHERE
                             matnr0(3) = wa_mb1b-matnr0(3).
          ELSE.
          ENDIF.
          MODIFY mard FROM TABLE it_mard.
          CLEAR it_mard.
          ls_quan6 = wa_mb1b-clabs + ls_quan5.
       ELSEIF ( quan_measure < wa_mb1b-clabs AND quan_measure <= ls_quan4 ).
          ls_quan5 = wa_mb1b-clabs - quan_measure.
          it_mard-labst = it_mard-labst + ls_quan5.
          MODIFY it_mard TRANSPORTING labst WHERE
                              matnr0(3) = wa_mb1b-matnr0(3).
          MODIFY mard FROM it_mard.
          ls_quan6 = wa_mb1b-clabs.
       ENDIF.
        it_gmitem-move_type    = move_type.      "Movement type
        it_gmitem-plant        = plant.          "Plant
        it_gmitem-stge_loc     = send_stloc.     "Storage Location
        it_gmitem-move_plant   = move_plant.     "Receiving Plant
        it_gmitem-move_stloc   = recv_stloc.     "Receiving storage location
        it_gmitem-batch        = batch.          "Batch Number
        it_gmitem-material     = wa_mb1b-matnr.  "Material Number
        it_gmitem-move_mat     = wa_mb1b-matnr.  "Receiving/issuing material
        it_gmitem-entry_qnt   = ls_quan6.        "Quantity in unit of entry
        APPEND it_gmitem.
      ENDLOOP.
      CLEAR return.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header             = gmhead
          goodsmvt_code               = gmcode
      TESTRUN                     = 'X'
       IMPORTING
      GOODSMVT_HEADRET            =
         materialdocument            = mat_doc
      MATDOCUMENTYEAR             =
        TABLES
          goodsmvt_item               = it_gmitem
      GOODSMVT_SERIALNUMBER       =
          return                      = return
      IF NOT mat_doc IS INITIAL.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
       EXPORTING
         wait          = 'X'
    IMPORTING
      RETURN        =
      ELSE.
      ENDIF.
    ENDFUNCTION.

  • Mb1b transfer posting

    Hello friends,
    In mb1b second screen, they are entering second line item which is called scrap(eg: M03-SCRAP).This is updated in MARD table as the scrap materials doesn't belong to any batch.
    So, they are entering matnr and labst (quantity in second line item).
    How to identify this particular scrap material from mard table.
    I m writing query like this:-
    SELECT matnr labst FROM mard
           INTO CORRESPONDING FIELDS OF TABLE it_mard
                           WHERE matnr = 'M03-SCRAP'
                           AND   werks = plant
                           AND   lgort = '2200'.
    How to get this material number without hardcoding bcoz this ll be vary for different material numbers.

    Hello max,
    scrap field they enter like "M03-SCRAP".
    They said that if first 3 letters of scrap = first 3 letters of receiving material.
    then data has to pick from mard-labst and to be added to the first line item of material and mard should be updated.
    please luk into my coding(function module):-
      DATA : ls_quan2 TYPE p DECIMALS 3,
             ls_quan3 TYPE p DECIMALS 3.
      DATA : it_mard LIKE mard OCCURS 0 WITH HEADER LINE.
      gmhead-pstng_date = sy-datum.
      gmhead-doc_date   = sy-datum.
      gmcode-gm_code    = '04'.       "Transfer Posting (MB1B)
      SELECT matnr clabs FROM mchb
                           INTO TABLE it_mb1b
                           WHERE werks = plant
                           AND   lgort = send_stloc
                           AND   charg = batch.
      SELECT matnr labst FROM mard
                           INTO CORRESPONDING FIELDS OF TABLE it_mard
                           WHERE matnr like '%SCRAP'
                           AND   werks = plant
                           AND   lgort = '2200'.
      LOOP AT it_mb1b INTO wa_mb1b.
        it_gmitem-move_type    = move_type.
        it_gmitem-plant        = plant.
        it_gmitem-stge_loc     = send_stloc.
        it_gmitem-move_plant   = move_plant.
        it_gmitem-move_stloc   = recv_stloc.
        it_gmitem-batch        = batch.
        it_gmitem-material     = wa_mb1b-matnr.
        ls_quan2 = quan_measure - wa_mb1b-clabs.
        IF ls_quan2 LE 0.
          ls_quan3 = wa_mb1b-clabs.
        ELSE.
          ls_quan3 = wa_mb1b-clabs + ls_quan2.
          it_mard-labst = it_mard-labst - ls_quan2.
    MODIFY table it_mard TRANSPORTING labst.
        <b>MODIFY it_mard TRANSPORTING labst WHERE matnr = 'M03-SCRAP'.</b>    MODIFY mard. " FROM TABLE it_mard.
        ENDIF.
    <b>" Here how we know that matnr only update in mard.</b>
        it_gmitem-entry_qnt    = ls_quan3.
        APPEND it_gmitem.
      ENDLOOP.
      CLEAR return.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header             = gmhead
          goodsmvt_code               = gmcode
      TESTRUN                     = 'X'
       IMPORTING
      GOODSMVT_HEADRET            =
         materialdocument            = mat_doc
      MATDOCUMENTYEAR             =
        TABLES
          goodsmvt_item               = it_gmitem
      GOODSMVT_SERIALNUMBER       =
          return                      = return
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
      wait          = 'X'
    IMPORTING
      RETURN        =

  • Transfer Posting MB1B with MvT 311

    Dear experts,
    I have 1 issue. For example, to do transfer posting from Sloc '1201' to Sloc '10F1' and '10F1' is in WM. With movement '311' , a transfer requirement is automatically created, followed by a transfer order creation screen.
    I have automate all these process using 'BAPI_GOODSMVT_CREATE', 'L_TO_CREATE_TR' & 'L_TO_CONFIRM'. And it works fine.
    My question is, physically the user is actually do the stock placement first to the storage bin then only they create a transfer posting. At the point of stock placement, the end user do not know the storage location to move stock. If I automate this process to create TO first then only do transfer posting, is it a correct way? I want to use FM 'L_TO_CREATE_SINGLE' & 'L_TO_CONFIRM'. Please advise.
    Thank you.

    Hello Hasniza,
    Yes you could use this function modules:
    L_TO_CREATE_SINGLE                                                       
    Create a transfer order with one item                                                                               
    L_TO_CREATE_MOVE_SU                                                      
    Create a transfer order to move a storage unit                                                                               
    L_TO_CREATE_TR                                                           
    Create a transfer order for a transfer requirement                                                                               
    L_TO_CONFIRM                                                             
    Confirm a transfer order                                                
    Please check the following link:
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/c6/f83a294afa11d182b90000e829fbfe/frameset.htm
    You could do that by using the user exit EXIT_SAPLL03T_002 not directly via function module.
    Please also pay attention to the documentation of enhancement MWMTO002: 
    "... Therefore, you must never start a transfer order creation via a function module."                                                       
    But you call FM L_TO_CREATE_SINGLE inside of this exit.   
    I hope it helps you.
    Regards,
    Fábio Almeida
    MM Consultant

  • Transfer Posting-Storage Loc-Storage Loc (311) with Ref to Material Documnt

    Hi Experts,
    I have a Requirement of doing Transfer Posting from one Storage Location to Other Storage Location within Plant with reference to a Material Document which is Goods Receipt against PO.
    With given reference (Material document u2013 GR against PO) system should copy all items from Material Document and Propose for Transfer Posting.
    I am aware that this feature is not available in standard R/3.
    Can anyone tell me how to achieve this by Development?
    Any Input is highly appreciated.
    Thanks and Regards,
    Selvakumar. M

    Hi,
    Thanks for your Reply.
    I have seen the documentation of "BAPI_GOODSMVT_CREATE" and it was mentioned only for following Scenarios.
    1) Transfer posting without reference to a reservation
    2) Transfer posting with reference to a reservation
    My requirement is Transfer Posting with reference to a Material Document (Material Document is GR against PO) in which system should copy all documents from refernce.
    Please Tell me how to develop with the above BAPI.
    Regards,
    Selva

  • MIGO Automatic Transfer Posting  (Mvt 101 ) to (mvt 301)

    Hi Experts,
        My requirement is : MIGO - once  performed goods receipt (MvT 101) in receiving plant then transfer posting will perform automatically MB1B (MvT 301) to destination plant/ storage location based on shipping address.
    This should transfer after updating tables (which is after save for Mvt 101 ).  For this I got 1 Badi ' MB_DOCUMENT_BADI'.
    I have used  methods MB_DOCUMENT_UPDATE   and 1 User Exit mb_CF0001  (EXIT_SAPLMIGO_001 or EXIT_SAPMM07M_001 ).
    These 2 will trigger after updating tables, but  the problem is tables are locked especially plant table, so my BAPI  BAPI_GOODSMVt_CREAte is throwing error (says plant is locked).   I even tried DEQUE_ALL  still unable to unlock tables. when I come out of these 2 spots then only tables are unlocked by SAP.
    Appreciated for right answer.
    Regards,
    Sri
    Edited by: srijaS on Aug 17, 2009 1:08 AM
    Edited by: srijaS on Aug 17, 2009 1:09 AM

    Try calling Bapi with 'IN UPDATE TASK' or 'IN  BACKGROUND TASK "

  • Bapi for transfer posting

    Estimated,
    I have to make a move between storage location of material that is blocked with status (movement 325). For that I'm trying on the Bapi MB_CREATE_GOODS_MOVEMENT and run with the same parameters as when I review the transaction MIGO_TR, but the structure EMSEG gives me the message number M7096 "Goods movement not possible with mvmt type 325". What could be wrong? and tried doing the Bapi commit, but still gives me error. It also showed the Bapi BAPI_GOODSMVT_CREATE and throws me the same message. Please I am desperate.
    Thanks.

    Hi,
    You can't use function module MB_CREATE_GOODS_MOVEMENT for movement 325, since that function module is used for Goods Issue for delivery.
    You should use bapi "BAPI_GOODSMVT_CREATE" for this movement 325 instead.
    Passing GOODSMVT_CODE = 04 (for Transfer Posting)
    The following thread has a sample code of above BAPI, then do adjustment accordingly as per your requirement.
    Re: i want to Stock upload with movement 561 and t code is mb1c
    Cheers,

  • Regarding: transfer posting

    Hi FRIENDS,
    i need an good solution for transfer posting (Variant configuaration)
    1.From one  sales order to another sales order.
    We tried with movement type 413E , system is not allowing as configuaration is different between sales orders.
    We tried with this scenario:
    EX: Sales order 1 has stock.
          Sales order 2 has no stock.
    We created planned order fo sales order stock 2 by running MRP.
    and then we moved sales order1 stock  to unrestricted use. when converting planned order to production order of sales order 2 we deleted the entire materials of Sales order2( while creating production order) and we tried to consume the sales order1 stock which was moved to unrestricted use...At this time though stock is there (which has been moved from sales order1)system is not sensing the stock and  showing missing parts list.
    So how to carry out next...please can anyone give me the solution or any other option.
    We have serial numbers also for each order.

    Hi ,
    can you please elaborate more on as how to use the BAPI BAPI_GOODSMVT_CREATE , how to use the GOODSMVT_CODE  ? it's value should be 04 or what.
    Thanks,
    Naveen

  • Transfer Posting for Line Items between Reconciliation Account

    HI,
    My customer want to transfer costing the line items between a old Reconciliation Account and a New Reconciliaton Account.
    For example, i have a Account Group Vendor with a old Reconciliation Account " Vendor CEE".
    This reconciliation account has the line items concern differents Vendors.
    Edit a new Account Group calling ( CEE) to replace a Old Account Group.
    After changing in Vendor Master data the Reconciliation account, we need to transfer posting the line items in the new account reconciliation
    In Sap system is there a report can do it? Can you help me?
    Regards

    Hi,
    Thank you for the answer.
    I did that, and exactly:
    - In Trx Obbw insert the reconciliation account and Adjustement account.
    - and execute the trx FAGLF101 in test but the sap system give me the following error:
      " Account determination for transaction A00 is missing for account 0205016001 ZM P001 "
       Message no. FR005
    Can you help me?
    Regards
    Edited by: Marika De Cesare on Oct 18, 2011 1:06 PM

Maybe you are looking for

  • (Un)mounting disks

    Connected to my Mac mini are 2 USB disks of equal size. I want one to be actively used and the other to be a copy of the first. I want that copy to be made once a week and I want the disk to not be accessible for anything but making that copy. So wha

  • How do I import avchd sony cx700 camcorder footage into Final Cut Pro?

    I've recently bought a Sony CX700 camcorder, but can't transfer the footage using the Log and Transfer window. Does anybody know how to import AVCHD footage into Final Cut Pro?

  • OS X "Help" won't work.

    Mountain Lion OS X has recently been installed, and "Help" for Safari, MS Word, Dictionary, MS Excel, Mail, iTunes, Notes, Calculator, and there may be others, will not function.  "Help" is accessible, but you can proceed only so far before the follo

  • 5800XM: Gallery: Images & Videos Shuts down while ...

    Ive recently notice while I was browsing through my phones Gallery: Images & Videos suddenly shuts off... My phone is currently running on V31.0.101 firmware, did not notice that problem when I updated the firmware, but everytime I try accessing the

  • Create Custom XML using Email Submit

    Hello, I have a form in which I load dynamic data into. I want to save only certain data in the xml file that gets emailed. How can I do that? For example I would like to get certain textfield items as well as the selected value from the drop down no