Backdate Posting of Goods Issue using standard BADI

Hi Experts!
The standard BADI we are using creates an STO then a Delivery and Goods Issue via a userexit. We have a requirement to backdate the posting dates and have a concern of deficit stock levels at the point of Goods Issue. How do we control this?

Hi,
Instead of updating entire data of deliveries and PGI once, you can manually update the stock for a specific period and then update the Deliveries and PGI in the system.
Or update entire stock at once till date and only then update the Deliveries and PGI in the system.
Hope this helps.
Regards,
Sharan

Similar Messages

  • 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.

  • 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 amend a do an post a goods issue by using BAPI_OUTB_DELIVERY_CONFIRM

    Dear All,
    As advised in this forum ,I want to used BAPI_OUTB_DELIVERY_CONFIRM_DEC to amend my DO and post a goods issue. However, I keep getting error message "error in document 80000970 item 000010 (quantity consistency check)"
    code:
    DATA:
    W_HEADER_DATA LIKE BAPIOBDLVHDRCON,
    W_HEADER_CONTROL LIKE BAPIOBDLVHDRCTRLCON,
    DELIVERY_NUM LIKE BAPIOBDLVHDRCON-DELIV_NUMB,
    W_ITEM_DATA LIKE BAPIOBDLVITEMCON,
    I_ITEM_DATA LIKE BAPIOBDLVITEMCON OCCURS 0,
    I_RETURN LIKE BAPIRET2 OCCURS 0.
    DATA :
    W_RETURN  LIKE BAPIRET2,
    L_RETURN LIKE SY-SUBRC.
    PERFORM OUTBOUND_DELIVERY
      CHANGING
        L_RETURN.
    FORM OUTBOUND_DELIVERY
      CHANGING
            L_OUT_RETURN   LIKE SY-SUBRC.
    DATA:
      V_LOGSTR(128)    TYPE C.                       "LOG ÄÚÈÝ
    DELIVERY_NUM = '80000970'.    "DO NUMBER
    "HEAD DATA PART
    W_HEADER_DATA-DELIV_NUMB = '80000970'.
    W_HEADER_DATA-GROSS_WT = 240.
    W_HEADER_DATA-NET_WEIGHT = 240 .
    W_HEADER_DATA-UNIT_OF_WT = 'G'.
    "HEAD DATA CONTROL PART
    W_HEADER_CONTROL-DELIV_NUMB = '80000970'.
    W_HEADER_CONTROL-GROSS_WT_FLG = 'X'.
    W_HEADER_CONTROL-NET_WT_FLG = 'X'.
    W_HEADER_CONTROL-VOLUME_FLG = 'X'.
    W_HEADER_CONTROL-POST_GI_FLG = 'X'.
    "ITEM DATA PART
    CLEAR W_ITEM_DATA.
    W_ITEM_DATA-DELIV_NUMB = '80000970'.
    W_ITEM_DATA-DELIV_ITEM = '000010'.
    W_ITEM_DATA-MATERIAL = '0015223'.
    W_ITEM_DATA-BATCH = '20040202'.
    W_ITEM_DATA-DLV_QTY = 1.
    W_ITEM_DATA-SALES_UNIT = 'CAR'.
    APPEND W_ITEM_DATA TO I_ITEM_DATA.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
      EXPORTING
        HEADER_DATA                = W_HEADER_DATA
        HEADER_CONTROL             = W_HEADER_CONTROL
        DELIVERY                   = DELIVERY_NUM
      TABLES
      HEADER_DEADLINES           =
        ITEM_DATA                  = I_ITEM_DATA
        RETURN                     = I_RETURN
      LOOP AT I_RETURN INTO W_RETURN.
        IF W_RETURN-TYPE = 'E'.
          L_OUT_RETURN = 4.
          MESSAGE   ID     W_RETURN-ID
                    TYPE   W_RETURN-TYPE
                    NUMBER W_RETURN-NUMBER
                    WITH   W_RETURN-MESSAGE_V1
                           W_RETURN-MESSAGE_V2
                           W_RETURN-MESSAGE_V3
                           W_RETURN-MESSAGE_V4
                    INTO   V_LOGSTR.
          WRITE :/ V_LOGSTR.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    Does anybody have a hint to the cause of the error message?
    There's no problem to do a goods issue manually in VL02n for the delivery.
    Best Regards,
    ERIC XU

    Hi Lin,
       he has changed the commit value to 'X' in DEBUG mode.
    If you just want to test it in se37, you have to keep a break point in the WS_DELIVERY_UPDATE_2 fm, and give the value of COMMIT = 'X' in debugging.
    If you want to do the same in a program, you have to cal the fm: bapi_transaction_commit after the call to the BAPI_OUTB_DELIVERY_CONFIRM_DEC bapi.
    Regards,
    ravi

  • Posting multiple goods issues against the same delivery

    Hello gurus,
    We are a fashion apparel company using ECC 6.0 and would like to know if it is possible to post mutliple goods issues against the same delivery?
    I will explain the business requirement.
    - We create a stock transport order to deliver 400 units of merchandise to on or our retail stores (STO is created and processed to a delivery).
    - This information is passed down to our warehouse management system (which is not SAP)
    - Our warehouse management system has the ability to split a delivery into multiple shipment when needed.  For example, our warehouse may only be able to complete 250 units for our morning shipment and will therefore pick, pack and post this.  This will feed back into SAP and process a 641 movement so that the units now show as "in transit".  This is needed so that our stores can process the ASN and move the units into their inventory when they receive the merchandise later that day.
    - During the afternoon, our warehouse will process the remaining 150 units and will ship this to our store later in the evening or next day.
    Currently, we are not able to process another goods issue against a delivery as we close out the delivery during the first goods issue.  We would prefer not to have to generate a new delivery for our DC and let them continue to process against the same delivery, but we are unsure how to configure this.
    Any help or guideance would be extremely appreciated
    Thanks in advance

    Hi RJ,
    First of all sorry to write such a lengthy reply,In one line if i want to summerize then it is not possible with standard SAP however we can achieve this by writing some piece of code in both the system
    AS - IS
                   Business process
              From business process point of view you are right that once the pick & pack is in process it is not advisable to create a new delivery document for balance quantity and share the same with WMS as then they have to create a new document in WMS and start picking based on that rather then the old delivery document number. if i am in your position then i can give a thought like this
    e.g.
    Delivery                                                  - 100 Unit
    Shipment confirmation from WMS            -   60 Unit
    Change in delievry quanity / Pick qty        -   60 Unit
    Invoice from SAP                                    -   60 Unit
    Second confirmation from WMS                          -   40  Unit
    Change in the existing delivery quantity                -   Now here we have two option either
    1) Change the delivery quantity / Pick qty  to (60+40) =100 or
    2) Remove the 60 and update 40 as delivery and pick quantity
    Pros & Cons
    if you will select option 1 then furhter invoice will happen for 100 unit which is incorrect as physically you are shipping only 40 unit
    if you are selecting option 2 then the document flow is incorrect as you don't have history(in SAP) for the 60 unit which was shipped earlier
    Solution ::
    so in my opinion the best option is to create a seperate delivery document (store the old delviery number in one of the field of the new delivery and pass the same to custom segment of the IDoc) transmit the IDoc to WMS write the validation logic in WMS
    Find the record with old deliver number in the WMS system, check the status whether it is active or inactive
    if it is acitive Validate the Material + qty with the WMS record(Material + balance quantity) if both are same then pass the new deliery number to custom field of the WMS table
    At the time of confirming back to the SAP, Write a piece of code in SAP that if the incoming idoc custom field(new delivery number) field is populated then ignore the orignal document number and post the document using the new delivery document number
    Hope this help

  • BAPI to post a Goods issue with relation to Sales Order?

    Hi Everyone,
    After creating a delivery order, I need a BAPI to automatically post a goods issue for this DO.
    I tried using BAPI_GOODSMVT_CREATE but it returns the message 'Goods Movement not possible with mvmt type 601'.
    Any advice?
    Best Regards,
    Junwen

    Hi John,
    My data are as follows:
    GOODSMVT HEADER:
    PSTNG_DATE: 30.09.2004
    DOC_DATE: 30.09.2004
    REF_DOC_NO: had tried 1014000359 or empty
    GOODSMVT_CODE: 03
    GOODSMVT_ITEM:
    MATERIAL: HP0121002
    PLAN: 1010
    STGE: 10FG
    BATCH: BATCH1
    MOV: 601
    CUSTOMER: 180017
    ENTRY_QNT: 1
    ENT_UOM: PC
    ENT_UOM_ISO: PC
    DELIV_NUMB: 1014000359
    DELIV_ITEM: 000001
    From your feedback, it is possible to use the BAPI to create a goods issue for movement type 601?
    Best Regards,
    Junwen

  • Post a good issue against an outbound delivery with movement type 601 K

    Hello,
    according to my business scenario I need to manage the stock of different vendors into the client's location (plant) at storage location level and I need to post the good issue against an outbound delivery to decrease the stock level.
    Since the owner of the goods isn't my client the item is managed only at quantity level (not value) so I'm not interesed in the accounting document.
    To do it I'm using the functionality related to the vendor consignment stock but I'm not able to post the good issue against an outbound delivery using the movemement type 601 and the special stock indicator equal to K.
    In particular I've tried in two different ways:
    - setup the consignment stock indicator (= K) into the sales item category, but when I post the goods issue the system is not able to find out the right vendor
    - to create a stock determination rule instead of the setting previous described, but the system display an error message (Fld selectn for mvmt type 601 / acct L534200770 differs for Cost center (010) ) even if the accouting is not relevant in my scenario
    Can you suggest me how the system has to be setup in order to cover my requirements?
    Thanks in advance,
    Alessandro

    Hi,
    Please clarrify which material type you are using in this scenario? I suggest you to use material type UNBW (no value updation will be there) and create a material master.  Use special stock indicator K. Proceed with 601K to do GI. Hope it works. Thanking you.

  • 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

  • Error when posting an goods issue of movement type 501: order not contain

    I tried to post an goods issue of movment type 501 to a stock transport order. But I get the error as below.
    Document 4500000130 does not contain any selectable items
    Message no. M7 064
    Diagnosis
    The document or item entered cannot be adopted.
    Possible reasons for this are:
    The document items have already been processed
    (Suggest zero lines indicator set?).
    the document items have been deleted or are blocked.
    the document items have been created for a different plant.
    (for reservations only) movements are not yet allowed for the reservation items.
    (for reservations only) the document items are retrograde components of the order. These are posted using the order confirmations.
    The document is an R/2 document.
    Procedure
    Make sure your entries are correct.
    If the system has already processed the total quantity, you can set the Suggest zero lines indicator. The system will suggest the quantity zero for the items that have already been processed.
    If you have entered a particular item, cancel the item. If you do not enter an item, the system searches all of the open items in the document.
    If the document is a purchase order, production order or a reservation, you can enter search criteria in the dialog box.
    You access the dialog box by choosing the menu option Enter with reference on the initial screen.
    If the document is an R/2 document, you have to cancel it manually by entering the reversal movement type.
    How can I proceed to post?
    Thanks,
    Eda

    Hi
    Go to T.code MB1A, enter the required movement type, Plant and storage location and then click,
    The push button of  Reservation on the tool bar for refereing the reservation or
    The push button of  order  on the tool bar for refereing the Production order.
    Cheers
    Kris

  • Post a goods issue

    Hi Everyone,
    After creating a delivery order, I need a BAPI to automatically post a goods issue for this DO.
    I tried using BAPI_GOODSMVT_CREATE . I haven't errors but the Goods issue has not been posted for the delivery.
    Any advice?
    Best Regards,
    Nadia

    One way is possible, but it has also negative aspects:
    You can set back the current period to a required period. There is a init repor in the customizing of MM. I would set the current one back to june, so you could post im may.
    After done this, the normal period report for setting the next month can be run.
    But: doing this, current values and the last period are at least the same. You loose one historical period....
    I would try this in a test system.
    Regards
    Uwe Werner

  • Goods Issue using RF Devices

    Hi,
    Our client wants to use RF devices to post the goods issue for reservations (movement 261) and reversals of these movements (262). I have checked the RF t codes and I do not see this functionality available.
    Typically client wants to select a reservation from the list (run MB26 on handheld) and then post GI by selecting the reservation.
    Can anybody suggest how to handle this situation using handhelds?
    Thanks,
    -Shekhar

    HI,
    check answer in thread [Goods Issue for Reservation using Bar Code System |Goods Issue for Reservation using Bar Code System;
    Andrzej

  • Cancel Goods Issue using VL09

    Hi,
    My Client have created a Delivery Order along with the Transfer order, the Goods Issue has been posted. When he tried to reverse the Goods Issue using VL09, it promoted the error: GI for Delivery XXX cannot be canceled for the following reason, Document (Material Movement Document: GI) does not contain any selectable items. Can anybody please help me?
    Thanks.

    Hi,
    Make sure  your User has created the Delivery only or Invoice also for that particular order if there is invoice also exist to that particular order he has to check first the Document Flow Status and he has to cancel the invoice by using tocode vf11, he has to cancel the shipment cost if there is vi02, he has to cancel the shipment vt02n then he can do goods reversal vl09 and Delivery.
    This may help you Inshallah
    Regards,
    Mh

  • 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.

  • Error in posting a goods issue

    Hi everyone,
    We're encountering an issue with posting. When trying to post a goods issue from a delivery via VL02N, an error message is displayed : "The document does not contain any item.". although it does contain items.
    Do you have an idea of why thie error would appear ?
    Thanks in advance.

    Hello,
    Can you check whether
    1. you have picked the item,if not then pick the material and goto Edit>Confirm pick order>All items, or
    2. activated warehouse management. if yes then you need to create a transfer order with reference to that delivery.
    Hope it helps.
    Regards,
    Priyanka

  • Posting a "goods issue" msg NR751

    Hi All,
    posting a goods issue, sap gives me the message NR751...
    But the number range has been created ...
    I can't post the goods issue
    Could anyone help me?
    thanks
    Gandalf

    Ciao Gandalf, ( e' sempre un piacere incontrare un fan del signore degli anelli)
    the error NR751 have 3 variables                                      
    -> For object &1 &2, number range interval &3 does not exist                                                                               
    Please, go to transaction SNRO and enter RF_BELEG (I suppose this is the object in the error) in the 'Object' field.     
    In the menu path press Go To -> Number Ranges.
    Enter the relevant  Company Code. Do you have an entry here for the interval &3?                                                                               
    Mauro

Maybe you are looking for