Exta fields to a std report copied to a Z

Dear Experts,
I have copied the std program RS_SOLAR_EVAL_DOCU into a Z report. The output is a ALV tree. My requiremetn is to adda additonal 5 fields to this ALV tree output.
Please throw some light on this. I can either copy the classes in it, function module to Z. but when i do that i get a dump.
Or from the point where the display starts , i can copy the output to another internal tabel and process it further using my own code but im confused.
Kindly suggest how to proceed.
Also if examples are available , can u please let me know
Thanks and Best Regards
SS

This is LFA1-SORTL.
However, a more robust logic would be to get the ADRNR from LFA1 for the vendor. Search term 1 is ADRC-SORT1.
Hope this answers,
Lakshman

Similar Messages

  • Change user field lable in std report

    Dear Experts ,
    I want to change the user field label in a std report eg . CN41n .
    How can i do it .
    Regards

    Hello Anis ... ask your ABAPer to help you, also go through the following
    http://help.sap.com/saphelp_nw70/helpdata/en/2f/7a5abf21c111d5969d00a0c94260a5/content.htm

  • Add fields in KOB2 & KSB2 report in selection screen as well as output

    Dear All,
    I have an issue in which i have to add fields in KOB2 & KSB2 report.
    i need to add below fields to KSB2 report.
    1) Internal order
    2) Vendor
    3) Purchasing group
    I also need to add profit centre in selection screen for KSB2
    Similarly for KOB2 i need to add below fields
    1) Cost centre
    2) Vendor
    3) Purchasing group
    I also need to add cost centre as input for KOB2 report.
    I have gone through note 325546 "CO line item reports: Creating a user-defined field" which can be helpful.
    However i am not sure as to how do i add fields in input screen as required.
    Other alternative is to create a Z report however when i try and copy the report both KOB2 & KSB2 call same report "RKAEP000".
    I am not able to get as to how do i differentiate the call of different screens when ZKOB2 is called or when ZKSB2 is called.
    I could identify " c_item_group" field having different values however i couldnot get a proper logic as to how correct screen can be called based on input
    Please suggest .
    Thanks,
    Ronak

    Hi Raymond,
    The note 747588 is good as soon as you are adding fields from the same table only.
    When I have added additional table into KAEP_SCOVP selection view below COVP (just because the extra fields I need are not in COVP) they will show up in KOB1 as selection criteria, but not getting saved.
    Any idea if any ABAP should be regenerated or what extra steps are required when adding more tables into Selection View?
    Thank you!

  • Std Report for headcount

    frnzz,
    Is there a standard report to find out the headcount in an organisation?
    Useful anwers will be rewarded.
    thanx in advance
    Viggy

    Hi,
    There are only following Std reports exist:
    S_AHR_61016497  Existing Jobs
    S_AHR_61016502  Existing Positions
    S_AHR_61016503  Staff assignments.
    See the Manning Level sample report:
    report zporgr0040
           line-size 108
           line-count 60(1)
           no standard page heading
           message-id zndc.
    Database Tables
    tables: hrp1001,     " HR Master Record (Orgn. Assignment)
            pa0002,      " Personal Data
            t528t,       " Position Texts
            t527x,       " Org Unit Text
            t528b,       " Positions
            csks,        " Cost Center
            cskt.        " Cost Center Texts
    Declaration of Internal Tables
    Internal Table for Orgn Object Data  HRP1000
    data: begin of obj_tab occurs 0,
            otype like hrp1000-otype,      " Object Type
            objid like hrp1000-objid,      " Object ID
            plvar like hrp1000-plvar,      " Plan Version
            istat like hrp1000-istat,      " Planning Status
            begda like hrp1000-begda,      " Begin date
            endda like hrp1000-endda,      " End date
          end of obj_tab.
    Internal Table for Active Employees data PA0000
    data: begin of stat_tab occurs 0,
            pernr like pa0000-pernr,       " Object Type
            begda like pa0000-begda,       " Begin date
            endda like pa0000-endda,       " End date
            stat2 like pa0000-stat2,       " Employment Status
          end of stat_tab.
    Internal Table for Actual Orgn Assignment Data PA0001
    data: begin of act_tab occurs 0,
            pernr like pa0001-pernr,       " Object Type
            begda like pa0001-begda,       " Begin date
            endda like pa0001-endda,       " End date
            kostl like pa0001-kostl,       " Cost Center
            orgeh like pa0001-orgeh,       " Org Unit
            plans like pa0001-plans,       " Position
            natio like pa0002-natio,       " Nationality
          end of act_tab.
    Internal Table for Orgn Data HRP1001
    data: begin of org_tab occurs 0,
            otype like hrp1001-otype,      " Object Type
            objid like hrp1001-objid,      " Object ID
            plvar like hrp1001-plvar,      " Plan Version
            istat like hrp1001-istat,      " Planning Status
            begda like hrp1001-begda,      " Begin date
            endda like hrp1001-endda,      " End date
            subty like hrp1001-subty,      " Sub Type
            sclas like hrp1001-sclas,      " Type of Related Object
            sobid like hrp1001-sobid,      " Id of Related Object
            kostl like pa0001-kostl,       " Cost Center
            plstx like t528t-plstx,        " Position Text
            orgtx like t527x-orgtx,        " Org Unit Text
          end of org_tab.
    Internal Table for Position Calculations
    data: begin of org1_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            objid like hrp1001-objid,      " Object ID
          end of org1_tab.
    Internal Table for Position Calculations
    data: begin of org2_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            count type i,                  " No of Positions
          end of org2_tab.
    Internal Table for Actual Manpower Calculations
    data: begin of act1_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            natio like pa0002-natio,       " Nationality
            plans like pa0001-plans,       " Position
          end of act1_tab.
    Internal Table for Actual Manpower Calculations(UAE)
    data: begin of act2_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            natio like pa0002-natio,       " Nationality
          end of act2_tab.
    Internal Table for Actual Manpower Calculations(Others)
    data: begin of act3_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            natio like pa0002-natio,       " Nationality
          end of act3_tab.
    Internal Table for Actual Manpower Calculations(UAE)
    data: begin of act4_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            count1 type i,                 " No of Positions(UAE)
          end of act4_tab.
    Internal Table for Actual Manpower Calculations(OTHERS)
    data: begin of act5_tab occurs 0,
            kostl like pa0001-kostl,       " Cost Center
            count2 type i,                 " No of Positions(Others)
          end of act5_tab.
    Internal Table for Vaccancies Data
    data: begin of vac_tab occurs 0,
            plvar like hrp1007-plvar,      " Plan Version
            otype like hrp1007-otype,      " Object Type
            objid like hrp1007-objid,      " Object ID
            istat like hrp1007-istat,      " Planning Status
            begda like hrp1007-begda,      " Begin date
            endda like hrp1007-endda,      " End date
            vacan like hrp1007-vacan,      " Vacancy Indicator
            status like hrp1007-status,    " Status of Vacancy
          end of vac_tab.
    Internal Table to store the Report Output data
    data : begin of rep_tab occurs 0 ,
             kostl(10) type n,                  " Cost Cente
             plans   like pa0001-plans,         " Position
             vacan   like hrp1007-vacan,        " Vacancy Indicator
             status  like hrp1007-status,       " Status of Vacancy
             plstx   like t528t-plstx,          " Position Text
             orgtx like t527x-orgtx,            " Org Unit Text
           end of rep_tab.
    Internal Table to store the Report Output data
    data : begin of rep1_tab occurs 0 ,
             kostl(10) type n,                  " Cost Cente
             cnt     type i,                    " No of Vacancies
           end of rep1_tab.
    Internal Table to store the Report Output data
    data : begin of rep2_tab occurs 0 ,
             kostl(10) type n,                  " Cost Cente
             app_no    type i,                  " Approved
             nat_no    type i,                  " National
             exp_no    type i,                  " Expatriate
             tot_no    type i,                  " Total
             vac_no    type i,                  " Vacancies
           end of rep2_tab.
    Declaration of Variables
    data: v_sobid  like hrp1001-sobid,   " Object Id
          v_sobid1 like hrp1001-sobid,   " Object Id
          v_sobid2 like hrp1001-sobid,   " Object Id
          v_sclas  like hrp1001-sclas,   " Related Obj Type
          v_subty  like hrp1001-subty,   " Related Object Id
          v_otype  like hrp1007-otype,   " Object Type
         v_str(9)    type c,            " Text
         v_str1(10)  type c,            " Text
          v_cnt    like sy-tabix.        " Table Index
    Declaration of Constants
    constants : c_x         type c value 'X',            " Flag
                c_stat1  like pa0000-stat2  value '3',   " Emp Status
                c_plan   like hrp1001-plvar value '01',  " Plan Version
                c_name   like hrp1000-uname value 'SAP', " Uname
                c_uae    like pa0002-natio  value 'AE',  " Country
                c_type   like hrp1007-otype  value 'O',  " Object Type
                c_otype  like hrp1007-otype  value 'S',  " Object Type
                c_stat   like hrp1007-status value '0',  " Status
                c_pstat  like hrp1007-istat  value '1',  " Plang Status
                c_sclas  like hrp1001-sclas value 'K',    " Rel. Obj Type
                c_subty  like hrp1001-subty value 'A002', " Related ObjId
                c_subty2 like hrp1001-subty value 'A003', " Related ObjId
                c_sclas1 like hrp1001-sclas value 'O',    " Rel.Obj Type
                c_subty1 like hrp1001-subty value 'A011', " Rel.Object Id
                c_kokrs  like coej-kokrs value '1000'. " Controlling Area
    Selection Screen
    selection-screen begin of block b1 with frame title text-001.
    parameters     :
      p_date  like pa0001-begda obligatory default sy-datum. " Date
    select-options :
      s_kostl for csks-kostl,                     " Cost Center
      s_plans for t528b-plans.                    " Position ID
    selection-screen end of block b1.
    At selection-screen
    at selection-screen.
    Validate the Selection Screen fields
      perform validate_screen.
    Start-of-Selection
    start-of-selection.
    Get the Orgn data from database Table HRP1001
      perform get_org_data.
    Get the Actual Manpower from PA0001
      perform get_act_data.
    Get the Vaccancies data from database Table HRP1007
      perform get_vac_data.
    Append the data into final Internal Table
      perform append_data.
    Top-of-page
    top-of-page.
    Write the Report and Column Headings
      perform top_of_page.
    End-of-Page
    end-of-page.
      write /1(108) sy-uline.
    End-of-Selection
    end-of-selection.
    Display the Output Report.
      perform display_report.
    Form-Routines
    *&      Form  validate_screen
    Validation of selection Screen fields
    form validate_screen.
    Validation of Position ID
      clear t528b.
      if not s_plans[] is initial.
        select single plans
          into t528b-plans
          from t528b
          where plans in s_plans.
        if sy-subrc <> 0.
          message e999 with 'Invalid Position ID'(009).
        endif.
      endif.
    Validation of Cost Center
      clear csks.
      if not s_kostl[] is initial.
        select single kostl
          into csks-kostl
          from csks
          where kostl in s_kostl.
        if sy-subrc <> 0.
          message e999 with 'Invalid Cost Center'(008).
        endif.
      endif.
    endform.                  "validate_screen
    *&      Form  get_org_data
    Get the Orgn Data from Database Table HRP1001
    form get_org_data.
    v_str  = 'Developee'(002).
    v_str1 = 'Deployment'(003).
    Select All the Positions from HRP1000
      select otype       " Object Type
             objid       " Object ID
             plvar       " Plan Version
             istat       " Planning Status
             begda       " Begin date
             endda       " End date
         into table obj_tab
         from hrp1000
         where otype = c_otype  and
               plvar = c_plan   and
               istat = c_pstat  and
               begda le p_date  and
               endda ge p_date  and
               objid in s_plans and
               uname ne c_name.
      sort obj_tab by otype objid.
    Get the Orgn and Cost Center for all the above Positions
      if not obj_tab[] is initial.
        select otype       " Object Type
               objid       " Object ID
               plvar       " Plan Version
               istat       " Planning Status
               begda       " Begin date
               endda       " End date
               subty       " Sub Type
               sclas       " Type of Related Object
               sobid       " Id of Related Object
           into table org_tab
           from hrp1001
           for all entries in obj_tab
           where otype = c_otype  and
                 plvar = c_plan   and
                 istat = c_pstat  and
                 begda le p_date  and
                 endda ge p_date  and
                 sclas eq c_sclas1 and
                 subty eq c_subty2 and
                 objid eq obj_tab-objid.
      endif.
      sort org_tab by otype objid.
    Get the Cost Center
      loop at org_tab.
        v_otype = c_otype.       " S
        v_sclas = c_sclas.       " K
        v_subty = c_subty1.                                     " A011
        v_sobid = org_tab-objid.
        perform get_org using v_otype v_sclas v_subty
                        v_sobid.
        if sy-subrc = 0.
          org_tab-kostl = hrp1001-sobid+0(10).
        else.
          v_otype = c_otype.    " S
          v_sclas = c_sclas1.   " O
          v_subty = c_subty2.                                   " A003
          v_sobid = org_tab-objid.
          perform get_org using v_otype v_sclas v_subty
                         v_sobid.
          if sy-subrc = 0.
            v_otype = c_type.     " O
            v_sclas = c_sclas.    " K
            v_subty = c_subty1.                                 " A011
            v_sobid1 = v_sobid.
            perform get_org using v_otype v_sclas v_subty
                                 v_sobid.
            if sy-subrc <> 0.
              v_otype = c_type.    " O
              v_sclas = c_sclas1.  " O
              v_subty = c_subty.                                " A002
              v_sobid = v_sobid1.
              perform get_org using v_otype v_sclas v_subty
                        v_sobid.
              if sy-subrc = 0.
                v_otype = c_type.   " O
                v_sclas = c_sclas.  " K
                v_subty = c_subty1.                             " A011
                v_sobid2 = v_sobid.
                perform get_org using v_otype v_sclas v_subty
                                 v_sobid.
                if sy-subrc <> 0.
                  v_otype = c_type.   " O
                  v_sclas = c_sclas1. " O
                  v_subty = c_subty.                            " A002
                  v_sobid = v_sobid2.
                  perform get_org using v_otype v_sclas v_subty
                          v_sobid.
                else.
                  org_tab-kostl = hrp1001-sobid+0(10).
                endif.
              endif.
            else.
              org_tab-kostl = hrp1001-sobid+0(10).
            endif.
          else.
            v_otype = c_otype.   " S
            v_sclas = c_otype.   " S
            v_subty = c_subty.                                  " A002
            v_sobid = org_tab-objid.
            perform get_org using v_otype v_sclas v_subty
                           v_sobid.
            if sy-subrc = 0.
              v_otype = c_otype.  " S
              v_sclas = c_sclas.  " K
              v_subty = c_subty1.                               " A011
              v_sobid1 = v_sobid.
              perform get_org using v_otype v_sclas v_subty
                                   v_sobid.
              if sy-subrc <> 0.
                v_otype = c_otype.  " S
                v_sclas = c_sclas1. " O
                v_subty = c_subty2.                             " A003
                v_sobid = v_sobid1.
                perform get_org using v_otype v_sclas v_subty
                          v_sobid.
                if sy-subrc = 0.
                  v_otype = c_type.   " O
                  v_sclas = c_sclas.  " K
                  v_subty = c_subty1.                           " A011
                  v_sobid2 = v_sobid.
                  perform get_org using v_otype v_sclas v_subty
                                   v_sobid.
                  if sy-subrc <> 0.
                    v_otype = c_type.    " O
                    v_sclas = c_sclas1.  " O
                    v_subty = c_subty.                          " A002
                    v_sobid = v_sobid2.
                    perform get_org using v_otype v_sclas v_subty
                            v_sobid.
                  else.
                    org_tab-kostl = hrp1001-sobid+0(10).
                  endif.
                endif.
              else.
                org_tab-kostl = hrp1001-sobid+0(10).
              endif.
            endif.
          endif.
        endif.
    Get the Position Text
        clear t528t.
        select single plstx from t528t into t528t-plstx
          where sprsl = sy-langu and
                otype = c_otype  and
                plans = org_tab-objid.
        org_tab-plstx = t528t-plstx.
    Get the Org Unit Text
        clear t527x.
        select single orgtx from t527x into t527x-orgtx
          where sprsl = sy-langu and
                orgeh = org_tab-sobid+0(8).
        org_tab-orgtx = t527x-orgtx.
        modify org_tab index sy-tabix.
        clear v_sobid.
      endloop.
      sort org_tab by otype objid.
    Calculate the Approved No of Positions
      loop at org_tab.
        if org_tab-kostl in s_kostl.
          move-corresponding org_tab to org1_tab.
          append org1_tab.
          clear org1_tab.
        endif.
      endloop.
      sort org1_tab by kostl objid.
      clear v_cnt.
      loop at org1_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          org2_tab-kostl = org1_tab-kostl.
          org2_tab-count   = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append org2_tab.
          clear:org2_tab.
        endat.
      endloop.
      sort org2_tab by kostl.
    endform.              "get_org_data
    *&      Form  get_act_data
    Get the Actual Manpower Data from Database Table PA0001
    form get_act_data.
      clear  : stat_tab, act_tab.
      refresh: stat_tab, act_tab.
    Get all the Active Employees
      select pernr       " Object Type
             begda       " Begin date
             endda       " End date
             stat2       " Emp Status
           into table stat_tab
           from pa0000
           where stat2 eq c_stat1 and
                 begda le p_date  and
                 endda ge p_date.
      sort act_tab by pernr.
      if not stat_tab[] is initial.
        select pernr       " Object Type
               begda       " Begin date
               endda       " End date
               kostl       " Cost Center
               orgeh       " Org Unit
               plans       " Position
           into table act_tab
           from pa0001
           for all entries in stat_tab
           where pernr eq stat_tab-pernr and
                 kostl in s_kostl and
                 plans in s_plans and
                 persg eq '1'     and
                 begda le p_date  and
                 endda ge p_date.
      endif.
      sort act_tab by pernr.
      loop at act_tab.
        move-corresponding act_tab to act1_tab.
        clear pa0002-natio.
        select single natio into pa0002-natio from pa0002
          where pernr = act_tab-pernr.
        if sy-subrc = 0.
          act1_tab-natio = pa0002-natio.
        endif.
        append act1_tab.
        clear act1_tab.
      endloop.
      sort act1_tab by kostl natio.
    Calculate the Local and Expatriate Manpower
      loop at act1_tab.
        if act1_tab-natio = c_uae.
          act2_tab-kostl = act1_tab-kostl.
          act2_tab-natio = act1_tab-natio.
        else.
          act3_tab-kostl = act1_tab-kostl.
          act3_tab-natio = act1_tab-natio.
        endif.
        append: act2_tab, act3_tab.
        clear : act2_tab,act3_tab.
      endloop.
      sort act2_tab by kostl.
      sort act3_tab by kostl.
    Actual UAE Manpower
      clear v_cnt.
      loop at act2_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          act4_tab-kostl   = act2_tab-kostl.
          act4_tab-count1  = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append act4_tab.
          clear:act4_tab.
        endat.
      endloop.
      sort act4_tab by kostl.
    Other Countries
      clear v_cnt.
      loop at act3_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          act5_tab-kostl   = act3_tab-kostl.
          act5_tab-count2  = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append act5_tab.
          clear:act5_tab.
        endat.
      endloop.
      sort act5_tab by kostl.
    endform.              "get_act_data
    *&      Form  get_org
    Get the Cost Center from Parent Org Id
    form get_org using p_v_otype p_v_sclas p_v_subty p_v_sobid.
      clear hrp1001.
      select single * from hrp1001
            where otype = p_v_otype  and
                  plvar = c_plan   and
                  istat = c_pstat  and
                  begda le p_date  and
                  endda ge p_date  and
                  sclas eq p_v_sclas   and
                  subty eq p_v_subty  and
                  objid eq p_v_sobid.
      v_sobid = hrp1001-sobid+0(8).
    endform.                    " get_org
    *&      Form  get_vac_data
    Get the Vaccancies Data from Database Table HRP1007
    form get_vac_data.
      if not org_tab[] is initial.
        select plvar       " Plan Version
               otype       " Object Type
               objid       " Object ID
               istat       " Planning Status
               begda       " Begin date
               endda       " End date
               vacan       " Vacancy Indicator
               status      " Status of Vacancy
           into table vac_tab
           from hrp1007
           for all entries in org_tab
           where plvar = c_plan   and
                 otype = c_otype  and
                 istat eq c_pstat and
                 objid = org_tab-objid and
                 begda le p_date and
                 endda ge p_date and
                 vacan eq c_x  and
                 status eq c_stat.
      endif.
      sort vac_tab by plvar otype objid.
    Get the HR data into the rep_tab Internal Table
      loop at vac_tab.
        rep_tab-plans  = vac_tab-objid.
        rep_tab-vacan  = vac_tab-vacan.
        rep_tab-status = vac_tab-status.
        read table org_tab with key objid = vac_tab-objid.
        if sy-subrc = 0.
          rep_tab-kostl = org_tab-kostl.
          rep_tab-plstx = org_tab-plstx.
          rep_tab-orgtx = org_tab-orgtx.
        endif.
        append rep_tab.
        clear  rep_tab.
      endloop.
      loop at rep_tab.
        if not rep_tab-kostl in s_kostl.
          delete rep_tab index sy-tabix.
        endif.
      endloop.
      sort rep_tab by kostl plans.
    delete rep_tab where plstx cs v_str.
    delete rep_tab where orgtx cs v_str1.
    Calculate the Count of Vacancies in each Division
      clear v_cnt.
      loop at rep_tab.
        at end of kostl.
          sy-tabix = sy-tabix - v_cnt.
          rep1_tab-kostl = rep_tab-kostl.
          rep1_tab-cnt   = sy-tabix.
          v_cnt = v_cnt + sy-tabix.
          append rep1_tab.
          clear:rep1_tab.
        endat.
      endloop.
      sort rep1_tab by kostl.
    endform.                  "get_vac_data
    *&      Form append_data
    Append the data into final Internal Table
    form append_data.
      loop at org2_tab.
        rep2_tab-kostl = org2_tab-kostl.
        rep2_tab-app_no = org2_tab-count.
        read table act4_tab with key kostl = org2_tab-kostl
                                     binary search.
        if sy-subrc = 0.
          rep2_tab-nat_no = act4_tab-count1.
        endif.
        read table act5_tab with key kostl = org2_tab-kostl
                                     binary search.
        if sy-subrc = 0.
          rep2_tab-exp_no = act5_tab-count2.
        endif.
        read table rep1_tab with key kostl = org2_tab-kostl
                                     binary search.
        if sy-subrc = 0.
          rep2_tab-vac_no = rep1_tab-cnt.
        endif.
        rep2_tab-tot_no = rep2_tab-nat_no + rep2_tab-exp_no.
        append rep2_tab.
        clear rep2_tab.
      endloop.
      sort rep2_tab by kostl.
    endform.             "append_data
    *&      Form  top_of_page
    Write the Report and Column Headings
    form top_of_page.
      skip.
      format color col_heading on.
      write: /1(108) 'NATIONAL DRILLING COMPANY'(010) centered,
             /1(108) 'Summary of Manning Level Report'(011) centered.
      format color off.
      skip.
      write: /2 'Key Date        :'(013), p_date,
             75 'Report Run Date:'(041), sy-datum.
      if not s_kostl[] is initial.
        if s_kostl-high is initial.
          write: /2 'Cost Center     :'(023), s_kostl-low,
                 75 'Time           :'(042), sy-uzeit.
        else.
          write: /2 'Cost Center From:'(024), s_kostl-low+7(3),
                                    'To'(022), s_kostl-high,
                 75 'Time           :'(042), sy-uzeit.
        endif.
      else.
        write: /75  'Time           :'(042), sy-uzeit.
      endif.
      if not s_plans[] is initial.
        if s_plans-high is initial.
          write: /2 'Position Id     :'(019), s_plans-low,
                 75 'User           :'(043), sy-uname.
        else.
          write: /2 'Position Id From:'(021), s_plans-low,
                              'To'(022), s_plans-high,
                 75 'User           :'(043), sy-uname.
        endif.
      else.
        write: /75 'User           :'(043), sy-uname.
      endif.
      write: /75 'Page No        :'(044), sy-pagno.
      skip.
      write /1(108) sy-uline.
      format color col_heading.
      write:/1 sy-vline,
            12 sy-vline, 53 sy-vline,
            64 sy-vline, 65(32)  'Actual'(018) centered,
            97 sy-vline,108 sy-vline.
      write:/1 sy-vline,  2(10) 'CostCenter'(014),
            12 sy-vline, 13(40) 'Description'(026) centered,
            53 sy-vline, 54(10) 'Approved'(025) centered,
            64 sy-vline, 65(32)  sy-uline,
            97 sy-vline, 98(10) 'Vacancies'(017),
           108 sy-vline.
      write:/1 sy-vline,
            12 sy-vline, 53 sy-vline,
            64 sy-vline, 65(10) 'National'(015) centered,
            75 sy-vline, 76(10) 'Expatriate'(020) centered,
            86 sy-vline, 87(10) 'Total'(016) centered,
            97 sy-vline,108 sy-vline.
      format color off.
      write /1(108) sy-uline.
    endform.               "top_of_page
    *&      Form  Display_report
    Write the Report Output
    form display_report.
      if rep2_tab[] is initial.
        message i999 with
        'No Data found for the entered Selection'(035).
      else.
        loop at rep2_tab.
    Authorization Check for the Orgn and Cost Centers
          perform auth_check_org.
          if sy-subrc = 0.
            clear cskt.
            select single ltext into cskt-ltext from cskt
                where spras = sy-langu and
                      kokrs = c_kokrs and
                      kostl = rep2_tab-kostl.
            format color col_normal.
            write: /1 sy-vline, 2(10) rep2_tab-kostl+7(3),
                   12 sy-vline, 13(40) cskt-ltext,
                   53 sy-vline, 54(10) rep2_tab-app_no,
                   64 sy-vline, 65(10) rep2_tab-nat_no,
                   75 sy-vline, 76(10) rep2_tab-exp_no,
                   86 sy-vline, 87(10) rep2_tab-tot_no,
                   97 sy-vline, 98(10) rep2_tab-vac_no,
                  108 sy-vline.
            format color off.
            at last.
              sum.
              format color 3.
              write /1(108) sy-uline.
              write: /1 sy-vline, 2(10) 'Total'(027),
                     12 sy-vline,
                     53 sy-vline, 54(10) rep2_tab-app_no,
                     64 sy-vline, 65(10) rep2_tab-nat_no,
                     75 sy-vline, 76(10) rep2_tab-exp_no,
                     86 sy-vline, 87(10) rep2_tab-tot_no,
                     97 sy-vline, 98(10) rep2_tab-vac_no,
                    108 sy-vline.
              format color off.
            endat.
          endif.
        endloop.
      endif.
      write /1(108) sy-uline.
    endform.                    " Display_report
    *&      Form  auth_check_org
    Authorization Check for the Orgn and Cost Center
    form auth_check_org.
      authority-check object 'ZNDCHROM'
            id 'PLVAR' dummy
            id 'OTYPE' dummy
            id 'KOSTL' field rep2_tab-kostl.
    endform.                  "auth_check_org
    reward if useful
    regards,
    ANJI

  • Std report for BOM : Reg.

    Hi experts,
         I need to display the materials along with the BOM of those materials with its quantity and its total price while user give the vendor name and date range as input.
    Is there any std report for the same? Try to give apt solution on it.
    Thanks and Regards
    Raaam's...

    Hi,
    CS12 is to get multi-level BOM report. You can insert satndard price field and vendor filed into the layout and you can filter it within the report itself.
    But what if you have several sources of supply and several prices (in info records!) for your goods? And this report can display only the multi-level BOM of one single material...
    If you want a transaction described by you, you should develop an own report in ABAP - I guess...
    You can post this thread in PP forum as well but I'm afraid there's no such kind of standard report in SAP...
    BR
    Csaba

  • No data in the STD Report S_ALR_87012272

    Hi,
    The SAP STD report is s_alr_87012272 is not showing any values.
    Kindly help me how we can get the values in the report.
    Report long text:  Cash Flow (Indirect Method) Variant 1
    Report name                      0SAPRATIO-03
    Thanks..,,
    Regards,
    John Pal

    Dear John,
    All reports are based on a financial statement version. This is
    determined in the form with the same name under the general selections
    (see overview of the report parameters). In the standard system, this is
    the INT version. In the version, accounts with chart of accounts (INT)
    and number are assigned to the individual items. If the system in
    question uses another financial statement version or another chart of
    accounts, the selected data cannot be assigned to the balance sheet
    items.
    This is the reason we suggest our customers to create their own form.
    Check SAP note 43661 which describes creation of new
    forms and reports.
    Following are the steps to create the form and report:
    FSI4 => Form type: Financial Statement Key Figures => Copy
                 Form: Name and Text for the new form
            Copy from: 0SAPRATIO-04
    FSI5 => find and double click the new form just created => Edit Gen.
    data selection => change the FSV to what you want to use
    FSI1 => Report type: Financial Statement Key Figures  => Create
                 Report: Name and Text for the new report
              With form: Name of the new form
    details please refer to standard SAP report 0SAPRATIO-04
    FSI3 => find and excute the new report to check if you can get the
    result you want
    To change the fin.statement version in the general data selections of
    your new form is not enough.
    All reports are based on a financial statement version. This is
    determined in the form with the same name under the general selections
    (see overview of the report parameters). In the standard system, this is
    the INT version. In the version, accounts with chart of accounts (INT)
    and number are assigned to the individual items. If the system in
    question uses another financial statement version or another chart of
    accounts, the selected data cannot be assigned to the balance sheet
    items.
    This is the reason we suggest our customers to create their own form.
    Please find the attached note 43661 which describes creation of new
    forms and reports.
    Following are the steps to create the form and report:
    FSI4 => Form type: Financial Statement Key Figures => Copy
                 Form: Name and Text for the new form
            Copy from: 0SAPRATIO-04
    FSI5 => find and double click the new form just created => Edit Gen.
    data selection => change the FSV to what you want to use
    FSI1 => Report type: Financial Statement Key Figures  => Create
                 Report: Name and Text for the new report
              With form: Name of the new form
    details please refer to standard SAP report 0SAPRATIO-04
    FSI3 => find and excute the new report to check if you can get the
    result you want
    To change the fin.statement version in the general data selections of
    your new form is not enough.
    Mauri

  • How to add more fields to Customer sales report

    I want to add some fields to customer sales report generating through S_ALR_87012186 like,Invoice number,Invoice date,Tax registration number,tax amount,before tax amount..etc.
    Please let us know the best possible method to add these details.

    It is not suggested to alter a standard SAP report. Still if the requirement persists, then copy the standard program into a zprogram and add required fields.

  • List of useful MM Std Report T code : Especially CIN

    Hello Experts !!
    Can anyone give me the link/reference of useful MM Std Report T code  Especially , Especially CIN
    Rgds
    Anis

    Dear Anis,
    Customizing
              J1I0 - CIN Health Check
    Indirect Taxes
              Master Data
                        J1ID - Excise Rate Maintenance
                        Deemed Export License
                                  J1ILIC01 u2013 Capture
                                  J1ILIC02 u2013 Change
                                  J1ILIC03 u2013 Display
                                  J1ILIC04 u2013 Cancel
                                  J1ILIC05 - Close
                        Excise Bond
                                  J1IBN01 u2013 Create
                                  J1IBN02 u2013 Change
                                  J1IBN03 u2013 Display
                                  J1IBN04 u2013 Cancel
                                  J1IBN05 - Close
              Procurement
                        Excise Invoice
                                  Incoming Excise Invoice
                                            Central Processing
    J1IEX - Capture / Change / Cancel /  Display /  Post
                                            Individual Processing
                                                      J1IEX_C - Capture / Display
    J1IEX_P - Change / Display / Post / Cancel
                                  For Depot
                                            J1IG - Create/ Change/ Display
                                            J1IGA - A-Certificate  entry at depot
                                            J1IGAD - Display of A-Certificates at depot
                                  Reports
                                            J2I8 - Balance credit for capital goods
                                            J1IGR - List of GRu2019s without Excise Invoice
                        Subcontracting
                                  Subcontracting Challans
                                            J1IF01 u2013 Create
                                            J1IF11 u2013 Change
                                            J1IF12 u2013 Display
                                            J1IFQ - Reconcile Quantity
                                            J1IF13 - Complete/ Reverse/ Recredit
                                  Reports
                                            J1IFR - Challan Listing
              Sales/Outbound Movements
                        Excise Invoice
                                  For Sales Order
    J1IIN - Outgoing Excise invoice create/change/display
                                            J1IP - Print
                                  For Depot
                                            J1IJ - Create/ Change / Display
    J1IDEPOTSTOCK1 - Depot stock with balances
                                  For Other Movements                            
                                            J1IS - Excise invoice for other movements
                                            J1IV - Post and Print
                        J2IUN - Fortnightly Payment
                        J2I9 - New Monthly Returns Report Rule 57AE
                        J1IIEXCP - Sales excise invoice exceptions
                        Exports Under Excise Regulations
                                  Exports
                                            Central Processing
    J1IA101 - Create/Change/Post/Update/Cancel/Display/Reverse ARE-1
                                            Individual Processing
    J1IA102 - Create/Change/Post/Cancel/Display ARE-1
    J1IA103 - Update/Display ARE-1
    J1IA104 - Reverse/Display ARE-1
                                                                                    Deemed Exports
                                            Central Processing
    J1IA301 - Create/Change/Post/Update/Cancel/Display/Reverse ARE-3
                                            Individual Processing
    J1IA302 - Create/Change/Post/Cancel/Display ARE-3
    J1IA303 - Update/Display ARE-3
    J1IA304 - Reverse/Display ARE-3
                                  Reports
                                            J1IANX18 - Pro Forma of Running Bond Account
    J1IANX19 - Statement Regarding Export of Excisable Goods
                                            J1IARE_AGE - Ageing Analysis for ARE Documents
                                            J1IBONSUM - Bond Summary Report
                                            J1ILICSUM - Deemed Export License Summary
    Excise JV
              J1IH - Create
    Forms Tracking
              J1IUN - Forms tracking
              Registers
                        Excise Tax
                                  J2I9 - Cenvat Register
                                  J1I5 - Update RG23A/C Issues and RG1
                                  J2I5 u2013 Extract
                                  J2I6 - Print Utility program
                        Sales Tax
                                  J1I2 - Sales Tax Register
    Tax Deduction at Source
              Classic
                        J1INC u2013 Post
                        J1I8 - Challan Update
                        Certificate
                                  J1ICREP u2013 Reprint
                                  J1ICCAN u2013 Cancel
                                  Print
                                            J1ICCERT - Regular Vendors
                                            J1ICOTV - One-time Vendors
                        Quarterly Return
                                  J1INQEFILE - Quarterly Returns - All IT sections
                        Utilities
                                  J1IHBK - Copy House Bank ID
    Extended Witholding Tax
              Provision
                        J1INPR u2013 Post
                        J1INUT u2013 Utilize
              Vendor Challan
                        J1INCHLN u2013 Post
                        J1INREV u2013 Reverse
                        J1INBANK - Update Bank Challan Number
              Vendor Certificate
                        J1INCERT u2013 Print
                        J1INREP u2013 Reprint
                        J1INCANC - Cancel
              Adjust
                        J1INJV - Post Vendor JV
              Customer Tax
                        J1INCUST - Clear
              Customer Challan
                        J1INCHLC u2013 Post
                        J1INREV u2013 Reverse
                        J1INBANK - Update Bank Challan Number
              Customer Certificate
                        J1INCC - Print
              Quarterly Returns
                        J1INQEFILE - Quarterly Return
    Asset Accounting
              J1IQ - Year-End Income Tax Depreciation Report
    this may help u
    Regards,
    Pardeep malik

  • I want add Document type and Document text std report S_ALR_87012357

    Hi Gurus
    I want add Document type(BLART) and Document text(BKTXT)  for std report S_ALR_87012357  .how can i pull these fields .do i need to change the code .
    Please help me
    Thanks & Regards
    Sandya
    Edited by: sandya rani on Feb 3, 2010 1:36 PM

    Hi
    Suggest you to ask the help of the ABAPER & Debug the report  S_ALR_87012357
    Please also check field HWBAS(Tax Base Amount in Local Currency)  in Table BSET  (Tax Data Document Segment)
    Regards
    Praveen P C
    Edited by: Praveen Chirakkel on Apr 20, 2011 6:13 AM

  • Need help to Modify the STD report which uses the Tcode CATS_DA.

    Hi ,
    we have a requirement as below. we need Add two Additional Fileds in the OutPut of the Std Report ( Tcode CATS_DA) .( 2 fileds are  one is Managername /Manager employee number ) ..
    Can you Please where we need to Modify the code to meet the above requirement.
    Thanks in Advance.
    Edited by: sandeep on Jul 29, 2008 12:45 PM

    Copy the report to "Z" version and plug in fields .
    Thanks,
    Saquib

  • MCE5 - Modifications in the std report

    Hi all,
    I need to modify the std report MCE5 i.e. MCE5 PURCHIS: Material Group Analysis Selection so that I can inlcude 2 custom fields in the selection screen and also in the o/p.
    Now my problem is:For the O/P screen,how do I add the 2 fields..in which structure?The comments in the std program are all in german and hecne difficult to locate the exact o/p strcture which is used to display the fields.
    Has anyone worked on this report earlier?Any inpits will be highly appreciated!
    Thanks
    SRM_Tech

    Hi,
    Standard and flexible analysis like MCE5 & MCSI are created & generated using LIS(Logistics Information System) by the functional person, wherein he decides the logic, selection parameters, levels of drilldown and output.
    The data here is fetched from infostructures.
    The code hence generated would be complex and difficult to understand or debug.
    Try creating a new report by create a flexible analysis report using infostructures.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOLIS/LOLIS.pdf
    http://help.sap.com/printdocu/core/print46c/en/data/pdf/LOLIS/LOLIS_KOMPONENTEN%20DES%20LIS.pdf
    Regards,
    Amit

  • Missing field info. after created by copy Customer

    Dear Experts,
    Found a problem relevant to creating by copy Customer using XD01. After extending Co. Code & Sales Area Data for the same Customer with ref. to another Co. Code & Sales Area, found that info. of a field "Prev.acct no. (Previous Master Record Number)" under "Co. Code Data - Account Mgt - Reference data", and Partners under "Partner Functions" of Sales Area Data could NOT be copied. Is it a standard SAP logic ? Could you advise reason for this ? Besides these, any other field(s) also CANNOT be copied after creating by copy Customer ?
    Many Thanks,
    KH Fong

    Hello KH Fong,
    "Prev.acct no." issue:
    The "copy with reference" is a SAP functionality that allows you to quickly create customers master data. Anyway not all the fields will be copied into the new target master data. Even if You create a customer with reference and all the information will be reported into the new master data.
    EXAMPLE:
    - In Accounting info screen: ALTKN (Previous Master Record Number) or PERNR (Personnel number) are not saved.
    - In Payment transaction accounting screen: LNRZB (Account number of the alternative payee) or ZAHLS (Block key for payment) are not saved.
    - In Correspondence accounting screen: ZSABE (Clerk at vendor), TLFNS (Accounting clerk's telephone number at business partner), TLFXS (Accounting clerk's fax number at the customer/vendor), INTAD (Internet address of partner company clerk) or KVERM (Account memo) neither are saved.
    Other fields as Reconciliation account, interest calculation indicator, terms of payment and so on should be reported into the new master data.
    "partner function" issue:
    Usually the partner functions, that are mandantory in a partner determination procedure are copied for the customer into the new sales area.
    You need to check if the relevant partner functions are set as mandantory partner function in the partner customising:
    - Transaction VOPAN
    - Select 'Cust.Master' -> Button 'Display'
    - Mark the relevant partner determeination procedure, that is
       assigned to the account group used, and double-click 'Partner
       Functions in Procdure' in the navigation on the left side
    - Check which partner functions are marked as 'MandFunction'
       These are the partner functions, that are copied.
    Hope above information is helpful.
    Best regards,
    Crystal Lin

  • SD std reports

    Hi
    Plz tell me some Std Reports in SD, what is the T.code for it
    thns&rgds
    raju

    Hi Raju,
    Standard SAP SD Reports:=
    Statistic Group:
    Purpose – To capture data for Standard Reports, we require to activate Statistic Group as under:
    --> Item category (Configuration)
    --> Sales document type (Configuration)
    --> Customer (Maintain in Master data)
    --> Material (Maintain in Master data)
    When you generate statistics in the logistics information system, the system uses the combination of specified statistics groups to determine the appropriate update sequence. The update sequence in turn determines for exactly which fields the statistics are generated.
    Configuration:
    IMG --> Logistics Information System (LIS) --> Logistics Data Warehouse --> Updating --> Updating Control --> Settings: Sales --> Statistics Groups -->
    1. Maintain Statistics Groups for Customers
    2. Maintain Statistics Groups for Material
    3. Maintain Statistics Groups for Sales Documents
    4. Assign Statistics Groups for Each Sales Document Type
    5. Assign Statistics Groups for each Sales Document Item Type .....
    All Standard Reports which are available are as under:
    SAP Easy Access: Information Systems -> Logistics -> Sales and distribution ->
    1. Customer -> Incoming orders / Returns / Sales / Credit memos / Sales activities / Customer master / Conditions / Credit Master Sheet
    2. Material -> Incoming orders / Returns / Sales / Credit memos / Material master / ...
    3. Sales organization -> Sales organization / Sales office / Sales employee
    4. Shipping point -> Deliveries / Returns
    5. SD documents -> Orders / Deliveries / Billing documents ...
    & so on.
    Some of the Standard reports in SD are:
    Sales summary - VC/2
    Display Customer Hierarchy - VDH2
    Display Condition record report - V/I6
    Pricing Report - V/LD
    Create Net Price List - V_NL
    List customer material info - VD59
    List of sales order - VA05
    List of Billing documents - VF05
    Inquiries list - VA15
    Quotation List - VA25
    Incomplete Sales orders - V.02
    Backorders - V.15
    Outbound Delivery Monitor - VL06o
    Incomplete delivery - V_UC
    Customer Returns-Analysis - MC+A
    Customer Analysis- Sales - MC+E
    Customer Analysis- Cr. Memo - MC+I
    Deliveries-Due list - VL04
    Billing due list - VF04
    Incomplete Billing documents - MCV9
    Customer Analysis-Basic List - MCTA
    Material Analysis(SIS) - MCTC
    Sales org analysis - MCTE
    Sales org analysis-Invoiced sales - MC+2
    Material Analysis-Incoming orders - MC(E
    General- List of Outbound deliveries - VL06f
    Material Returns-Analysis - MC+M
    Material Analysis- Invoiced Sales - MC+Q
    Variant configuration Analysis - MC(B
    Sales org analysis-Incoming orders - MC(I
    Sales org analysis-Returns - MC+Y
    Sales office Analysis- Invoiced Sales - MC-E
    Sales office Analysis- Returns - MC-A
    Shipping point Analysis - MC(U
    Shipping point Analysis-Returns - MC-O
    Blocked orders - V.14
    Order Within time period - SD01
    Duplicate Sales orders in period - SDD1
    Display Delivery Changes - VL22
    Reward if it helpful.
    Regards
    Sasikanth.Ch

  • Open and closing balances std report

    Dear All,
    please suggest me open and closing balances std report and can i suggest my user below t.code for viewing open and closing balnces for India scenarion T.code:J3RFLVMOBVED
    Regards
    Gopal.S

    hi
    kindly chk MB5B it will fullfill your requirement
    regards
    praveen.k

  • What is vendor performance report what are the fields using in the report

    What is vendor performance report what are the fields using in the report and i need some sample reports for that particular topic (clasical report)not using any alvs or any advance topics.
    U R Satish Patnaik

    hi
    good
    *"Table declarations...................................................
    TABLES:
    EKKO, " Purchasing Document Header
    CDHDR, " Change document header
    SSCRFIELDS. " Fields on selection screens
    *"Selection screen elements............................................
    SELECT-OPTIONS:
    S_EBELN FOR EKKO-EBELN, " Purchasing Document Number
    S_LIFNR FOR EKKO-LIFNR, " Vendor's account number
    S_EKGRP FOR EKKO-EKGRP, " Purchasing group
    S_BEDAT FOR EKKO-BEDAT, " Purchasing Document Date
    S_UDATE FOR CDHDR-UDATE. " Creation date of the change
    " document
    *" Data declarations...................................................
    Field String to hold Purchase Document Number *
    DATA:
    BEGIN OF FS_EBELN,
    EBELN(90) TYPE C, " Purchase Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created
    " the Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EBELN,
    Field String to hold Purchase Document Header *
    BEGIN OF FS_EKKO,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    END OF FS_EKKO,
    Field String to hold Account Number and name of the Vendor *
    BEGIN OF FS_LFA1,
    LIFNR TYPE LFA1-LIFNR, " Account Number of Vendor
    NAME1 TYPE LFA1-NAME1, " Name1
    END OF FS_LFA1,
    Field String to hold Change date and the name of the user *
    BEGIN OF FS_CDHDR,
    OBJECTCLAS TYPE CDHDR-OBJECTCLAS, " Object Class
    OBJECTID TYPE CDHDR-OBJECTID, " Object value
    CHANGENR TYPE CDHDR-CHANGENR, " Document change number
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    END OF FS_CDHDR,
    Field String to hold Change document items *
    BEGIN OF FS_CDPOS,
    OBJECTCLAS TYPE CDPOS-OBJECTCLAS," Object class
    OBJECTID(10) TYPE C, " Object Value
    CHANGENR TYPE CDPOS-CHANGENR, " Document change number
    TABNAME TYPE CDPOS-TABNAME, " Table Name
    FNAME TYPE CDPOS-FNAME, " Field Name
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_CDPOS,
    Field String to hold Date Element Name *
    BEGIN OF FS_DATAELE,
    TABNAME TYPE DD03L-TABNAME, " Table Name
    FIELDNAME TYPE DD03L-FIELDNAME, " Field Name
    ROLLNAME TYPE DD03L-ROLLNAME, " Data element (semantic domain)
    END OF FS_DATAELE,
    Field String to hold Short Text of the Date Element *
    BEGIN OF FS_TEXT,
    ROLLNAME TYPE DD04T-ROLLNAME, " Data element (semantic domain)
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    END OF FS_TEXT,
    Field String to hold data to be displayed on the ALV grid *
    BEGIN OF FS_OUTTAB,
    EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    ERNAM TYPE EKKO-ERNAM, " Name of Person who Created the
    " Object
    LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    EKGRP TYPE EKKO-EKGRP, " Purchasing group
    BEDAT TYPE EKKO-BEDAT, " Purchasing Document Date
    WERKS TYPE LFA1-WERKS, " Plant
    NAME1 TYPE LFA1-NAME1, " Name1
    USERNAME TYPE CDHDR-USERNAME, " User name
    UDATE TYPE CDHDR-UDATE, " Creation date of the change
    " document
    DDTEXT TYPE DD04T-DDTEXT, " Short Text Describing R/3
    " Repository Objects
    VALUE_NEW TYPE CDPOS-VALUE_NEW, " New contents of changed field
    VALUE_OLD TYPE CDPOS-VALUE_OLD, " Old contents of changed field
    END OF FS_OUTTAB,
    Internal table to hold Purchase Document Number *
    T_EBELN LIKE STANDARD TABLE
    OF FS_EBELN,
    Internal table to hold Purchase Document Header *
    T_EKKO LIKE STANDARD TABLE
    OF FS_EKKO,
    Temp Internal table to hold Purchase Document Header *
    T_EKKO_TEMP LIKE STANDARD TABLE
    OF FS_EKKO,
    Internal table to hold Account number and Name of the Vendor *
    T_LFA1 LIKE STANDARD TABLE
    OF FS_LFA1,
    Internal Table to hold Change date and the name of the user *
    T_CDHDR LIKE STANDARD TABLE
    OF FS_CDHDR,
    Internal Table to hold Change document items *
    T_CDPOS LIKE STANDARD TABLE
    OF FS_CDPOS,
    Temp. Internal Table to hold Change document items *
    T_CDPOS_TEMP LIKE STANDARD TABLE
    OF FS_CDPOS,
    Internal Table to hold Data Element Name *
    T_DATAELE LIKE STANDARD TABLE
    OF FS_DATAELE,
    Temp. Internal Table to hold Data Element Name *
    T_DATAELE_TEMP LIKE STANDARD TABLE
    OF FS_DATAELE,
    Internal Table to hold Short Text of the Date Element *
    T_TEXT LIKE STANDARD TABLE
    OF FS_TEXT,
    Internal Table to hold data to be displayed on the ALV grid *
    T_OUTTAB LIKE STANDARD TABLE
    OF FS_OUTTAB.
    C L A S S D E F I N I T I O N *
    CLASS LCL_EVENT_HANDLER DEFINITION DEFERRED.
    *" Data declarations...................................................
    Work variables *
    DATA:
    W_EBELN TYPE EKKO-EBELN, " Purchasing Document Number
    W_LIFNR TYPE EKKO-LIFNR, " Vendor's account number
    W_EKGRP TYPE EKKO-EKGRP, " Purchasing group
    W_VALUE TYPE EKKO-EBELN, " Reflected Value
    W_SPACE VALUE ' ', " Space
    W_FLAG TYPE I, " Flag Variable
    W_VARIANT TYPE DISVARIANT, " Variant
    *--- ALV Grid
    W_GRID TYPE REF TO CL_GUI_ALV_GRID,
    *--- Event Handler
    W_EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
    *--- Field catalog table
    T_FIELDCAT TYPE LVC_T_FCAT.
    AT SELECTION-SCREEN EVENT *
    AT SELECTION-SCREEN ON S_EBELN.
    Subroutine to validate Purchase Document Number.
    PERFORM VALIDATE_PD_NUM.
    AT SELECTION-SCREEN ON S_LIFNR.
    Subroutine to validate Vendor Number.
    PERFORM VALIDATE_VEN_NUM.
    AT SELECTION-SCREEN ON S_EKGRP.
    Subroutine to validate Purchase Group.
    PERFORM VALIDATE_PUR_GRP.
    START-OF-SELECTION EVENT *
    START-OF-SELECTION.
    Subroutine to select all Purchase orders.
    PERFORM SELECT_PO.
    CHECK W_FLAG EQ 0.
    Subroutine to select Object values.
    PERFORM SELECT_OBJ_ID.
    CHECK W_FLAG EQ 0.
    Subroutine to select Changed values.
    PERFORM SELECT_CHANGED_VALUE.
    CHECK W_FLAG EQ 0.
    Subroutine to Select Purchase Orders.
    PERFORM SELECT_PUR_DOC.
    Subroutine to select Vendor Details.
    PERFORM SELECT_VENDOR.
    Subroutine to select Text for the Changed values.
    PERFORM DESCRIPTION.
    END-OF-SELECTION EVENT *
    END-OF-SELECTION.
    IF NOT T_EKKO IS INITIAL.
    Subroutine to populate the Output Table.
    PERFORM FILL_OUTTAB.
    Subroutine to build Field Catalog.
    PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT.
    CALL SCREEN 100.
    ENDIF. " IF NOT T_EKKO...
    CLASS LCL_EVENT_HANDLER DEFINITION
    Defining Class which handles events
    CLASS LCL_EVENT_HANDLER DEFINITION .
    PUBLIC SECTION .
    METHODS:
    HANDLE_HOTSPOT_CLICK
    FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
    IMPORTING E_ROW_ID E_COLUMN_ID.
    ENDCLASS. " LCL_EVENT_HANDLER DEFINITION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION
    Implementing the Class which can handle events
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
    *---Handle Double Click
    METHOD HANDLE_HOTSPOT_CLICK .
    Subroutine to get the HotSpot Cell information.
    PERFORM GET_CELL_INFO.
    SET PARAMETER ID 'BES' FIELD W_VALUE.
    CALL TRANSACTION 'ME23N'.
    ENDMETHOD. " HANDLE_HOTSPOT_CLICK
    ENDCLASS. " LCL_EVENT_HANDLER
    *& Module STATUS_0100 OUTPUT
    PBO Event
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'OOPS'.
    SET TITLEBAR 'TIT'.
    Subroutine to fill the Variant Structure
    PERFORM FILL_VARIANT.
    IF W_GRID IS INITIAL.
    CREATE OBJECT W_GRID
    EXPORTING
    I_SHELLSTYLE = 0
    I_LIFETIME =
    I_PARENT = CL_GUI_CONTAINER=>SCREEN0
    I_APPL_EVENTS =
    I_PARENTDBG =
    I_APPLOGPARENT =
    I_GRAPHICSPARENT =
    I_NAME =
    I_FCAT_COMPLETE = SPACE
    EXCEPTIONS
    ERROR_CNTL_CREATE = 1
    ERROR_CNTL_INIT = 2
    ERROR_CNTL_LINK = 3
    ERROR_DP_CREATE = 4
    OTHERS = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0
    CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT = W_VARIANT
    I_SAVE = 'A'
    I_DEFAULT = 'X'
    IS_LAYOUT =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    IT_OUTTAB = T_OUTTAB
    IT_FIELDCATALOG = T_FIELDCAT
    IT_SORT =
    IT_FILTER =
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF W_GRID IS INITIAL
    CREATE OBJECT W_EVENT_CLICK.
    SET HANDLER W_EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    PAI Event
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'CANCEL'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form PREPARE_FIELD_CATALOG
    Subroutine to build the Field catalog
    <--P_T_FIELDCAT Field Catalog Table
    FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
    DATA LS_FCAT TYPE LVC_S_FCAT.
    Purchasing group...
    LS_FCAT-FIELDNAME = 'EKGRP'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Number...
    LS_FCAT-FIELDNAME = 'EBELN'.
    LS_FCAT-REF_TABLE = 'EKKO' .
    LS_FCAT-EMPHASIZE = 'C411'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-HOTSPOT = 'X'.
    APPEND LS_FCAT TO PT_FIELDCAT .
    CLEAR LS_FCAT .
    Name of Person who Created the Object...
    LS_FCAT-FIELDNAME = 'ERNAM'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-OUTPUTLEN = '15' .
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Purchasing Document Date...
    LS_FCAT-FIELDNAME = 'BEDAT'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Vendor's account number...
    LS_FCAT-FIELDNAME = 'LIFNR'.
    LS_FCAT-REF_TABLE = 'EKKO'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Account Number of Vendor or Creditor...
    LS_FCAT-FIELDNAME = 'NAME1'.
    LS_FCAT-REF_TABLE = 'LFA1'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Vendor Name'(001).
    LS_FCAT-SELTEXT = 'Vendor Name'(001).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Creation date of the change document...
    LS_FCAT-FIELDNAME = 'UDATE'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Change Date'(002).
    LS_FCAT-SELTEXT = 'Change Date'(002).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    User name of the person responsible in change document...
    LS_FCAT-FIELDNAME = 'USERNAME'.
    LS_FCAT-REF_TABLE = 'CDHDR'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '10'.
    LS_FCAT-COLTEXT = 'Modified by'(003).
    LS_FCAT-SELTEXT = 'Modified by'(003).
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Short Text Describing R/3 Repository Objects...
    LS_FCAT-FIELDNAME = 'DDTEXT'.
    LS_FCAT-REF_TABLE = 'DD04T'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '15'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    Old contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_OLD'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    New contents of changed field...
    LS_FCAT-FIELDNAME = 'VALUE_NEW'.
    LS_FCAT-REF_TABLE = 'CDPOS'.
    LS_FCAT-INTTYPE = 'C'.
    LS_FCAT-OUTPUTLEN = '12'.
    APPEND LS_FCAT TO PT_FIELDCAT.
    CLEAR LS_FCAT.
    ENDFORM. " PREPARE_FIELD_CATALOG
    *& Form SELECT_PO
    Subroutine to select all the Purchase Orders
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PO .
    SELECT EBELN " Purchasing Document Number
    ERNAM " Name of Person who Created
    " the Object
    LIFNR " Vendor's account number
    EKGRP " Purchasing group
    BEDAT " Purchasing Document Date
    FROM EKKO
    PACKAGE SIZE 10000
    APPENDING TABLE T_EBELN
    WHERE EBELN IN S_EBELN
    AND BEDAT IN S_BEDAT.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S401(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDFORM. " SELECT_PO
    *& Form SELECT_OBJ_ID
    Subroutine to select Object ID
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_OBJ_ID .
    IF NOT T_EBELN IS INITIAL.
    SELECT OBJECTCLAS " Object Class
    OBJECTID " Object value
    CHANGENR " Document change number
    USERNAME " User name
    UDATE " Creation date
    FROM CDHDR
    INTO TABLE T_CDHDR
    FOR ALL ENTRIES IN T_EBELN
    WHERE OBJECTID EQ T_EBELN-EBELN
    AND UDATE IN S_UDATE
    AND TCODE IN ('ME21N','ME22N','ME23N').
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Header Not Found'(031).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EBELN IS INITIAL
    ENDFORM. " SELECT_OBJ_ID
    *& Form SELECT_CHANGED_VALUE
    Subroutine to select Changed Values
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_CHANGED_VALUE .
    IF NOT T_CDHDR IS INITIAL.
    SELECT OBJECTCLAS " Object class
    OBJECTID " Object value
    CHANGENR " Document change number
    TABNAME " Table Name
    FNAME " Field Name
    VALUE_NEW " New contents of changed field
    VALUE_OLD " Old contents of changed field
    FROM CDPOS
    PACKAGE SIZE 10000
    APPENDING TABLE T_CDPOS
    FOR ALL ENTRIES IN T_CDHDR
    WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
    AND OBJECTID EQ T_CDHDR-OBJECTID
    AND CHANGENR EQ T_CDHDR-CHANGENR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    W_FLAG = 1.
    MESSAGE S833(M8) WITH 'Item Not Found'(032).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_CDHDR IS INITIAL
    T_CDPOS_TEMP[] = T_CDPOS[].
    ENDFORM. " SELECT_CHANGED_VALUE
    *& Form SELECT_PUR_DOC
    Subroutine to select Purchase Order Details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PUR_DOC .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_EBELN BY EBELN.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
    FS_CDPOS-OBJECTID BINARY SEARCH.
    IF SY-SUBRC NE 0.
    DELETE TABLE T_EBELN FROM FS_EBELN.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDLOOP. " LOOP AT T_CDPOS...
    LOOP AT T_EBELN INTO FS_EBELN.
    MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
    MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
    MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
    MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
    MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
    APPEND FS_EKKO TO T_EKKO.
    ENDLOOP. " LOOP AT T_EBELN...
    T_EKKO_TEMP[] = T_EKKO[].
    ENDIF. " IF NOT T_CDPOS IS INITIAL
    ENDFORM. " SELECT_PUR_DOC
    *& Form SELECT_VENDOR
    Subroutine to select Vendor details
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_VENDOR .
    IF NOT T_EKKO IS INITIAL.
    SORT T_EKKO_TEMP BY LIFNR.
    DELETE ADJACENT DUPLICATES FROM T_EKKO_TEMP COMPARING LIFNR.
    SELECT LIFNR " Account Number of Vendor or
    " Creditor
    NAME1 " Name 1
    FROM LFA1
    INTO TABLE T_LFA1
    FOR ALL ENTRIES IN T_EKKO_TEMP
    WHERE LIFNR EQ T_EKKO_TEMP-LIFNR.
    IF SY-SUBRC NE 0.
    MESSAGE S002(M8) WITH 'Master Details'(033).
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_EKKO IS INITIAL
    ENDFORM. " SELECT_VENDOR
    *& Form DESCRIPTION
    Subroutine to get the description
    There are no interface parameters to be passed to this subroutine.
    FORM DESCRIPTION .
    IF NOT T_CDPOS IS INITIAL.
    SORT T_CDPOS_TEMP BY TABNAME FNAME.
    DELETE ADJACENT DUPLICATES FROM T_CDPOS_TEMP COMPARING TABNAME FNAME
    SELECT TABNAME " Table Name
    FIELDNAME " Field Name
    ROLLNAME " Data element
    FROM DD03L
    INTO TABLE T_DATAELE
    FOR ALL ENTRIES IN T_CDPOS_TEMP
    WHERE TABNAME EQ T_CDPOS_TEMP-TABNAME
    AND FIELDNAME EQ T_CDPOS_TEMP-FNAME.
    IF NOT T_DATAELE IS INITIAL.
    T_DATAELE_TEMP[] = T_DATAELE[].
    SORT T_DATAELE_TEMP BY ROLLNAME.
    DELETE ADJACENT DUPLICATES FROM T_DATAELE_TEMP COMPARING ROLLNAME.
    SELECT ROLLNAME " Data element
    DDTEXT " Short Text Describing R/3
    " Repository Objects
    FROM DD04T
    INTO TABLE T_TEXT
    FOR ALL ENTRIES IN T_DATAELE_TEMP
    WHERE ROLLNAME EQ T_DATAELE_TEMP-ROLLNAME
    AND DDLANGUAGE EQ SY-LANGU.
    IF SY-SUBRC NE 0.
    EXIT.
    ENDIF. " IF SY-SUBRC NE 0.
    ENDIF. " IF NOT T_DATAELE IS INITIAL.
    ENDIF. " IF NOT T_CDPOS IS INITIAL.
    ENDFORM. " DESCRIPTION
    *& Form FILL_OUTTAB
    Subroutine to populate the Outtab
    There are no interface parameters to be passed to this subroutine.
    FORM FILL_OUTTAB .
    SORT T_CDHDR BY OBJECTCLAS OBJECTID CHANGENR.
    SORT T_EKKO BY EBELN.
    SORT T_LFA1 BY LIFNR.
    SORT T_DATAELE BY TABNAME FIELDNAME.
    SORT T_TEXT BY ROLLNAME.
    LOOP AT T_CDPOS INTO FS_CDPOS.
    READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY
    OBJECTCLAS = FS_CDPOS-OBJECTCLAS
    OBJECTID = FS_CDPOS-OBJECTID
    CHANGENR = FS_CDPOS-CHANGENR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
    MOVE FS_CDHDR-UDATE TO FS_OUTTAB-UDATE.
    READ TABLE T_EKKO INTO FS_EKKO WITH KEY
    EBELN = FS_CDHDR-OBJECTID
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
    MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
    MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
    MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
    MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
    READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY
    LIFNR = FS_EKKO-LIFNR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
    MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
    READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
    TABNAME = FS_CDPOS-TABNAME
    FIELDNAME = FS_CDPOS-FNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    READ TABLE T_TEXT INTO FS_TEXT WITH KEY
    ROLLNAME = FS_DATAELE-ROLLNAME
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
    ENDIF. " IF SY-SUBRC EQ 0.
    ENDIF. " IF SY-SUBRC EQ 0.
    APPEND FS_OUTTAB TO T_OUTTAB.
    CLEAR FS_OUTTAB.
    ENDLOOP.
    ENDFORM. " FILL_OUTTAB
    *& Form GET_CELL_INFO
    Subroutine to get the Cell Information
    --> W_VALUE Holds the value of Hotspot clicked
    FORM GET_CELL_INFO .
    CALL METHOD W_GRID->GET_CURRENT_CELL
    IMPORTING
    E_ROW =
    E_VALUE = W_VALUE
    E_COL =
    ES_ROW_ID =
    ES_COL_ID =
    ES_ROW_NO =
    ENDFORM. " GET_CELL_INFO
    *& Form VALIDATE_PD_NUM
    Subroutine to validate Purchase Document Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PD_NUM .
    IF NOT S_EBELN[] IS INITIAL.
    SELECT EBELN " Purchase Document Number
    FROM EKKO
    INTO W_EBELN
    UP TO 1 ROWS
    WHERE EBELN IN S_EBELN.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E717(M8).
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EBELN[]...
    ENDFORM. " VALIDATE_PD_NUM
    *& Form VALIDATE_VEN_NUM
    Subroutine to validate Vendor Number
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_VEN_NUM .
    IF NOT S_LIFNR[] IS INITIAL.
    SELECT LIFNR " Vendor Number
    FROM LFA1
    INTO W_LIFNR
    UP TO 1 ROWS
    WHERE LIFNR IN S_LIFNR.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E002(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_LIFNR[]...
    ENDFORM. " VALIDATE_VEN_NUM
    *& Form VALIDATE_PUR_GRP
    Subroutine to validate the Purchase Group
    There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PUR_GRP .
    IF NOT S_EKGRP[] IS INITIAL.
    SELECT EKGRP " Purchase Group
    FROM T024
    INTO W_EKGRP
    UP TO 1 ROWS
    WHERE EKGRP IN S_EKGRP.
    ENDSELECT.
    IF SY-SUBRC NE 0.
    CLEAR SSCRFIELDS-UCOMM.
    MESSAGE E622(M8) WITH W_SPACE.
    ENDIF. " IF SY-SUBRC NE 0
    ENDIF. " IF NOT S_EKFRP[]...
    ENDFORM. " VALIDATE_PUR_GRP
    *& Form FILL_VARIANT
    Subroutine to fill the Variant Structure
    There are no interface parameters to be passed to this subroutine
    FORM FILL_VARIANT .
    Filling the Variant structure
    W_VARIANT-REPORT = SY-REPID.
    W_VARIANT-USERNAME = SY-UNAME.
    ENDFORM. " FILL_VARIANT
    reward point if helpful.
    thanks
    mrutyun^

Maybe you are looking for