<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: EBELN in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799934#M343481</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The changes are marked in bold...I copied the code from your post and made the changes..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just copy the changes as mentioned..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done the user command for both the ALV FMs..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please go through till the end of the code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added a subroutine USER_COMMAND1..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ables: t001, " Company Codes&lt;/P&gt;&lt;P&gt;t001w, " Plants/Branches&lt;/P&gt;&lt;P&gt;lfa1, " Vendor Master&lt;/P&gt;&lt;P&gt;ska1, " GL Account Master&lt;/P&gt;&lt;P&gt;mara, " Material Master&lt;/P&gt;&lt;P&gt;ekko, " PO Header Data&lt;/P&gt;&lt;P&gt;cska, " Cost Elements&lt;/P&gt;&lt;P&gt;csks, " Cost Centers&lt;/P&gt;&lt;P&gt;bsis, " GL Accounts: Open Items Data&lt;/P&gt;&lt;P&gt;bkpf. " Accounting Doc: Header Data&lt;/P&gt;&lt;P&gt;type-pools : slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: g_repid like sy-repid,&lt;/P&gt;&lt;P&gt;g_exit type c,&lt;/P&gt;&lt;P&gt;g_events type slis_t_event,&lt;/P&gt;&lt;P&gt;g_list_top_of_page type slis_t_listheader,&lt;/P&gt;&lt;P&gt;g_exit_caused_by_caller,&lt;/P&gt;&lt;P&gt;g_exit_caused_by_user type slis_exit_by_user,&lt;/P&gt;&lt;P&gt;g_top_of_page type slis_formname value 'TOP_OF_PAGE',&lt;/P&gt;&lt;P&gt;g_variant like disvariant,&lt;/P&gt;&lt;P&gt;g_variant1 like disvariant, " To store variant - OS0160&lt;/P&gt;&lt;P&gt;g_var_save type c value 'A', " Save - OS0160&lt;/P&gt;&lt;P&gt;g_var_exit type c, " Exit - OS0160&lt;/P&gt;&lt;P&gt;g_save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;constants : c_x type c value 'X', " Flag&lt;/P&gt;&lt;P&gt;c_c type c value 'C', " Flag&lt;/P&gt;&lt;P&gt;c_l type c value 'L', " Flag&lt;/P&gt;&lt;P&gt;c_a type c value 'A', " Line Type&lt;/P&gt;&lt;P&gt;c_h type c value 'H', " Dr/Cr&lt;/P&gt;&lt;P&gt;c_s type c value 'S', " Line Type&lt;/P&gt;&lt;P&gt;c_mkpf(4) type c value 'MKPF', " Table&lt;/P&gt;&lt;P&gt;c_save type c value 'U', " OS0160&lt;/P&gt;&lt;P&gt;c_mat_obj like znablackbx-obj_id&lt;/P&gt;&lt;P&gt;value 'CIMMATNR'. "Object Id OS0335&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_bsis occurs 0,&lt;/P&gt;&lt;P&gt;bukrs like bsis-bukrs, " Company Code&lt;/P&gt;&lt;P&gt;hkont like bsis-hkont, " GR IR Account&lt;/P&gt;&lt;P&gt;gjahr like bsis-gjahr, " Fiscal Year&lt;/P&gt;&lt;P&gt;belnr like bsis-belnr, " Acc Document&lt;/P&gt;&lt;P&gt;buzei like bsis-buzei, " Item No&lt;/P&gt;&lt;P&gt;budat like bsis-budat, " Receipt Date(Posting)&lt;/P&gt;&lt;P&gt;monat like bsis-monat, " Period&lt;/P&gt;&lt;P&gt;end of i_bsis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_bseg occurs 0,&lt;/P&gt;&lt;P&gt;bukrs like bsis-bukrs, " Company Code&lt;/P&gt;&lt;P&gt;belnr like bsis-belnr, " Acc Document&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;buzei like bsis-buzei, " Item No "Comment CR 47607&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gjahr like bsis-gjahr, " Fiscal Year&lt;/P&gt;&lt;P&gt;buzei like bsis-buzei, " Item No "Insert CR 47607&lt;/P&gt;&lt;P&gt;shkzg like bseg-shkzg, " Dr/Cr Indicator&lt;/P&gt;&lt;P&gt;lifnr like bseg-lifnr, " Vendor Code&lt;/P&gt;&lt;P&gt;matnr like bseg-matnr, " Material No&lt;/P&gt;&lt;P&gt;ebeln like bseg-ebeln, " Purchase Order&lt;/P&gt;&lt;P&gt;ebelp like bseg-ebelp, " PO Item&lt;/P&gt;&lt;P&gt;werks like bseg-werks, " Plant&lt;/P&gt;&lt;P&gt;menge like bseg-menge, " PO Quantity&lt;/P&gt;&lt;P&gt;meins like bseg-meins, " UOM&lt;/P&gt;&lt;P&gt;dmbtr like bseg-dmbtr, " Amount in Local Currency&lt;/P&gt;&lt;P&gt;wrbtr like bseg-wrbtr, " Amount in Trans.Currency&lt;/P&gt;&lt;P&gt;bpmng like bseg-bpmng, " Order UOM&lt;/P&gt;&lt;P&gt;bprme like bseg-bprme, " Order Base UOM&lt;/P&gt;&lt;P&gt;end of i_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_bkpf occurs 0,&lt;/P&gt;&lt;P&gt;bukrs like bkpf-bukrs, " Company Code&lt;/P&gt;&lt;P&gt;belnr like bkpf-belnr, " Acc Document&lt;/P&gt;&lt;P&gt;gjahr like bkpf-gjahr, " Fiscal Year&lt;/P&gt;&lt;P&gt;waers like bkpf-waers, " Trans. Currency&lt;/P&gt;&lt;P&gt;awkey like bkpf-awkey, " Object Key&lt;/P&gt;&lt;P&gt;awtyp like bkpf-awtyp, " Reference Procedure&lt;/P&gt;&lt;P&gt;end of i_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_mseg occurs 0,&lt;/P&gt;&lt;P&gt;mblnr like mseg-mblnr, " Material Document&lt;/P&gt;&lt;P&gt;mjahr like mseg-mjahr, " Fiscal Year&lt;/P&gt;&lt;P&gt;bwart like mseg-bwart, " Movement Type&lt;/P&gt;&lt;P&gt;matnr like mseg-matnr, " Material No&lt;/P&gt;&lt;P&gt;menge like mseg-menge, " PO Quantity&lt;/P&gt;&lt;P&gt;meins like mseg-meins, " UOM&lt;/P&gt;&lt;P&gt;end of i_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_mbew occurs 0,&lt;/P&gt;&lt;P&gt;matnr like mbew-matnr, " Material No&lt;/P&gt;&lt;P&gt;werks like mbew-bwkey, " Plant&lt;/P&gt;&lt;P&gt;bklas like mbew-bklas, " Valuation Class&lt;/P&gt;&lt;P&gt;end of i_mbew.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_ekpo occurs 0,&lt;/P&gt;&lt;P&gt;ebeln like ekpo-ebeln, " Purchase Order&lt;/P&gt;&lt;P&gt;ebelp like ekpo-ebelp, " PO Item&lt;/P&gt;&lt;P&gt;ernam like ekko-ernam, " PO Creator&lt;/P&gt;&lt;P&gt;afnam like ekpo-afnam, " PO Requisitioner&lt;/P&gt;&lt;P&gt;matnr like ekpo-matnr, " Material No&lt;/P&gt;&lt;P&gt;txz01 like ekpo-txz01, " Material Text&lt;/P&gt;&lt;P&gt;bednr like ekpo-bednr, " Tracking number OS0335&lt;/P&gt;&lt;P&gt;end of i_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_ekkn occurs 0,&lt;/P&gt;&lt;P&gt;ebeln like ekkn-ebeln, " Purchase Order&lt;/P&gt;&lt;P&gt;ebelp like ekkn-ebelp, " PO Item&lt;/P&gt;&lt;P&gt;kostl like ekkn-kostl, " Cost Center&lt;/P&gt;&lt;P&gt;sakto like ekkn-sakto, " Cost Element&lt;/P&gt;&lt;P&gt;end of i_ekkn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_lfa1 occurs 0,&lt;/P&gt;&lt;P&gt;lifnr like lfa1-lifnr, " Vendor&lt;/P&gt;&lt;P&gt;name1 like lfa1-name1, " Name&lt;/P&gt;&lt;P&gt;end of i_lfa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_user occurs 0,&lt;/P&gt;&lt;P&gt;bname like v_username-bname, " User ID&lt;/P&gt;&lt;P&gt;name1 like v_username-name_text, " User Name&lt;/P&gt;&lt;P&gt;end of i_user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_final occurs 0,&lt;/P&gt;&lt;P&gt;lifnr like lfa1-lifnr, " Vendor&lt;/P&gt;&lt;P&gt;werks like bseg-werks, " Plant&lt;/P&gt;&lt;P&gt;ekgrp like ekko-ekgrp, " Purch Group&lt;/P&gt;&lt;P&gt;monat like bsis-monat, " Period&lt;/P&gt;&lt;P&gt;matnr like mara-matnr, " Material Number&lt;/P&gt;&lt;P&gt;frbnr like mkpf-frbnr, " Bill of lading no&lt;/P&gt;&lt;P&gt;bednr like ekpo-bednr, " Tracking no&lt;/P&gt;&lt;P&gt;xblnr like mkpf-xblnr, " Ref Doc No&lt;/P&gt;&lt;P&gt;bklas like mbew-bklas, " Val Class&lt;/P&gt;&lt;P&gt;ebeln like bseg-ebeln, " PO&lt;/P&gt;&lt;P&gt;ebelp like bseg-ebelp, " Po Item&lt;/P&gt;&lt;P&gt;crtor like v_username-name_text, " PO Creator&lt;/P&gt;&lt;P&gt;reqnr like v_username-name_text, " PO Requisitioner&lt;/P&gt;&lt;P&gt;kostl like ekkn-kostl, " Cost Center&lt;/P&gt;&lt;P&gt;sakto like ekkn-sakto, " Cost Element&lt;/P&gt;&lt;P&gt;budat like bsis-budat, " Rec. Date&lt;/P&gt;&lt;P&gt;name1 like lfa1-name1, " Vendor Name&lt;/P&gt;&lt;P&gt;belnr like bsis-belnr, " FI Document&lt;/P&gt;&lt;P&gt;bwart like mseg-bwart, " Movement Type&lt;/P&gt;&lt;P&gt;txz01 like ekpo-txz01, " Material Text&lt;/P&gt;&lt;P&gt;menge like bseg-menge, " Quantity&lt;/P&gt;&lt;P&gt;meins like bseg-meins, " UOM&lt;/P&gt;&lt;P&gt;dmbtr like bseg-dmbtr, " Local Amount&lt;/P&gt;&lt;P&gt;wrbtr like bseg-wrbtr, " Tran.Amount&lt;/P&gt;&lt;P&gt;waers like bkpf-waers, " Tran.Currency&lt;/P&gt;&lt;P&gt;status type c, " Material Status&lt;/P&gt;&lt;P&gt;end of i_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_fldcat type slis_t_fieldcat_alv. " Table - field catgory&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_sort type slis_t_sortinfo_alv. " Table - sort/Subtotals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: x_layout type slis_layout_alv, " Structure-layout&lt;/P&gt;&lt;P&gt;x_fldcat like line of i_fldcat, " Structure-field catagory&lt;/P&gt;&lt;P&gt;x_sort like line of i_sort. " Structure-Sort/Subtotals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen : begin of block b1 with frame title text-000.&lt;/P&gt;&lt;P&gt;parameters:&lt;/P&gt;&lt;P&gt;p_bukrs like t001-bukrs obligatory. " Company Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select-options:&lt;/P&gt;&lt;P&gt;s_grira for ska1-saknr default '0241101000' obligatory, " Account&lt;/P&gt;&lt;P&gt;s_budat for bkpf-budat, " Posting Date&lt;/P&gt;&lt;P&gt;s_werks for t001w-werks, " Plant&lt;/P&gt;&lt;P&gt;s_ekgrp for ekko-ekgrp, " Purch. Group&lt;/P&gt;&lt;P&gt;s_lifnr for lfa1-lifnr, " Vendor&lt;/P&gt;&lt;P&gt;s_matnr for mara-matnr, " Material Number&lt;/P&gt;&lt;P&gt;s_kostl for csks-kostl, " Cost Center&lt;/P&gt;&lt;P&gt;s_kstar for cska-kstar, " Cost Element&lt;/P&gt;&lt;P&gt;s_ebeln for ekko-ebeln, " Purchase Order&lt;/P&gt;&lt;P&gt;s_monat for bsis-monat. " Period&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip.&lt;/P&gt;&lt;P&gt;parameters:&lt;/P&gt;&lt;P&gt;p_incmt as checkbox default 'X',&lt;/P&gt;&lt;P&gt;p_incnm as checkbox default 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip. " OS0160&lt;/P&gt;&lt;P&gt;parameters: p_disvar like disvariant-variant modif id v1. " OS0160&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;initialization.&lt;/P&gt;&lt;P&gt;g_repid = sy-repid.&lt;/P&gt;&lt;P&gt;perform layout_init using x_layout.&lt;/P&gt;&lt;P&gt;perform eventtab_build using g_events[].&lt;/P&gt;&lt;P&gt;g_variant-report = g_repid.&lt;/P&gt;&lt;P&gt;g_save = 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform validate_screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value-request for p_disvar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform f_get_var_list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa_ekko,&lt;/P&gt;&lt;P&gt;ebeln like ekko-ebeln,&lt;/P&gt;&lt;P&gt;ekorg like ekko-ekorg,&lt;/P&gt;&lt;P&gt;ekgrp like ekko-ekgrp,&lt;/P&gt;&lt;P&gt;END OF wa_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: v_repid TYPE syrepid.&lt;/P&gt;&lt;P&gt;v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA it_bseg LIKE STANDARD TABLE OF i_bseg&lt;/P&gt;&lt;P&gt;WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM bseg&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE it_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_program_name = v_repid&lt;/P&gt;&lt;P&gt;i_internal_tabname = 'i_bseg'&lt;/P&gt;&lt;P&gt;i_inclname = v_repid&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;ct_fieldcat = i_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I_BSEG[] = IT_BSEG[].&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_callback_program = v_repid&lt;/P&gt;&lt;P&gt;it_fieldcat = i_fldcat&lt;/P&gt;&lt;P&gt;i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;t_outtab = it_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM user_command USING ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ucomm = '&amp;amp;IC1' and selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_bseg INDEX selfield-tabindex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'BES' FIELD i_bseg-ebeln.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form validate_screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of Company Code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear t001.&lt;/P&gt;&lt;P&gt;if not p_bukrs is initial.&lt;/P&gt;&lt;P&gt;select single bukrs&lt;/P&gt;&lt;P&gt;into t001-bukrs&lt;/P&gt;&lt;P&gt;from t001&lt;/P&gt;&lt;P&gt;where bukrs eq p_bukrs.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid Company Code'(012).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of GL Account (GR/IR)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear ska1.&lt;/P&gt;&lt;P&gt;if not s_grira[] is initial.&lt;/P&gt;&lt;P&gt;select saknr&lt;/P&gt;&lt;P&gt;into ska1-saknr&lt;/P&gt;&lt;P&gt;from ska1&lt;/P&gt;&lt;P&gt;up to 1 rows&lt;/P&gt;&lt;P&gt;where saknr in s_grira.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid GR/IR Account'(013).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of Vendor Code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear lfa1.&lt;/P&gt;&lt;P&gt;if not s_lifnr[] is initial.&lt;/P&gt;&lt;P&gt;select single lifnr&lt;/P&gt;&lt;P&gt;into lfa1-lifnr&lt;/P&gt;&lt;P&gt;from lfa1&lt;/P&gt;&lt;P&gt;where lifnr in s_lifnr.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid Vendor'(001).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of Plant Code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear t001w.&lt;/P&gt;&lt;P&gt;if not s_werks[] is initial.&lt;/P&gt;&lt;P&gt;select single werks&lt;/P&gt;&lt;P&gt;into t001w-werks&lt;/P&gt;&lt;P&gt;from t001w&lt;/P&gt;&lt;P&gt;where werks in s_werks.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid Plant'(014).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of Material Code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear mara.&lt;/P&gt;&lt;P&gt;if not s_matnr[] is initial.&lt;/P&gt;&lt;P&gt;select single matnr&lt;/P&gt;&lt;P&gt;into mara-matnr&lt;/P&gt;&lt;P&gt;from mara&lt;/P&gt;&lt;P&gt;where matnr in s_matnr.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid Material'(015).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of Purchase Order&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear ekko.&lt;/P&gt;&lt;P&gt;if not s_ebeln[] is initial.&lt;/P&gt;&lt;P&gt;select single ebeln&lt;/P&gt;&lt;P&gt;into ekko-ebeln&lt;/P&gt;&lt;P&gt;from ekko&lt;/P&gt;&lt;P&gt;where ebeln in s_ebeln.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid Purchase Order'(016).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of Cost Center&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear csks.&lt;/P&gt;&lt;P&gt;if not s_kostl[] is initial.&lt;/P&gt;&lt;P&gt;select kostl&lt;/P&gt;&lt;P&gt;into csks-kostl&lt;/P&gt;&lt;P&gt;from csks&lt;/P&gt;&lt;P&gt;up to 1 rows&lt;/P&gt;&lt;P&gt;where kostl in s_kostl.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid Cost Center'(017).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validation of Cost Element&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear cska.&lt;/P&gt;&lt;P&gt;if not s_kstar[] is initial.&lt;/P&gt;&lt;P&gt;select kstar&lt;/P&gt;&lt;P&gt;into cska-kstar&lt;/P&gt;&lt;P&gt;from cska&lt;/P&gt;&lt;P&gt;up to 1 rows&lt;/P&gt;&lt;P&gt;where kstar in s_kstar.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Enter Valid Cost Element'(018).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Validate Display variant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if not p_disvar is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g_variant-variant = p_disvar.&lt;/P&gt;&lt;P&gt;if not g_variant-variant is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Function module to Check existence of a display variant&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call function 'REUSE_ALV_VARIANT_EXISTENCE'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;i_save = c_save&lt;/P&gt;&lt;P&gt;changing&lt;/P&gt;&lt;P&gt;cs_variant = g_variant&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;wrong_input = 1&lt;/P&gt;&lt;P&gt;not_found = 2&lt;/P&gt;&lt;P&gt;program_error = 3&lt;/P&gt;&lt;P&gt;others = 4.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message e899 with 'Please Enter Valid ALV Variant'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of insert by OS0160&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. "validate_screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form read_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Data from the database Tables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form read_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of changes CR 49329&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;data: begin of i_bseg_lifnr occurs 0,&lt;/P&gt;&lt;P&gt;bukrs like bseg-bukrs,&lt;/P&gt;&lt;P&gt;belnr like bseg-belnr,&lt;/P&gt;&lt;P&gt;gjahr like bseg-gjahr,&lt;/P&gt;&lt;P&gt;lifnr like bseg-lifnr,&lt;/P&gt;&lt;P&gt;end of i_bseg_lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_bsis_belnr occurs 0,&lt;/P&gt;&lt;P&gt;bukrs like bseg-bukrs,&lt;/P&gt;&lt;P&gt;belnr like bseg-belnr,&lt;/P&gt;&lt;P&gt;gjahr like bseg-gjahr,&lt;/P&gt;&lt;P&gt;end of i_bsis_belnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of changes CR 49329&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_ekgrp like ekko-ekgrp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Accounting Documents for the GR/IR Account Entered on&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Selection Screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear i_bsis.&lt;/P&gt;&lt;P&gt;refresh i_bsis.&lt;/P&gt;&lt;P&gt;select bukrs " Company Code&lt;/P&gt;&lt;P&gt;hkont " GR IR Account&lt;/P&gt;&lt;P&gt;gjahr " Fiscal Year&lt;/P&gt;&lt;P&gt;belnr " Acc Document&lt;/P&gt;&lt;P&gt;buzei " Item No&lt;/P&gt;&lt;P&gt;budat " Receipt Date(Posting)&lt;/P&gt;&lt;P&gt;monat " Period&lt;/P&gt;&lt;P&gt;into table i_bsis&lt;/P&gt;&lt;P&gt;from bsis&lt;/P&gt;&lt;P&gt;where bukrs = p_bukrs&lt;/P&gt;&lt;P&gt;and hkont in s_grira&lt;/P&gt;&lt;P&gt;and budat in s_budat&lt;/P&gt;&lt;P&gt;and monat in s_monat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message i899 with 'No data found'(043).&lt;/P&gt;&lt;P&gt;g_exit = c_x.&lt;/P&gt;&lt;P&gt;stop.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_bsis by bukrs hkont gjahr belnr buzei.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Vendor,PO,Material,Qty details from BSEG Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if not i_bsis[] is initial.&lt;/P&gt;&lt;P&gt;clear i_bseg.&lt;/P&gt;&lt;P&gt;refresh i_bseg.&lt;/P&gt;&lt;P&gt;select bukrs " Company Code&lt;/P&gt;&lt;P&gt;belnr " Acc Document&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;buzei " Item No "Comment CR 47607&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;gjahr " Fiscal Year&lt;/P&gt;&lt;P&gt;buzei " Item No "Insert CR 47607&lt;/P&gt;&lt;P&gt;shkzg " Dr/Cr Indicator&lt;/P&gt;&lt;P&gt;lifnr " Vendor Code&lt;/P&gt;&lt;P&gt;matnr " Material No&lt;/P&gt;&lt;P&gt;ebeln " Purchase Order&lt;/P&gt;&lt;P&gt;ebelp " PO Item&lt;/P&gt;&lt;P&gt;werks " Plant&lt;/P&gt;&lt;P&gt;menge " PO Quantity&lt;/P&gt;&lt;P&gt;meins " UOM&lt;/P&gt;&lt;P&gt;dmbtr " Amount in Local Currency&lt;/P&gt;&lt;P&gt;wrbtr " Amount in Trans.Currency&lt;/P&gt;&lt;P&gt;bpmng " Order UOM&lt;/P&gt;&lt;P&gt;bprme " Order Base UOM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into table i_bseg&lt;/P&gt;&lt;P&gt;from bseg&lt;/P&gt;&lt;P&gt;for all entries in i_bsis&lt;/P&gt;&lt;P&gt;where bukrs = p_bukrs&lt;/P&gt;&lt;P&gt;and belnr = i_bsis-belnr&lt;/P&gt;&lt;P&gt;and gjahr = i_bsis-gjahr&lt;/P&gt;&lt;P&gt;and buzei = i_bsis-buzei&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and lifnr in s_lifnr &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;and werks in s_werks&lt;/P&gt;&lt;P&gt;and matnr in s_matnr&lt;/P&gt;&lt;P&gt;and ebeln in s_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;sort i_bseg by bukrs belnr buzei gjahr. "&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;sort i_bseg by bukrs belnr gjahr buzei. " &lt;/P&gt;&lt;P&gt;check not i_bseg[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of changes &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at i_bsis.&lt;/P&gt;&lt;P&gt;i_bsis_belnr-bukrs = i_bsis-bukrs.&lt;/P&gt;&lt;P&gt;i_bsis_belnr-belnr = i_bsis-belnr.&lt;/P&gt;&lt;P&gt;i_bsis_belnr-gjahr = i_bsis-gjahr.&lt;/P&gt;&lt;P&gt;append i_bsis_belnr.&lt;/P&gt;&lt;P&gt;clear i_bsis_belnr.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_bsis_belnr by bukrs belnr gjahr.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from i_bsis_belnr.&lt;/P&gt;&lt;P&gt;*-- Getting the lifnr from bseg&lt;/P&gt;&lt;P&gt;select bukrs&lt;/P&gt;&lt;P&gt;belnr&lt;/P&gt;&lt;P&gt;gjahr&lt;/P&gt;&lt;P&gt;lifnr&lt;/P&gt;&lt;P&gt;into table i_bseg_lifnr&lt;/P&gt;&lt;P&gt;from bseg&lt;/P&gt;&lt;P&gt;for all entries in i_bsis_belnr&lt;/P&gt;&lt;P&gt;where bukrs = p_bukrs&lt;/P&gt;&lt;P&gt;and belnr = i_bsis_belnr-belnr&lt;/P&gt;&lt;P&gt;and gjahr = i_bsis_belnr-gjahr&lt;/P&gt;&lt;P&gt;and lifnr in s_lifnr&lt;/P&gt;&lt;P&gt;and KOART = 'K'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;sort i_bseg_lifnr by bukrs belnr gjahr.&lt;/P&gt;&lt;P&gt;*-- Modify the BSEG internal table with lifnr.&lt;/P&gt;&lt;P&gt;loop at i_bseg where lifnr = ' '.&lt;/P&gt;&lt;P&gt;read table i_bseg_lifnr with key bukrs = i_bseg-bukrs&lt;/P&gt;&lt;P&gt;belnr = i_bseg-belnr&lt;/P&gt;&lt;P&gt;gjahr = i_bseg-gjahr&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_bseg-lifnr = i_bseg_lifnr-lifnr.&lt;/P&gt;&lt;P&gt;modify i_bseg.&lt;/P&gt;&lt;P&gt;clear i_bseg.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;free i_bseg_lifnr.&lt;/P&gt;&lt;P&gt;free i_bsis_belnr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete i_bseg where not lifnr in s_lifnr. " CR53283 OS0160 06.23.2006&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of changes CR 49329&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Material And Description from EKPO Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if not i_bseg[] is initial.&lt;/P&gt;&lt;P&gt;clear i_ekpo.&lt;/P&gt;&lt;P&gt;refresh i_ekpo.&lt;/P&gt;&lt;P&gt;select b~ebeln " Purchase Order&lt;/P&gt;&lt;P&gt;b~ebelp " PO Item&lt;/P&gt;&lt;P&gt;a~ernam " PO Creator&lt;/P&gt;&lt;P&gt;b~afnam " PO Requisitioner&lt;/P&gt;&lt;P&gt;b~matnr " Material No&lt;/P&gt;&lt;P&gt;b~txz01 " Material Text&lt;/P&gt;&lt;P&gt;b~bednr " Tracking no OS0335&lt;/P&gt;&lt;P&gt;into table i_ekpo&lt;/P&gt;&lt;P&gt;from ekpo as b join ekko as a&lt;/P&gt;&lt;P&gt;on b~ebeln = a~ebeln&lt;/P&gt;&lt;P&gt;for all entries in i_bseg&lt;/P&gt;&lt;P&gt;where b~ebeln = i_bseg-ebeln&lt;/P&gt;&lt;P&gt;and b~ebelp = i_bseg-ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_ekpo by ebeln ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the PO Creator and PO Requisitioner Name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if not i_ekpo[] is initial.&lt;/P&gt;&lt;P&gt;select bname " UserID&lt;/P&gt;&lt;P&gt;name_text " User Name&lt;/P&gt;&lt;P&gt;into table i_user&lt;/P&gt;&lt;P&gt;from v_username&lt;/P&gt;&lt;P&gt;for all entries in i_ekpo&lt;/P&gt;&lt;P&gt;where bname = i_ekpo-ernam or&lt;/P&gt;&lt;P&gt;bname = i_ekpo-afnam.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;sort i_user by bname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Valuation Class from MBEW Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear i_mbew.&lt;/P&gt;&lt;P&gt;refresh i_mbew.&lt;/P&gt;&lt;P&gt;select matnr " Material No&lt;/P&gt;&lt;P&gt;bwkey " Plant&lt;/P&gt;&lt;P&gt;bklas " Valuation Class&lt;/P&gt;&lt;P&gt;into table i_mbew&lt;/P&gt;&lt;P&gt;from mbew&lt;/P&gt;&lt;P&gt;for all entries in i_bseg&lt;/P&gt;&lt;P&gt;where matnr = i_bseg-matnr&lt;/P&gt;&lt;P&gt;and bwkey = i_bseg-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_mbew by matnr werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Cost Center and Cost Element of the PO from EKKN Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear i_ekkn.&lt;/P&gt;&lt;P&gt;refresh i_ekkn.&lt;/P&gt;&lt;P&gt;select ebeln " Purchase Order&lt;/P&gt;&lt;P&gt;ebelp " PO Item&lt;/P&gt;&lt;P&gt;kostl " Cost Center&lt;/P&gt;&lt;P&gt;sakto " Cost Element&lt;/P&gt;&lt;P&gt;into table i_ekkn&lt;/P&gt;&lt;P&gt;from ekkn&lt;/P&gt;&lt;P&gt;for all entries in i_bseg&lt;/P&gt;&lt;P&gt;where ebeln = i_bseg-ebeln&lt;/P&gt;&lt;P&gt;and ebelp = i_bseg-ebelp&lt;/P&gt;&lt;P&gt;and kostl in s_kostl&lt;/P&gt;&lt;P&gt;and sakto in s_kstar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_ekkn by ebeln ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Vendor Name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear i_lfa1.&lt;/P&gt;&lt;P&gt;refresh i_lfa1.&lt;/P&gt;&lt;P&gt;select lifnr " Vendor&lt;/P&gt;&lt;P&gt;name1 " Name&lt;/P&gt;&lt;P&gt;into table i_lfa1&lt;/P&gt;&lt;P&gt;from lfa1&lt;/P&gt;&lt;P&gt;for all entries in i_bseg&lt;/P&gt;&lt;P&gt;where lifnr = i_bseg-lifnr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;sort i_lfa1 by lifnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Select the Trans.Currency from BKPF Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear i_bkpf.&lt;/P&gt;&lt;P&gt;refresh i_bkpf.&lt;/P&gt;&lt;P&gt;select bukrs " Company Code&lt;/P&gt;&lt;P&gt;belnr " Acc Document&lt;/P&gt;&lt;P&gt;gjahr " Fiscal Year&lt;/P&gt;&lt;P&gt;waers " Trans. Currency&lt;/P&gt;&lt;P&gt;awkey " Object Key&lt;/P&gt;&lt;P&gt;awtyp " Reference Procedure&lt;/P&gt;&lt;P&gt;into table i_bkpf&lt;/P&gt;&lt;P&gt;from bkpf&lt;/P&gt;&lt;P&gt;for all entries in i_bsis&lt;/P&gt;&lt;P&gt;where bukrs = p_bukrs&lt;/P&gt;&lt;P&gt;and belnr = i_bsis-belnr&lt;/P&gt;&lt;P&gt;and gjahr = i_bsis-gjahr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;sort i_bkpf by bukrs belnr gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the Quantity and UOM of Material from MSEG Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if not i_bkpf[] is initial.&lt;/P&gt;&lt;P&gt;clear i_mseg.&lt;/P&gt;&lt;P&gt;refresh i_mseg.&lt;/P&gt;&lt;P&gt;select mblnr " Material Document&lt;/P&gt;&lt;P&gt;mjahr " Fiscal Year&lt;/P&gt;&lt;P&gt;bwart " Movement Type&lt;/P&gt;&lt;P&gt;matnr " Material No&lt;/P&gt;&lt;P&gt;menge " PO Quantity&lt;/P&gt;&lt;P&gt;meins " UOM&lt;/P&gt;&lt;P&gt;into table i_mseg&lt;/P&gt;&lt;P&gt;from mseg&lt;/P&gt;&lt;P&gt;for all entries in i_bkpf&lt;/P&gt;&lt;P&gt;where mblnr = i_bkpf-awkey(10).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;sort i_mseg by mblnr mjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Move the data to Final Output Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at i_bsis.&lt;/P&gt;&lt;P&gt;i_final-belnr = i_bsis-belnr. " FI Document&lt;/P&gt;&lt;P&gt;i_final-monat = i_bsis-monat. " Period&lt;/P&gt;&lt;P&gt;i_final-budat = i_bsis-budat. " Rec. Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read Vendor, Plant, PO Document, Local And Trans.Amounts&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;from BSEG Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;read table i_bseg with key bukrs = i_bsis-bukrs&lt;/P&gt;&lt;P&gt;belnr = i_bsis-belnr&lt;/P&gt;&lt;P&gt;gjahr = i_bsis-gjahr&lt;/P&gt;&lt;P&gt;buzei = i_bsis-buzei&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-lifnr = i_bseg-lifnr. " Vendor&lt;/P&gt;&lt;P&gt;i_final-werks = i_bseg-werks. " Plant&lt;/P&gt;&lt;P&gt;i_final-ebeln = i_bseg-ebeln. " PO&lt;/P&gt;&lt;P&gt;i_final-ebelp = i_bseg-ebelp. " PO Item&lt;/P&gt;&lt;P&gt;i_final-dmbtr = i_bseg-dmbtr. " Local Amount&lt;/P&gt;&lt;P&gt;i_final-wrbtr = i_bseg-wrbtr. " Tran.Amount&lt;/P&gt;&lt;P&gt;i_final-menge = i_bseg-bpmng. " Order Quantity&lt;/P&gt;&lt;P&gt;i_final-meins = i_bseg-bprme. " Order Base UOM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Filter data based upon Purch Org.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;select single ekgrp&lt;/P&gt;&lt;P&gt;into l_ekgrp&lt;/P&gt;&lt;P&gt;from ekko&lt;/P&gt;&lt;P&gt;where ebeln = i_bseg-ebeln.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;clear i_final-ekgrp.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;if l_ekgrp in s_ekgrp.&lt;/P&gt;&lt;P&gt;i_final-ekgrp = l_ekgrp.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;clear i_final.&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For Credit Indicator(SHKZG = H) amounts should be (-)ve&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if i_bseg-shkzg = c_h.&lt;/P&gt;&lt;P&gt;i_final-dmbtr = i_final-dmbtr * -1.&lt;/P&gt;&lt;P&gt;i_final-wrbtr = i_final-wrbtr * -1.&lt;/P&gt;&lt;P&gt;i_final-menge = i_final-menge * -1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Material and its Description from EKPO Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;read table i_ekpo with key ebeln = i_bseg-ebeln&lt;/P&gt;&lt;P&gt;ebelp = i_bseg-ebelp&lt;/P&gt;&lt;P&gt;matnr = i_bseg-matnr&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-matnr = i_ekpo-matnr. " Material Number&lt;/P&gt;&lt;P&gt;i_final-txz01 = i_ekpo-txz01. " Material Text&lt;/P&gt;&lt;P&gt;i_final-bednr = i_ekpo-bednr. " Tracking no. OS0335&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the PO Creator Name/ID&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear i_user.&lt;/P&gt;&lt;P&gt;read table i_user with key bname = i_ekpo-ernam binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-crtor = i_user-name1. " Po Creator Name&lt;/P&gt;&lt;P&gt;else. " CR 49329&lt;/P&gt;&lt;P&gt;i_final-crtor = i_ekpo-ernam. " CR 49329&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the PO Requisitioner Name/ID&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;clear i_user.&lt;/P&gt;&lt;P&gt;read table i_user with key bname = i_ekpo-afnam binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-reqnr = i_user-name1. " Po Requisitioner Name&lt;/P&gt;&lt;P&gt;else. " CR 49329&lt;/P&gt;&lt;P&gt;i_final-reqnr = i_ekpo-afnam. " CR 49329&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate the Material Status depending on the Input Checkbox&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;On Selection Screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if not i_ekpo-matnr is initial.&lt;/P&gt;&lt;P&gt;i_final-status = c_x.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the PO related Cost Element and Cost Centers&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;from EKKN Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;read table i_ekkn with key ebeln = i_bseg-ebeln&lt;/P&gt;&lt;P&gt;ebelp = i_bseg-ebelp&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-kostl = i_ekkn-kostl. " Cost Center&lt;/P&gt;&lt;P&gt;i_final-sakto = i_ekkn-sakto. " Cost Element&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Valuation Class from MBEW Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;read table i_mbew with key matnr = i_bseg-matnr&lt;/P&gt;&lt;P&gt;werks = i_bseg-werks&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-bklas = i_mbew-bklas. " Val Class&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Vendor Name from LFA1 Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;read table i_lfa1 with key lifnr = i_bseg-lifnr&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-name1 = i_lfa1-name1. " Vendor Name&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;clear i_final.&lt;/P&gt;&lt;P&gt;continue.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Transaction Currency from BKPF Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;read table i_bkpf with key bukrs = i_bsis-bukrs&lt;/P&gt;&lt;P&gt;belnr = i_bsis-belnr&lt;/P&gt;&lt;P&gt;gjahr = i_bsis-gjahr&lt;/P&gt;&lt;P&gt;binary search.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;i_final-waers = i_bkpf-waers. " Tran.Currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read the Movement Type for all Material Related&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Documents from MSEG Internal Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if i_bkpf-awtyp = c_mkpf.&lt;/P&gt;&lt;P&gt;read table i_mseg with key mblnr = i_bkpf-awkey(10)&lt;/P&gt;&lt;P&gt;mjahr = i_bkpf-awkey+10(4).&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of changes by OS0335 on 09/16/2004&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;select single frbnr " Bill of lading No.&lt;/P&gt;&lt;P&gt;xblnr " Reference Doc No OS0160 CR54527&lt;/P&gt;&lt;P&gt;into (i_final-frbnr,&lt;/P&gt;&lt;P&gt;i_final-xblnr)&lt;/P&gt;&lt;P&gt;from mkpf&lt;/P&gt;&lt;P&gt;where mblnr eq i_mseg-mblnr&lt;/P&gt;&lt;P&gt;and mjahr eq i_mseg-mjahr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of changes by OS0335 on 09/16/2004&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;i_final-bwart = i_mseg-bwart. " Movement Type&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append i_final.&lt;/P&gt;&lt;P&gt;clear i_final.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_final by lifnr werks monat matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Depending on the check Box Selected display the data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if p_incmt = c_x and p_incnm ne c_x.&lt;/P&gt;&lt;P&gt;delete i_final where matnr eq space.&lt;/P&gt;&lt;P&gt;elseif p_incnm = c_x and p_incmt ne c_x.&lt;/P&gt;&lt;P&gt;delete i_final where matnr ne space.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. "Read Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form : populate_layout_stucture&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description : Populating the layout structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form populate_layout_stucture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear x_layout .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Layout properties&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;x_layout-zebra = c_x.&lt;/P&gt;&lt;P&gt;x_layout-detail_popup = c_x.&lt;/P&gt;&lt;P&gt;x_layout-detail_initial_lines = c_x.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;x_layout-colwidth_optimize = c_x. OS0160 - CR54527&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. " populate_layout_stucture&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form : build_field_catalog&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description : Building the field catalog data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_field_catalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh i_fldcat.&lt;/P&gt;&lt;P&gt;clear i_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;i_program_name = g_repid&lt;/P&gt;&lt;P&gt;i_internal_tabname = 'I_FINAL'&lt;/P&gt;&lt;P&gt;i_inclname = g_repid&lt;/P&gt;&lt;P&gt;changing&lt;/P&gt;&lt;P&gt;ct_fieldcat = i_fldcat&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;inconsistent_interface = 1&lt;/P&gt;&lt;P&gt;program_error = 2&lt;/P&gt;&lt;P&gt;others = 3.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;message id sy-msgid type sy-msgty number sy-msgno&lt;/P&gt;&lt;P&gt;with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Getting the Header text for the coloums&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at i_fldcat into x_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'LIFNR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Vendor'(003).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Vendor'(003).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Vendor'(003).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Vendor'(003).&lt;/P&gt;&lt;P&gt;x_fldcat-inttype = c_c.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'NAME1'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Vendor Name'(002).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Vendor Name'(002).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Vendor Name'(002).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Vendor Name'(002).&lt;/P&gt;&lt;P&gt;x_fldcat-inttype = c_c.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'WERKS'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Plant'(010).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Plant'(010).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Plant'(010).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Plant'(010).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'EKGRP'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Purch. Group'(108).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Purch. Group'(108).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Purch. Group'(108).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Purch. Group'(108).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'MONAT'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Period'(011).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Period'(011).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Period'(011).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Period'(011).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'MATNR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Material'(004).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Material'(004).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Material'(004).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Material'(004).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start of changes &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if x_fldcat-fieldname = 'CIMITEM'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Cimpro Material'(050).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Cimpro Material'(050).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Cimpro Material'(050).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Cimpro Material'(050).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'FRBNR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Bill of lading'(051).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Bill of lading'(051).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Bill of lading'(051).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Bill of lading'(051).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'XBLNR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Delivery Note'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Delivery Note'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Delivery Note'.&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Delivery Note'.&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'BEDNR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Tracking No'(052).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Tracking No'(052).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Tracking No'(052).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Tracking No'(052).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;End of changes by OS0335 on 09/16/2004&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'BKLAS'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Valuation Class'(009).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Valuation Class'(009).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Valuation Class'(009).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Valuation Class'(009).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Purchase Order'(005).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Purchase Order'(005).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Purchase Order'(005).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Purchase Order'(005).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'EBELP'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'PO Item No'(007).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'PO Item No'(007).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'PO Item No'(007).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'PO Item No'(007).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'CRTOR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'PO Creator'(044).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'PO Creator'(044).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'PO Creator'(044).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'PO Creator'(044).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'REQNR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'PO Requisitioner'(045).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'PO Requisitioner'(045).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'PO Requisitioner'(045).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'PO Requisitioner'(045).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'KOSTL'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Cost Center'(006).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Cost Center'(006).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Cost Center'(006).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Cost Center'(006).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'BUDAT'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Receipt Date'(008).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Receipt Date'(008).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Receipt Date'(008).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Receipt Date'(008).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'BELNR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Acc.Document'(100).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Acc.Document'(100).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Acc.Document'(100).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Acc.Document'(100).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'BWART'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Movement Type'(101).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Movement Type'(101).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Movement Type'(101).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Movement Type'(101).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'TXZ01'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Material Text'(102).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Material Text'(102).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Material Text'(102).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Material Text'(102).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'MENGE'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Quantity'(103).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Quantity'(103).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Quantity'(103).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Quantity'(103).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;x_fldcat-do_sum = c_x.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'MEINS'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'UOM'(104).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'UOM'(104).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'UOM'(104).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'UOM'(104).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'DMBTR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Amount in Local Curr'(105).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Amount in Local Curr'(105).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Amount in Local Curr'(105).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Amount in Local Curr'(105).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;x_fldcat-do_sum = c_x.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'WRBTR'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Amount in Trans.Curr'(106).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Amount in Trans.Curr'(106).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Amount in Trans.Curr'(106).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Amount in Trans.Curr'(106).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;x_fldcat-do_sum = c_x.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'WAERS'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Trans.Currency'(107).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Trans.Currency'(107).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Trans.Currency'(107).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Trans.Currency'(107).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if x_fldcat-fieldname = 'STATUS'.&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_l = 'Material Status'(019).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_m = 'Material Status'(019).&lt;/P&gt;&lt;P&gt;x_fldcat-seltext_s = 'Material Status'(019).&lt;/P&gt;&lt;P&gt;x_fldcat-reptext_ddic = 'Material Status'(019).&lt;/P&gt;&lt;P&gt;x_fldcat-ddictxt = c_l.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify i_fldcat from x_fldcat index sy-tabix.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. " build_field_catalog&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form : build_sort_totals&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description : Building the Criteria for Sort/Subtotals&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_sort_totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'LIFNR'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 1.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'WERKS'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 2.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'EKGRP'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 3.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'MONAT'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 4.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'MATNR'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 5.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'BKLAS'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 6.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 7.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'KOSTL'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 8.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x_sort-fieldname = 'BUDAT'.&lt;/P&gt;&lt;P&gt;x_sort-tabname = 'I_FINAL'.&lt;/P&gt;&lt;P&gt;x_sort-spos = 9.&lt;/P&gt;&lt;P&gt;x_sort-up = c_x.&lt;/P&gt;&lt;P&gt;x_sort-subtot = c_x.&lt;/P&gt;&lt;P&gt;append x_sort to i_sort.&lt;/P&gt;&lt;P&gt;clear x_sort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. " build_sort_totals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form : comment_build&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description : This form is used to display the Report Header(ALV)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;form comment_build using lt_top_of_page type&lt;/P&gt;&lt;P&gt;slis_t_listheader.&lt;/P&gt;&lt;P&gt;data: l_line type slis_listheader,&lt;/P&gt;&lt;P&gt;l_heading1 like rs38m-repti,&lt;/P&gt;&lt;P&gt;l_date(10), l_time(8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_line.&lt;/P&gt;&lt;P&gt;l_heading1 = 'GR/IR DETAIL REPORT'(021).&lt;/P&gt;&lt;P&gt;g_repid = sy-repid.&lt;/P&gt;&lt;P&gt;write sy-uzeit to l_time.&lt;/P&gt;&lt;P&gt;write sy-datum to l_date.&lt;/P&gt;&lt;P&gt;l_line-typ = c_h.&lt;/P&gt;&lt;P&gt;move l_heading1 to l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear l_line.&lt;/P&gt;&lt;P&gt;l_line-typ = c_s.&lt;/P&gt;&lt;P&gt;concatenate 'System:'(023) sy-sysid&lt;/P&gt;&lt;P&gt;'Date:'(024) l_date&lt;/P&gt;&lt;P&gt;' Time:'(025)&lt;/P&gt;&lt;P&gt;l_time into l_line-info&lt;/P&gt;&lt;P&gt;separated by space.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;concatenate 'Report:'(026) g_repid&lt;/P&gt;&lt;P&gt;' User:'(027) sy-uname into&lt;/P&gt;&lt;P&gt;l_line-info&lt;/P&gt;&lt;P&gt;separated by space.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;l_line-typ = c_a.&lt;/P&gt;&lt;P&gt;move 'SELECTION CRITERIA:'(028) to l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Company Code : '(029)&lt;/P&gt;&lt;P&gt;p_bukrs into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' GR/IR Account: '(030) s_grira-low&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;p_grira into l_line-info.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;' To: '(031) s_grira-high into l_line-info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Posting Date : '(032) s_budat-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_budat-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Plant : '(033) s_werks-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_werks-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Purchasing Group : '(020) s_ekgrp-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_ekgrp-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Vendor: '(034) s_lifnr-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_lifnr-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Material: '(035) s_matnr-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_matnr-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Cost Center : '(036) s_kostl-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_kostl-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Cost Element: '(037) s_kstar-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_kstar-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Purchase Order: '(038) s_ebeln-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_ebeln-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Period : '(039) s_monat-low&lt;/P&gt;&lt;P&gt;' To: '(031) s_monat-high into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Include Material Items: '(040)&lt;/P&gt;&lt;P&gt;p_incmt into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate ' Include Non-Material Items: '(041)&lt;/P&gt;&lt;P&gt;p_incnm into l_line-info.&lt;/P&gt;&lt;P&gt;append l_line to lt_top_of_page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Form : call_list_viewer&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description : This form is used to display the grid through ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form call_list_viewer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;i_callback_program = g_repid&lt;/P&gt;&lt;P&gt;is_layout = x_layout&lt;/P&gt;&lt;P&gt;it_fieldcat = i_fldcat[]&lt;/P&gt;&lt;P&gt;i_default = c_x&lt;/P&gt;&lt;P&gt;it_sort = i_sort[]&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I_CALLBACK_USER_COMMAND = 'USER_COMMAND1'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;i_save = g_save&lt;/P&gt;&lt;P&gt;is_variant = g_variant&lt;/P&gt;&lt;P&gt;it_events = g_events[]&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;e_exit_caused_by_caller = g_exit_caused_by_caller&lt;/P&gt;&lt;P&gt;es_exit_caused_by_user = g_exit_caused_by_user&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;t_outtab = i_final&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;program_error = 1&lt;/P&gt;&lt;P&gt;others = 2.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;write: / 'Problem in calling the ALV report'(042).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. " call_list_viewer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;FORM USER_COMMAND1 &lt;/P&gt;&lt;P&gt;USING ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ucomm = '&amp;amp;IC1' and selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_final INDEX selfield-tabindex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'BES' FIELD i_final-ebeln.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form GET_DETAILS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate Cimpro material&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_DETAILS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_final where not matnr is initial&lt;/P&gt;&lt;P&gt;and cimitem is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select from_val1&lt;/P&gt;&lt;P&gt;into i_final-cimitem&lt;/P&gt;&lt;P&gt;from znablackbx&lt;/P&gt;&lt;P&gt;up to 1 rows&lt;/P&gt;&lt;P&gt;where obj_id = c_mat_obj&lt;/P&gt;&lt;P&gt;and to_val1 = i_final-matnr.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;modify i_final transporting cimitem&lt;/P&gt;&lt;P&gt;where matnr = i_final-matnr.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " GET_DETAILS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form F_GET_VAR_LIST&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get Display Variant list&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form f_get_var_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Function module to Display variant selection dialog box&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call function 'REUSE_ALV_VARIANT_F4'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;is_variant = g_variant&lt;/P&gt;&lt;P&gt;i_save = g_var_save&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;e_exit = g_var_exit&lt;/P&gt;&lt;P&gt;es_variant = g_variant1&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;not_found = 1&lt;/P&gt;&lt;P&gt;program_error = 2&lt;/P&gt;&lt;P&gt;others = 3.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;if sy-subrc = 1.&lt;/P&gt;&lt;P&gt;message i899 with 'No Variant exits for the ALV'.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;message i899 with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if g_var_exit = space.&lt;/P&gt;&lt;P&gt;p_disvar = g_variant1-variant.&lt;/P&gt;&lt;P&gt;g_variant = g_variant1.&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Dec 2006 22:36:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-25T22:36:42Z</dc:date>
    <item>
      <title>EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799912#M343459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hI EVERYBODY  , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To generate double click on a field&lt;/P&gt;&lt;P&gt;THANKS.&lt;/P&gt;&lt;P&gt;HEMA.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Dec 2006 04:18:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799912#M343459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-24T04:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799913#M343460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the changed code...changes are marked in bold.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form handle_user_command using r_ucomm like sy-ucomm&lt;/P&gt;&lt;P&gt;rs_selfield type slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case r_ucomm.&lt;/P&gt;&lt;P&gt;when '&amp;amp;IC1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case rs_selfield-FIELDNAME.&lt;/P&gt;&lt;P&gt;when 'EBELN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;read table I_bseg index rs_selfield-tabindex.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set parameter id 'BES' field &amp;lt;b&amp;gt;l_bseg-ebeln&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;call transaction 'ME23N'  AND SKIP FIRST SCREEN.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Dec 2006 05:54:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799913#M343460</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-24T05:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799914#M343461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Naren.&lt;/P&gt;&lt;P&gt;but when I did u r changes I'm getting the output screen as it is but drill down is not working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Dec 2006 13:18:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799914#M343461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-24T13:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799915#M343462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this example..This works fine..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF wa_ekko,&lt;/P&gt;&lt;P&gt;ebeln like ekko-ebeln,&lt;/P&gt;&lt;P&gt;ekorg like ekko-ekorg,&lt;/P&gt;&lt;P&gt;ekgrp like ekko-ekgrp,&lt;/P&gt;&lt;P&gt;END OF wa_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: v_repid TYPE syrepid.&lt;/P&gt;&lt;P&gt;v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA it_ekko LIKE STANDARD TABLE OF wa_ekko WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM ekko&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE it_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          i_program_name     = v_repid&lt;/P&gt;&lt;P&gt;          i_internal_tabname = 'WA_EKKO'&lt;/P&gt;&lt;P&gt;          i_inclname         = v_repid&lt;/P&gt;&lt;P&gt;     CHANGING&lt;/P&gt;&lt;P&gt;          ct_fieldcat        = gt_fieldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Pass the program.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;          i_callback_program      = v_repid&lt;/P&gt;&lt;P&gt;          it_fieldcat             = gt_fieldcat&lt;/P&gt;&lt;P&gt;          i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;          t_outtab                = it_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM user_command USING ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF ucomm = '&amp;amp;IC1' and selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE it_ekko INDEX selfield-tabindex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      SET PARAMETER ID 'BES' FIELD it_ekko-ebeln.&lt;/P&gt;&lt;P&gt;      CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Dec 2006 17:08:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799915#M343462</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-24T17:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799916#M343463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;now also the drill down is not working can anyone suggest me where I'm going wrong.&lt;/P&gt;&lt;P&gt;How will the program knows  that when we double click on po no in o/p screen it must display po&lt;/P&gt;&lt;P&gt;becoz&lt;/P&gt;&lt;P&gt;when I'm  d.clicking no action is done &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not getting it I need some help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 14:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799916#M343463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799917#M343464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sample code that I gave works fine for me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paster your program ..so that we can check if you have missed anythig..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 16:25:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799917#M343464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T16:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799918#M343465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 18:19:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799918#M343465</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T18:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799919#M343466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are using IT_BSEG to display the data..But using I_BSEG to read..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use internal table IT_BSEG...Changes are marked in bold..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM user_command USING ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ucomm = '&amp;amp;IC1' and selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;b&amp;gt;IT_BSEG&amp;lt;/b&amp;gt; INDEX selfield-tabindex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'BES' FIELD i_bseg-ebeln.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 19:05:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799919#M343466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T19:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799920#M343467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm getting error  when i kept IT_bseg in place of I_ bseg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_bseg does not exsts similar fiels i_bseg exists.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 20:03:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799920#M343467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T20:03:36Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799921#M343468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move the it_bseg declaration above the initialization event...to make it as global internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA it_bseg LIKE STANDARD TABLE OF i_bseg&lt;/P&gt;&lt;P&gt;WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 20:07:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799921#M343468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T20:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799922#M343469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NAREN THANKS FOR U R PATIENCE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now when i declared it before initialization it is disturbing the orig program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 20:19:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799922#M343469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T20:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799923#M343470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move the values from it_bseg to i_bseg before calling the alv fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;i_bseg[] = it_bseg[].&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;i_callback_program = v_repid&lt;/P&gt;&lt;P&gt;it_fieldcat = i_fldcat&lt;/P&gt;&lt;P&gt;i_callback_user_command = 'USER_COMMAND'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;t_outtab = it_bseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM user_command USING ucomm LIKE sy-ucomm&lt;/P&gt;&lt;P&gt;selfield TYPE slis_selfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ucomm = '&amp;amp;IC1' and selfield-fieldname = 'EBELN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_bseg INDEX selfield-tabindex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;SET PARAMETER ID 'BES' FIELD i_bseg-ebeln.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 20:45:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799923#M343470</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T20:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799924#M343471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is no change still getting the same error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 21:02:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799924#M343471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T21:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799925#M343472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't move the internal table declaration..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just move the values from the internal table IT_BSEG to I_BSEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I_BSEG[] = IT_BSEG[]..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As explained in my last post..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 21:05:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799925#M343472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T21:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799926#M343473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did same thing I_BSEG[] = IT_BSEG[]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 21:18:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799926#M343473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T21:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799927#M343474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the error you are getting??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 21:22:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799927#M343474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T21:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799928#M343475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it_bseg does not exsts similar fields i_bseg exists.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 21:34:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799928#M343475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T21:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799929#M343476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all ..There are two alv FMs in your program..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REUSE_ALV_GRID_DISPLAY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In which one do you want to have the USER_COMMAND..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want it for ALV_GRID_DISPLAY..Add the following code marked in bold..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;i_callback_program = g_repid&lt;/P&gt;&lt;P&gt;is_layout = x_layout&lt;/P&gt;&lt;P&gt;it_fieldcat = i_fldcat[]&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I_CALLBACK_USER_COMMAND = 'USER_COMMAND'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;i_default = c_x&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 21:57:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799929#M343476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T21:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799930#M343477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my cr is to generate drill down to ebeln and belnr .to an already existing program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result fun guy wants is if we d.click on po no then he must get the po&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The already existing pgm displays the report but document cannot be drilled from the report.&lt;/P&gt;&lt;P&gt;I pasted the whole pgm I'm new to real time work so struggling  sorry for troubling u if it is ok I will call u or we can chat in gmail&lt;/P&gt;&lt;P&gt;mhnagini@gmail.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 22:07:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799930#M343477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T22:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: EBELN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799931#M343478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please trying passing the parameter I_CALLBACK_USER_COMMAND = 'USER_COMMAND'..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please do this change..It should work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;i_callback_program = g_repid&lt;/P&gt;&lt;P&gt;is_layout = x_layout&lt;/P&gt;&lt;P&gt;it_fieldcat = i_fldcat[]&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;I_CALLBACK_USER_COMMAND = 'USER_COMMAND'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't have to change any other thing in the program...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also ignore moving the internal table values as mentioned in my previous post..Just only this change..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Dec 2006 22:13:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ebeln/m-p/1799931#M343478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-25T22:13:08Z</dc:date>
    </item>
  </channel>
</rss>

