Manpower output (HR-ABAP Payroll)

Hi ABAP Gurus,
I have done manpower detalis using PNP logical database.
this program is regarding manpower details according to plant wise and payroll area wise.
for this i have used smart forms, but where ever i call smartform function, the output is comming as n times(i.e single output for each pernr )
Can you please help me out.
Thanks and Regards,
Giri

Hi
See this sample report to display Cost center wise Man power and do accordingly
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 points for useful Answers
Regards
Anji

Similar Messages

  • HR-ABAP(Payroll Management)

    Hi All,
    I am new to HR-ABAP.
    I wanted to know more about HR-ABAP(Payroll Management).
    Please send me the links or documents if u have collected.
    Regards,
    Mihira

    1.http://www.atomhr.com/know_preview/Reading_Payroll_Results_with_ABAP.htm
    2.http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?track=NL-142&ad=500911#Payroll
    3. http://www.sap-press.com/product.cfm?account=&product=H967
    http://www.sapdevelopment.co.uk/hr/payres_abap.htm
    http://www.sapdevelopment.co.uk/hr/payres_tcode.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
    http://www.atomhr.com/training/Technical_Topics_in_HR.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    you can see some Standard Program examples in this one..
    http://www.sapdevelopment.co.uk/programs/programshr.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
    These are the FAQ's that might helps you
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm

  • HR-ABAP Payroll-reports-interfaces-forms

    Hi everybody,
                     Please can any body send me the code for HR-ABAP  Payroll, time management  in case of REPORTS, Interfaces.
    I mean  to  get  coding fof retrievel of data from Payroll and Time Management modules.
    Waiting for reply.

    Hi,
    please go thorugh following links
    HR deals with the INFOTYPES which are similar to Tables in General ABAP.
    There are different ways of fetching data from these infotypes.
    There are different areas in HR LIKE Personal Admn, Orgn Management, Benefits, Time amangement, Event Management, Payroll etc
    Infotypes for these areas are different from one another area.
    storing of records data in each type of area is different
    LDBS like PNP are used in HR programing.
    Instead of Select.. we use some ROUTINES and PROVIDE..ENDPROVIDE.. etc
    and in the case of Pay roll we use Clusters and we Import and Export them for data fetching.
    On the whole Normal ABAP is different from HR abap.
    For Personal Admn the Infotypes start with PA0000 to PA1999
    Time Related Infotypes start with PA2000 to PA2999.
    Orgn related Infotypes start with HRP1000 to HRP1999.
    All custom developed infotypes stsrat with PA9000 onwards.
    In payroll processing we use Clusters like PCL1,2,3 and 4.
    Instead of Select query we use PROVIDE and ENDPROVIDE..
    You have to assign a Logical Database in the attributes PNP.
    Go through the SAp doc for HR programming and start doing.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/report%2bin%2bhr%2babap%2b(without%2bLDB)
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    Please check this link for HR sample programs.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://www.sapfans.com/forums/viewtopic.php?p=498530&sid=d7ec5866e3fb26880da129de45ce79de
    http://www.sapcookbook.com/preview_hr_questions.htm
    http://www.atomhr.com/library_full.htm
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci983590,00.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b74ce990-0201-0010-a595-8c1203c93e56
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sap-img.com/abap/sample-hr-reports-allocate-petrol-allowance.htm
    http://www.planetsap.com/HR_ABAP_LDB.htm
    http://help.sap.com/erp2005_ehp_02/helpdata/en/16/b8b83b5b831f3be10000000a114084/content.htm
    http://help.sap.com/saphelp_45b/helpdata/en/1e/728d281d5e11d289d30000e82158f1/content.htm
    http://diocio.wordpress.com/2007/04/27/sap-abap-insert-infotype-data-with-maintain-text/
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

  • HR ABAP - PAYROLL - Copy existing payroll function and changes

    Hello all,
    Required a help over an issue with HR ABAP - Payroll module.
    My requirement is to Copy an existing custom Payroll Function (Transaction PE04), into a new one. The existing payroll function has the code for updating payroll results in RT table. I have to change the statements in the new function making sure that now it will update  IT/OT table instead of RT table.
    Kindly help me with the issue.
    Thanks,
    Ruchir.
    Edited by: Ruchir Pathak on Nov 17, 2011 9:09 AM

    Hi,
    you can not copy function as i know. you should create a new one and copy code from the existing function to new function and modify code for the new requirement. this will be mush easier.
    Çağatay

  • Change output of abap logical database report

    Hello
    I have an abap report that is using a logical database to display some fields.My problem is that i have to change it and display more fields for output ,how can i control this?
    Thank you

    Hi,
    We need to add the required (additional) fields to the internal table structure, fill the fields with relevant data and display them on the screen. How is the output fields related to using a LDB..?
    Can you explain me a little bit more on the below stmt?
    " I have an abap report that is using a logical database to display some fields."
    I am not clear in understanding the relation b/w 'using LDB' and 'fields in output'. I dont think the fields displayed in the output screen will be restricted while using a LDB. Pls correct me if i understood wrong.
    Thanks,
    teja.

  • How to make output of ABAp query interactive(drill down)..?

    Hi All,
    I have developed one ABAP query which shows the output in which there is a coloumm 'order number'.
    I want to make this coloumn interactive ,that means after double clicking on any row of this colomn ,it should go to transaction KO02.
    Where do i have to write the code  in ABAP query ?
    I am very new to ABAP query..this is the first query i have deloped till now.
    points will be rewarded.
    Thnks in advance.
    Regards,
    Sanjay.

    <b>The below sample code is one such example of Drill down reporting...
    Make the necessary modifications, change the statement CALL TRANSACTION to whatever you want to CALL. Proceed further.</b>
    *"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
    Regards,
    Pavan

  • How 2 Change of column wise o/p  to row wise output in ABAP?

    Hi all,
    I am getting the output in column wise as normally but how can I get the ouput in row wise.in ABAP.
    its urgent. can any one help me how to change the output layout?
    thanks in advance,
    Sakthi.C

    if it is normal report  .then
    go through the write  statents  . one of that is below 
    Loop at itab .
    write  : itab  .
    endloop.
    if it is  ALV  then you have to  define an internal table which are the fieldds  you  want palce in the  Row .
    so  that  
    data  c type  i value    '1'.
    loop at  itab .
    fieldcatalog-fieldname   = itab-field.
    fieldcatalog-col_pos     = c.
    append fieldcatalog to fieldcatalog.
    clear  fieldcatalog
    c = c + 1.
    endloop.
    so that  the Col_pos  will be increased  and the  Column data will be moved into Row .
    reward  points if it is usefull...
    Girish

  • Display Smartform Pdf output in ABAP Webdynpro application

    Hello,
    there is a solution for displaying Smartform output in Java Webdynpro application in this forum. Since i want to start an project in ABAP Webdynpro i need a solution for this technology since i don't want to recreate all the paperwork again using Adobe. Is there any solution available?
    Thanks
    Udo Ahle

    Hello,
    this is the solution which i was able to implement using the hints given by Heidi and Thomas. Thank you for the support. With this solution it is possible to reuse oldstyle sapscripts and smartforms in todays environment.  Here is the sample code which solves the problem:
    In WDA you define for example a pushbutton to start the display of the PDF.
    In the onaction method you implement:
    method ONACTIONSHOW_PDF .
      data LX_pdf type xstring.
    * get PDF from existing sapscript or smatform
      call function 'Y_PDF_GET' destination '46c'
        IMPORTING
          ex_PDF = LX_PDF.
    * append the pdf to the response
      cl_wd_runtime_services=>attach_file_to_response(
        i_filename  = 'Hello.PDF'
        i_content   = lx_pdf
        i_mime_type = 'application/pdf'
        i_in_new_window = 'X'
        i_inplace       = 'X' ).
    endmethod.
    The function 'Y_PDF_GET' is implemented as follows:
    FUNCTION Y_PDF_GET .
    *"*"Local interface:
    *"  EXPORTING
    *"     VALUE(EX_PDF) TYPE  XSTRING
    *"  TABLES
    *"      ET_OTF STRUCTURE  ITCOO OPTIONAL
      data: lf_filesize type i,
            lt_otf type table of ITCOO,
            lt_lines type table of tline,
            tline type tline.
    * start sapscript or smatforms and return
      perform make_otf.
      CALL FUNCTION 'READ_OTF_FROM_MEMORY'
        TABLES
          OTF                = lt_otf
       EXCEPTIONS
         MEMORY_EMPTY       = 1
         OTHERS             = 2
      et_otf[] = lt_otf.
      CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
       IMPORTING
         BIN_FILESIZE                = lf_filesize
        TABLES
          OTF                         = lt_otf
          LINES                       = lt_lines
       EXCEPTIONS
         ERR_MAX_LINEWIDTH           = 1
         ERR_FORMAT                  = 2
         ERR_CONV_NOT_POSSIBLE       = 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.
    * convert tline to xstring as needed in
    * in web dynpro            
      field-symbols <X>.
      data: st(268) type c.
      data l1 type i.
      data len type i.
      data maxline type i value 134.
      l1 = 0.
      loop AT lt_lines INTO tline.
        clear st.
        st+l1(maxline) = tline.
        len = maxline + l1.
        l1 = maxline - strlen( tline ).
        ASSIGN st TO <x> TYPE 'X'.
        CONCATENATE ex_pdf <x>(len) INTO ex_pdf.
      endloop.
    ENDFUNCTION.
    The make_otf for sapscript is the following:
    * the next attribute enables the otf output.
    * no other output will be generated
    <b>options-TDGETOTF = 'X'</b>
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
    *         APPLICATION        = 'TX'
    *         ARCHIVE_INDEX      = ARCHIVE_INDEX
             ARCHIVE_PARAMS     = ARCHIVE_PARAMS
                DEVICE             = DEVICE
                DIALOG             = ' '
                FORM               = FORM
                LANGUAGE           = language
               OPTIONS            = OPTIONS
    *     IMPORTING
    *          LANGUAGE           =
    *          NEW_ARCHIVE_PARAMS =
    *          RESULT             =
           EXCEPTIONS
                CANCELED           = 1
                DEVICE             = 2
                FORM               = 3
                OPTIONS            = 4
                UNCLOSED           = 5
                OTHERS             = 6.
    *... make some write forms
      data lT_OTF     type table of     ITCOO.
    * get the otf data
      CALL FUNCTION 'CLOSE_FORM'
    *     IMPORTING
    *          RESULT   = result
           TABLES
               OTFDATA  = lt_otf
           EXCEPTIONS
                UNOPENED = 1
                OTHERS   = 2.
    * put otf into memory for later usage
      if not lt_otf is initial.
        CALL FUNCTION 'SAVE_OTF_TO_MEMORY'
    * EXPORTING
    *   MEMORY_KEY       = 'DEF_OTF_MEMORY_KEY'
          TABLES
            OTF              = lt_otf.
      endif.
    For Smartforms technology it is possible to implement the same concept.

  • Creating a text file output from ABAP

    Hi
    I'm trying to create a comma delimited text file by using ABAP code
    Could someone please help me with my coding in the following areas or is there better coding to do it:
    1)Is there a way  to move the entire Customer file KNA1 into my text file instead of doing it field by field.
    2)How can I do the comma seperation correctly?
    REPORT  ZTEXTFILE.
    data: lt_kna1 type table of kna1.
    data: ls_kna1 type kna1.
    data: lv_filename type string value 'ztest.txt'.
    select * from kna1 into table lt_kna1.
    open dataset lv_filename for output in text mode encoding default.
    IF sy-subrc <> 0.
      WRITE :/ 'ERROR'.
      EXIT.
    ENDIF.
    loop at lt_kna1 into ls_kna1.
    transfer ls_kna1-kunnr  to lv_filename.
    transfer ';' to lv_filename.
    transfer ls_kna1-name1 to lv_filename.
    transfer ';' to lv_filename.
    endloop.
    close dataset lv_filename.
    WRITE :/ 'DONE'.
    Many thanks
    Gerhard

    REPORT ZTEXTFILE.
    data: lt_kna1 type table of kna1,
            ls_kna1 type kna1,
            lv_filename type string value 'ztest.txt',
            lv_file type string.
    select * from kna1 into table lt_kna1.
    open dataset lv_filename for output in text mode encoding default.
    IF sy-subrc ne 0.
    WRITE :/ 'ERROR'.
    EXIT.
    else
    loop at lt_kna1 into ls_kna1.
    CONCATENATE ls_kna1-kunnr ls_kna1-name1 into lv_file separated by ','.
    transfer lv_file to lv_lilename.
    clear lv_file.
    endloop.
    close dataset lv_filename.
    endif.
    WRITE :/ 'DONE'.
    Try this out, should do the trick. Also, may i suggest not using '*' in your select statement and fetch data only for the fields you wish to have in your text file after filtering using a where Claus. It would greatly improve performance.
    Edited by: AJ Nayak on Feb 9, 2012 11:05 AM

  • Set color alv output cell abap webdynpro

    Hi Guys ,
    i wanted to set the color of some cells in alv output to red in ABAP WebDynpro.
    i am using the salv_wd_table.
    any piece of code is appreciated.
    thanks,
    Bobby.

    Bobby,
    If let's say you are build a ALV table to output 'SFLIGHT' table, and you want PLANETYPE '747-400' to be displayed in green, and PLANETYPE '146-200' displayed in red.
    Also, let's just say, you already had a context node 'SFLIGHT_NODE' that is mapped to the external node 'DATA' of your ALV.
    Now:
    1.  you need to modify the context node 'SFLIGHT_NODE' to add an attribute -- say 'CELL_COLOR' of type 'WDY_UIE_LIBRARY_ENUM_TYPE' -- to the SFLIGHT_NODE (note, you need to delete 'DICTIONARY structure' that is bind to the 'SFLIGHT_NODE' node, otherwise, you will not be able to create addition attributes)
    After, you will have something like this for your context node .
      CONTEXT
        --> SFLIGHT_NODE  
    > CARRID
    > CONNID
    > FLDATE
    > PRICE
    > PLANETYPE
    > <and any other attributes you had pulled from SFLIGHT)
    > CELL_COLOR (TYPE WDY_UIE_LIBRARY_ENUM_TYPE)
    2.  In your supply function to the 'SFLIGHT_NODE', you now need to supply the data to this newly added attribute:
    METHOD supply_sflight_node .
    ** data declaration
      DATA:
        itab_sflight_node            TYPE if_componentcontroller=>elements_sflight_node,
        stru_sflight_node            LIKE LINE OF itab_sflight_node.
    ** read sflight data
      SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE itab_sflight_node.
    ** populate the 'CELL_COLOR' field
      LOOP AT itab_sflight_node INTO stru_sflight_node .
        IF stru_sflight_node-planetype = '747-400'.
          stru_sflight_node-cell_color = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GOODVALUE_DARK .
         ELSEIF stru_sflight_node-planetype = '146-200'.
          stru_sflight_node-cell_color = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-BADVALUE_DARK .  
        ELSE.
          stru_sflight_node-cell_color = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-STANDARD .
        ENDIF.
        modify itab_sflight_node from stru_sflight_node.
      ENDLOOP.
    ** bind all the elements
      node->bind_table(
        new_items =  itab_sflight_node
        set_initial_elements = abap_true ).
    ENDMETHOD.
    3. Now, you need to obtain the configuration model of the ALV and config it before display.  (say you have an method does this 'init_alv_table_settings', and it is called from your view's wddoinit() method)
    METHOD init_alv_table_settings .
      DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
      l_ref_cmp_usage =   wd_this->wd_cpuse_alv_table( ).
      IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
        l_ref_cmp_usage->create_component( ).
      ENDIF.
      DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      l_ref_interfacecontroller =   wd_this->wd_cpifc_alv_table( ).
      DATA:
      node_sflight_node                   TYPE REF TO if_wd_context_node .
      node_sflight_node = wd_context->get_child_node( name = if_flights_view=>wdctx_sflight_node ).
      CALL METHOD l_ref_interfacecontroller->set_data
        EXPORTING
          r_node_data = node_sflight_node.
    **  get ConfigurationModel from ALV Component
      DATA:    lr_table TYPE REF TO cl_salv_wd_config_table.
      lr_table = l_ref_interfacecontroller->get_model( ).
    ** change the color of the cell
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      lr_column_settings ?= lr_table.
      lr_column = lr_column_settings->get_column( 'PLANETYPE' ).
      DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
      CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'PLANETYPE'.
      lr_column->set_cell_editor( lr_input_field ).
      lr_column->set_cell_design_fieldname( value = 'CELL_COLOR' ).
    ENDMETHOD.
    Compile and activate your code.
    Regards,
    Tina Yang
    Message was edited by: Tina Yang

  • Handling of Output Tax in Payroll

    Hi,
    I have a scenario where a deduction from an employee payroll is subjected to input tax.
    Is there any config in standard payroll where it can split the total amount into (1) output tax amt and (2) revenue amt?
    If this is not in the standard, what is the usual practice for this?  Must I code in my schema to generate two wagetype records for the splitting?
    Regards.
    Augustine

    Tushar,
    Read below link, if it helps you:
    Merge Dimensions and extended merge in Webi
    Sahil

  • HR-ABAP Payroll report

    Hi Gurus,
       I have to display payroll report ( With PNP logical data base ), where in I have to compare indicator 'P' & 'A' records of each personal number for given period.
      sample code & useful links will be  rewarded with points.
    Thanks,
    U.S.Raju

    refer program
    EXAMPLE_PNP_GET_PAYROLL.
    It might be useful to u....

  • Pdf output from abap spool

    Would like to know how to use the spool at the backend to create the pdf output in webdynpro. Thanks

    Appreciate if anyone can help me on this. Thanks!!

  • Hr-abap payroll

    hi,
    plz  let me know how to exclude one person and run payroll,
    explain process flow .
    Thanks&Regards
    vijaya.m

    Wrong forum!

  • HR ABAP-Payroll Function Module

    Hi pple,
    Well, When I am trying to run the payroll function module PYXX_READ_PAYROLL_RESULT, I am getting a DUMP.
    I checked the corresponding input data from PCL2 table. But still it is dumping.
    Can anyone send me some sample code, so that I too will learn the usage of this function module.
    Regards,
    Raja Sekhar

    hi,
    just having a look in google i found this example.
      CALL FUNCTION 'CU_READ_RGDIR'
          EXPORTING
               persnr          = p0001-pernr
          IMPORTING
               molga           = country
          TABLES
               in_rgdir        = rgdir
          EXCEPTIONS
               no_record_found = 1
               OTHERS          = 2.
    LOOP AT rgdir WHERE void = space AND
                         fpbeg GE pn-begps AND
                         fpend LE pn-endps AND
                         srtza EQ 'A'.
       v_pernr = p0001-pernr.
       v_seqnr = rgdir-seqnr.
       CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
         EXPORTING
          clusterid                       = 'RU'
           employeenumber                 = v_pernr
           sequencenumber                 = v_seqnr
      READ_ONLY_BUFFER                   = ' '
      READ_ONLY_INTERNATIONAL            = ' '
      ARC_GROUP                          = ' '
      CHECK_READ_AUTHORITY               = 'X'
      FILTER_CUMULATIONS                 = 'X'
      CLIENT                             * IMPORTING
      VERSION_NUMBER_PAYVN               *   VERSION_NUMBER_PCL2                      CHANGING
           payroll_result                     = payroll
        EXCEPTIONS
          illegal_isocode_or_clusterid       = 1
          error_generating_import            = 2
          import_mismatch_error              = 3
          subpool_dir_full                   = 4
          no_read_authority                  = 5
          no_record_found                    = 6
          versions_do_not_match              = 7
          error_reading_archive              = 8
          error_reading_relid                = 9
          OTHERS                             = 10.
    Hope it helps.
    Best regards.

Maybe you are looking for

  • Raw materail insp at the time of GR

    Hi, During good in-ward insp from vender out of 10 pcs, 4 pieces are rejected or to be scraped and 6 are good. How to show this scrap qty at the time of gr? pls help.

  • No display when connect DVI-D dual link cable

    Hi     I am using MS-6398 motherboard and I have the latest Bios 5.60.  when I connect DVI-D dual link cable from ATI All-In-Wonder 8500DV graphic card to my SONY SDM-M81 Flat Panel.  There is no display at all during POST as well as after boot up. I

  • This copy of Windows is not genuine

    This message keeps showing up on desktop, and goes away after clicking on Computer properties where it shows that it's already activated.

  • Report Designer - Summary page based on 3 queries with dynamic hierarchy?

    Dear All, I am trying to build a workbook based on 3 queries with a summary page that pulls in the query data into one page. Each query is based on one key figure that is split by profit centre hierarchy. i.e. Turnover -Profit Centre Node A -Profit C

  • Restoring deleted mail?

    Is there any way to restore e-mail once you've deleted it? (BTW, if your ISP is RCN, you're probably having the same problem I'm having today -- receiving hundreds of duplicate e-mails every hour. They say it's their server and they say they're worki