BAPI_GOODSMVT_CREATE movement type 344

Hi , i want to convert unristricted stock to block stock, so i use movement 344. the thing is ,it is creating document but commit work and wait is failing. i am geeting mail in sap mailbox, updation is failed like that. i am not able to see that document, but bapi is creating document, but is not saving to database.
what should be reason. i am providing sample of my code.
PERFORM within_warehouse_convert
               USING l_lqua '344'.
FORM within_warehouse_convert
    USING wa2_lqua TYPE lqua
          l_bwlvs  TYPE ltak-bwlvs.
*Decalre Variables
  DATA :
  wa_header    LIKE bapi2017_gm_head_01,
  wa_header1   LIKE bapi2017_gm_head_ret,
  l_code       LIKE bapi2017_gm_code,
  l_belnr      LIKE bapi2017_gm_head_ret-mat_doc,
  l_gjahr      LIKE bapi2017_gm_head_ret-doc_year,
  it_items     LIKE bapi2017_gm_item_create OCCURS 0 WITH HEADER LINE,
  it_return    LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
  l_uom        LIKE t006-msehi,
  l_uom_iso    LIKE t006-isocode,
  l_text(100),
  l_error.
Assign Variables
  CLEAR wa_header.
  wa_header-pstng_date = sy-datum.
  wa_header-doc_date = sy-datum.
  wa_header-header_txt = 'Converted to Blocked'.
  l_code = '04'.
  REFRESH :
   it_items, it_return.
  CLEAR :
   wa_header1, l_belnr, l_gjahr, l_error,l_uom.
  SELECT SINGLE meins INTO l_uom FROM mara
   WHERE matnr = wa2_lqua-matnr.
  CALL FUNCTION 'SAP_TO_ISO_MEASURE_UNIT_CODE'
       EXPORTING
            sap_code    = l_uom
       IMPORTING
            iso_code    = l_uom_iso
       EXCEPTIONS
            not_found   = 1
            no_iso_code = 2
            OTHERS      = 3.
  IF sy-subrc <> 0.
    MESSAGE s001 WITH 'Unable to convert Units of Mesaurement'.
  ELSE.
    it_items-entry_uom_iso  = l_uom_iso.
    it_items-material       = wa2_lqua-matnr.
    it_items-plant          = wa2_lqua-werks.
    it_items-stge_loc       = wa2_lqua-lgort.
    it_items-batch          = wa2_lqua-charg.
    it_items-move_plant     = wa2_lqua-werks.
    it_items-move_stloc     = wa2_lqua-lgort.
    it_items-spec_stock     = wa2_lqua-sobkz.
    it_items-sales_ord      = wa2_lqua-sonum(10).
    it_items-s_ord_item     = wa2_lqua-sonum+10(6).
    it_items-val_sales_ord  = wa2_lqua-sonum(10).
    it_items-val_s_ord_item = wa2_lqua-sonum+10(6).
    it_items-item_text      = 'Converted to Blocked'.
    it_items-move_type      = l_bwlvs.
    it_items-entry_qnt      = wa2_lqua-gesme.
    APPEND it_items.
  Call BAPI Goods movement
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
         EXPORTING
              goodsmvt_header  = wa_header
              goodsmvt_code    = l_code
              testrun          = l_test
         IMPORTING
              goodsmvt_headret = wa_header1
              materialdocument = l_belnr
              matdocumentyear  = l_gjahr
         TABLES
              goodsmvt_item    = it_items
              return           = it_return.
    CLEAR l_error.
    LOOP AT it_return WHERE type = 'E' OR type = 'A'.
      MESSAGE i001 WITH it_return-message text-001.
      l_error = 'X'.
      EXIT.
    ENDLOOP.
  Call Commit BAPI.
    IF l_error = ' '.
      CLEAR : it_return.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                wait   = 'X'
           IMPORTING
                return = it_return.
      IF it_return-type = 'E' OR it_return-type = 'A'.
        MESSAGE i001 WITH it_return-message.
        l_error = 'X'.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
        EXIT.
      ENDIF.
    ENDIF.
  ENDIF.
ENDFORM.                    " within_warehouse_convert

Hi ,
put simple code like this .
Call BAPI  'Create Goods '.
loop at lt_return where type eq 'E' or 'A'.
error = 'X'.
endloop.
if error ne  'X'.
commit work.
else.
Roll back.
endif.
regards
Prabhu

Similar Messages

  • HUMO-A reason has to be entered for movement type 344

    Hi All,
    We currently have the system configured to enter a 'reason for movement' for movement type 344 and this field is marked as required in the movement type configuration. We have configures the transactions allowed for the movement type and HUMO is one of them.
    When I try to post the same HU using the path 'Edit-> Change HU Posting-> Other Postings->Process-> Transfer posting unrestriced to blocked', it prompts me for a 'Reason for Movt' and allows me to post it to a blocked stock.
    However, when we try to post an HU to blocked to stock using the path in HU monitor 'Edit-> Change HU Posting->In Blocked Stock', the system gives an error 'A reason has to be entered for movement type 344'. Please note, it does not even prompt me to enter a reason for the movement.
    Is there a configuration node to have the above error corrected? Or is there any SAP note which could help us solve the problem? We are aware of the SAP note 1679167 for transaction VLMOVE but not sure the same would actually correct the issue for HUMO. Any help in this regard is appreciated.

    Hello Biswajit,
    unfortunately, as far as I can see in source
    SAPLHUMO                 
    / LHUMOF04
    FORM                     
    / TRANSFER_POSTING_HU
    during debugging, there is no GUI code to ask user for a reason. So it's a lack of functionality.
    I think you can add this by an implicit enhancement around FORM transfer_posting_hu asking user e.g. with function module call POPUP_GET_VALUES_DB_CHECKED.
    But transfering the entered reason down to the MM posting seems also not so easy because reason field "GRUND" may not visible in that callstack level.
    Hope that helps you along
    Best regards,
    Matthias

  • Movement type '344' blocked to unrestricted - reversal error.

    Hi,
    I am trying to post movement type '344' blocked to unrestriced reversal in IM. I am using WM for this storage location. while posting the '344' i am getting an error 'Data for creating a delivery is incomplete (vendor)'. Will appreciate any help to resolve this.
    thanks.

    Hi,
    I am trying to post movement type '344' blocked to unrestriced reversal in IM. I am using WM for this storage location. while posting the '344' i am getting an error 'Data for creating a delivery is incomplete (vendor)'. Will appreciate any help to resolve this.
    thanks.

  • Create Immediate TO for movement type 344

    Hi Gurus ,
    I wanna create immediate TO for movement type 344, so i did the following configs:
    1:Go to OMLR, set field "Immed.TO " as "A" for my warehouse and movement type 344.
    Then , i called up MB1B 344, but no TO was created immediatelly.
    i checked the additional data in LU03, the movement type is 344, and immed.TO is ticked.  it seems all setting is ok, why the TO can't be created immediatelly?
    thank you in advance.
    BR,
    Dragsky

    First check which ref. movement type assigned to 344 movement type in W/H under below path
    SPRO> LE>WM>Interfaces>IM>Define movement types
    In this go to first option and check the last movement type assigned to mvt type 344 i.e. "Reference movement type for posting change in whse mgmt" (in combination with other indicator like stock category, special stock indicator etc....)
    Then got to OMLR and check whether this ref. movement type defined for your W/H,
    if yes, maintain setting for auto TO  in that specific entry (in combination with other indicator like stock category, special stock indicator etc....)
    If no, then check movement type for *** W/H and maintain specific entry (in combination with other indicator like stock category, special stock indicator etc....)
    Hope it helps.
    Regards
    Anand Misra

  • Purpose of Movement type 344

    Hi guys,
    Just want to confirm if movement type 344 is used to transfergoods from Blocked to Unrestricted.
    Cheers,
    Karthick

    Hi
    Yes 344 is to transfer from unrestricted to blocked
    TF - First transaction
    TR - Return transaction
    you can see lot of examples in tranfer posting
    Like 301 & 302
    311 & 312
    Always stock will be received into Quality or Unrestricted and not into Blocked so TR movemet type wont be there from unrestricted.
    Thanks/Karthik
    Edited by: Karthik on Oct 27, 2009 8:59 AM

  • BAPI_GOODSMVT_CREATE Movement Type 641

    Hi All
    I was wondering if it is possible to do a Stock Transfer posting using Movement type 641 in the BAPI, BAPI_GOODSMVT_CREATE.
    I am trying to replicate the VL02N functionality using this BAPI.
    No matter what I do I keep getting the error "For item 00001 of purch. order 80000274, no goods issue can be posted"  M7 152
    Is this even possible, if yes, what am I doing wrong ?
    Thanks
    Aju Paul

    Hi,
    You need to change your GMCODE to 03 for GOODS ISSUE.
    GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
                         02 - MB31 - Goods Receipts for Prod Order
                         03 - MB1A - Goods Issue*
                         04 - MB1B - Transfer Posting
                         05 - MB1C - Enter Other Goods Receipt
                         06 - MB11
    Regards,
    Gilberto Li

  • Goods Issue using BAPI_GOODSMVT_CREATE movement type 541

    Hi
        According to my requirement I need to do Post goods issue using BAPI_GOODSMVT_CREATE. But I am unable to do PGI . how to consume BOM details if batches are changed. please let me know what values I need to pass to BAPI . give with an example.
    Its an urgent requirement.

    are you passing batch number to the BAPI?
    if not try pass the batch number the rest of the things bapi will take care of.
    bi

  • 'BAPI_GOODSMVT_CREATE movement type

    here are my requirements
    The current functionality in SAP takes a Material and changes it from “Unrestricted” to “Restricted” at the time of Material Expiry.
    The Following Functionality is required:
    • Upon automatically running a batch job the system will check for all expired Materials with a stock status of “Restricted” and change that status to “Blocked”
    i have to call Call 'BAPI_GOODSMVT_CREATE' function module for creating the material document
    Upon running Batch job, the program will look in table MCH1 for all Batch/Material combinations that have an expired SLED (field: VFDAT).
    After finding all expired Batch/Material combinations in step one the program will then use that data to locate the associated Plants (field: WERKS) and Storage Locations (field: LGORT) in table MCHB
    where BAPI2017_GM_CODE-GM_CODE = 04(Transfer Posting).
    my question is after passing the selcted data into GOODSMVT_ITEM will the materials that i have selcted will automatically be changed from “Restricted” and change that status to “Blocked”
    if so what would be the correct GOODSMVT_ITEM-MOVE_TYPE
    please help

    I thinkfthats case for gm_code being goods reciept
    but i have get it for TP-transfer posting code 04

  • BAPI_GOODSMVT_CREATE - Movement type 309

    I am using  this BAPI to do a 309 movement. 
    I get the error message M7 E021                                                                 
    Deficit of SL Unrestricted-use .
    I do not get the error message for the same data when i use MB1b. 
    The problem exists in program LMBMVFV0
    The online tcode assigns a value using this code....
            ASSIGN (t156f-felds) TO <m>.
    But when the BAPi executes there is no value here.  It is 0. This causes the error.
    I cannot find an OSS note.
    Canybody have any experience mapping a move 309 using this BAPI

    Updating the thread as it appears in google search and has no solution.
    Came across same issue when posting goods movement 309 on same material/batch twice. Problem is with function module that fetches data from MCHB table. If called two or more times it will pass data from local internal table instead of reading from database.
    MB_PREFETCH_MATERIAL calls MATERIAL_PRE_READ_MBEF to read data from MCHB. Function module MATERIAL_PRE_READ_MBEF maintains buffer for MCHB. Unless calling program specifically request data from database, it (MATERIAL_PRE_READ_MBEF) tries to full-fill from internal table. Within function module MB_PREFETCH_MATERIAL there is a bit of logic which tells fm MATERIAL_PRE_READ_MBEF to use buffer if late exclusive block is activated (field TCURM-MBEQU transaction OMJI). 
    Note 194070 resolves the issue.

  • Move types in MM

    please provide mov types in goods recipt for material to blocked and quality stock. GR in consignment and goods return to vendor and consignment.

    Hi
    Use following movement types
    344 for transfer between Un-restricted to Blocked stock
    322 for transfer between un-restricted to QI stock
    GR in consignment
    use
    101 K or
    posting of vendor consigned stock to own stock using 411 K in MB1B
    Return to vendor
    161 Return for purchase order
    122 Return delivery to supplier or to production
    thanks
    prasanna
    award if usefull

  • Movement Type 341 not seen in MIGO

    Hi all,
    I need movement type 341 for transfer posting with SLocs within same plant (Unrestricted use to Block stock) but i could not find the MType 341 in MIGO for transfer posting..
    Could any one let me know how to go about this configuration?
    Regards,
    Sachin Narvekar,Mumbai

    Hi
    If you want to transfer the stock <b>from Unrestricted to Blocked,</b> then in MIGO Transaction Use <b>Movement type: 344.</b>...It will solve your Purpose.
    <b>Dont use 341 movement type for this purpose</b>.
    Reward if useful
    Regards
    S.Baskaran
    Message was edited by:
            baskaran srinivasan
    Message was edited by:
            baskaran srinivasan

  • Goods Receipt Report With 101 movement type using bapi_goodsmvt_create

    Dear Abapers,
            i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
    bapi_goodsmvt_create and data should upload through excel sheet.
    still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
    What are all the inputs i need to take and please give some valuable inputs to me.
    please do help ..... thanks for advance..
    Thanks & regards,
    Vinay.
    Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
    Edited by: Vinod Kumar on Sep 27, 2011 10:58 AM

    Dear Abapers,
            i am getting some problem, i got requirement like Goods Receipt Report with 101 movement type using
    bapi_goodsmvt_create and data should upload through excel sheet.
    still facing problems, i have searched sdn forum n sdn code also, but relevant answer i could not find.
    What are all the inputs i need to take and please give some valuable inputs to me.
    please do help ..... thanks for advance..
    Thanks & regards,
    Vinay.
    Moderator message : Spec dumping is not allowed, show the work you have already done. Thead locked.
    Edited by: Vinod Kumar on Sep 27, 2011 10:58 AM

  • Error while using BAPI_GOODSMVT_CREATE wiht movement type 311.

    Hi All experts,
    i am geting error msg, while using BAPI_GOODSMVT_CREATE wiht movement type 311.
    the error msg is " For reservation 0000443815 0000, no movements can be posted".
    Here is my code.
    IF I_ZMM_S_MBIB_LOT[] IS NOT INITIAL.
    *moving posting date and document date  to header
        GOODSMVT_HEADER-PSTNG_DATE = ZMM_S_MBIB_311-BUDAT.
        GOODSMVT_HEADER-DOC_DATE   =  ZMM_S_MBIB_311-BUDAT.
        LOOP AT I_ZMM_S_MBIB_LOT WHERE MENGE NE '0'.
          IF I_ZMM_S_MBIB_LOT-IND = 'X'.
    *moving material and plant ,stge_loc,qty and movement type  to header
            GOODSMVT_ITEM-MATERIAL       = I_ZMM_S_MBIB_LOT-MATNR.
            GOODSMVT_ITEM-PLANT          = I_ZMM_S_MBIB_LOT-WERKS.
            GOODSMVT_ITEM-BATCH          =  I_ZMM_S_MBIB_LOT-CHARG.
            GOODSMVT_ITEM-STGE_LOC       = I_ZMM_S_MBIB_LOT-SLGORT.
            GOODSMVT_ITEM-MOVE_TYPE      = '311'.
            GOODSMVT_ITEM-ENTRY_QNT      = I_ZMM_S_MBIB_LOT-MENGE.
            GOODSMVT_ITEM-ENTRY_UOM      = I_ZMM_S_MBIB_LOT-MEINS.
            GOODSMVT_ITEM-MOVE_MAT       = I_ZMM_S_MBIB_LOT-MATNR.
            GOODSMVT_ITEM-MOVE_PLANT     = I_ZMM_S_MBIB_LOT-RWERKS.
            GOODSMVT_ITEM-MOVE_BATCH     = I_ZMM_S_MBIB_LOT-UMCHA.
            GOODSMVT_ITEM-MOVE_STLOC     = I_ZMM_S_MBIB_LOT-UMLGO.
            GOODSMVT_ITEM-RESERV_NO      = I_ZMM_S_MBIB_LOT-RSNUM.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              GOODSMVT_HEADER               = GOODSMVT_HEADER
              GOODSMVT_CODE                 = '04'
          TESTRUN                       = ' '
          GOODSMVT_REF_EWM              =
            IMPORTING
          GOODSMVT_HEADRET              =
              MATERIALDOCUMENT              = MATERIALDOCUMENT
              MATDOCUMENTYEAR               = MATDOCUMENTYEAR
            TABLES
              GOODSMVT_ITEM                 = GOODSMVT_ITEM
          GOODSMVT_SERIALNUMBER         =
              RETURN                        = RETURN.
          GOODSMVT_SERV_PART_DATA       =
          EXTENSIONIN                   =
        ELSE.
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on Feb 23, 2011 11:46 AM

    Hi Sachin,
    Pass the Item Number of Reservation to GOODSMVT_ITEM-RES_ITEM .
    Regards
    DKS

  • BAPI_GOODSMVT_CREATE - error for movement type 343 (movement code - 04)

    Hi Gurus,
    I am using BAPI_GOODSMVT_CREATE for doing transfer posting MB1B.
    I need to do transfer posting using movement type - 343 "Blocked to Unrestricted stock"
    Movement type - 343
    GOODSMVT_CODE - 04 (transfer posintg)
    I am getting error message -
    E /CWM/MM              001 Transfer the parallel entry quantity/entry unit of measure
    Help me with some pointers.
    Thanks,
    Madan

    Rajesh,
    Here is my code for line items:
    MATERIAL                       100001374
    PLANT                          1AAE
    STGE_LOC                       B100
    BATCH                          0111331309
    MOVE_TYPE                      343
    ENTRY_QNT                                10.000
    ENTRY_UOM                      EA
    Let me know should I need to fill any other fields.
    Thanks,
    Madan

  • BAPI_GOODSMVT_CREATE with a movement type of 262

    hi:
    when  I do a goods movement using BAPI_GOODSMVT_CREATE with a movement type of 262. If I supply the reservation number it creates the material document with a movement type of 261 ignoring the 262 . why ?

    Hi,
    Check if GM_CODE in the import parameters is set to "06" for the reversal movement type. If not, please set it to 06.
    Regards,
    Sachin .

Maybe you are looking for

  • When I begin to type "m" in the location bar, I simply cannot -- it always changes it to an "h". Simply put, I can't type a simple URL. What gives? (FF 7.0.1)

    Basically, I'm trying to go to a mobile version of my own site to see something, so I start typing, "m.mysite..." and it just won't let me do it. I have to open Notepad, type the URL, then paste it in the URL bar. I must be breaking someone's new sel

  • Safari Internet Quicktime Plug-in Fails

    I recently purchased a Mac Pro a couple of weeks ago, and I have ran into a few glitches with the Intel based system, however I have found a fix for most expect this one. When I launched Safari and went to watch Apple Quicktime Trailers I received an

  • How to run the client from server

    HI FRIENDS, I HAVE A SMALL PROBLEM WITH MY PROGRAM.I WANTED TO START THE CLIENT FROM SERVER I.E THE CLIENT SHOULD BE EXECUTED AS SOON AS THE SERVER STARTS EXECUTION.SOME OF THEM SAID THAT THIS CAN BE DONE BY USING 'EXEC' COMMAND.BUT I COULDNT.SO PLEA

  • Batch file renaming questions

    Beyond knowing that such a facility exists, I have no knowledge about Bridge scripting. Can it be used to modify the standard batch file rename process in Bridge? I would like to rename my Canon Raw images with the date (from EXIF Date Digitised) and

  • Converting multiple msft office docs to one pdf-Mac

    HELF - i am using adobe acrobat 9 pro for macs (Mac OS X 10.6.3). when we had a pc, we were able to convert multiple files (microsoft office) to a single pdf at once without first converting them all to pdf. when I attempt this using the same techniq