PGI for Delivery

Hi Experts,
I have coded the following successfully.
1. Create a delivery from a production order
2. Create TO from delivery created
3. Pick/Pack and Confirm TO
Now, I need to create a PGI based from the delivery i created. I used FM BAPI_GOODSMVT_CREATE, however it only creates another delivery. Code is below:
LOOP AT i_itemhu INTO wa_itemhu.
    wa_goodsmvt_item-plant      = wa_itemhu-plant.
    wa_goodsmvt_item-stge_loc   = wa_itemhu-stge_loc.
    wa_goodsmvt_item-batch      = wa_itemhu-batch.
    wa_goodsmvt_item-move_type  = '261'.
    wa_goodsmvt_item-entry_qnt  = wa_itemhu-entry_qnt.
    wa_goodsmvt_item-entry_uom  = wa_itemhu-entry_uom.
    wa_goodsmvt_item-orderid    = wa_itemhu-orderid.
    wa_goodsmvt_item-deliv_numb = wa_itemhu-deliv_numb.
    wa_goodsmvt_item-deliv_item = wa_itemhu-deliv_item.
    APPEND wa_goodsmvt_item TO i_goodsmvt_item.
    CLEAR wa_goodsmvt_item.
ENDLOOP.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
    EXPORTING
      goodsmvt_header  = wa_header
      goodsmvt_code    = '03'
    IMPORTING
      materialdocument = ws_doc_gihu
    TABLES
      goodsmvt_item    = i_goodsmvt_item.
Is it really possible to do PGI using this FM? If yes, please help in coding.. Many many thanks!!!

Hi,
I am using WS_DELIVERY_UPDATE to perform PGI of delivery. I am testing first the FM by in SE37 and PGI is correctly done for a delivery, however, when I had coded it (same way as the testing) I am getting error Delivery XXXXXXXXXX created. On which the delivery XXXXXXXXXX is the delivery I want to perform PGI. I am also trying do some changes in my code like passing the items to vbpok_tab; enabling synchon FM parameter; enabling nicht_sperren; etc., but still same error is being produced. My code is as below:
wa_vbkok-vbeln_vl     = ws_delivery_doc.
  wa_vbkok-vbtyp_vl     = 'J'.
  wa_vbkok-wabuc        = 'X'.
  CALL FUNCTION 'WS_DELIVERY_UPDATE'
    EXPORTING
      vbkok_wa                  = wa_vbkok
      commit                    = 'X'
      delivery                  = ws_delivery_doc
    IMPORTING
      ef_error_any_0            = ws_xfeld
    TABLES
      prot                 = wa_prot.
Please help.

Similar Messages

  • Cannot PGI for Delivery

    Dear Experts,
    While performing packing for an Outbound Delivery (in an HU Managed Storage Location) in VL02N> Edit> Pack--->Materials to be packed section , I am finding some lines with materials. But I am not able to select them. It is kind of greyed out.
    Hence even after entering Handling Unit number, I am not able to select them for packing.
    Kindly suggest how to proceed aince I am not allowed to perform PGI for this delivery
    Thanks
    Shetty

    Dear Csaba Szommer,
    Just to elaborate my question it is purely a business requirement where the Sales Order and Delivery will be created by the Sales Office and the Picking and PGI needs to be performed from the plant and plant will not have authorisaion to create delivery to have control centralised.
    Further plant can create PGI only on the basis of truckload and there can be multiple truck loads for each delivery as the quantity in the delivery will be more than a truck load capacity.(this is STANDARD BUSINESS PROCESS almost in all industries)
    So , now I hope you can understand the requirement.
    Secondly I am very much aware of Delivey Split in SAP , thus do not need to waste the valuable time of various experts to provide input on the same.
    Thirdly, in SAP everything is possible through developments but the requirement here has to be met by standard or else business procedure needs to be changed.
    That is the reason I requested for no developments.
    Further I know one way it can be addressed in the system in standard, but it is complicated and will make maintenance difficult.
    That is why I am looking for suggestion which is simple but possible in SAP.
    If you can help please advise.
    Regards,
    Deb

  • User exit for PGI via delivery (Vl02N)

    Hi Folks
    Can you suggest me appropriate user exit which can be used during PGI for delivery in Vl02N. This should get triggered when POST PGI tab is hit in VL02N.
    Via USer exit I want to change the GL account in the accounting document for PGI ( GL account for Tr price difference which is posted via key AUM (Expense/revenue from stock transfer).
    Please reply ASAP.
    Thanks
    Vipin

    Hi Vipin
    I did a small check in our internal system.
    In VL02n choosing the PGI TAB it hits user exit MV50AFZ1 -> FORM USEREXIT_SAVE_DOCUMENT_PREPARE
    This is the call:
    Main Program     SAPMV50A
    Source code of   FV50XF0B_BELEG_SICHERN
    form BELEG_SICHERN_DET_CHECK
    * Userexit
        PERFORM userexit_save_document_prepare(sapmv50a).
    So you are good to go with MV50AFZ1 just use
    form USEREXIT_SAVE_DOCUMENT_PREPARE
    Kind regards
    Brian

  • Proforma invoice is created for delivery without PGI in STO(Depot sales)

    Dear Gurus,
       I am facing a strange issue, user created Purchase order with some material X of 4 quantity, and he created the replenishment delivery for 1 quantity and without doing any Picking and PGI but system allowed to create proforma invoice with 4 quantity I checked the copy control config settings for Delivery and Proforma invoice all are maintained fine (viz., billing qty as D, copying req:311 and Data VBRK\VBRP:001)( Ichecked the change log for delivery but I didnt observed any chanes in delivery) .. strange to watch ........created the same scenario in quality but system doesnt allowed to create proforma invoice without PGI and picking(Just one month before quality is refreshed with Production).
    If anyone faced the same problem let me konw the solution ate the earliest.
    Best Regards,
    Kishore.SGR

    Hi
    As already said, as per the standard the Performa Invoice do not check the Goods Issue status of a Delivery since it uses the Copying Requirement 009 in transaction VTFL.
    If you want your performa invoice to be created only after the PGI of a delivery, then use the Requirement 003 in Copying Requirement field for the combination of your Delivery Doc. and Billing doc. in transaction VTFL at Header level.
    Regards
    Amitesh Anand

  • How to reverse PGI @ VL09 for delivery with subsequent invoice

    Greetings
    Our business process sometimes requires billing to happen prior to PGI.
    Hence, we have modified copy control settings to allow billing based off delivery creation (rather than PGI delivery).
    No modifications to the item categories and we are using standard movement types 601/602
    My issue is at VL09.
    VL09 will not allow me to reverse without cancelling the billing document.
    I get a message No data available for these selection criteria
    I have checked OMJJ movement type settings and I dont see anything here.
    Can anyone point me in the right direction to customize such a setting if it exists?
    We are using ECC 6.0
    thank you
    Ken

    hi
    your issue as standard behavior , when delivery document  billing status completed ,  you can not do the PGI , when you cancel the billing document then only system will accept PGI ,
    when you cancel the billing document , delivery document billing status will change , so accept PGI
    this status comes based on billing document types , like final billing (f2) delivery billing status comes complete, proforma invoice completed then delivery billing status comes not yet proceed
    this is the why system not accept the PGI for final billing document done
    check proforma billing document delivery PGI
    Regards
    sankar

  • Error while doing PGI for Outbound delivery using BAPI BAPI_GOODSMVT_CREATE

    Hi All,
    I am getting an below error while doing PGI for outbound delivery using the BAPI BAPI BAPI_GOODSMVT_CREATE:
    Goods movement not possible with mvmt type 601
    Can anyone suggest me what will be the solution for it?
    Regards,
    Raghuraman.k

    I tried with the above BAPI but it is not working.
    In my case a delivery has one line item with batch split and other line item without batch split.
    Below is my code :
    DATA : gwa_header_data TYPE bapiobdlvhdrcon,
           gwa_header_ctrl TYPE bapiobdlvhdrctrlcon,
           lv_delivery     TYPE bapiobdlvhdrcon-deliv_numb,
           git_item_data TYPE STANDARD TABLE OF bapiobdlvitemcon,
           gwa_item_data TYPE bapiobdlvitemcon,
           git_item_ctrl TYPE STANDARD TABLE OF bapiobdlvitemctrlcon,
           gwa_item_ctrl TYPE bapiobdlvitemctrlcon,
           git_return    TYPE STANDARD TABLE OF bapiret2,
           gwa_return    TYPE bapiret2.
    *Header data
    gwa_header_data-deliv_numb = '0808000002'.
    *Header Control data
    gwa_header_ctrl-deliv_numb = '0808000002'.
    gwa_header_ctrl-post_gi_flg = 'X'.
    *Delivery Number
    lv_delivery = '0808000002'.
    *Item data and its corresponding control data
    gwa_item_data-deliv_numb      = '0808000002'.
    gwa_item_data-deliv_item      = '900002'.
    gwa_item_data-dlv_qty         = 4.
    gwa_item_data-dlv_qty_imunit  = 4.
    gwa_item_data-fact_unit_nom   = 1.
    gwa_item_data-fact_unit_denom = 1.
    APPEND gwa_item_data TO git_item_data.
    gwa_item_ctrl-deliv_numb      = '0808000002'.
    gwa_item_ctrl-deliv_item      = '900002'.
    gwa_item_ctrl-chg_delqty      = 'X'.
    APPEND gwa_item_ctrl TO git_item_ctrl.
    gwa_item_data-deliv_numb      = '0808000002'.
    gwa_item_data-deliv_item      = '900003'.
    gwa_item_data-dlv_qty         = 6.
    gwa_item_data-dlv_qty_imunit  = 6.
    gwa_item_data-fact_unit_nom   = 1.
    gwa_item_data-fact_unit_denom = 1.
    APPEND gwa_item_data TO git_item_data.
    gwa_item_ctrl-deliv_numb      = '0808000002'.
    gwa_item_ctrl-deliv_item      = '900003'.
    gwa_item_ctrl-chg_delqty      = 'X'.
    APPEND gwa_item_ctrl TO git_item_ctrl.
    gwa_item_data-deliv_numb      = '0808000002'.
    gwa_item_data-deliv_item      = '000020'.
    gwa_item_data-dlv_qty         = 10.
    gwa_item_data-dlv_qty_imunit  = 10.
    gwa_item_data-fact_unit_nom   = 1.
    gwa_item_data-fact_unit_denom = 1.
    APPEND gwa_item_data TO git_item_data.
    gwa_item_ctrl-deliv_numb      = '0808000002'.
    gwa_item_ctrl-deliv_item      = '000020'.
    gwa_item_ctrl-chg_delqty      = 'X'.
    APPEND gwa_item_ctrl TO git_item_ctrl.
    BREAK-POINT.
    CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
      EXPORTING
        header_data    = gwa_header_data
        header_control = gwa_header_ctrl
        delivery       = lv_delivery
      TABLES
        item_data      = git_item_data
        item_control   = git_item_ctrl
        return         = git_return.
    BREAK-POINT.
    IF git_return IS INITIAL.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDIF.

  • Getting the error while doing PGI for depot delivery

    Hi
    I am getting the below error while doing PGI for Depot delivery. This error is happening only when I taking the materials from stock transfer order which has more than 10 line items. Same issue is not happening when I am taking one material in Stock transfer order in & same material in depot delivery. Please see the screen shots below attachment. I have already maintained no range for the object J_1IDEPINV for year 2014.
    Regards
    PK

    Moved from SAP ERP SD Sales to Internationalization and Unicode.  Please post all your CIN related queries here.  Also ensure that before posting, you made efforts in searching in SCN or Google.  The reason for this indication is the issue you posted has already been discussed many times here and you will get some clue had you searched.
    G. Lakshmipathi

  • Problem with pgi for returns delivery

    Hi,
    I'm trying to do PGI for returns delivery through BAPI_GOODSMVT_CREATE.
    The when the delivery is opened through VL02N, the Post Goods Issue button has Post Goods Receipt text written on it. When the GI is done, the material document has movement type 651.
    However I'm not able to create the same through the BAPI. I have tried various combinations of GM_CODE and all other variables. Have anybody of you tried doing movement type 651 for a returns delivery using the same BAPI?
    Please reply if you've come across some similar situation. I know how to use the BAPI,  I've been using it successfully for other movement codes etc. It's only in this case that I'm stuck up.
    Regards,
    Vijay

    Hi Vijay,
    can u pls tell me how  did u do  it....i am also having the same requirement....
    Developed a custom program for creating and updating Goods Movement Document by using BAPI_GOODSMVT_CREATE & WS_DELIVERY_UPDATE_2.
    thanks, Ankita.

  • Material document posted during PGI for Outbound Delivery

    Dear Experts,
    We have an Outbound Delivery having multiple line items.
    I have a couple of questions.
    1). How may material doc numbers will be generated if I do PGI multiple times?
    2). Can I have 5 different material docs if I post GI 5 times (Per line). Is this scenario possible?
    Your inputs are valuable. Kindly revert
    Thanks,
    Shetty

    Hi Harry
    In my scenario, Outbound delivery having 5 lines.
    I created TO a and confirmed TO for only 2 lines.
    Now when I do PGI for outbound delivery, GI is done for only those 2 lines with confirmed TO
    I will do the rest of GI again
    In this scenario, what will happen? how many material docs are posted?
    Thanks
    Shetty

  • During PGI for inbound delivery it is giving an error message in ECC6.0

    I am getting an error message  during processing a serialized production order through one custom transaction. In that program FM BAPI_GOODSMVT_CREATE is used to create inbound delivery . After the inbound delivery is created it is giving  error messages
    'System status ESTO is Active (EQUXXXXXX)'
    'Check the status of the Serial Number XXXXXXX'
    'Serial Number cannot be used here'
    'Termination of goods issue posting of delivery item XXXXX'
    and it does not create the PGI for the delivery.
    I have done the same steps in 4.7 system but did not get any error and posting of goods issue has also done successfully but in ECC6.0 system I am getting this error from BAPI_GOODSMVT_CREATE.
    If anyone have faced this issue in ECC6.0 then please help.....

    ESTO means "in the warehouse".  Looks like you may be trying to receive a serial no. you already have received?

  • BAPI for PGI against Delivery

    Hi all,
    I want BAPI for PGI against Delivery or any Function Module ,which Give All Error Message before PGI Posting.
    Thanks & Regards.

    Hi chaitanya,
    Can u please tell me what are the parameters that need to be passed in the BAPI "WS_DELIVERY_UPDATE" to get the PGI done.
    Thanks & Regards,
    Santhosh

  • When I am doing the PGI for the delivery i am getting error message

    Hi All,
    Could you please help to solve this issue,
    When I am doing the Pgi for one Delivery I am receiving the error message "Posting only possible in periods 2008/03 and 2008/02 in company code", please help to provide the step to resolve this issue.
    Regards,
    Muralikrishna Nandigama.

    Dear Friend,
    Make sure you have sufficient quantity in the stocks
    The open posting period for your company code is 2008/03 means "oct Nov december" and "Jul aug sep"
    So the posting will be possible only in these periods.
    Go to TC: OBYC and maintain the posting periods.
    Open or close the periods.
    You can as well use tC:OB52
    CHANGE VEIW POSTING PERIODS SPECIFY TIME INTERVAL: OVERVEIW     
    edited by,
    Amlan Sarkar.

  • Problem while doing PGI for Returns Delivery

    Hi,
    We are facing some problem which doing PGI for a returns delivery. Our scenario is HU and WM managed. After creation of delivery I have created a TO and has two different valuation type of same material. Total quantity in TO is 2, 1 of each valuation type. So, automatically, batch split happened for the line item in delivery.
    Now when I am trying to do PGI for this delivery, I get en error message saying "Enter Valuation Type". The movement type used here is 161 (Vendor Returns)
    Same thing is happening successfully for movement type 643 (Transfer inter company code).  What I can gather is that while creating 161 document against delivery system is not automatically taking the valuation types mentioned in line item of delivery.
    Let me know possible reasons for this error and resolution.
    Regards,
    Vishal

    Implement the OSS note 965985

  • Automatic PGI and delivery for Inter company STO

    Hi,
    We have a requirement as below,
    Client have 3rd party software at weighbridge,which would track vehicle no,material qty,ship to party.
    Here at Inter company STO,
    PO will be raised,latter on we do VL10D,there by a delivery number is generated based on PO number.Then based on that PGI & delivery will be done.
    Can we do auto PGI & delivery in this case.Client requirement is both VL10D,VL02n should happen automatically.
    Assuming the number range for delivery in SAP and third party software are set same.Kindly advise me
    Pradeep

    Check this where the same topic was discussed
    STO Process Automation
    G. Lakshmipathi

  • Delivery/PGI for Material

    Hi PS gurus,
    I  have one PO for Material a created against WBS. As PO was created manually how to do delivery/PGI for Material a.
    We can see the Stock in MMBE for that WBS & Material
    Note: - In CNS0 material a will not appear as PO was created manually.
    Help me how we can do delivery/PGI for Material
    Please throw light on this.
    Thanks
    MM

    Hello
    Can someone please explain me why we are discussing about the CNS0 with the consumption of material. we use CNS0 to deliver for the customer. how can we relate the CNS0 with the PO. In CNS0 the delievery projects it requires ship to party information and all. How come the consumption is comming into picture here?
    I am also trying to understand the process of delivery from projects.
    Regards
    Gokul

Maybe you are looking for