Post Goods issue using bapi_goodsmvt_create

hi,
Iam trying to do post goods issue using bapi_goodsmvt_create. please let me know what are the mandatory fields to be passed?

hi,
*& Report  ZRPT_SUB_KO01GOODSMOVEMENT
REPORT  ZRPT_SUB_KO01GOODSMOVEMENT.
PARAMETERS : P_BAG(17)  TYPE C,
             P_ZZORG LIKE zaUFK-ZZORG,
             P_MATNR LIKE MARA-MATNR,
             P_WERKS LIKE AUFK-WERKS,
             P_WERK LIKE AFPO-PWERK,
             P_DATE LIKE MKPF-BUDAT,
             P_LGORT LIKE GOITEM-LGOBE.
DATA : BDC_DATA TYPE STANDARD TABLE OF BDCDATA. "internla table for bdc data
  DATA : WA_BDC_DATA TYPE BDCDATA .                "work area for bdc data
  DATA : T_XMSEG TYPE   MSEG.
  DATA : T_XMKPF TYPE MKPF.
  DATA : V_BAGS1(17) TYPE C.
DATA : BEGIN OF WA_MB1B,
       ZZGCODE TYPE ZMIGO-ZZGCODE,
       ZZGBAGS TYPE ZMIGO-ZZGBAGS,
       WERKS TYPE AUFK-WERKS,
       LGORT TYPE VBRP-LGORT,
       ZZORG TYPE zAUFK-ZZORG,
       END OF WA_MB1B.
DATA : V_MATERIAL TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
data : v_date(10) type c.
DATA : T_GOODSMVT_HEADER TYPE BAPI2017_GM_HEAD_01,
       T_GOODSMVT_CODE TYPE BAPI2017_GM_CODE,
       T_GOODSMVT_ITEM TYPE STANDARD TABLE OF BAPI2017_GM_ITEM_CREATE,
       T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA : WA_GOODSMVT_ITEM TYPE BAPI2017_GM_ITEM_CREATE.
DATA : BEGIN OF S_MARA,
       MEINS LIKE MARA-MEINS,
       END OF S_MARA.
DATA : MATERIALDOCUMENT TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
*FORM GOODSMOVEMENT TABLES T_RETURN
                         USING WA_MB1B LIKE WA_MB1B.
SELECT SINGLE  MEINS
               FROM MARA
               INTO S_MARA
               WHERE MATNR = P_MATNR.
   CONCATENATE p_date6(2) p_date4(2) p_date+0(4) INTO V_DATE SEPARATED BY '.'.
    T_GOODSMVT_HEADER-PSTNG_DATE = P_DATE.
    T_GOODSMVT_HEADER-DOC_DATE = P_DATE.
    T_GOODSMVT_CODE-GM_CODE = '04'.
    WA_GOODSMVT_ITEM-MATERIAL =      P_MATNR.                    "'000000000000001556'.
    WA_GOODSMVT_ITEM-PLANT  =        P_WERK.                     " '1000'.
    WA_GOODSMVT_ITEM-STGE_LOC =      P_LGORT.                    " '0001'.
    WA_GOODSMVT_ITEM-MOVE_TYPE =     'Z42'.
    WA_GOODSMVT_ITEM-VENDOR =         P_ZZORG.                   "'0000100224'.
    WA_GOODSMVT_ITEM-ENTRY_QNT =      P_BAG.                   " '1'.
    WA_GOODSMVT_ITEM-ENTRY_UOM =     S_MARA-MEINS.
    WA_GOODSMVT_ITEM-ENTRY_UOM_ISO = S_MARA-MEINS.
    WA_GOODSMVT_ITEM-MOVE_PLANT = P_WERKS.
    APPEND WA_GOODSMVT_ITEM TO T_GOODSMVT_ITEM.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
      GOODSMVT_HEADER          = T_GOODSMVT_HEADER
      GOODSMVT_CODE            = T_GOODSMVT_CODE
IMPORTING
    MATERIALDOCUMENT           = V_MATERIAL
TABLES
      GOODSMVT_ITEM            = T_GOODSMVT_ITEM
RETURN                        = T_RETURN.
BREAK shailajaa.
           EXPORT t_return  to MEMORY ID '123'.
           EXPORT V_MATERIAL TO MEMORY ID 'MAT'.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
       WAIT          = ' '.
*ENDFORM.

Similar Messages

  • 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

  • Post Goods issue using delivery

    Hi,
    Anyone know a function module or BAPI to post goods issue (mvt:601) for delivery. function module BAPI_GOODSMVT_CREATE does not support 601 or like. and if we use BDC, there are no return message because we use transaction VL02N and in this if any error, it will stop at error screen.
    Pls let me know if you have any solution on this.
    regards,
    Nilesh

    Hi,
    I got solution with fm: WS_DELIVERY_UPDATE_2 which will update delivery, packing, picking.......
    Still waiting for answer on: creating delivery realted billing document. Tried BAPI_BILLINGDOC_CREATEMULTIPLE which will create order related only.

  • Posting goods issue using Message type SHPCON and idoc type DELVRY03

    Hi SAP Gurus,
    I am using message type SHPCON and idoc type DELVRY01 with processing code DELV to post goods issue for a delivery note.
    I tried to simulate the inbound entry via WE19. The scenario should be posting goods issue based on the delivery order.
    In some cases, quantity issued is less than the quantity in the DO. For this, I need to change the delv quantity in the DO via VL02N before I select Post goods issue button. This will change at the same time post the goods issue.
    What I have filled up are the fields:
    E1EDL20-VBELN = DO num
    E1EDL20-VSTEL = Plant
    E1EDL18-QUALF = "PGI"
    E1EDTH13-QUALF = "006"
    E1EDTH13-NTANF = date today
    E1EDL24-POSNR = 000010
    E1EDL24-MATNR = material num
    E1EDL24-WERKS = delv plant
    E1EDL24-LGORT = sloc
    E1EDL24-LFIMG = updated quantity
    But everytime I simulate using WE19, the entire quantity in the DO is not changed at all. The goods issue quantity posted is still the original DO quantity.
    May I know how to do this? Thanks.

    Put value in E1EDL24-LGMNG for qty to pgi.

  • How to create post goods issue using sapgui.

    hi,
    can u pls tell how to create pgi for delivery .pls tell  spep by step procedure
    regards
    Guru

    Hi,
    Goto VL02N -> give the delivery number..Then press enter..
    In the resulting screen..There will be a button for called "Post goods issue"..Then press that..The goods issue will be posted automatically..
    Thanks,
    Naren

  • Deficit of Stck w.vend.unr.prev : Goods issue using BAPI_GOODSMVT_CREATE' subcontracting PO

    Hi Experts,
    I am facing one issue while doing Goods Issue for sub contracting PO . In my case, inbound idoc will trigger the BAPI 'BAPI_GOODSMVT_CREATE' with movement code '07'  and movement type as 543.
    But it throws the error Deficit of Stck w.vend.unr.prev 438.793 THD : U329557 0113 VARIOUS O. U329557 is the child material of finished material 0003121XAZ. When i checked in MMBE, for the given material/storageloc/batch it has sufficient quantity.
    I debugged the whole scenerio and found that from one table T156F in FM 'MB_MODIFY_STOCK_ENQUEUE_ENTRY', the value <m> is ASSIGNED from (t156f-felds) with value 1126.190. Later it subtract the value, provided in structure GOODS_ITEMS of BAPI BAPI_GOODSMVT_CREATE with quantity 1564.983 which is to be Goods issued from vendor. 
    1564.983 - 1126.190 = 438.793 .
    Please help me why i am getting this Deficit error even when quantity is present for child material.
    Thanks
    Shahab

    Hi Experts,
    Please help me in this issue.

  • Goods issue using bapi  BAPI_GOODSMVT_CREATE getting error E M7

    HI  consultants,
    While  posting goods issue using bapi BAPI_GOODSMVT_CREATE . Running the batch job(zprogram) to post the goods issue . The goods issue is been posted by passing  goods receipt data's.
    while processing 3 goods receipt , 2 works fine one goods receipt getting  E M 7 300 NO ITEMS ARE TRANSFERED error.
    when i  processing one by one all the 3 goods receipt is working fine and process sucessfully. While processing in bulk ,i am getting this issue.
    If anybody faces this same problem or knows the solution .Please post the answer.
    The way i am passing the parameter to bapi given bellow.
        WA_GOODSMVT_CODE-GM_CODE = C_03.
    *--populate header data
        WA_GOODSMVT_HEADER-DOC_DATE   = WA_MKPF-BLDAT.
        WA_GOODSMVT_HEADER-PSTNG_DATE = WA_MKPF-BUDAT.
    *--populate item data      
    *-- call the bapi for posting goods issue
                 IT_GOODSMVT_ITEM-NETWORK     = WA_RESBP-AUFNR.
                IT_GOODSMVT_ITEM-RESERV_NO   = WA_RESBP-RSNUM.
                IT_GOODSMVT_ITEM-RES_ITEM    = WA_RESBP-RSPOS.
                IT_GOODSMVT_ITEM-ACTIVITY    = WA_RESBP-VORNR.
                IT_GOODSMVT_ITEM-MOVE_TYPE   = C_281.
                IT_GOODSMVT_ITEM-ENTRY_QNT   = WA_RESBP-NET.
    *--get the item details
                  IT_GOODSMVT_ITEM-MATERIAL   = WA_MSEG-MATNR.
                  IT_GOODSMVT_ITEM-PLANT      = WA_MSEG-WERKS.
                  IT_GOODSMVT_ITEM-STGE_LOC   = WA_MSEG-LGORT.
                  IT_GOODSMVT_ITEM-ENTRY_UOM  = WA_MSEG-ERFME.
                  CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
                    EXPORTING
                      INPUT  = WA_MSEG-PS_PSP_PNR
                    IMPORTING
                      OUTPUT = WA_PSPHI_TEMP.
                  IT_GOODSMVT_ITEM-WBS_ELEM   = WA_PSPHI_TEMP.
                  APPEND IT_GOODSMVT_ITEM.  
                CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
                  EXPORTING
                    GOODSMVT_HEADER  = WA_GOODSMVT_HEADER
                    GOODSMVT_CODE    = WA_GOODSMVT_CODE
                  IMPORTING
                    MATERIALDOCUMENT = WA_MATERIALDOCUMENT
                  TABLES
                    GOODSMVT_ITEM    = IT_GOODSMVT_ITEM
                    RETURN           = IT_RETURN.
    With Regards,
    Ambrose Mohandoss.

    Problem solved.

  • Dump "COMMIT_IN_POSTING" while posting Goods Issue

    Hi All,
    We are trying to post Goods Issue using the FM BAPI_GOODSMVT_CREATE.
    Based on the return status of this FM we are commiting the transaction using BAPI_TRANSACTION_COMMIT.
    On Execution we are getting the dump "COMMIT_IN_POSTING".
    Please let us know if anyone has any idea about this error.
    Regards,
    Lavanya.

    Hi Florian,
    I have commented the BAPI_TRANSACTION_COMMIT, but it is giving same dump since commit work is happening in another FM which I am using in my program. So I have commented that FM, now it is giving a dump MESSAGE_TYPE_X. The dump error analysis is:
    Short text of error message:
    Nested call of PERFORM ON COMMIT: NESTED_PERFORM_ON_COMMIT caller: SAPLM
    BRE program: SAPLMBRE form: DELTA_PUT
    Long text of error message:
    Diagnosis
         During processing of a routine called using PERFORM ... ON COMMIT,
         the system attempted to call PERFORM ... ON COMMIT again. Nesting
         of this is not allowed.
    System Response
    Procedure
         The program indicated after "Caller:" must be changed. This is the
         program that calls the routine indicated after "Form:" during
         COMMIT processing. This routine is part of the program indicated
         after     "Program:".
    Regards,
    Lavanya.

  • Change BSEG-ZUONR  during the Post Goods issue.

    Hi
    We wanted to Update the BSEG-ZUONR with sales Order no( traverse back to the Original SO during reversal)  ( Basically Assignment field (ZUONR) in the Accounting side) after performing the Post Goods issue  USING TRANSACTION VL02N.
    Is there any user exit which can allow us to update the accounting field ( ZUONR) during the post goods issue ( Tcode VL02N)?
    Thanks a lot.

    Hi,
    you can achieve this using the concept of validation and substitution rules in FI (Check transaction OB28) or below help
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/27/06e23954d9035de10000000a114084/content.htm
    Hope this helps
    Regards
    Shiva

  • Help: one request using ALE&IDOC to Posting Goods Issue about MaterialScrap

    Hi Exports,
    i got a situation. My client is using ALE&IDOC to deal with the Material Scrapping. The business scenario is:
    1. One third system (Non-SAP) Send IDOC to SAP Production Server through the Intermedia SEEBEYOND.
        Message Type: MBGMCR
        IDOC Type: MBGMCR02
        BUSINESS OBJECT: BUS2017
    2. SAP Production Server use "Message Type: MBGMCR" to find out the BAPI in Distribution Model and trigger the BAPI.
    the Distribution Model:
    Model View
    SEEBEYONG
    PRODUCTION
    GoodsMovement.CreateFromData
    Reciever determination: no filter
    Now my client's request is:
    When the Movement Type is 551 in the IDOC Segment "E1BP2017_GM_ITEM_CREATE", This IDOC will be ignore and not trigger the BAPI to post goods issue.
    i try to add the destination filter in the Distribution Model. but when i add the filter group, there are only two filter parameter ("Plant" and "Storage Location") and don't allow to add others.
    i have no idea now. can anyone give me a favor. thank you very much in advance.
    Edited by: Dave Wang on Feb 29, 2008 7:09 AM

    We got hold of the Idoc type 'DELVRY03 PGI SHPCON' we are able to post the Idoc but we are able to do the packing only or we are able to change the deliveries but the PGI is not happening..
    please help us on this.. is there some condig that updates the delivery with the PGi or is there something else do be done in the Idoc....
    will provide additional details if required.
    Thanks
    Arun

  • STO Post goods issue reversal using vl09 not happening.

    hi
    user has done following cycle
    1.ME21N-PO document type UB and Item cat I.
    2.VL10B- Outbound delivery
    3.VL06G-goods issue using automatic MVT 647 and 101)
    4.VF01-Performa Invoice(billing Type JEX)
    5.J1IIN- Excise invoice.
    In billing base price is missing because of that all duties and net price zero.now user wants to cancel entire cycle. he has done excise cancellation using J1IH. we are not able to reverse billing using VF11, we are not able to PGI reversal using Vl09. it giving error "No dat available for your selection".
    Note: is it problem of JEX because we have not assigned cancell billing type and doc pric procedure to JEX?
    any solution for the above issue.

    the optional solution can be as following steps:
    1) create the bin manually with ls01n: storage type 904, bin name is the delivery number,
    2) reverse with vl09 and a material doc will be created.
    3) check the bin stock with ls24, you will see negative stock in 904.
    4) create TO to offset this negative qty with lt06 with above mentioned material doc. this TO's source bin is just the one in regular storage type.
    5) confirm TO
    6) don't forget to delete the bin created in step 1,  this is because it is created manually but not dynamic bin that will dissapear automatically.
    pls reward if helpful.

  • Need Bapi Names for Post Goods Reciept and Post Goods issue to STO in MIGO

    Hi All..
    I need to post goods receipt using input data in MIGO. Is there any BAPI that i can use.
    Also once STO (Stock Transport order) is created, i also need to Post goods issue to STO in MIGO transaction. I do need a bapi for this too...
    Appreciate your help and will reward any helpful answers.
    Thanks..

    Hi,
    ata  : gm_header  type bapi2017_gm_head_01.
    data  : gm_code    type bapi2017_gm_code.
    data  : gm_headret type bapi2017_gm_head_ret.
    data  : gm_item    type table of
            bapi2017_gm_item_create with header line.
    data  : gm_return  type bapiret2 occurs 0 with header line.
    data  : gm_retmtd  type bapi2017_gm_head_ret-mat_doc.
    clear : gm_return, gm_retmtd. refresh gm_return.
    gm_code-gm_code      = '03'.
    gm_header-header_txt = firstscreen-bktxt.
        gm_header-pstng_date = sy-datum.
        gm_header-doc_date   = sy-datum.
        gm_header-ver_gr_gi_slip = ' '.  "print
        gm_code-gm_code      = '03'.
      move lineitem1-bwartwa  to gm_item-move_type     .
          move lineitem1-matnr  to gm_item-material.
          move lineitem1-erfmg     to gm_item-entry_qnt.
          move 'EA'    to gm_item-entry_uom.
          move lineitem1-werks  to gm_item-plant.
          move lineitem1-lgort  to gm_item-stge_loc.
          move lineitem1-kostl to gm_item-costcenter.
          while gm_item-costcenter+9(1) = ' '.
            shift gm_item-costcenter right.
          endwhile.
          overlay gm_item-costcenter with '0000000000'.
          append gm_item.
    call function 'BAPI_GOODSMVT_CREATE'
           exporting
                goodsmvt_header  = gm_header
                goodsmvt_code    = gm_code
           importing
                goodsmvt_headret = gm_headret
                materialdocument = gm_retmtd
           tables
                goodsmvt_item    = gm_item
                return           = gm_return.
    Thanks
    venki

  • Post goods Issue ,in VL02n

    Hi friends ,
    I am trying to post Goods issue from delivery order,through VL02n .I tried using BAPI_GOODSMVT_CREATE but it returns the message 'Goods Movement not possible with mvmt type 645'.
    I saw in some of the threads about this BAPI ,BAPI_OUTB_DELIVERY_CONFIRM_DEC .Can i achive the same functionality .Please suggest me which parameters should be passed into the BAPI.
    The BAPI should return me the material document number generated from VL02n ,i mean after posting the goods issue .
    Regards ,
    Hemanth Nugur .

    Hi
    "I am trying to post Goods issue from delivery order,through VL02n"
    If you want to do it inside VL02N transaction, you already a PGI button, just click on that, PGI will be done
    Regards
    MD

  • Posting Goods Issue problem?

    Hi SDN,
    I am using BAPI  BAPI_GOODSMVT_CREATE for posting of goods issue using movement type 261.
    I am getting following error = Goods movement not possible with mvmt type 261.
    But if i use movement type other than 261 it works.
    But unfortunately i have to use movement type 261.
    Please help
    Regards,
    Rahul Wagh

    Dear
    Pls follow the steps,
    Use tcode OB53, put X    and create on P& L account G/L and put it there. That is " Define retained earnings account".
    Your problem is solved. Enjoy.............!!!!!!
    Regs
    Rajakumar.k

  • Post Goods Issue for movement type 351

    Hi experts,
    I need to perform a post goods issue for the movement type 351.
    which bapi we need to use? is it going to be "BAPI_GOODSMVT_CREATE" or something else.
    What are the information that we require other than movement type for performing post goods isue?
    Any pointers on this will be highly appreciated.
    Regards,
    Sajith

    Hi ,
    Thanks man.. Then where should I do that.
    Idoc is PORDCR102. Message type is PORDCR1.
    My requirement is to create a STO first in the user exit EXIT_SAPL2012_001 and then to perform a Post goods issue in the user exit EXIT_SAPL2012_003.
    Can u please explain it.
    Regards,
    Sajith

Maybe you are looking for

  • Hp color laserjet cp5525

    My printer hp color laserjet cp5525 is working very well,just recently after I servicing the printer and I turn ON the power the error code 57.00.01 appear on the screen. is there any help for that error. thanks student. 

  • FX differences occured in clearing important

    Hi sap gurus, i make clearing for both customer and vendor line items however i can not find any report or customizing to see FX differences by line item basis or customer basis. do you know any table or customizing showing FX differences by customer

  • Problem with JSF Page loading with WAS 6.1.0.2

    We are using Trindad Faces & the app server is Websphere 6.1.0.2. When the server starts up, its gives lots of logs (does not say error or warning) as below. 11:13:58:881 EST] 00000019 jsf W com.ibm.ws.jsf.configuration.FacesConfigParser parseShared

  • Project Settlement Issue

    Hi All, We had an invoice that was entered with a wbs that had the following currencies:  CO Currency = USD, Transaction Currency = USD and Object Currency = GBP within a company with a currency of GBP.  However, when settling through CJ88, the settl

  • What is invoice list

    hi gurus what invoice list does.  Where do we use this invoice list how to configure means where do we set customizing settings.   How it will be use ful in a business. Thanks & Regards Poitns will be rewarded