Updating delivery date on Purchase order line items  Urgent

Hi,
I have same problem with update the Delivery date in ME22N transaction. I have used BAPI_PO_CHANGE function module. but it does not working properly. Can anybody please send the sample code.
my maild id is [email protected]
it_POSCHDULE-PO_ITEM = '10'. "PO item number
it_POSCHDULE-DELIVERY_DATE = '08/28/2007'. "changed delivery date
it_POSCHDULE-SCHED_LINE = '1'.
append it_POSCHDULE.
IT_POSCHDULEX-PO_ITEMX = 'X'. "PO item number
IT_POSCHDULEX-DELIVERY_DATE = 'X'. "changed delivery date
IT_POSCHDULEX-SCHED_LINEX = 'X'. "schedule line
append IT_POSCHDULEX.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = '4500232997'
TABLES
RETURN = return
POSCHEDULE = IT_POSCHDULE
POSCHEDULEX = IT_POSCHDULEX
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
is any more parameters i have to pass for update the delivery date
Thanks
Gopal.

This is my code.
it_POSCHDULE-PO_ITEM = '00010'. "PO item number
it_POSCHDULE-DELIVERY_DATE = '08.28.2007'. "changed delivery date
it_POSCHDULE-SCHED_LINE = '0001'.
append it_POSCHDULE.
it_poschdulex-po_item = '00010'.
IT_POSCHDULEX-SCHED_LINE = '0001'.
IT_POSCHDULEX-PO_ITEMX = 'X'. "PO item number
IT_POSCHDULEX-DELIVERY_DATE = 'X'. "changed delivery date
IT_POSCHDULEX-SCHED_LINEX = 'X'. "schedule line
append IT_POSCHDULEX.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = '4500002299'
TABLES
RETURN = return
POSCHEDULE = IT_POSCHDULE
POSCHEDULEX = IT_POSCHDULEX
commit work.
and messages in RETURN are
TYPE     ID     NUMBER     MESSAGE
I          0     Changing of PO using Enjoy BAPI unsuccessful 
E     MEPO     0     Purchase order still contains faulty items
I     VD     345     Date 08.28.2007 period D is not valid
E     6     70     Enter a quantity
E     MEPO     43     Please enter an order quantity

Similar Messages

  • Updating delivery date on Purchase order line items

    Hi,
    I am using BAPI_PO_CREATE1 to create purchase order. It is creating fine except I want the delivery date on line item to be overwritten instead of system determining from MRP view of material on each line item.
    I am passing delivery date to DELIVERY_DATE parameter of POSCHEDULE  table of the BAPI, but instead of taking the value that I passed it is calculating from material master.
    Is there any other parameter for BAPI that I need to set ?
    Please suggest me a solution.
    Thanks,
    Sonali.

    Thank You!
    My problem is solved regarding DELIVERY_DATE but I am getting new problem .
    I am getting error message
    "Control indicators for controlling area UPS do not exist"
    when I use BAPI BAPI_PO_CREATE1 . 'UPS' is the new controlling area that in which I am creating the Purchase order.
    Please suggest me some solution.
    Thanks,
    Sonali.

  • Creating inbound delivery for the purchase order line items

    Hi Experts,
    Please let me know how can I create inbound delivery for the purchase order line items?  Say, I have a purchase order with 5 line items in it.  I wanted to create an inbound delivery for only 2 line items at this point of time.  Which SAP Standard transaction I have to use and what all  data I need to populate?  I would appreciate any help on this and will reward the right answer.  Please let me know.
    Thank you in advance.
    with regards,
    Muthu Ganapathy.

    Hi,
    While creating the inbound delivery (VL31N), intially all the items will be shown, see the advance shipping notfication - from the vendor for which he has send confirmation & rest items you can delete simply & save. & next time when the vendor sends rest advance shipping notifcation (confirmation), you can receive them.
    Hope this answers your query.
    Regards
    Irfan.

  • Inbound idoc for updating delivery date of purchase order

    Hi All,
    Our vendor sends a delivery file consisting of delivery date and quantity(could be partial) for line items of a purchase order.
    I need to update the Purchase order line item with the delivery date and quantity sent from the Vendor. It should add a new confirmation line with custom confirmation category in the confirmation tab of the line item in the Purchase order.
    Each time we get a delivery file we need to add a new confirmation line in the confirmation tab of the purchase order line item.
    How can I get this working using inbound idoc processing? Which Idoc type should I use to solve my issue. Will ORDERSP work for my scenario?
    Thank you,
    Sonali.

    >
    sonali ashi wrote:
    > We have all EDI set up done for ORDERSP idoc in our system. Problem when I use this idoc type by default system is always adding confirmation catgeory 'AB' but we want our custom  category to be added instead of 'AB'.
    > Edited by: sonali ashi on Dec 23, 2010 9:47 PM
    Confirmation category used for order acknowledgement is define in configuation. You can change that from AB to your custom condition and EDI should pickup that.
    SPRO->Material Management->Purchasing->Confirmation->Define Internal Confirmation Category
    >
    sonali ashi wrote:
    > I have also noticed that 'AB' confirmation accepts only full quantity order acknowledgement through Idoc processing.
    > Manually I can add a "AB" confirmation for partial quantity but in the idoc processing it fails.
    > Edited by: sonali ashi on Dec 23, 2010 9:47 PM
    Check tolerance limit defined for confirmation category in 'Conformation Control' Node in SPRO at same level as above.
    Regards,
    Pawan.

  • Update of delivery date on purchase order line

    Hi,
    Is it possible that the delivery date in the purchase order is automatically updated. When the required delivery date changes in the sales order when there is a link between the two?
    If yes, how?

    Thank You!
    My problem is solved regarding DELIVERY_DATE but I am getting new problem .
    I am getting error message
    "Control indicators for controlling area UPS do not exist"
    when I use BAPI BAPI_PO_CREATE1 . 'UPS' is the new controlling area that in which I am creating the Purchase order.
    Please suggest me some solution.
    Thanks,
    Sonali.

  • Purchase order line items Urgent !!!!!!

    hi all,
    I am doing idoc to file .
    my idoc type is orders and other side i created  target message type (mt_target)
    my target structure created same as idoc i.e
    header , lineitemS1 ,s2 .
    Problem is that i getting line items is sequence order not as   lineitem one data then it is segment  and again i should get line item 2 data and its segements,
    please help me .
    it is basicly to get header lineitems in sequence  .
    Thanks

    hi ,
    thanks for ur replies
    below is format it is coming
    E2EDP01006
    E2EDP01006
    Z2EKETX000
    Z2EKETX000
    E2EDP19001
    E2EDP19001
    i should get in this form
    E2EDK01005
    E2EDP01006
    Z2EKETX000
    E2EDP19001
    E2EDP01006
    Z2EKETX000
    E2EDP19001
    i am using fcc fixed field length.
    1. how should my target message type should be  , herchy level (same as idoc )or flat level
    i had define my target strtucre at flat level  . above is teh format i got .
    Thanks
    Edited by: Brunda Reddy on Apr 1, 2008 9:32 PM

  • Delivery date in Purchase Order in the item overview

    Hi all,
    In which table is Delivery date in Purchase Order in the item overview stored.
    the screen field name is eeind.
    Thanks

    In table EKET in field EINDT the delivery date is stored, based on the Schedule lines in the PO Item

  • In Purchase Order Line item Maintaining Serial Numbers for Material Codes

    Dear Gurus,
    We have a business process in legacy system for Purchase Order like in PO line item, Material code with description, Quantity, unit of Measurement, Serial Number Start and Serial Number End is maintained, for example for Material code when we enter the data AXMLN00001 in Serial Number Start column, if the Qty 500 is maintained, by default system will calculate AXMLN00500 in Serial Number End column. 
    We understand that in standard SAP we donu2019t have this option of maintaining Serial Number Start and End in Purchase order Line item. Please let us know how this can be mapped and is it advisable to create two Z fields in EKPO table or else can we make any development.
    Suppose if this is not possible in SAP for PO then in Banks if we want to place a order for Cheque books how we can maintain Start and End Serial Numbers to print in cheque books.
    Also client is not agreeing to maintain manually Serial numbers in item text.
    regards,
    Dhanu

    Aamir,
    When the PO Item was created say for example Material had Valuation category "Y" and latter you wanted to change the category to "Y". Now system would have check for all open PO's etc...based on this you must have set Deletion Indicator to this Line Item to allow valuation category change in material master. Now when this Item got created in the table level (EKPO), system updates the valuation category "Y". Currently this valuation category is not active so it would not allow you to perform removal of deletion indicator as program cannot automatically nor you have an option to manually update the valuation category to this Item.
    Regards,
    Prasobh

  • Output the requested delivery date for each different line item

    Hello Experts
    I have program called ZFSFSF(following), in the output Its showing multiple requested delvery dates per line item.
    But We need to show the requested delivery date for each different line item.
    Any code is highly appreciated. I wud appreacite if you cud bold the added code.
    Thanks
    SP
    TYPE-POOLS: slis.
    TABLES: vbap, vbrk, vbfa, vbak, vbrp, konv, kna1, bkpf, bsad, bkpf_bsad,
    knvv, pa0002, t005u, mvke, lips, likp, vbpa, vbep.
    DATA: BEGIN OF i_list OCCURS 0,
    vbeln LIKE vbak-vbeln,
    posnr LIKE vbap-posnr,
    matnr LIKE vbap-matnr,
    erdat LIKE vbap-erdat,
    mvgr1 LIKE mvke-mvgr1,
    wadat_ist LIKE likp-wadat_ist,
    days TYPE i,
    werks LIKE vbap-werks,
    lgort LIKE vbap-lgort,
    kwmeng LIKE vbap-kwmeng," CH01+
    lfimg LIKE lips-lfimg," CH01+
    pstyv LIKE vbap-pstyv," CH01+
    obd LIKE lips-vbeln," CH01+
    obd_pos LIKE lips-posnr," CH01+
    soldto LIKE vbaK-kunnr," JR+
    shipto LIKE vbpa-kunnr," JR+
    edatu like vbep-edatu," PR+
    END OF i_list.
    DATA: i_list2 LIKE i_list OCCURS 0 WITH HEADER LINE,
    i_list3 LIKE i_list OCCURS 0 WITH HEADER LINE.
    DATA: i_list4 LIKE vbap OCCURS 0 WITH HEADER LINE.
    *ALV Output Header
    DATA: gt_list_top_of_page TYPE slis_t_listheader,
    prognm LIKE sy-repid,
    gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
    gt_events TYPE slis_t_event,
    is_layout TYPE slis_layout_alv,
    is_variant LIKE disvariant,
    it_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:gt_fieldcat TYPE slis_t_fieldcat_alv.
    DATA:gt_outtab LIKE i_list OCCURS 0 WITH HEADER LINE.
    DATA: g_repid LIKE sy-repid,
    g_count LIKE sy-tabix.
    SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME TITLE text-t01.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(79) text-t10.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(79) text-t11.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN: BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(79) text-t12.
    SELECTION-SCREEN: END OF LINE.
    SELECTION-SCREEN END OF BLOCK block0.
    */ Selection and Input Parameters
    SELECTION-SCREEN BEGIN OF BLOCK blocko WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_vbeln FOR vbap-vbeln, "SO
    s_auart FOR vbak-auart DEFAULT 'KB' OBLIGATORY,
    s_matnr FOR vbap-matnr," obligatory,
    s_mvgr1 FOR mvke-mvgr1,
    s_erdat FOR vbap-erdat OBLIGATORY,
    s_werks FOR vbap-werks,
    s_lgort FOR vbap-lgort,
    s_edatu FOR vbep-edatu.
    PARAMETERS: p_vkorg LIKE vbak-vkorg DEFAULT '5010'.
    SELECTION-SCREEN SKIP 2.
    +EC1
    Addition +EC1
    +EC1
    PARAMETERS: p_vari LIKE disvariant-variant.
    +EC1
    End Addition +EC1
    +EC1
    SELECTION-SCREEN END OF BLOCK blocko.
    +EC1
    Addition +EC1
    +EC1
    DATA: g_save(1) TYPE c,
    g_default(1) TYPE c,
    g_exit(1) TYPE c,
    gx_variant LIKE disvariant,
    g_variant LIKE disvariant.
    +EC1
    End Addition +EC1
    +EC1
    Initialization fieldcatalog
    INITIALIZATION.
    PERFORM clear_tables.
    g_repid = sy-repid.
    PERFORM fieldcat_init USING gt_fieldcat[].
    +EC1
    Addition +EC1
    +EC1
    g_save = 'A'.
    PERFORM variant_init.
    Get default variant
    gx_variant = g_variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
    i_save = g_save
    CHANGING
    cs_variant = gx_variant
    EXCEPTIONS
    not_found = 2.
    IF sy-subrc = 0.
    p_vari = gx_variant-variant.
    ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    PERFORM f4_for_variant.
    AT SELECTION-SCREEN.
    PERFORM auth_check. "+ESC
    PERFORM pai_of_selection_screen.
    +EC1
    End Addition +EC1
    +EC1
    START-OF-SELECTION.
    PERFORM get_data.
    PERFORM alv.
    END-OF-SELECTION.
    FORM get_data *
    FORM get_data.
    *CH01 - Added kwmeng(order qty) to selection, excluded rejects
    *JR -added soldto and shipto code
    SELECT avbeln aposnr amatnr aerdat awerks algort
    akwmeng apstyv bkunnr cedatu
    CH01+
    INTO
    (i_list-vbeln, i_list-posnr, i_list-matnr, i_list-erdat, i_list-werks,
    i_list-lgort,
    i_list-kwmeng , i_list-pstyv, i_list-soldto,i_list-edatu)
    CH01+
    FROM vbap AS a INNER JOIN vbak AS b ON avbeln = bvbeln
    INNER JOIN vbep AS c ON avbeln = cvbeln
    WHERE b~vkorg = p_vkorg
    AND a~werks IN s_werks
    AND a~lgort IN s_lgort
    AND b~auart IN s_auart
    AND a~vbeln IN s_vbeln
    AND a~erdat IN s_erdat
    AND a~abgru = ''" CH01+
    AND a~matnr IN s_matnr
    AND c~edatu IN s_edatu.
    APPEND i_list.
    ENDSELECT.
    COMMIT WORK AND WAIT.
    LOOP AT i_list.
    SELECT SINGLE mvgr1 INTO i_list-mvgr1 FROM mvke
    WHERE matnr = i_list-matnr.
    MODIFY i_list.
    CLEAR: i_list.
    ENDLOOP.
    COMMIT WORK AND WAIT.
    LOOP AT i_list.
    IF i_list-mvgr1 IN s_mvgr1.
    CONTINUE.
    ELSE.
    DELETE i_list.
    COMMIT WORK AND WAIT.
    ENDIF.
    ENDLOOP.
    CH01 - commented these lines out and redid logic below
    LOOP AT i_list.
    select single vbeln into lips-vbeln from lips
    where vgbel = i_list-vbeln
    and vgpos = i_list-posnr.
    select single wadat_ist into i_list-wadat_ist from likp
    where vbeln = lips-vbeln.
    SELECT b~wadat_ist INTO i_list-wadat_ist
    FROM lips AS a INNER JOIN
    likp AS b ON avbeln = bvbeln WHERE a~vgbel = i_list-vbeln
    AND a~vgpos = i_list-posnr.
    MODIFY i_list.
    CLEAR: i_list, lips-vbeln.
    ENDSELECT.
    ENDLOOP.
    CH01 - Changed to select multiple delivery lines & del qty
    summing the total deliveries per OBD# and date
    LOOP AT i_list.
    SELECT avbeln sum( alfimg ) b~wadat_ist
    INTO (i_list-obd , i_list-lfimg , i_list-wadat_ist)
    FROM lips AS a INNER JOIN
    likp AS b ON avbeln = bvbeln WHERE a~vgbel = i_list-vbeln
    AND a~vgpos = i_list-posnr
    AND a~pstyv = i_list-pstyv
    group by avbeln bwadat_ist.
    i_list2 = i_list.
    APPEND i_list2.
    ENDSELECT.
    IF sy-subrc <> 0.
    i_list2 = i_list.
    APPEND i_list2.
    ENDIF.
    ENDLOOP.
    i_list[] = i_list2[].
    *End CH01
    COMMIT WORK AND WAIT.
    LOOP AT i_list.
    IF i_list-wadat_ist IS INITIAL.
    CONTINUE.
    ELSE.
    i_list-days = i_list-wadat_ist - i_list-erdat.
    ENDIF.
    MODIFY i_list.
    CLEAR: i_list.
    COMMIT WORK AND WAIT.
    ENDLOOP.
    COMMIT WORK AND WAIT.
    LOOP AT i_list.
    IF i_list-vbeln IS INITIAL.
    DELETE i_list.
    ENDIF.
    ENDLOOP.
    COMMIT WORK AND WAIT.
    *JR
    LOOP AT i_list.
    SELECT SINGLE KUNNR INTO i_list-shipto FROM vbpa
    WHERE vbeln = i_list-vbeln
    AND parvw = 'WE'.
    MODIFY i_list.
    ENDLOOP.
    *END JR
    gt_outtab[] = i_list[].
    COMMIT WORK AND WAIT.
    ENDFORM.
    FORM alv *
    FORM alv.
    PERFORM e03_eventtab_build USING gt_events[]. "+EC1
    PERFORM e04_comment_build USING gt_list_top_of_page[]. "+EC1
    prognm = sy-repid. "+EC1
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_user_command = 'USER_COMMAND'
    i_callback_program = g_repid
    it_fieldcat = gt_fieldcat[]
    it_events = gt_events[] "+ESC
    it_sort = it_sort[]
    +EC1
    Addition +EC1
    +EC1
    is_variant = g_variant
    i_save = g_save
    +EC1
    End Addition +EC1
    +EC1
    TABLES
    t_outtab = gt_outtab.
    COMMIT WORK AND WAIT.
    ENDFORM.
    FORM fieldcat_init *
    --> I_FIELDCAT *
    FORM fieldcat_init
    USING i_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: ls_fieldcat TYPE slis_fieldcat_alv.
    DATA: pos TYPE i VALUE 1.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'VBELN'.
    ls_fieldcat-ref_tabname = 'VBAK'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'POSNR'.
    ls_fieldcat-ref_tabname = 'VBAP'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'MATNR'.
    ls_fieldcat-ref_tabname = 'VBAP'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'MVGR1'.
    ls_fieldcat-ref_tabname = 'MVKE'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'WERKS'.
    ls_fieldcat-ref_tabname = 'VBAP'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'LGORT'.
    ls_fieldcat-ref_tabname = 'VBAP'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'ERDAT'.
    ls_fieldcat-ref_tabname = 'VBAP'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'WADAT_IST'.
    ls_fieldcat-ref_tabname = 'LIKP'.
    ls_fieldcat-key = 'X'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'DAYS'.
    ls_fieldcat-ref_fieldname = 'DAYS'.
    ls_fieldcat-seltext_s = '# Of Days'.
    ls_fieldcat-seltext_m = '# Of Days'.
    ls_fieldcat-seltext_l = '# Of Days'.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    *Begin CH01
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'KWMENG'.
    ls_fieldcat-ref_tabname = 'VBAP'.
    ls_fieldcat-outputlen = 7.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'LFIMG'.
    ls_fieldcat-ref_tabname = 'LIPS'.
    ls_fieldcat-outputlen = 7.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'OBD'.
    ls_fieldcat-seltext_s = 'OBD'.
    ls_fieldcat-seltext_m = 'Outbound Del'.
    ls_fieldcat-seltext_l = 'Outbound Delivery'.
    ls_fieldcat-outputlen = 10.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'OBD_POS'.
    ls_fieldcat-seltext_s = 'OBD Ln'.
    ls_fieldcat-seltext_m = 'Outbound Del Ln'.
    ls_fieldcat-seltext_l = 'Outbound Del Line'.
    ls_fieldcat-outputlen = 10.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    *End CH01
    *JR
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'SOLDTO'.
    ls_fieldcat-ref_tabname = 'VBAP'.
    ls_fieldcat-seltext_m = 'Sold To'.
    ls_fieldcat-seltext_l = 'Sold To'.
    ls_fieldcat-outputlen = 10.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'SHIPTO'.
    ls_fieldcat-ref_tabname = 'VBPA'.
    ls_fieldcat-seltext_m = 'Ship To'.
    ls_fieldcat-seltext_l = 'Ship To'.
    ls_fieldcat-outputlen = 10.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    *END JR
    ls_fieldcat-col_pos = pos.
    ls_fieldcat-fieldname = 'EDATU'.
    ls_fieldcat-ref_tabname = 'VBEP'.
    ls_fieldcat-seltext_m = 'Requested Delivery date'.
    ls_fieldcat-seltext_l = 'Requested Delivery date'.
    ls_fieldcat-outputlen = 20.
    APPEND ls_fieldcat TO i_fieldcat.
    CLEAR ls_fieldcat.
    *FOR ALV SORT & SUBTOTAL
    CLEAR it_sort.
    it_sort-spos = '0'.
    it_sort-fieldname = 'VBELN'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '1'.
    it_sort-fieldname = 'POSNR'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '2'.
    it_sort-fieldname = 'MATNR'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '3'.
    it_sort-fieldname = 'MVGR1'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '4'.
    it_sort-fieldname = 'ERDAT'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '5'.
    it_sort-fieldname = 'WADAT_IST'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-down = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '6'.
    it_sort-fieldname = 'PERNR'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '7'.
    it_sort-fieldname = 'VORNA'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '8'.
    it_sort-fieldname = 'NACHN'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '9'.
    it_sort-fieldname = 'VKGRP'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '10'.
    it_sort-fieldname = 'VBELN'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '11'.
    it_sort-fieldname = 'ERDAT'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    CLEAR it_sort.
    it_sort-spos = '12'.
    it_sort-fieldname = 'BEZEI'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    it_sort-subtot = 'X'.
    APPEND it_sort.
    clear it_sort.
    it_sort-spos = '1'.
    it_sort-fieldname = 'BELNR'.
    it_sort-tabname = 'GT_OUTTAB'.
    it_sort-up = 'X'.
    append it_sort.
    ENDFORM.
    +EC1
    Addition +EC1
    +EC1
    *& Form VARIANT_INIT
    text
    --> p1 text
    <-- p2 text
    FORM variant_init.
    CLEAR g_variant.
    g_variant-report = g_repid.
    ENDFORM. " VARIANT_INIT
    FORM f4_for_variant *
    FORM f4_for_variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
    is_variant = g_variant
    i_save = g_save
    it_default_fieldcat =
    IMPORTING
    e_exit = g_exit
    es_variant = gx_variant
    EXCEPTIONS
    not_found = 2.
    IF sy-subrc = 2.
    MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    IF g_exit = space.
    p_vari = gx_variant-variant.
    ENDIF.
    ENDIF.
    ENDFORM.
    *& Form PAI_OF_SELECTION_SCREEN
    text
    FORM pai_of_selection_screen.
    IF NOT p_vari IS INITIAL.
    MOVE g_variant TO gx_variant.
    MOVE p_vari TO gx_variant-variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
    EXPORTING
    i_save = g_save
    CHANGING
    cs_variant = gx_variant.
    g_variant = gx_variant.
    ELSE.
    PERFORM variant_init.
    ENDIF.
    ENDFORM. " PAI_OF_SELECTION_SCREEN
    +EC1
    End Addition +EC1
    +EC1
    FORM e03_eventtab_build *
    --> E03_LT_EVENTS *
    FORM e03_eventtab_build USING e03_lt_events TYPE slis_t_event.
    DATA: ls_event TYPE slis_alv_event.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    i_list_type = 0
    IMPORTING
    et_events = e03_lt_events.
    READ TABLE e03_lt_events WITH KEY name = slis_ev_top_of_page
    INTO ls_event.
    IF sy-subrc = 0.
    MOVE gc_formname_top_of_page TO ls_event-form.
    APPEND ls_event TO e03_lt_events.
    ENDIF.
    ENDFORM.
    FORM e04_comment_build *
    --> E04_LT_TOP_OF_PAGE *
    FORM e04_comment_build USING e04_lt_top_of_page TYPE slis_t_listheader.
    DATA: ls_line TYPE slis_listheader.
    *Report Title
    CLEAR ls_line.
    ls_line-typ = 'H'.
    ls_line-info = text-007.
    APPEND ls_line TO e04_lt_top_of_page.
    **Doc Type Desc.
    clear ls_line.
    ls_line-typ = 'S'.
    ls_line-key = text-008.
    ls_line-info = p_matnr.
    append ls_line to e04_lt_top_of_page.
    clear ls_line.
    ls_line-typ = 'S'.
    ls_line-key = text-009.
    ls_line-info = p_werks.
    append ls_line to e04_lt_top_of_page.
    clear ls_line.
    ls_line-typ = 'S'.
    ls_line-key = text-010.
    ls_line-info = p_stlan.
    append ls_line to e04_lt_top_of_page.
    clear ls_line.
    ls_line-typ = 'S'.
    ls_line-key = text-011.
    ls_line-info = p_stlal.
    append ls_line to e04_lt_top_of_page.
    clear ls_line.
    ls_line-typ = 'S'.
    ls_line-key = text-012.
    ls_line-info = p_stlal.
    append ls_line to e04_lt_top_of_page.
    ENDFORM.
    FORM top_of_page *
    FORM top_of_page.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = gt_list_top_of_page.
    ENDFORM.
    FORM auth_check *
    FORM auth_check.
    AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'
    ID 'VKORG' FIELD p_vkorg.
    IF sy-subrc NE 0.
    MESSAGE e054 WITH p_vkorg.
    ENDIF.
    ENDFORM. " auth_check
    *& Form USER_COMMAND
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    PERFORM display_so_order USING r_ucomm
    rs_selfield.
    ENDCASE.
    ENDFORM.
    *& Form display_sales_order
    text
    -->P_R_UCOMM text
    -->P_RS_SELFIELD text
    FORM display_so_order USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    CASE rs_selfield-sel_tab_field.
    WHEN '1-VBELN'.
    SET PARAMETER ID 'AUN' FIELD rs_selfield-value.
    CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    WHEN '1-MATNR'.
    SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
    CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
    WHEN '1-OBD'.
    SET PARAMETER ID 'VL' FIELD rs_selfield-value.
    CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
    WHEN OTHERS.
    MESSAGE i000(z1) WITH 'Please Click on the Valid Selection'.
    EXIT.
    ENDCASE.
    ENDFORM. " display_sales_order
    FORM EDit_table *

    > TYPE-POOLS: slis.
    >
    > TABLES: vbap, vbrk, vbfa, vbak, vbrp, konv, kna1,
    > bkpf, bsad, bkpf_bsad,
    > knvv, pa0002, t005u, mvke, lips, likp, vbpa, vbep.
    >
    > DATA: BEGIN OF i_list OCCURS 0,
    > vbeln LIKE vbak-vbeln,
    > posnr LIKE vbap-posnr,
    <b>  etenr like vbep-etenr,</b>
    > matnr LIKE vbap-matnr,
    > erdat LIKE vbap-erdat,
    > mvgr1 LIKE mvke-mvgr1,
    > wadat_ist LIKE likp-wadat_ist,
    > days TYPE i,
    > werks LIKE vbap-werks,
    > lgort LIKE vbap-lgort,
    > kwmeng LIKE vbap-kwmeng," CH01+
    > lfimg LIKE lips-lfimg," CH01+
    > pstyv LIKE vbap-pstyv," CH01+
    > obd LIKE lips-vbeln," CH01+
    > obd_pos LIKE lips-posnr," CH01+
    > soldto LIKE vbaK-kunnr," JR+
    > shipto LIKE vbpa-kunnr," JR+
    > edatu like vbep-edatu," PR+
    > END OF i_list.
    >
    > DATA: i_list2 LIKE i_list OCCURS 0 WITH HEADER LINE,
    > i_list3 LIKE i_list OCCURS 0 WITH HEADER LINE.
    >
    > DATA: i_list4 LIKE vbap OCCURS 0 WITH HEADER LINE.
    >
    >
    > *ALV Output Header
    > DATA: gt_list_top_of_page TYPE slis_t_listheader,
    > prognm LIKE sy-repid,
    > gc_formname_top_of_page TYPE slis_formname VALUE
    > 'TOP_OF_PAGE',
    > gt_events TYPE slis_t_event,
    > is_layout TYPE slis_layout_alv,
    > is_variant LIKE disvariant,
    > it_sort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    >
    > DATA:gt_fieldcat TYPE slis_t_fieldcat_alv.
    > DATA:gt_outtab LIKE i_list OCCURS 0 WITH HEADER
    > LINE.
    >
    > DATA: g_repid LIKE sy-repid,
    > g_count LIKE sy-tabix.
    >
    > SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME
    > TITLE text-t01.
    >
    > SELECTION-SCREEN: BEGIN OF LINE.
    > SELECTION-SCREEN COMMENT 1(79) text-t10.
    >
    > SELECTION-SCREEN: END OF LINE.
    >
    > SELECTION-SCREEN: BEGIN OF LINE.
    > SELECTION-SCREEN COMMENT 1(79) text-t11.
    > SELECTION-SCREEN: END OF LINE.
    >
    > SELECTION-SCREEN: BEGIN OF LINE.
    > SELECTION-SCREEN COMMENT 1(79) text-t12.
    > SELECTION-SCREEN: END OF LINE.
    >
    > SELECTION-SCREEN END OF BLOCK block0.
    >
    > */ Selection and Input Parameters
    > SELECTION-SCREEN BEGIN OF BLOCK blocko WITH FRAME
    > TITLE text-001.
    >
    >
    >
    > SELECT-OPTIONS: s_vbeln FOR vbap-vbeln, "SO
    > s_auart FOR vbak-auart DEFAULT 'KB' OBLIGATORY,
    > s_matnr FOR vbap-matnr," obligatory,
    > s_mvgr1 FOR mvke-mvgr1,
    > s_erdat FOR vbap-erdat OBLIGATORY,
    > s_werks FOR vbap-werks,
    > s_lgort FOR vbap-lgort,
    > s_edatu FOR vbep-edatu.
    >
    > PARAMETERS: p_vkorg LIKE vbak-vkorg DEFAULT '5010'.
    >
    >
    >
    > SELECTION-SCREEN SKIP 2.
    > *----
    > -
    +EC1
    > * Addition +EC1
    > *----
    > -
    +EC1
    > PARAMETERS: p_vari LIKE disvariant-variant.
    > *----
    > -
    +EC1
    > * End Addition +EC1
    > *----
    > -
    +EC1
    > SELECTION-SCREEN END OF BLOCK blocko.
    >
    > *----
    > -
    +EC1
    > * Addition +EC1
    > *----
    > -
    +EC1
    > DATA: g_save(1) TYPE c,
    > * g_default(1) TYPE c,
    > g_exit(1) TYPE c,
    > gx_variant LIKE disvariant,
    > g_variant LIKE disvariant.
    > *----
    > -
    +EC1
    > * End Addition +EC1
    > *----
    > -
    +EC1
    >
    > * Initialization fieldcatalog
    > INITIALIZATION.
    >
    > * PERFORM clear_tables.
    >
    > g_repid = sy-repid.
    > PERFORM fieldcat_init USING gt_fieldcat[].
    > *----
    > -
    +EC1
    > * Addition +EC1
    > *----
    > -
    +EC1
    > g_save = 'A'.
    > PERFORM variant_init.
    > * Get default variant
    > gx_variant = g_variant.
    > CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    > EXPORTING
    > i_save = g_save
    > CHANGING
    > cs_variant = gx_variant
    > EXCEPTIONS
    > not_found = 2.
    > IF sy-subrc = 0.
    > p_vari = gx_variant-variant.
    > ENDIF.
    >
    > AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    > PERFORM f4_for_variant.
    >
    > AT SELECTION-SCREEN.
    > PERFORM auth_check. "+ESC
    > PERFORM pai_of_selection_screen.
    >
    >
    >
    > *----
    > -
    +EC1
    > * End Addition +EC1
    > *----
    > -
    +EC1
    >
    >
    > START-OF-SELECTION.
    >
    > PERFORM get_data.
    >
    > PERFORM alv.
    >
    > END-OF-SELECTION.
    >
    > *----
    > -
    > * FORM get_data *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > FORM get_data.
    > *CH01 - Added kwmeng(order qty) to selection,
    > excluded rejects
    > *JR -added soldto and shipto code
    SELECT a~vbeln a~posnr a~matnr a~erdat a~werks a~lgort
    a~kwmeng a~pstyv b~kunnr c~edatu
    CH01+
    INTO corresponding fields of table i_list
    FROM vbap AS a INNER JOIN vbak AS b ON a~vbeln = b~vbeln
    INNER JOIN vbep AS c ON a~vbeln = c~vbeln
    and a~posnr = c~posnr
    WHERE b~vkorg = p_vkorg
    AND a~werks IN s_werks
    AND a~lgort IN s_lgort
    AND b~auart IN s_auart
    AND a~vbeln IN s_vbeln
    AND a~erdat IN s_erdat
    AND a~abgru = ''" CH01+
    AND a~matnr IN s_matnr
    AND c~edatu IN s_edatu.
    > COMMIT WORK AND WAIT.
    >
    > LOOP AT i_list.
    > SELECT SINGLE mvgr1 INTO i_list-mvgr1 FROM mvke
    > WHERE matnr = i_list-matnr.
    > MODIFY i_list.
    > CLEAR: i_list.
    > ENDLOOP.
    > COMMIT WORK AND WAIT.
    >
    > LOOP AT i_list.
    > IF i_list-mvgr1 IN s_mvgr1.
    > CONTINUE.
    > ELSE.
    > DELETE i_list.
    > COMMIT WORK AND WAIT.
    > ENDIF.
    > ENDLOOP.
    > * CH01 - commented these lines out and redid logic
    > below
    > * LOOP AT i_list.
    > ** select single vbeln into lips-vbeln from lips
    > ** where vgbel = i_list-vbeln
    > ** and vgpos = i_list-posnr.
    > **
    > ** select single wadat_ist into i_list-wadat_ist from
    > likp
    > ** where vbeln = lips-vbeln.
    > *
    > * SELECT b~wadat_ist INTO i_list-wadat_ist
    > * FROM lips AS a INNER JOIN
    > * likp AS b ON a~vbeln = b~vbeln WHERE a~vgbel =
    > i_list-vbeln
    > * AND a~vgpos = i_list-posnr.
    > * MODIFY i_list.
    > * CLEAR: i_list, lips-vbeln.
    > * ENDSELECT.
    > * ENDLOOP.
    >
    > * CH01 - Changed to select multiple delivery lines &
    > del qty
    > * summing the total deliveries per OBD# and date
    > LOOP AT i_list.
    > SELECT avbeln sum( alfimg ) b~wadat_ist
    > INTO (i_list-obd , i_list-lfimg , i_list-wadat_ist)
    > FROM lips AS a INNER JOIN
    > likp AS b ON avbeln = bvbeln WHERE a~vgbel =
    > i_list-vbeln
    > AND a~vgpos = i_list-posnr
    > AND a~pstyv = i_list-pstyv
    > group by avbeln bwadat_ist.
    > i_list2 = i_list.
    > APPEND i_list2.
    > ENDSELECT.
    > IF sy-subrc <> 0.
    > i_list2 = i_list.
    > APPEND i_list2.
    > ENDIF.
    > ENDLOOP.
    > i_list[] = i_list2[].
    > *End CH01
    >
    > COMMIT WORK AND WAIT.
    >
    > LOOP AT i_list.
    > IF i_list-wadat_ist IS INITIAL.
    > CONTINUE.
    > ELSE.
    > i_list-days = i_list-wadat_ist - i_list-erdat.
    > ENDIF.
    > MODIFY i_list.
    > CLEAR: i_list.
    > COMMIT WORK AND WAIT.
    > ENDLOOP.
    >
    > COMMIT WORK AND WAIT.
    >
    > LOOP AT i_list.
    > IF i_list-vbeln IS INITIAL.
    > DELETE i_list.
    > ENDIF.
    > ENDLOOP.
    > COMMIT WORK AND WAIT.
    >
    > *JR
    > LOOP AT i_list.
    > SELECT SINGLE KUNNR INTO i_list-shipto FROM vbpa
    > WHERE vbeln = i_list-vbeln
    > AND parvw = 'WE'.
    > MODIFY i_list.
    > ENDLOOP.
    > *END JR
    >
    > gt_outtab[] = i_list[].
    > COMMIT WORK AND WAIT.
    >
    >
    > ENDFORM.
    >
    > *----
    > -
    > * FORM alv *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > FORM alv.
    >
    > PERFORM e03_eventtab_build USING gt_events[]. "+EC1
    > PERFORM e04_comment_build USING
    > gt_list_top_of_page[]. "+EC1
    > prognm = sy-repid. "+EC1
    >
    >
    > CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    > EXPORTING
    > i_callback_user_command = 'USER_COMMAND'
    > i_callback_program = g_repid
    > it_fieldcat = gt_fieldcat[]
    > it_events = gt_events[] "+ESC
    > it_sort = it_sort[]
    > *----
    > -
    +EC1
    > * Addition +EC1
    > *----
    > -
    +EC1
    > is_variant = g_variant
    > i_save = g_save
    > *----
    > -
    +EC1
    > * End Addition +EC1
    > *----
    > -
    +EC1
    > TABLES
    > t_outtab = gt_outtab.
    >
    > COMMIT WORK AND WAIT.
    >
    >
    > ENDFORM.
    >
    >
    > *----
    > -
    > * FORM fieldcat_init *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > * --> I_FIELDCAT *
    > *----
    > -
    > FORM fieldcat_init
    > USING i_fieldcat TYPE slis_t_fieldcat_alv.
    > DATA: ls_fieldcat TYPE slis_fieldcat_alv.
    > DATA: pos TYPE i VALUE 1.
    > CLEAR ls_fieldcat.
    <b>Please note to keep on incrementing pos variable for column position.</b>
    <b> pos = pos + 1.</b>
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'VBELN'.
    > ls_fieldcat-ref_tabname = 'VBAK'.
    > ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    <b> pos = pos + 1.</b> ===> after every append to field catalog.
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'POSNR'.
    > ls_fieldcat-ref_tabname = 'VBAP'.
    > ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    <b>> ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'ETERN'.
    > ls_fieldcat-ref_tabname = 'VBEP'.
    > ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.</b>
    >
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'MATNR'.
    > ls_fieldcat-ref_tabname = 'VBAP'.
    > ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'MVGR1'.
    > ls_fieldcat-ref_tabname = 'MVKE'.
    > ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'WERKS'.
    > ls_fieldcat-ref_tabname = 'VBAP'.
    > * ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'LGORT'.
    > ls_fieldcat-ref_tabname = 'VBAP'.
    > * ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'ERDAT'.
    > ls_fieldcat-ref_tabname = 'VBAP'.
    > * ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'WADAT_IST'.
    > ls_fieldcat-ref_tabname = 'LIKP'.
    > * ls_fieldcat-key = 'X'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'DAYS'.
    > ls_fieldcat-ref_fieldname = 'DAYS'.
    > ls_fieldcat-seltext_s = '# Of Days'.
    > ls_fieldcat-seltext_m = '# Of Days'.
    > ls_fieldcat-seltext_l = '# Of Days'.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > *Begin CH01
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'KWMENG'.
    > ls_fieldcat-ref_tabname = 'VBAP'.
    > ls_fieldcat-outputlen = 7.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'LFIMG'.
    > ls_fieldcat-ref_tabname = 'LIPS'.
    > ls_fieldcat-outputlen = 7.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'OBD'.
    > ls_fieldcat-seltext_s = 'OBD'.
    > ls_fieldcat-seltext_m = 'Outbound Del'.
    > ls_fieldcat-seltext_l = 'Outbound Delivery'.
    > ls_fieldcat-outputlen = 10.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > * ls_fieldcat-col_pos = pos.
    > * ls_fieldcat-fieldname = 'OBD_POS'.
    > * ls_fieldcat-seltext_s = 'OBD Ln'.
    > * ls_fieldcat-seltext_m = 'Outbound Del Ln'.
    > * ls_fieldcat-seltext_l = 'Outbound Del Line'.
    > * ls_fieldcat-outputlen = 10.
    > * APPEND ls_fieldcat TO i_fieldcat.
    > * CLEAR ls_fieldcat.
    > *
    > *End CH01
    >
    > *JR
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'SOLDTO'.
    > ls_fieldcat-ref_tabname = 'VBAP'.
    > ls_fieldcat-seltext_m = 'Sold To'.
    > ls_fieldcat-seltext_l = 'Sold To'.
    > ls_fieldcat-outputlen = 10.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'SHIPTO'.
    > ls_fieldcat-ref_tabname = 'VBPA'.
    > ls_fieldcat-seltext_m = 'Ship To'.
    > ls_fieldcat-seltext_l = 'Ship To'.
    > ls_fieldcat-outputlen = 10.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    > *END JR
    >
    > ls_fieldcat-col_pos = pos.
    > ls_fieldcat-fieldname = 'EDATU'.
    > ls_fieldcat-ref_tabname = 'VBEP'.
    > ls_fieldcat-seltext_m = 'Requested Delivery date'.
    > ls_fieldcat-seltext_l = 'Requested Delivery date'.
    > ls_fieldcat-outputlen = 20.
    > APPEND ls_fieldcat TO i_fieldcat.
    > CLEAR ls_fieldcat.
    >
    >
    > *FOR ALV SORT & SUBTOTAL
    > CLEAR it_sort.
    > it_sort-spos = '0'.
    > it_sort-fieldname = 'VBELN'.
    > it_sort-tabname = 'GT_OUTTAB'.
    > it_sort-up = 'X'.
    > * it_sort-subtot = 'X'.
    > APPEND it_sort.
    >
    > CLEAR it_sort.
    > it_sort-spos = '1'.
    > it_sort-fieldname = 'POSNR'.
    > it_sort-tabname = 'GT_OUTTAB'.
    > it_sort-up = 'X'.
    > it_sort-subtot = 'X'.
    > * it_sort-subtot = 'X'.
    > APPEND it_sort.
    > *
    > CLEAR it_sort.
    > it_sort-spos = '2'.
    > it_sort-fieldname = 'MATNR'.
    > it_sort-tabname = 'GT_OUTTAB'.
    > it_sort-up = 'X'.
    > * it_sort-subtot = 'X'.
    > APPEND it_sort.
    >
    > CLEAR it_sort.
    > it_sort-spos = '3'.
    > it_sort-fieldname = 'MVGR1'.
    > it_sort-tabname = 'GT_OUTTAB'.
    > it_sort-up = 'X'.
    > * it_sort-subtot = 'X'.
    > APPEND it_sort.
    > *
    > CLEAR it_sort.
    > it_sort-spos = '4'.
    > it_sort-fieldname = 'ERDAT'.
    > it_sort-tabname = 'GT_OUTTAB'.
    > it_sort-up = 'X'.
    > * it_sort-subtot = 'X'.
    > APPEND it_sort.
    >
    >
    > CLEAR it_sort.
    > it_sort-spos = '5'.
    > it_sort-fieldname = 'WADAT_IST'.
    > it_sort-tabname = 'GT_OUTTAB'.
    > it_sort-down = 'X'.
    > * it_sort-subtot = 'X'.
    > APPEND it_sort.
    >
    > *
    > * CLEAR it_sort.
    > * it_sort-spos = '6'.
    > * it_sort-fieldname = 'PERNR'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > ** it_sort-subtot = 'X'.
    > * APPEND it_sort.
    > *
    > *
    > * CLEAR it_sort.
    > * it_sort-spos = '7'.
    > * it_sort-fieldname = 'VORNA'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > ** it_sort-subtot = 'X'.
    > * APPEND it_sort.
    > *
    > * CLEAR it_sort.
    > * it_sort-spos = '8'.
    > * it_sort-fieldname = 'NACHN'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > ** it_sort-subtot = 'X'.
    > * APPEND it_sort.
    > *
    > * CLEAR it_sort.
    > * it_sort-spos = '9'.
    > * it_sort-fieldname = 'VKGRP'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > ** it_sort-subtot = 'X'.
    > * APPEND it_sort.
    > *
    > * CLEAR it_sort.
    > * it_sort-spos = '10'.
    > * it_sort-fieldname = 'VBELN'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > ** it_sort-subtot = 'X'.
    > * APPEND it_sort.
    > *
    > * CLEAR it_sort.
    > * it_sort-spos = '11'.
    > * it_sort-fieldname = 'ERDAT'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > ** it_sort-subtot = 'X'.
    > * APPEND it_sort.
    > *
    > * CLEAR it_sort.
    > * it_sort-spos = '12'.
    > * it_sort-fieldname = 'BEZEI'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > ** it_sort-subtot = 'X'.
    > * APPEND it_sort.
    > *
    >
    > * clear it_sort.
    > * it_sort-spos = '1'.
    > * it_sort-fieldname = 'BELNR'.
    > * it_sort-tabname = 'GT_OUTTAB'.
    > * it_sort-up = 'X'.
    > * append it_sort.
    >
    >
    > ENDFORM.
    >
    > *----
    > -
    +EC1
    > * Addition +EC1
    > *----
    > -
    +EC1
    > *&----
    > -
    > *& Form VARIANT_INIT
    > *&----
    > -
    > * text
    > *----
    > -
    > * --> p1 text
    > * <-- p2 text
    > *----
    > -
    > FORM variant_init.
    > *
    > CLEAR g_variant.
    > g_variant-report = g_repid.
    > ENDFORM. " VARIANT_INIT
    >
    >
    >
    > *----
    > -
    > * FORM f4_for_variant *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > FORM f4_for_variant.
    > *
    > CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    > EXPORTING
    > is_variant = g_variant
    > i_save = g_save
    > * it_default_fieldcat =
    > IMPORTING
    > e_exit = g_exit
    > es_variant = gx_variant
    > EXCEPTIONS
    > not_found = 2.
    > IF sy-subrc = 2.
    > MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
    > WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    > ELSE.
    > IF g_exit = space.
    > p_vari = gx_variant-variant.
    > ENDIF.
    > ENDIF.
    > ENDFORM.
    > *&----
    > -
    > *& Form PAI_OF_SELECTION_SCREEN
    > *&----
    > -
    > * text
    > *----
    > -
    > FORM pai_of_selection_screen.
    > *
    > IF NOT p_vari IS INITIAL.
    > MOVE g_variant TO gx_variant.
    > MOVE p_vari TO gx_variant-variant.
    > CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
    > EXPORTING
    > i_save = g_save
    > CHANGING
    > cs_variant = gx_variant.
    > g_variant = gx_variant.
    > ELSE.
    > PERFORM variant_init.
    > ENDIF.
    > ENDFORM. " PAI_OF_SELECTION_SCREEN
    > *----
    > -
    +EC1
    > * End Addition +EC1
    > *----
    > -
    +EC1
    >
    >
    > *----
    > -
    > * FORM e03_eventtab_build *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > * --> E03_LT_EVENTS *
    > *----
    > -
    > FORM e03_eventtab_build USING e03_lt_events TYPE
    > slis_t_event.
    > DATA: ls_event TYPE slis_alv_event.
    >
    > CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    > EXPORTING
    > i_list_type = 0
    > IMPORTING
    > et_events = e03_lt_events.
    > READ TABLE e03_lt_events WITH KEY name =
    > slis_ev_top_of_page
    > INTO ls_event.
    > IF sy-subrc = 0.
    > MOVE gc_formname_top_of_page TO ls_event-form.
    > APPEND ls_event TO e03_lt_events.
    > ENDIF.
    > ENDFORM.
    >
    > *----
    > -
    > * FORM e04_comment_build *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > * --> E04_LT_TOP_OF_PAGE *
    > *----
    > -
    > FORM e04_comment_build USING e04_lt_top_of_page TYPE
    > slis_t_listheader.
    > DATA: ls_line TYPE slis_listheader.
    >
    > *Report Title
    > CLEAR ls_line.
    > ls_line-typ = 'H'.
    > ls_line-info = text-007.
    > APPEND ls_line TO e04_lt_top_of_page.
    > *
    > *
    > **Doc Type Desc.
    > * clear ls_line.
    > * ls_line-typ = 'S'.
    > * ls_line-key = text-008.
    > ** ls_line-info = p_matnr.
    > * append ls_line to e04_lt_top_of_page.
    > *
    > * clear ls_line.
    > * ls_line-typ = 'S'.
    > * ls_line-key = text-009.
    > ** ls_line-info = p_werks.
    > * append ls_line to e04_lt_top_of_page.
    > *
    > *
    > * clear ls_line.
    > * ls_line-typ = 'S'.
    > * ls_line-key = text-010.
    > ** ls_line-info = p_stlan.
    > * append ls_line to e04_lt_top_of_page.
    > *
    > * clear ls_line.
    > * ls_line-typ = 'S'.
    > * ls_line-key = text-011.
    > ** ls_line-info = p_stlal.
    > * append ls_line to e04_lt_top_of_page.
    > *
    > * clear ls_line.
    > * ls_line-typ = 'S'.
    > * ls_line-key = text-012.
    > ** ls_line-info = p_stlal.
    > * append ls_line to e04_lt_top_of_page.
    >
    >
    >
    > ENDFORM.
    >
    > *----
    > -
    > * FORM top_of_page *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > FORM top_of_page.
    >
    > CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    > EXPORTING
    > it_list_commentary = gt_list_top_of_page.
    >
    >
    > ENDFORM.
    >
    > *----
    > -
    > * FORM auth_check *
    > *----
    > -
    > * ........ *
    > *----
    > -
    > FORM auth_check.
    >
    > AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'
    > ID 'VKORG' FIELD p_vkorg.
    > IF sy-subrc NE 0.
    > MESSAGE e054 WITH p_vkorg.
    > ENDIF.
    >
    >
    > ENDFORM. " auth_check
    >
    >
    > *&----
    > -
    > *& Form USER_COMMAND
    > *&----
    > -
    > FORM user_command USING r_ucomm LIKE sy-ucomm
    > rs_selfield TYPE slis_selfield.
    >
    > CASE r_ucomm.
    > WHEN '&IC1'.
    > PERFORM display_so_order USING r_ucomm
    > rs_selfield.
    >
    > ENDCASE.
    >
    > ENDFORM.
    >
    > *&----
    > -
    > *& Form display_sales_order
    > *&----
    > -
    > * text
    > *----
    > -
    > * -->P_R_UCOMM text
    > * -->P_RS_SELFIELD text
    > *----
    > -
    > FORM display_so_order USING r_ucomm LIKE sy-ucomm
    > rs_selfield TYPE slis_selfield.
    >
    > CASE rs_selfield-sel_tab_field.
    > WHEN '1-VBELN'.
    > SET PARAMETER ID 'AUN' FIELD rs_selfield-value.
    > CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
    > WHEN '1-MATNR'.
    > SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
    > CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
    > WHEN '1-OBD'.
    > SET PARAMETER ID 'VL' FIELD rs_selfield-value.
    > CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
    > WHEN OTHERS.
    > MESSAGE i000(z1) WITH 'Please Click on the Valid
    > Selection'.
    > EXIT.
    > ENDCASE.
    >
    >
    > ENDFORM. " display_sales_order
    >
    > *----
    > -
    > * FORM EDit_table *
    > *----
    > -
    > * ........ *
    > *----
    > -
    Message was edited by: Anurag Bankley

  • Purchase order Line item Excise Details

    Dear All..
                    In purchase order line item Excise Details Basic price and Excise 14% and 2%cess and 1%Se.Cess And cst 4% Are Stored in Which table.. or any standard report available for this.. Please Resolve this.
    Usefull Threads will Be Rewarded..
    Thanks & Regards
    Kumar

    for excise check table J_1IEXCHDR for header
    J_1IEXCDTL  for item excise
    The Table name used to find the Tax Values are
    KOMV: Pricing Communications-Condition Record
    KONV: Conditions (Transaction Data)
    From the above tables you can refer the fields below.
    KAWRT
    KBETR
    Fetch the corresponding records based on the field
    KNTYP
    hope it help
    regards
    kunal

  • One inspection lot for multiple materials of purchase order line items

    Hi All,
    My client requirement is one inspection lot for multiple materials of purchase order line items.
    Please share your thoughts.
    Thanks in advance for early reply.
    Regards,
    Jishu

    I totally agree with Amol.
    I don't think I would touch that development nor would I ever tell a client it could reliably be done through development.
    Knowing what I know about the table structures, I don't think you could create any development for this that could use a significant amount of the existing tables and functionality.  I think you'd have to create all your own Z tables and basically rebuild the functionality.  Tying it back in with SAP data will be difficult.
    You're even looking at all custom screens for your results recording and UD as well.  And if you have follow-on functions like batch classification requirements, batch determination, COA publication, results copy functions, use of DMR and sampling procedures, physical samples, quality notifications, etc. etc.. you could be looking a whole lot of development.
    Craig

  • Which table stores the condition values of a purchase order line item?

    Hi,
    Please let me know the table that stores the condition values of purchase order line items(when we click on conditions tab after selecting an item then we can see the condition types and there is a corresponding condition value for that condition type.
    My requirement is to get the actual price for a purchase order line item(it can be seen in the last line and it is calculated after considering all the condition types) and display this value in a custom report.
    Thanks,
    Ravindra

    Hi Ravindra
    You can find the conditions data for PO in TAble KONV.
    KONV-KSCH is the condition type
    KONV-KWERT is  the cond value
    KONV-KNUMH is the condition doc no. which is there in EKKO field KNUMH.
    So u have to make a link between KONV-KNUMH and EKKO-KNUMH.
    Thanks
    Vijeta

  • Source inspection before 365 days of delivery date of purchase order

    Hi Experts,
    Business wants to create source inspection lot well in advance before 365 days of delivery date of purchase order. this lot is required to record results.
    In SAP, transaction code QA51 allows only two digit characters for 'number of days for opening period' so system is not creating inspection lot for more than 99 days delivery date from current date.
    Please advise.

    Hi Patel, I really got interested on this particular issue because we have been using source inspection in our company for a while. After some investigation on ABAP code of report I will share with you my fact findings:
    1) System calculates the start date of source inspection (delivery date from PO - Leadtime from q-info record). For example, in my test case it was 14.08.2015 - 0 days. So field g_datum below will be 14.08.2015:
    2) System then checks if you are running the report in background (highlighted in yellow above). If so then it will check if the start date of inspection (g_datum) falls on opening horizon (g_datum_eroff). The opening horizon is calculated as per formula below (system login date + opening period). As an example: 14.08.2014 + 30 days = 13.09.2014.
    Default opening period (p_eroff) is 30 days:
    3) So all-in-all, when you are running QI07 online you´ll get a yellow traffic light on the long leadtime PO but you will be able to process it (on-line). However if you run the report in background (job scheduling) system will only create inspection lot to the relevant POs if the PO's delivery date falls on the 30 days window based upon the current date.

  • Posting multiple invoices against single purchase order line item

    Hi,
    We receive invoices on completion of certain milestones and Goods receipt is done when the final lot of material is delivered.  For example the purchase order may be to deliver 1 quantity of Machine.  Material is supplied in bits like Gear Box, Engine and body.  Invoice is received when Gear Box, Engine is supplied. Final invoicing is received on completion of delivery (taking into account what has already been delivered)
    Goods Receipt in SAP needs to be posted only once when complete machinery is delivered (the tracking for different parts delivered is done outside SAP).  However, the multiple invoice needs to be posted in SAP referring to same PO item (Please note PO quantity for complete assembled material is only 1).
    This needs to be treated as material and not service in SAP.  Can you please suggest how to book multiple invoices for same purchase order line item?
    Thanks

    Hi Charan
    Thanks for your reply.  However, both the options are not feasible.  Invoices can be received in different periods, sometimes over different months or years, hence needs to be booked immediately.
    Also, i cannot create material master for each component as the quantity for the final material is only 1.
    Any other alternatives?
    regards
    Sameer

  • Purchase order line item block

    Hi,
    Need to understand in what circumstance Purchase order line item gets blocked automatically. I have a situation in which net price is 0.01 and line item has got blocked automatically. This is through conversion objects(using BAPI_PO_CREATE). When manually created this works fine. Where can i see this standard behavior in customization. Any additional inputs will be helpfull.
    Regards,
    Kishan

    A BAPI is just a program that cannot do anything if it does not get filled with data.
    How does it get the data? What is made with the data in a framework program before the BAPI is called? This is were you or you ABAPer has to start analyzing. Of course the BAPI is not changed, but the data has to be read from a source and need to be transferred to a internal table which is then transferred to the BAPI. This all happens in a program that is developed by a programmer. Or do you call the BAPI via SE37 ?
    SAP does not set an item block by itself, SAP gives you an error message and stops you from saving, or gives a warning message and you confirm that you read it and can continue.

Maybe you are looking for

  • Having issues with Flash in Opera

    I have been having issues getting videos to work in my browser. I use Opera and it will not load anything Flash related. It gives me an error telling me to install the latest version of flash despite the fact that i have the latest version. If i load

  • Acrobat Forms - Make fillable text box appear after box checked or drop down menu item selected

    I have been asked to build an approvals form for my workplace however the approval processes vary considerably depending on the subject. I have been asked to create a list of topics in the form of check boxes or a drop down menu which will then popul

  • 'Replace all' in the code window

    Dear all - We have a problem with UK pound signs (that are hard-coded into our code) being converted to ¿¿ (two upside-down question-marks) when a DDL script is run via SQL*Plus. I'm looking into what I need to SET in order to prevent this from happe

  • What version of abobe do i need?

    What version of adobe do i need to have in order to be able to delete pages once a file in pdf?

  • Retrieve/Extract a portion of a string

    In a table I have a field with formula data. What I need to do is locate the "IF|" in the formula field and retrieve the data between the "IF|" and the next "|" following the "IF|". Formula data: IF-.16 (1.03*IF) ((IF)+.0959) Expected results: PIPE X