Picking and PGI

Any fm for doing picking and PGI

Hi,
Try this link
[Need to update picking,packing and PGI using FM "WS_delivery_update";
Regards,
Surinder

Similar Messages

  • Partial picking and PGI (with Idoc)

    Hello
    a) We have a scenario where we would like to achieve partial picking and PGI with Idoc:
    For example
    In the delivery the delivery qty is 10 from the beginning, but we would like to pick only 7 and perform the PGI anyway. The 3 remaining units should remain open and create a new delivery with VL10 or whatever. For the picking confirmation we are using SHP_OBDLV_CONFIRM_DECENTRAL03. We are not using WM, just inventory management in this scenario.
    We know that per standard SAP functionality the picking quantity must match the delivery quantity when doing the PGI.
    b) However: we have another scenario where we run picking and confirmation from a DWMS, where all confirmations are made by the idoc type SHP_OBDLV_CONFIRM_DECENTRAL03. In this scenario, it is possible to achieve the partial picking and PGI.
    So my questions are really:
    1) Anyone knows why SHP_OBDLV_CONFIRM_DECENTRAL03 would post partial picking PGI with DWMS succesfully, and not with a "normal" scenario where there is no DWMS in use, just a normal plant/storage location?
    2) Anyone knows a suitable idoc type to achieve partial picking idoc, one where the picking qty and the delivery qty could be adjusted at the same time so that picked and delivery quantities would be exactly the same?
    3) Any suitable user exit that could be used in order to change the delivery qty according to what has been picked for the delivery? Some success stories around it would be appreciated.
    Thanks in advance,
    OT

    Hi,
    I am not able to get the details whether you want to know the information about the Inbound Idoc or Outbound Idoc. But you want to do the picking and packing of the delivery then I can presume that you are doing the Inbound process.
    In that case you can do use the process code SDPI which has the message type SDPICK. In this we have the function module SD_IDOC_INPUT_PICKING which can do the picking and PGI of delivery.
    In this you can also change the delivery quantity if you are not picking up the whole quantity from the plant. So it allows you to change the delivery quantity and then do the PGI for the same.
    Regards
    Suneet

  • FM or BAPI for Delivery Order Picking and PGI

    Good day,
    I would like to check with you all on any function module or BAPI which can perform delivery order picking and PGI ?
    I did some research and found that a lot of people is introducing this FM "WS_DELIVERY_UPDATE_2"
    but i'm not sure how this FM works. Can anyone provide some information for me on this function like what data to propagate into this FM and etc... ?

    hi,please check this link.
    Need to update picking,packing and PGI using FM "WS_delivery_update"
    also,
    for picking:  WS_DELIVERY_UPDATE_2
    pgi :  BAPI_GOODSMVT_CREATE
    thanks.

  • Picking and PGI through background job

    Hi,
    Can any one help to find out the programs to do Picking and PGI through background job.
    Without transfer order. Just picking
    Thanks and Regards
    Alokam Chandra Sekhar

    RLAUTA20     Create Transfer Orders for Deliveries Automatically or Immediately
    RLAUTA10     Create Transfer Orders for Material Document in Background
    RVV50L21     Create Background Jobs for Goods Issue Posting
    WS_MONITOR_OUTB_DEL_PICK - Outbound deliveries for picking
    Thanks & Regards
    JP

  • Shipment of Free Item alongwith Parent Item (STO,Warehouse Picking and PGI)

    Hi Experts,
    In Retail industries Vendor/Company promote offers to customer free items along with Saleable Product so increase footfalls and basket value. In case there is free item with parent item, PO will be created accordingly as free item. Is there any standard method so that for certain period while creating STO/Picking/PGI when we select Parent Item automatically Free Item should be added and picking document contains the free item to pick.

    Hi Vijay
    By changing storage location you could do b'coz the new storage location is not maintained with warehouse, hence no need to perform warehouse transactions (TO creation and confirmation) before inventory mgmt transactions (PGI).
    For trying pick up with WH, first u should have enough stocks in approppriate storage bins and u should perform pick up by creation of TO and confirmation.
    warm regards
    sairam akundi

  • Goods picking and Post goods issue in VL02N

    Dear All,
    Am hving problem in Picking goods and Post goods issue.
    This is for the Stock Transport Order with Delivery via Shipping
    Supplying plant is 1000(SAP std,sloc 0001) and Receiving plant 1100(sloc 0001).
    Sales org:1000
    Distrbn Chnnl:10
    Division:00
    1.maintained matrial for both the plants.
    2.Creted STO by using DOC type as "UB" and item cat "U".
    3.And getting the Shipping data for the material in the STO.as shipping point is 1000.
    saved the Po.
    4.After that i done the GR w/o PO for the material using Mvt type 501.
    5.Then,VL10B creating Delivery doc.n this is also created.
    6.but when i do the picking and PGI in VL02N there picking field is greyed out bt i have tried to mangae that when i give the picking Qty in the picking qty field system is throwing the following error.
    <b>Item to be picked by WM (picking quantity cannot be entered)
    Message no. VL118
    Diagnosis
    For this item, picking is carried out using warehouse management transfer orders since the material is stored in a warehouse with random storage.
    System Response
    The system does not allow you to enter a picking quantity manually. The picking quantity is copied automatically into the delivery during the creation of the corresponding transfer order.</b>
    is any data missed by me while doing this process?
    pls let me know n help me in this regrds
    Thank you all

    Hi Vijay
    By changing storage location you could do b'coz the new storage location is not maintained with warehouse, hence no need to perform warehouse transactions (TO creation and confirmation) before inventory mgmt transactions (PGI).
    For trying pick up with WH, first u should have enough stocks in approppriate storage bins and u should perform pick up by creation of TO and confirmation.
    warm regards
    sairam akundi

  • Function module to Post picking quantity & PGI

    hi all,
    i want to post picking quantity and do PGI for the given delivery document . please let me know if there is any BAPI or function module to do that .
    thanks in advace,
    aswin.

    Hi Friend,
    Use function moudle
    SD_DELIVERY_UPDATE_PICKING, it will do picking and PGI both for delivery.
    Regards
    Krishnendu

  • Any bapi or FM for doing picking or PGI

    Hi All
    I want to do picking and PGI for outbound deliveries.  i tried using ws_delivery_update, its taking the pick quantity but not the batch number, for picking I just want to put the pick quantity same as delivery quantity and the batch say 'XYZ' provide by the distibuter need to put in the batch.
    any help will be highly appreciated.
    thanks
    A

    Hi Anup,
    I have created a z functional module which is calling 'WS_DELIVERY_UPDATE' and its working fine. Sample code of my z-object is attached for your reference.
    function z_post_goods_issue.
    ""Local interface:
    *"  TABLES
    *"      I_INPUT STRUCTURE  ZTMP_PGI OPTIONAL
      loop at i_input.
        clear : i_vbkok,flag1,flag2,i_prot,i_prot[].
        i_vbkok-vbeln_vl = i_input-vbeln.
        i_vbkok-wabuc    = 'X'.
        call function 'WS_DELIVERY_UPDATE'
             exporting
                  vbkok_wa                          = i_vbkok
                  synchron                           = 'X'
                  commit                              = 'X'
                  delivery                              = i_input-vbeln
                  nicht_sperren                     = 'X'
                  if_database_update             = '1'
                  if_error_messages_send_0  = 'X'
             importing
                  ef_error_any_0                  = flag1
                  ef_error_in_goods_issue_0 = flag2
             tables
                  prot                                  = i_prot.
        if flag1 = 'X' and flag2 = 'X' and not i_prot[] is initial.
          loop at i_prot where msgty = 'E'.
            call function 'FORMAT_MESSAGE'
                 exporting
                      id   = i_prot-msgid
                      lang = sy-langu
                      no   = i_prot-msgno
                 importing
                      msg  = i_input-retrn.
            if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            endif.
          endloop.
        else.
          i_input-retrn = 'PGI has been done'.
        endif.
        modify i_input.
      endloop.
    Regards,
    NJ

  • Need help on IDoc for Picking, Packing and PGI against the Sale order

    Hi All,
    I am new to this IDoc stuffs. Below is the scenario for which I would like to know the details of the IDoc...
    Business Case:
    1. Storage location is a HU Managed but not WM managed.
    2. This storage locations is managed by a third party
    3. Outbound delivery document against the SO will be created by our personnels in SAP for this storage location.
    4. Picking, Packing and PGI needs to happen/post via Idoc. (By packing here, i refer to assign the HUs that are already created for the materials and is available in the storage location and not repacking)
    Is there any standard IDoc that can be used here to Pick, Pack and post PGI. We would like to have picking and packing in a first idoc and PGI on the second idoc.
    Thanks,
    Prashant

    Hi Typewriter,
    Thanks for your reply on this post..
    The business process is as below (it was changed recently to have the creation of OBD, pick HUS and then post GI via single IDOC)
    1. We have a storage loc in our enterprise structure that is HU managed but not WM managed.
    2. This storage loc is being maintained by a third party.
    3. SO will be created to be shipped out of this plant/sloc.
    3. The stocks at this storage loc will be Special stock "E" against the sales order. And the stocks will be Packed in HUs.
    4. The third party is informed to deliver the stocks (HUs - that do have the special stock number which internally refers to the the SO number and the line item number) directly to ship to party address in SO.
    5. The 3rd party will physically ship the HUs to customer and send in the details that they have shipped goods against the sales order.
    6. The details sent by the 3rd party will be received in SAP to create OBD for the sales order, Pick, Pack and post GI. This can happen via a single IDOC..
    I am now planning to create a custom IDOC type referring to the standard IDOC type DELVRY03 and message type DESADV and to use a custom BAPI/FM.
    Do you think I am using the right ones?
    Thanks,
    Prashant Kumar

  • Restrict Output type at the time of Picking and Print after PGI

    Hi All....
    My business requirement is to restirct certain Output types such as LD00, LD0F etc. at the time of Picking and Batch determination and to print after PGI.
    These output types are triggered Automatically via Batch job scheduled via third party tool. All the complete Delivery process is Auto.
    Once Sales order is created the below process takes place.
    Auto Delivery
    Auto Shipment
    Auto Picking and Batch determination (Now in this step I need to restrict)
    PGI (Manually vai some custom program)
    Once the Picking is done all the Output types appear in Delivery Header output which are processed with a Dispatch time of 4. (Appeared as Green tarrif.)
    For the Output type LD00 -> 911 routine is added .
    This routine is triggering at the time of Picking and Batch determination.
    At this Point of  Picking I can restirct the output type by using the Routine that not to display in Delivery Header,  but iam not able to retrieve again at the time of PGI. Is there any option  to get the data of Output type at the time of PGI.
    Or is there any option for LD00 output type to dynamically select the Routine Number to trigger at the time of PGI. ( If I use Routine no 1 it will trigger at the time of PGI, but I cannot change especially for this purpose since this output type is used for multiple purposes)
    Pls provide me the solution.

    Hi Brad
    I can copy the code from routine #1 into my routine #911 inorder to restirct the display of output type in delivery header. But as mentioned by you this routine is not triggered at the time of PGI. ( I checked at the time of PGI )
    If i link my output type LD00 with Requirement #1 routine then it will be triggered at the time of PGI, but here the o/p is linked with Requirement #911.
    Pls let me know if any thing wrong i mentioned...

  • Using WHSCON to Pick Pack and PGI

    Hi,
    I need to do Pick pack and PGI with inbound WHSCON idoc in WM non relevant delivery. Can anybody please suggest me what are all the necessary fields do I need to pass to achieve the same.
    Thanks,
    Neha.

    Hi,
    We have the same requirement as you have. We need an inbound IDOC to pick / pack and PGI and customer delivery.  We are working with message type WHSCON.
    We initially created the delivery without any batches assigned to it. The IDOC coming in will have the batch details on it. We would like an IDOC to create these lines (batch split lines)
    Is it possible to do this?
    Regards,
    Finbarr

  • Inbound Delivery Idoc with batch split then PIC and PGI using DELIVERY03

    Dear Experts,
    Requirement to split the delivery item then PIC and PGI, while Processing Inbound Idoc using basic Idoc type DELIVERY03
    I have searched forum already but it vain. Please advice.
    Thanks and Regards,
    Thiru.
    Moderator message : Spec/requirements dumping not allowed, show the work you have already done.  Thread locked.
    Edited by: Vinod Kumar on Nov 16, 2011 5:09 PM

    Hello Finbarr
    I assume that you do NOT send any (suggested) batches to your warehouse. Otherwise you would have the same problem like we have that the WHSCON cannot overwrite a (suggested) batch.
    However, if you just send the quantity per item then the batch split is much simpler than you suggested:
    "First E1EDL24 segment:
    POSNR     50
    MATNR     000000000000602006
    MATWA     000000000000602006
    CHARG     L1519   " <<< first batch
    LFIMG     37.000
    VRKME     CT
    "Second E1EDL24 segment:
    POSNR     50
    MATNR     000000000000602006
    MATWA     000000000000602006
    CHARG     L1880   " <<< second batch
    LFIMG     37.000
    VRKME     CT
    Well, and as qualifier we use: E1EDL19-QUALF = 'XYZ'  " a dummy
    The SAP system is smart enough the realize that these two E1EDL24 segment belong to the same item yet have different batches and, therefore, yield a batch split in the delivery. The system generated the 9xxxxx numbers for this sub-item lines automatically.
    Although I believe that it is not possible to change a batch in the delivery using an inbound WHSCON I would appreciate to have a final proof of this assumption. I could imagine that if you first delete the item containing the suggested batch and then add a new item with the actual batch from the warehouse it might works. However, this would require to implement a user-exit which I do not prefer.
    Regards
      Uwe
    PS: It seems I gave an answer to the wrong question (should be EDI (DESADV): Can batches be overwritten by an inbound WHSCON (pick conf)? )

  • Problem in Creating Delivery  and PGI

    Hi Guru's
           My sales process is  Sales Order-- Delivery( PGI is not done here)- Billing-- (PGI is done after doing Invoicing)
          (1)  My user created one delivery for a quantity of ( say 100 quantity) and forgot to pick and assign batch in the delivery and created an invoice for the delivery. (Usually the system will ensure the delivery quantity and picked quantity is same when doing PGI and since we are not doing PGI before Billing the system allowed to create an invoice)
          While doing PGI the system is not considering this quantity because quantity is assigned and an excess quantity is showing in Stock Overview.how to correct this. and my situation is i cant cancel the invoice and assing the batch and do PGI.
        how to correct this quantity difference ?
      (2) Recently when doing Physical inventory they adjusted the quantity in the system by decreasing the quantity by said 100 quantity but there is a problem in doing new delivery( short of 100 quantity) because the already invoiced delivery is showing a requirement of 100 quantity. In order to do delivery they added that  100 quantity with same batch number.
             I want a solution for this please help me
    regards,
    Ravi Kiran
          I

    Hi Ravi kiran
    As your process is different so you need to go with the new sub-routine and you need to assign that   sub-routine in VTFL .then only the problem can be solved. . But if you are doing order related billing then in VTFA you need to maintain the item category . and also check the feild Overdelivery in 0VLP Then you can change the quantity in the delivery level
    Regards
    Srinath

  • Create STO,Delivery and PGI delivery from an interface

    Hi,
    We are using a third party WMS system to manifest and ship orders froma  distribution center to a store. The only data that is going to come into SAP is the Bill of Lading as to how much has shipped for a material to the store from the DC. This has to drive a Stock transport order cycle of creating an STO, create and PGI delivery. As we are building the interface,  I am a bit confused as to how we can make all this happen from one data feed.  Since there is only one feed and it has to trigger mutliple processes should we trigger multiple idocs (different types) to trigger the STO creation, create the delivery and PGI it (Delivery 03 idoc)?
    Will it be too cumbersome to build all this logic in the interface?
    Another option would be to create the STO using the feed, then run VL10B in a given time interval (Background) to create the delivery.
    However, I am not 100% sure how you can spawn off a PGI job? Even if I were to run the VL02n program in the background how can I populate the pick quantity?
    Any insight would be very useful.
    Thanks..

    My assumption is just you need to adopt delivery qty as pick qty.You are not doing any TR ,TO as your ware house is third party managed.
    you need to define the picking form EKOO to your shipping point type and then the quontity will copy
    You can do it in the difintion of the shipping point, you have to difine send time = 4
    I will explain how need to  set up this automatic picking, and then you can
    work backwards from there. The automatic picking you are experiencing
    is actually related to the output type EK00 assigned to your shipping
    point.
    Consider the following two setup steps which will result is automatic
    picking:
    Set the output type to EKOO, in the print picking list of the shipping
    point in customizing.
    Make sure the parameters below are set:
    Message Language
    Number of Messages
    Send Time <<<<<<<<<<< this must be set to 4 (send immed)!!
    Transmission Medium
    1) you have to set the parameters for EK00 in the shipping-point-
    maintenance in customizing:
    -> Enterprise Structure
    -> Definition
    -> Logistics Execution
    -> Define, copy, delete, check shipping point
    2) as second step you define the shipping-print-parameters in
    customizing:
    -> Logistics Execution
    -> Shipping
    -> Basic Shipping Functions
    -> Output Control
    -> Define print parameters shipping
    -> Shipping (Spec.case)
    Therein there should be an entry for every shipping-point, where
    you like to use the picking-list EK00!
    If you have 1 & 2 setup for a particular shipping point you will
    experience the "automatic" picking of deliveries.
    and finally picking storage  location determined as per storage conditions maintained in material master.

  • URGENT- Update for picking confirmation & PGI

    Hi Experts,
    Is there any FM/BAPI to update delivery for both the picking confirmation & PGI.
    I am trying to use WS_UPDATE_DELIVERY_2 but it is triggerring me an error at delivery positions.
    If it is the correct FM used then plz forward me the parameters for the req.
    Thank you,
    Sangeetha

    Check with below logic :
    if flag = 'X'.  Assume that flag = X means - PGI else  delivery update.
    Use FM  -  WS_DELIVERY_UPDATE
    else.
    Use FM : SD_DELIVERY_UPDATE_PICKING
    endif.
    Check the below code for ref PGI ..
    REPORT ZWM_OVERWEIGHT_FIX  no standard page heading
                               message-id zwm.
    ======================================================================
    Program Name : ZWM_OVERWEIGHT_FIX                                    *
    Description  : Tool to fix Overweight in delivery line item,         *
                   Used All Function module to cancel invoice ,          *
                   Reverse the goods issue  ,Update Delivery qty,Create  *
                   invoice                                               *
    Author       : Seshu                                                 *
    Date         : 05/08/2007                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    --|||--
    05/08/07| Seshu    | DEVK921979 | Initial                            *
    D A T A - D E C L A R A T I O N     *******************
    Tables
    Tables : vbak,
             vbap,
             vbfa,
             likp,
             lips,
             vbrk,
             vbrp.
    Internal Tables
    data : i_lips like lips occurs 0 with header line,
           i_vbap like vbap occurs 0 with header line.
    Variables
    data : v_deliv like vbfa-vbelv,
           v_invoic like vbfa-vbelv.
    Data Declaration Part for Post Goods Issue
    DATA: l_vbeln LIKE likp-vbeln,
          l_vbkok LIKE vbkok,
          i_prot LIKE prott OCCURS 0 WITH HEADER LINE,
          ef_error_any_0 TYPE c,
          ef_error_in_item_deletion_0 TYPE c,
          ef_error_in_pod_update_0 TYPE c,
          ef_error_in_interface_0 TYPE c,
          ef_error_in_goods_issue_0 TYPE c,
          ef_error_in_final_check_0 TYPE c,
          d_return   LIKE bapireturn1.
    Internal tables for BAPI Function Module
    data : i_cret like BAPIRETURN1 occurs 0 with header line,
           i_csucess like BAPIVBRKSUCcESS occurs 0 with header line,
           i_ret2 like bapiret2 ,
           flag type c,
           i_mesg like mesg occurs 0 with header line.
    Data Declaration for Invoice Creation
    DATA: VBSK_I     LIKE  VBSK.
    data: d_success  type  c.
    DATA: XKOMFK LIKE      KOMFK   OCCURS 0 WITH HEADER LINE,
          XKOMV  LIKE      KOMV    OCCURS 0 WITH HEADER LINE,
          XTHEAD LIKE      THEADVB OCCURS 0 WITH HEADER LINE,
          XVBFS  LIKE      VBFS    OCCURS 0 WITH HEADER LINE,
          XVBPA  LIKE      VBPAVB  OCCURS 0 WITH HEADER LINE,
          XVBRK  LIKE      VBRKVB  OCCURS 0 WITH HEADER LINE,
          XVBRP  LIKE      VBRPVB  OCCURS 0 WITH HEADER LINE,
          XVBSS  LIKE      VBSS    OCCURS 0 WITH HEADER LINE,
          XKOMFKGN LIKE    KOMFKGN OCCURS 0 WITH HEADER LINE.
    S E L E C T I O N  -  S C R E E N   ******************
    Selection-screen
    Selection-screen : begin of block blk with frame title text-001.
    parameters : p_vbeln like vbak-vbeln obligatory.
    selection-screen : end of block blk.
    A T -  S E L E C T I O N  - S C R E E N ***************
    Validation on Sales order
    at selection-screen on p_vbeln.
    Check the data on VBAK Table
      select single vbeln from vbak into vbak-vbeln
                                where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message e006 with p_vbeln.
      endif.
    S T A R T  - O F - S E L E C T I O N *******************
    Start-of-selection.
      break sreddy.
    Get the Invoice Number corresponding Sales Order Number
      perform get_invoice.
    Step 1.
    Cancel the Invoice  - Transaction VF11
      perform cancel_invoice.
    Reverse the goods issue
      perform reverse_goodsissue.
    Get the Order and Delivery Items
      perform get_sales_deliv.
    Delivery Change
      perform Delivery_change.
    Create Invoice document
      perform invoice_create.
    E N D  -  O F -  S E L E C T I O N  *******************
    end-of-selection.
    if flag = 'X'.
    message i012 with p_vbeln.
    endif.
    *&      Form  get_invoice
          Get Invoice Number
    FORM get_invoice.
    Clear Variables
      clear : v_deliv,
              v_invoic,
              flag.
    Get the Delivery Number First
      select single vbeln from vbfa into v_deliv
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'J'.
      if sy-subrc ne 0.
        message i004 with p_vbeln.
        stop.
      endif.
    Get the Invoice Number
      select single vbeln from vbfa into v_invoic
                               where vbelv = p_vbeln
                               and   vbtyp_n = 'M'.
      if sy-subrc ne 0.
        message i003 with p_vbeln.
        stop.
      endif.
    ENDFORM.                    " get_invoice
    *&      Form  cancel_invoice
          Cancel the Invoice
    FORM cancel_invoice.
      clear : i_ret2,
              i_cret,
              i_csucess.
      refresh : i_cret,
                i_csucess.
      CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
        EXPORTING
          BILLINGDOCUMENT       = v_invoic
      TESTRUN               =
      NO_COMMIT             =
      BILLINGDATE           =
        TABLES
          RETURN                = i_cret
          SUCCESS               = i_csucess
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
           EXPORTING
                WAIT   = space
           IMPORTING
                RETURN = i_ret2.
    read table i_cret with key type = 'E'.
      if sy-subrc ne 0.
        message i005 with v_invoic.
        stop.
      endif.
    ENDFORM.                    " cancel_invoice
    *&      Form  reverse_goodsissue
          Reverse the goods Issue
    FORM reverse_goodsissue.
    Local Variable
      data : lv_vbtyp like likp-vbtyp.
      clear : i_mesg,
              lv_vbtyp.
      refresh : i_mesg.
      select single vbtyp from likp into lv_vbtyp
                               where vbeln = v_deliv.
      CALL FUNCTION 'WS_REVERSE_GOODS_ISSUE'
        EXPORTING
          I_VBELN                         = v_deliv
          I_BUDAT                         = sy-datum
        I_COUNT                         =
        I_MBLNR                         =
        I_TCODE                         =
          I_VBTYP                         = lv_vbtyp
        TABLES
          T_MESG                          = i_mesg
       EXCEPTIONS
         ERROR_REVERSE_GOODS_ISSUE       = 1
         OTHERS                          = 2
      if sy-subrc ne 0.
        message i007 with v_deliv.
      endif.
    ENDFORM.                    " reverse_goodsissue
    *&      Form  get_sales_deliv
          Get the Sales order and Deliv Items
    FORM get_sales_deliv.
    Local Variables
      data : lv_kwmeng like vbap-kwmeng.
      clear : i_lips,
              i_vbap.
      refresh : i_lips,
                i_vbap.
    Select the data from LIPS
      select * from lips into table i_lips
                         where vbeln = v_deliv.
      if sy-subrc ne 0.
        message i008 with v_deliv.
        stop.
      endif.
      sort i_lips by vbeln posnr.
      Get the Sales order Item Data.
      select * from vbap into table i_vbap
                              where vbeln = p_vbeln.
      if sy-subrc ne 0.
        message i006 with p_vbeln.
        stop.
      endif.
      sort i_vbap by vbeln posnr.
    Compare delivery Item and Order Items
      loop at i_lips.
        clear lv_kwmeng.
        read table i_vbap with key posnr = i_lips-posnr.
        if sy-subrc eq 0.
          lv_kwmeng = i_vbap-kwmeng * 2.
          if lv_kwmeng >= i_lips-lfimg.
            i_lips-lfimg = i_vbap-kwmeng.
            modify i_lips.
          endif.
        endif.
      endloop.
    ENDFORM.                    " get_sales_deliv
    *&      Form  Delivery_change
          Delivery Update
    FORM Delivery_change.
      Clear : i_prot.
      refresh : i_prot.
    Delivery Update
      CALL FUNCTION 'LE_MOB_DELIVERY_UPDATE'
           EXPORTING
                do_commit                = 'X'
           TABLES
                t_delivery_items         = i_lips
                prot                     = i_prot
           EXCEPTIONS
                conversion_overflow      = 1
                essential_data_missing   = 2
                error                    = 3
                nothing_to_update        = 4
                lock_after_update_failed = 5
                error_in_delivery_update = 6
                OTHERS                   = 7.
      COMMIT WORK.
      IF sy-subrc <> 0.
        MESSAGE i009 with v_deliv.
      endif.
    Post Goods Issue
      CLEAR:    d_return,
                i_prot,
                l_vbeln,
                l_vbkok.
      REFRESH i_prot.
      CLEAR:  ef_error_in_item_deletion_0    ,
              ef_error_in_pod_update_0       ,
              ef_error_in_interface_0        ,
              ef_error_in_goods_issue_0      ,
              ef_error_in_final_check_0      .
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    carry out goods issue
      l_vbeln          = v_deliv.
      l_vbkok-vbeln_vl = l_vbeln.
      l_vbkok-wabuc    = 'X'.
    SET UPDATE TASK LOCAL.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
           EXPORTING
                vbkok_wa                    = l_vbkok
                synchron                    = 'X'
                no_messages_update          = ' '
                update_picking              = 'X'
                commit                      = 'X'
                delivery                    = l_vbeln
                nicht_sperren               = 'X'
                if_error_messages_send_0    = space
           IMPORTING
                ef_error_any_0              = ef_error_any_0
                ef_error_in_item_deletion_0 = ef_error_in_item_deletion_0
                ef_error_in_pod_update_0    = ef_error_in_pod_update_0
                ef_error_in_interface_0     = ef_error_in_interface_0
                ef_error_in_goods_issue_0   = ef_error_in_goods_issue_0
                ef_error_in_final_check_0   = ef_error_in_final_check_0
           TABLES
                prot                        = i_prot
           EXCEPTIONS
                error_message               = 1
                OTHERS                      = 2.
      if sy-subrc ne 0.
        message i010 with v_deliv.
      else.
        COMMIT WORK .
      endif.
    ENDFORM.                    " Delivery_change
    *&      Form  invoice_create
          Invoice Creation
    FORM invoice_create.
      refresh: XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS.
      clear  : XKOMFK, XKOMV,
               XTHEAD, XVBFS,
               XVBPA,  XVBRK,
               XVBRP,  XVBSS,
               VBSK_I.
      VBSK_I-SMART = 'F'.
      XKOMFK-VBELN =  v_deliv.
      XKOMFK-VBTYP = 'J'.
      APPEND XKOMFK.
      CALL FUNCTION 'RV_INVOICE_CREATE'
           EXPORTING
                VBSK_I       = VBSK_I
                WITH_POSTING = 'C'
           TABLES
                XKOMFK       = XKOMFK
                XKOMV        = XKOMV
                XTHEAD       = XTHEAD
                XVBFS        = XVBFS
                XVBPA        = XVBPA
                XVBRK        = XVBRK
                XVBRP        = XVBRP
                XVBSS        = XVBSS.
      if sy-subrc eq 0.
        COMMIT WORK.
       flag = 'X'.
      else.
      message i011 with p_vbeln.
      endif.
    ENDFORM.                    " invoice_create
    Thanks
    Seshu

Maybe you are looking for