How to combine two Info provider data matained at different line items?

Hello Friends,
I have a requirement in which they want to combine the invoice line item data with the GL line item data , in which both are maintained at different line items.......
For e.g:
DSo 1:
Invoice no                Inv line item         Net price
5100000674            10                         300 
5100000674            20                         400
5100000674            30                         200
5100000674            40                         100 
DSO2:
Acc Doc no            Line item            GL account    Invoice number            amount
9480000000               1                      21110000         5100000674          100         
9480000000               2                      31110000         5100000674          200
I tried Infoset, but multiple lines are generating..... as both the line items are maintained at different line items..... Please help me with some ideas and suggestions.......
Thanks for your time..............................................................................

Hi,
You should maintain the InfoObejcts (Charecteristcis) in both DSO's other wise it will disiplay # in reports.
1. While loading the data to DSO's use LOOKUPs in transformations and load teh full fledged data to DSO-2, (in sequence if it will come in second place.)
2. Check with InfoSet Innrr/Outer Joins option.
Else use FM based on both DSO's  and cretae DataSourcea nd load the data to another DSO/Cube and build report on that.
Thanks
Reddy

Similar Messages

  • 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

  • How to combine two datarows (business component data) in BI Publisher

    Hi ,
    We are using BI Publisher in Siebel Environment.
    We have data coming from two business components (like from 2 diff tables)
    a) <?for-each:ssTest1?>
    b) <?for-each:ssTest2?>
    ssTest1 and ssTest2 are the business components
    We need to combine these 2 datarows (a&b) and show the data into a single combined data row for ex like <?for-each:ssTest1ssTest2?> and show all the fields in that.
    I'm not sure how we can combine these two data rows into a single combined data row and show the data.
    Any help from any one would be apprecated.
    Thanks
    PV
    Edited by: user8633002 on Oct 21, 2010 4:05 PM

    Hi sajid
    There was nothing more description about your issue in this site and I found an issue below is mostly like yours
    http://www.codeproject.com/Questions/855487/how-to-combine-two-table-value-in-rdlc-report
    In the issue above, if you want to show the two other tables in the report, I think you could combine the tables into one datatable joining on key. The link below show an example of a DataSet Helper from Microsoft about combine DataSets. Take note of
    the related content for other DataSet Helper examples. And then you could use the datatable in your RDLC.
    # HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET
    http://support.microsoft.com/kb/326080/en-us
    In an alternative way, I think you could create a view in the database which combine your tables and use it in your rdlc.
    In addition, your issue is about asp.net and you could get more support in the asp.net forum whose link as below.
    http://forums.asp.net
    Best Regards
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • How to combine sales and delivery data

    hi
    i have requirement to make a report from sales as well as deliveries. Important fields in report are sales document , material , plant , sales document type , country key , sold to party , ordered quantity , delivered quantity , price from vakon ( KBETR ), actual goods issue date.
    The required extractors are 2LIS_11_VASCL, 2LIS_11_V_SSL ,2LIS_11_VAKON.
    Problem is how to combine sales and delivery data as V_SSL has different key figures.Multicube is not the solution as dont have plant , sold to party and many other fields in V_SSL.
    Kindly suggest how to combine sales and deivery data.
    Regards,
    Monika

    I guess you do have shipping point in delivery.
    In most scenarios shipping point may not(or) may be same like order plant.
    Although they are different you can still roll up the delivery information to order level by plant since you have order # available as reference key in delivery.
    With this reference key you can convert all delivery information to order (item) level.
    I guess you can use one merge ODS with one cube (or) with 2 ODS for each at order level for validation.
    You may have to map delivery type to order type as per R3 configuration as well.
    speak with any Logistics guys for help.
    cheers
    Martin

  • Download info provider data in CSV

    Hello BI experts,
       i have a requirement to download the info provider data in a csv file. I am aware of GUI_DOWNLOAD Function Module but i am not sure which table should i use to extract data in a csv file. for example, if i need to download data from a infocube i need to write a program. can someone help me

    Hi,
    -> There are many options to download the data if you have application server you can mention the path (in listcube) where you want take the data and schedule a background job.
    ->You can also create a openhub on the cube and download the data.
    Hope this helps...........
    Rgs,
    I.Ravikanth

  • Full data load for vendor line items 0FI_GL_4

    Hi Experts,
    i need to delete the data from the vendor line items cube and load all the historic data from r/3 production, so how do i proceed, i am assuming that there is no setup table concept for this since its FI, so how do i do this and what are the steps that needs to be done on r/3 side as well as BW?
    Thanks,
    shetty.

    Its pretty simple in FI. There are no setup tables like LO extraction.
    1. Double click ont he cube in BW and delete all the requests. make sure all of them are deleted. (or) you can right click on the cube and say "delete data".
    2. As youa re working on production make sure ur requests and data are completely deleted. Check twice
    3. Activate your master data.
    4. replicate datasources and activate transfer structure in BW
    5. Load data from BW
                  I would think twice to delete data from a cube particularly in production. I don't know your situation but if I were u, I would create another cube copying the cube and then load all the R/3 data into the new one.
    Good luck.

  • How to upload a file which has more than 999 line item  through BDC ?

    Hello Techards
    Hi to all
    Can any body tell me how to upload a file which has more than 999 line item  through BDC for traction F-02 ?
    Thanks in advance.
    Shovan

    Hello Shovan,
    You split it up to post two accounting documents with the help of a "suspense" a/c.
    Say, you have to post the following line items below:
    line 1 - dr. - GL a/c X - $1000
    line 2 - cr. - GL a/c Y - $1
    line 3 - cr. - GL a/c Y - $1
    line 1001 - cr. - GL a/c Y - $1
    You cannot post the above as a single doc in SAP (because of technical reasons), so you need to break it up into 2 documents as below:
    Doc1
    line 1 - dr - GL a/c X - $1000
    line 2 - cr - GL a/c Y - $1
    line 3 - cr - GL a/c Y - $1
    line 998 - cr - GL a/c Y - $1
    line 999 - cr - SUSPENSE a/c - $3
    Doc2
    line 1 - dr - SUSPENSE a/c - $3
    line 2 - cr - GL a/c Y - $3
    Note that there is no incorrect impact on accounting as first we credit suspense a/c by $3 and next we debit the same suspense a/c by $3 as a result the effect is nil. Similarly, we credit $997 to GL a/c Y (which is less by $3) in the first doc which is compensated by the second doc by crediting the shortfall of $3.
    Hope this helps,
    Cheers,
    Sougata.

  • Legacy asset data upload for multiple line items

    Hello
    Legacy asset data upload for multiple line items- for example Building is an asset which is having different line items for purchasing of land,constructaion or renovation etc.........now to upload the legacy data what should be consider...only one line item for Building or numbers of line item.........
    which one is the proper way to do this exercise?
    regards

    Hi,
    It completely depends on clients requirement. but following are few approaches:
    1. Define Building as Asset Class.
    2. Create a Building at specific location at asset code and
    3. create asset sub numbers for other components.
    other approach would be:
    1. Define Building as Asset Class.
    2. Create a Building at specific location at asset code and
    3. create further asset codes for other components where field description will be used for relating each other.
    Regards,
    Sayujya

  • How user can get a Sales Text for the any Line Item in the Billing?

    Salute Masters ! !
    How user can get a Sales Text for the any Line Item in the Billing?
    It's coming for other Order (Line Item for Bought out Item at Project Site - Some Item they procure at project site & complete the task).
    Where I can configure in system for all.
    Rgds
    Srivastav
    09973504950

    Hi,
    Sales text can be copied from customer to order , order to delivery and delivery to billing .
    Check the T-code : VOTXN , do the customization as per your requirement.
    check the below link :
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/dd/55f993545a11d1a7020000e829fd11/content.htm

  • How to make the vendor column have figure in GRIR line item with RE document type?

    Dear Experts,
         Could you tell me how to make the vendor column have figure in GRIR line item whose document type is RE?
         Thanks!
    Xinling Zhang

    Hi ,
    You are using FAGLL03 .
    FAGLL03 report vendor code is blank
    vendor number in new FAGLL03 tcode (offsetting account information)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30b96fed-eb5d-2e10-1792-f3ff9f65df8a?QuickLink=index&…
    Also check OSS note
    Note 112312 - Line item: Display of offsetting a/c information
    Note 1034354 - FAGLL03: Display of offsetting account information
    Many Thanks

  • How to make the GL account discription possible in FAGLL03 line item display?

    Dear Experts,
        Could you tell me how to make the GL account discription possible in FAGLL03 line item display?
        I checked the layout, there is no account discription.
        How should I do?
    Thanks!
    Xinling Zhang

    Hi
    One you execute FAGLL03, go to Settings>Layout>Current Header Rows
    You can add some predefine characteristics here.
    I am not sure why the hyperlink is not working at your end. But you can search the SDN for special fields in FAGLL03 and you can get lot of posts for this document.
    Regards
    Sanil Bhandari

  • Retrieving the milestone dates for an opportunity line item

    Good afternoon experts,
    I am looking for a way to retrieve the milestone dates for an opportunity line item.  I have the line item GUID and need to find out the milestone dates for the item.
    Is there a table or FM that will allow me to do this?
    Thanks,
    Eric

    Hi Eric,
                     I think you can use the FM 'CRM_ORDER_READ'. Pass the guid of the transaction as input to the FM , milestones details you will get from the parameter 'ET_APPOINTMENT'.
    Hope this helps.
    Regards,
    Ruby.

  • " COMBINING TWO INFO-OBJECTS ! "

    Hai  Friends ,
                        I  am having 2 info-objects  : Info-object1 - length 60, Info-objec2 - Length -30. I have to combine these two Info-objects . Let anyone  know me the procedure forcombining these two Info-objects : Info-object1,Info-object2 .
        Waiting for your reply .

    Hi,
    Create the infoobject which contain the string.
    if CHAR1 is 30 and CHAR2 is 60, your new infoobject should be 90.
    In the transformation/update rule you concatenate the two infoobject.
    Concatenate is a function which is available in the formula builder, no ABAP needed
    In the Routine you reference at the uploaded Data with:
    concatenate COMM_STRUCTURE-infoobject1
    COMM_STRUCTURE-Infoobject2
    into RESULT.
    Thanks & Regards,
    Vipin

  • How to combine +two fields without submitting page (via AJAX/HTMLDB_Get)?

    Hi all,
    After my last contribution "Request for Scott Spendolini" I was able to create the scripts to update fields in forms without having to refresh the page. Thanks again to Scott, Carl and the others who helped me solving my problem.
    I have another question regarding this however. How do I combine two (or more) values on a form to fill a field with the values, for instance to create a unique Primary-key field?
    This is the example: combine the postcode and the house-number (and maybe an extension to the housenumber) in one field 'adrescode'. This uniquely identifies an adress in the Netherlands. I can 'get' the postcode to fill the first part of the adrescode, but how do I modify the scripts to 'get' the housenumber (huisnummer) and - if not left null - the extension to the housenumber?
    Here are the scripts I created to far:
    in the region source of the page I have the following Javascript:
    <script language="JavaScript1.1" type="text/javascript">
    function f_P52_getAdrescode ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=P52_getAdrescode',0);
    get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P52_ADRESCODE').value = gReturn  }
    else
    {  html_GetElement('P52_ADRESCODE').value = 'null'  }
    get = null;
    </script>
    and in the shared components of the application I have created an process P52_getAdrescode as follows:
    declare
      l_adrescode varchar2(16);
    begin
        l_adrescode := :P52_POSTCODE || :P52_HUISNR ;
        if :P52_HUISNRTOEVOEGING is null then
              NULL ;
        else
              l_adrescode := l_adrescode ||':'||:P52_HUISNRTOEVOEGING ;
        end if ;
        htp.prn(l_adrescode);
    -- dbms_output.put_line(l_adrescode);
    end;
    I ran this PL/SQL in the SQL-section of HTMLDB and it does what a expect: combine the values in a new string.
    In my page however, it only gets the value of postcode and puts this into the adrescode field.
    So my question is: how do I modify the Javascript (I Guess) so that also the fields 'huisnummer' and 'huisnummertoevoeging' end up in the adrescode field?
    Thanks for your help,
    Jan.

    Carl, Scott,
    I have two pages with exact the same fields and codings (as described before in this Post.
    I now have two different named functions and application processes, a javascript an process for each page. They both do the same thing, use the same code except for the page-number (:P52_ and :P92). I tried to make one process to replace both, but ran into problems when I changed the name in the get.add statement.
    Changing the get.add from: get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value) to: get.add('POSTCODE',html_GetElement('P52_POSTCODE').value) always ends up in what looks like a complete html-(source)dump of the page in the field that has to be updated. Even when I replace the :P52_POSTCODE in the application process as well Changing back the application process and the javascript to so that both javascript and process use the :P52_ again and the function returns the correct value again. What am I doing wrong?
    I requested an online-workspace to post the application to it, but have no answer to my request yet, so I can't provide a working example at the moment....
    Thanks for your help again,
    Jan.

  • How to combine two dimension in dashboard??

    Dear experts,
    I have a requirement that i need two combine two dimension in dashboard.
    Ex:-
    -  I have two different providers (Query1 and Query2) and both is having common dimension called Plant.
    - The plant from both query is having different values (for example, Query1 Plant = A,B,C and Query2 Plant = D,E,F,G)
    - Now I want the total list of plants from both query and list of plants will be used as filter on combo box in dashboard.
    Note: List of values for Plant (dimension) may increase or decrease from both query.
    Thanks and regards
    Vijay Muniraj

    Hi Vijay,
    How can you combine the 2 queries as a single query in dashboard?If i understood the query,use a Multiprovider for your requirement and get the combined results in single query and use Plant as single prompt in the dashboard(If you are getting data from BI).You cannot merge this behaviour in the dashboard.(In Web Intelligence you can merge it based on common dimension values only).
    Regards,
    Venkat

Maybe you are looking for