HRABAP about pn-begda in logicdatabase

When using the logic database to retrive the data in HR, do the pn-begda and pn-endda have any effects on GET PERNR?
I have no experience in HR ABAP programmming. When I set the pn-begps, it did affect the data which was selected in GET EVENT, but it seemed that the pn-begda have no effect the infotype data result selected .

Hi,
It does affect the selection. If you give date range, then you will get the data retrieved which is valid within that date range.

Similar Messages

  • Help me plz ,about pn-begda and pn-endda

    hi everyone.
    what do "pn-begda" and "pn-endda" means?
    it always EQ "18000101" and "99991231"
    can anyone explain it to me ?
    thanks very much

    Hi Grubby,
      pn-begda and pn-endda are depend on the selection options for the period.
    Example:
    1) If you select radio button <b>Today</b> then the values for pn-begda and pn-endda are
    pn-begda = 20070905
    pn-endda = 20070905
    2) If you select radio button <b>Current month</b> then the values for pn-begda and pn-endda are
    pn-begda = 20070901
    pn-endda = 20070930
    3) If you select radio button <b>Current year</b> then the values for pn-begda and pn-endda are
    pn-begda = 20070101
    pn-endda = 20071231
    4) If you select radio button <b>Up to today</b> then the values for pn-begda and pn-endda are
    pn-begda = 18000101
    pn-endda = 20070905
    5) If you select radio button <b>From today</b> then the values for pn-begda and pn-endda are
    pn-begda = 20070905
    pn-endda = 99991231
    For <b>other period</b>, you can enter the dates for the Data selection period and person selection period.
    I hope you understood.

  • About HRABAP??

    HI,
    Can anybody know hw about market fr HR ABAP in US??
    PLEASE SUGGEST ME WHICH IS BEST EITHER ABAP WITH SD MM <OR>
    HRABAP
    PLEASE LET ME KNOW WHICH IS BEST

    hi kumar
                  according to my knowledge ABAP coding comes under technical aspect and when u are doing ABAP only u are called technical consultant. coming to the case of SD \ PP or HR along with ABAP it involves functional knowledge as well.so in my opinion if to be ABAP SD \ ABAP HR u must have domain knowledge of respective function module like as if doing ABAP HR u should be a graduate in HR then only it would be easy for u to become ABAP HR as coding needs no domain experiance ,same with all other functional modules.
    regards,
    srikanth

  • About to use HR_INFOTYPE_OPERATION to create customer infotype issue:

    hi
    i want to create infotype use function(HR_INFOTYPE_OPERATION).
    this infotype is customer infotype.
    the first scenario is:
      i'm be sure no data about one employee in this infotype(9004).
      to call with data upload function and put data into internal table IT_PA9004.
      and the table data as follow:
    one line: it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 50 (customer field).
    two line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 60 (customer field).
    three line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 70 (customer field).
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    i run the programme and get information is:
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    but i use the transation PA30 to view all data:
    in database just exist one row:
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    the second scenario is:
    in database the infotype have exist one row:
               pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
               pa9004-begda = '20080318' , pa9004-endda = '20080318'
               pa9004-zzvalue = X (customer field).
    and i create another row:
    line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
              it_pa9004-begda = '20080318' , it_pa9004-endda = '99991231'
              it_pa9004-zzvalue = 80 (customer field)
    i run the programme and get information is:
    11022887 insert ok.
    the three scenario is:
        set  HR_INFOTYPE_OPERATION of import parameter operation = 'MOD'
        in any scenario will get error :not exist subtype .
    what heppend about HR_INFOTYPE_OPERATION working,i had to use this function to
       create other infotype of SAP owner.
       and will create successfully.
    so i thank it may be config Constraints about customer infotype.
    is time Constraints effect?
    so i want to how to check it?
    and if i want to create one infotype for customer using PM01 what some thing
    must be taken into account.
    think you advance.
    partial source code as follow:
    FORM ACTION_INSERT .
      DATA: P_FLAG TYPE C.
      DATA: WA_LOG LIKE LINE OF DATA_LOG.
      DATA: PP_ACTION TYPE PSPAR-ACTIO.
      LOOP AT IT_PA9004.
        CLEAR P_FLAG.
        CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
        PERFORM lock_employee USING IT_PA9004-pernr CHANGING P_FLAG.
        PP_ACTION = IT_PA9004-ACTION.
        PERFORM HR_INFOTYPE_OPERATION USING IT_PA9004 PP_ACTION CHANGING P_FLAG.
        IF P_FLAG IS INITIAL.
          if test_run = space.
            COMMIT WORK.
          else.
            ROLLBACK WORK.
          endif.
          write:/ it_pa9004-pernr,'insert ok'.
        ELSE.
          ROLLBACK WORK.
          write:/ it_pa9004-pernr,'error'.
        ENDIF.
        PERFORM unlock_employee USING IT_PA9004-pernr .
      ENDLOOP.
    ENDFORM.                    " ACTION_INSERT
    FORM LOCK_EMPLOYEE  USING    P_PERNR
                        CHANGING PP_FLAG.
      CHECK PP_FLAG IS INITIAL.
      CLEAR P_RETURN.
      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number = P_PERNR
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
      CALL FUNCTION 'HR_INITIALIZE_BUFFER'
        EXPORTING
          pernr = P_PERNR.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '1'.
      ENDIF.
    ENDFORM.                    " LOCK_EMPLOYEE
    FORM HR_INFOTYPE_OPERATION  USING    P_PA9004 LIKE IT_PA9004
                                         P_ACTION type PSPAR-ACTIO
                                CHANGING PP_FLAG.
      CHECK PP_FLAG  IS INITIAL.
      DATA: bapipakey type bapipakey,
            P_SUBTY TYPE P9004-SUBTY,
            PP_9004 TYPE TABLE OF  P9004 WITH HEADER LINE.
      CLEAR P_RETURN.
      REFRESH PP_9004.
      MOVE-CORRESPONDING P_PA9004 TO PP_9004.
      IF P_ACTION = 'INS'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      IF P_ACTION = 'MOD'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      APPEND PP_9004.
      P_SUBTY = P_LGART.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '9004'
         subtype       = 'FQ03'
          subtype       = P_SUBTY
          number        = PP_9004-pernr
          validityend   = PP_9004-ENDDA
          validitybegin = PP_9004-begda
         RECORDNUMBER  = pp_9004-seqnr
          record        = PP_9004
           operation     = 'INS'
         operation     = P_ACTION
          nocommit      = 'X'
        IMPORTING
          return        = P_RETURN
          key           = bapipakey
        EXCEPTIONS
          OTHERS        = 0.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '9'.
      ENDIF.
    ENDFORM.                    " HR_INFOTYPE_OPERATION
    FORM UNLOCK_EMPLOYEE  USING    P_PERNR.
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = p_pernr
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
    ENDFORM.                    " UNLOCK_EMPLOYEE

    hi
    i want to create infotype use function(HR_INFOTYPE_OPERATION).
    this infotype is customer infotype.
    the first scenario is:
      i'm be sure no data about one employee in this infotype(9004).
      to call with data upload function and put data into internal table IT_PA9004.
      and the table data as follow:
    one line: it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 50 (customer field).
    two line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080201' , it_pa9004-endda = '20080930'
              it_pa9004-zzvalue = 60 (customer field).
    three line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 70 (customer field).
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    i run the programme and get information is:
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    11022887 insert ok.
    but i use the transation PA30 to view all data:
    in database just exist one row:
    four line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ03',
              it_pa9004-begda = '20080101' , it_pa9004-endda = '20081031'
              it_pa9004-zzvalue = 80 (customer field).
    the second scenario is:
    in database the infotype have exist one row:
               pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
               pa9004-begda = '20080318' , pa9004-endda = '20080318'
               pa9004-zzvalue = X (customer field).
    and i create another row:
    line:it_pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
              it_pa9004-begda = '20080318' , it_pa9004-endda = '99991231'
              it_pa9004-zzvalue = 80 (customer field)
    i run the programme and get information is:
    11022887 insert ok.
    but in database just exist the first data
               pa9004-pernr = '11022887' ,it_pa9004-subty = 'FQ02',
               pa9004-begda = '20080318' , pa9004-endda = '20080318'
               pa9004-zzvalue = X (customer field).
    the three scenario is:
        set  HR_INFOTYPE_OPERATION of import parameter operation = 'MOD'
        in any scenario will get error :not exist subtype .
    what heppend about HR_INFOTYPE_OPERATION working,i had to use this function to
       create other infotype of SAP owner.
       and will create successfully.
    so i thank it may be config Constraints about customer infotype.
    is time Constraints effect?
    so i want to how to check it?
    and if i want to create one infotype for customer using PM01 what some thing
    must be taken into account.
    think you advance.
    partial source code as follow:
    FORM ACTION_INSERT .
      DATA: P_FLAG TYPE C.
      DATA: WA_LOG LIKE LINE OF DATA_LOG.
      DATA: PP_ACTION TYPE PSPAR-ACTIO.
      LOOP AT IT_PA9004.
        CLEAR P_FLAG.
        CALL FUNCTION 'HR_PSBUFFER_INITIALIZE'.
        PERFORM lock_employee USING IT_PA9004-pernr CHANGING P_FLAG.
        PP_ACTION = IT_PA9004-ACTION.
        PERFORM HR_INFOTYPE_OPERATION USING IT_PA9004 PP_ACTION CHANGING P_FLAG.
        IF P_FLAG IS INITIAL.
          if test_run = space.
            COMMIT WORK.
          else.
            ROLLBACK WORK.
          endif.
          write:/ it_pa9004-pernr,'insert ok'.
        ELSE.
          ROLLBACK WORK.
          write:/ it_pa9004-pernr,'error'.
        ENDIF.
        PERFORM unlock_employee USING IT_PA9004-pernr .
      ENDLOOP.
    ENDFORM.                    " ACTION_INSERT
    FORM LOCK_EMPLOYEE  USING    P_PERNR
                        CHANGING PP_FLAG.
      CHECK PP_FLAG IS INITIAL.
      CLEAR P_RETURN.
      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number = P_PERNR
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
      CALL FUNCTION 'HR_INITIALIZE_BUFFER'
        EXPORTING
          pernr = P_PERNR.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '1'.
      ENDIF.
    ENDFORM.                    " LOCK_EMPLOYEE
    FORM HR_INFOTYPE_OPERATION  USING    P_PA9004 LIKE IT_PA9004
                                         P_ACTION type PSPAR-ACTIO
                                CHANGING PP_FLAG.
      CHECK PP_FLAG  IS INITIAL.
      DATA: bapipakey type bapipakey,
            P_SUBTY TYPE P9004-SUBTY,
            PP_9004 TYPE TABLE OF  P9004 WITH HEADER LINE.
      CLEAR P_RETURN.
      REFRESH PP_9004.
      MOVE-CORRESPONDING P_PA9004 TO PP_9004.
      IF P_ACTION = 'INS'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      IF P_ACTION = 'MOD'.
        PP_9004-AEDTM = SY-DATUM.
        PP_9004-UNAME = SY-UNAME.
      ENDIF.
      APPEND PP_9004.
      P_SUBTY = P_LGART.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '9004'
         subtype       = 'FQ03'
          subtype       = P_SUBTY
          number        = PP_9004-pernr
          validityend   = PP_9004-ENDDA
          validitybegin = PP_9004-begda
         RECORDNUMBER  = pp_9004-seqnr
          record        = PP_9004
           operation     = 'INS'
         operation     = P_ACTION
          nocommit      = 'X'
        IMPORTING
          return        = P_RETURN
          key           = bapipakey
        EXCEPTIONS
          OTHERS        = 0.
      IF P_RETURN IS NOT INITIAL.
        PP_FLAG = '9'.
      ENDIF.
    ENDFORM.                    " HR_INFOTYPE_OPERATION
    FORM UNLOCK_EMPLOYEE  USING    P_PERNR.
      CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = p_pernr
        IMPORTING
          return = P_RETURN
        EXCEPTIONS
          OTHERS = 01.
    ENDFORM.                    " UNLOCK_EMPLOYEE

  • A very confusing issue about ABAP HR programming

    Dear,
      I have a curious problem,when i am using HR_infotype_operation function to insert a record into info type 0016.
    EG;  a person 'James' his contract date is between  2010.01.01-2010.12.31. i want to add  one year's contract for him.
    Then the contract should be 2011.01.01-2011.12.31 . But when i call  function 'HR_infotype_operation',it inserts an record like this .2011.01.01-2013.12.31 ,it automatically  add three years contract!
         This is my code:
    program ztest.
    data ls_p0016 type p0016.
    DATA ls_return      TYPE bapireturn1.
    selection-screen begin of block b1 with frame TITLE text-001.
    PARAMETERS per type p0016-pernr.
    PARAMETERS cn_begda type p0016-begda.
    PARAMETERS cn_endda type p0016-begda.
    parameters mod type PSPAR-ACTIO.
    selection-screen end of block b1.
      ls_p0016-pernr = per.
      ls_p0016-endda = '99991231'.
      ls_p0016-begda =  cn_begda.
      ls_p0016-cttyp = '01'.
      ls_p0016-ctedt = cn_endda.
      CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
        EXPORTING
          number = per
        IMPORTING
          return = ls_return.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty         = '0016'
          number        = per
          subtype       = ''
          validityend   = ls_p0016-endda
          validitybegin = ls_p0016-begda
          record        = ls_p0016
          operation     = mod
          dialog_mode   = '1'
          nocommit      = 'X'
        IMPORTING
          return        = ls_return
        EXCEPTIONS
          error_message = 4
          OTHERS        = 1
        commit work.
        CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
        EXPORTING
          number = per
        IMPORTING
          return = ls_return.

    Hi,
    You use fuction module to get leave in
                   WHILE i_pa2001-begda <= date.
                    SELECT SINGLE mofid FROM t001p INTO calid WHERE werks = wa_final-werks.
                      CALL FUNCTION 'HOLIDAY_CHECK_AND_GET_INFO'
                        EXPORTING
                          date                    = i_pa2001-begda
                          holiday_calendar_id     = calid
                          with_holiday_attributes = 'X'
                        IMPORTING
                          holiday_found           = lc_holiday_found
                        TABLES
                          holiday_attributes      = ltab_holiday_attributes.
                      CALL FUNCTION 'DAY_IN_WEEK'
                        EXPORTING
                          datum = i_pa2001-begda
                        IMPORTING
                          wotnr = day.
                      IF lc_holiday_found = 'X' OR day = 7.
                      ELSE.
                        sum_d = sum_d + 1.
                      ENDIF.
                      i_pa2001-begda = i_pa2001-begda + 1.
                    ENDWHILE.
    Above logic give you better  idea about how to used function module and function module name
    Rgds
    Ravi Lanjewar

  • About HR Module

    Hi Gurus,
         I have an object in  SAP-HR module. so i want to know about HR module. what is the flow? what are the T-Codes? what are the Tables used?

    Hi
    HR:
    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.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    see the sample HR report:
    report zporgr0030
    line-size 193
    line-count 60(1)
    no standard page heading
    message-id zndc.
    Database Tables
    tables: pernr, " Logical PNP
    t001p, " Personnel Subarea
    t005t, " Country Descriptions
    t500p, " Personnel Area
    t501, " Employee Group
    t503k, " Employee Subgroup
    csks, " Cost Centers
    cskt, " Cost Center Texts
    t513c, " Job (Previous) Texts
    t513s, " Job Titles
    t517t, " Edn Est.Text
    t518b, " Discipline Text
    t519t, " Certificate Text
    t528t, " Positions Texts
    t538t, " Unit Text
    pa0003. " Payroll Status
    infotypes:
    0000, " Actions
    0001, " Organizational Assignment
    0002, " Personal Data
    0007, " Planned working time
    0008, " Payroll Data
    0022, " Education Data
    0023, " Previous Employer data
    0025, " Performance Appraisal Data
    0041, " Date Spcifications
    2001. " Absences
    Declaration of Internal Tables
    Internal Table for Personal Data
    data: begin of pers_tab occurs 0,
    pernr like pa0001-pernr, " Personal Number
    ename like pa0001-ename, " Employee Name
    trfgr like pa0008-trfgr, " Grade
    natio like pa0002-natio, " Nationality
    hdate like pa0041-dat01, " Hire Date
    gbdat like pa0002-gbdat, " Birth Date
    plans like pa0001-plans, " Position
    werks like pa0001-werks, " Pers.Area
    kostl like pa0001-kostl, " Cost Center
    ctext(40), " Cost Center Text
    ptext(25), " Position Text
    ntext(15), " Nation Text
    name1(23), " Location
    end of pers_tab.
    Internal Table for Payroll Data
    data: begin of pay_tab occurs 0,
    pernr like pa0008-pernr, " Personal Number
    waers like pbwla-waers, " Grade
    basic like pa0008-bet01, " Basic Pay
    hra_allow like pa0008-bet01, " Housing Allowance
    sup_allow like pa0008-bet01, " Supp. Allowance
    soc_allow like pa0008-bet01, " Social Allowance
    chl_allow like pa0008-bet01, " Child Allowance
    fix_allow like pa0008-bet01, " Fixed Overtime
    ra_allow like pa0008-bet01, " RA Allowance
    per_allow like pa0008-bet01, " Perform. Allowance
    pen_allow like pa0008-bet01, " Pension Allowance
    oth_allow like pa0008-bet01, " Other Allowances
    tot_allow like pa0008-bet01, " Total Allowances
    end of pay_tab.
    Internal Table for Educational Data
    data: begin of edn_tab occurs 0,
    pernr like pa0022-pernr, " Personal Number
    ausbi like pa0022-ausbi, " Discipline Name
    slart like pa0022-slart, " Edn Establishment
    insti like pa0022-insti, " Institute
    sland like pa0022-sland, " Country
    slabs like pa0022-slabs, " Certificate
    anzkl like pa0022-anzkl, " Duration
    anzeh like pa0022-anzeh, " Unit for Duration
    atext like t518b-atext, " Discipline Text
    stext like t517t-stext, " Edn Est.Text
    landx like t005t-landx, " Country Text
    ctext like t519t-stext, " Certificate Text
    etext like t538t-etext, " Unit Text
    end of edn_tab.
    Internal Table for Previous Employment Data
    data: begin of pemp_tab occurs 0,
    pernr like pa0023-pernr, " Personal Number
    arbgb like pa0023-arbgb, " Previous Employer
    begda like pa0023-begda, " Start Date
    endda like pa0023-endda, " End Date
    taete like pa0023-taete, " Last Position
    land1 like pa0023-land1, " Country
    stltx like t513s-stltx, " Position Text
    landx like t005t-landx, " Country Text
    end of pemp_tab.
    Internal Table for Job History Data
    data: begin of job_tab occurs 0,
    pernr like pa0001-pernr, " Personal Number
    begda like pa0001-begda, " Promotion Date
    plans like pa0001-plans, " Position
    stell like pa0001-stell, " Job Key
    stltx like t513s-stltx, " Job Text
    ptext like t528t-plstx, " Position Text
    end of job_tab.
    Internal Table for Performance Appraisal Data
    data: begin of app_tab occurs 0,
    pernr like pa0001-pernr, " Personal Number
    year(4) type c, " Current Year
    appr(35) type c, " C Y Appraisal
    year1(4) type c, " Last Year
    appr1(35) type c, " Last Year Appraisal
    year2(4) type c,
    appr2(35) type c,
    year3(4) type c,
    appr3(35) type c,
    year4(4) type c,
    appr4(35) type c,
    end of app_tab.
    Internal Table for Performance Appraisal Data
    data: begin of app1_tab occurs 0,
    year(4) type c, " Year
    appr(35) type c, " Appraisal
    end of app1_tab.
    Internal Table to get the Payroll Amounts
    data wage_tab like pbwla occurs 0 with header line.
    Internal table for retreiving Employee Appraisals
    data app_in_tab like hrsobid occurs 0 with header line .
    data app_out_tab like hrpe_profa occurs 0 with header line .
    Declaration of Variables
    data : v_year(4) type c,
    v_ayear(4) type c,
    v_cyear(4) type c,
    v_year1(4) type c,
    v_year2(4) type c,
    v_year3(4) type c,
    v_year4(4) type c,
    v_year5(4) type c,
    v_year6(4) type c,
    v_mon(2) type c,
    v_date2 like sy-datum,
    v_date3 like sy-datum,
    v_date like sy-datum,
    v_date1 like sy-datum.
    Declaration of Constants
    constants : c_x type c value 'X', " Sign
    c_pernr(8) type n value '00000000', " Pernr
    c_p like hrp1007-otype value 'P', " Object Type
    c_01 like hrp1001-plvar value '01', " Version
    c_val1(2) type c value '31', " Date Type
    c_val2(2) type c value '12', " Date Type
    c_val like p0041-dar01 value '01', " Date Type
    c_1 like pernr-persg value '1', " Emp Group
    c_type like hrp1001-otype value 'S', " Object Type
    c_date1 like sy-datum value '18000101', " Date
    c_date2 like sy-datum value '99991231', " Date
    c_lga01 like pa0008-lga01 value '0101', " Wage Type
    c_lga02 like pa0008-lga01 value '0102', " Wage Type
    c_lga03 like pa0008-lga01 value '0103', " Wage Type
    c_lga04 like pa0008-lga01 value '0105', " Wage Type
    c_lga05 like pa0008-lga01 value '0109', " Wage Type
    c_lga06 like pa0008-lga01 value '0110', " Wage Type
    c_lga07 like pa0008-lga01 value '0114', " Wage Type
    c_lga08 like pa0008-lga01 value '0116', " Wage Type
    c_lga09 like pa0008-lga01 value '0267', " Wage Type
    c_kokrs like cskt-kokrs value '1000'. " Controlling Area
    Selection Screen
    selection-screen begin of block b1 with frame title text-003.
    selection-screen begin of line.
    selection-screen comment 1(33) text-060.
    parameters: r_all radiobutton group rb1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(33) text-020.
    parameters: r_per radiobutton group rb1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(33) text-021.
    parameters: r_pay radiobutton group rb1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(33) text-022.
    parameters: r_edn radiobutton group rb1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(33) text-023.
    parameters: r_pemp radiobutton group rb1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(33) text-024.
    parameters: r_job radiobutton group rb1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(33) text-025.
    parameters: r_app radiobutton group rb1.
    selection-screen end of line.
    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.
    Selection of Period
    perform get_period.
    Get PERNR from LDB
    get pernr.
    if pernr-persg eq c_1 or pernr-pernr ne c_pernr.
    if r_all eq c_x.
    Get the Personal data from PA0001,PA0002, PA0008, PA0041
    perform get_pers_data.
    Get the Payroll data from PA0008
    perform get_pay_data.
    Get the Education data from PA0022
    perform get_edn_data.
    Get the Previous Employment data from PA0023
    perform get_pemp_data.
    Get the Job History data
    perform get_job_data.
    Get the Performance Appraisal data
    perform get_app_data.
    elseif r_per eq c_x.
    Get the Personal data from PA0001,PA0002, PA0008, PA0041
    perform get_pers_data.
    elseif r_pay eq c_x.
    Get the Payroll data from PA0008
    perform get_pay_data.
    elseif r_edn eq c_x.
    Get the Education data from PA0022
    perform get_edn_data.
    elseif r_pemp eq c_x.
    Get the Previous Employment data from PA0023
    perform get_pemp_data.
    elseif r_job eq c_x.
    Get the Job History data
    perform get_job_data.
    elseif r_app eq c_x.
    Get the Performance Appraisal data
    perform get_app_data.
    endif.
    endif.
    Top-of-page
    top-of-page.
    Write the Report and Column Headings
    perform top_of_page.
    End-of-Page
    end-of-page.
    perform end_of_page.
    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 Personnel Number
    clear pa0003.
    if not pnppernr[] is initial.
    select pernr
    from pa0003 up to 1 rows
    into pa0003-pernr
    where pernr in pnppernr.
    endselect.
    if sy-subrc <> 0.
    message e999 with 'Incorrect Personnel Number Entered'(001).
    endif.
    endif.
    Validation of Cost Center
    clear csks.
    if not pnpkostl[] is initial.
    select single kostl
    into csks-kostl
    from csks
    where kostl in pnpkostl.
    if sy-subrc <> 0.
    message e999 with 'Invalid Cost Center'(002).
    endif.
    endif.
    Validation of Personnel Area
    clear t500p.
    if not pnpwerks[] is initial.
    select persa
    from t500p up to 1 rows
    into t500p-persa
    where persa in pnpwerks.
    endselect.
    if sy-subrc <> 0.
    message e999 with 'Incorrect Personnel Area Entered'(004).
    endif.
    endif.
    Validation of Personnel Sub Area
    clear t001p.
    if not pnpbtrtl[] is initial.
    select btrtl
    from t001p up to 1 rows
    into t001p-btrtl
    where btrtl in pnpbtrtl.
    endselect.
    if sy-subrc <> 0.
    message e999 with 'Incorrect Personnel Sub Area Entered'(005).
    endif.
    endif.
    Validation of Employee Group
    clear t501.
    if not pnppersg[] is initial.
    select persg
    from t501 up to 1 rows
    into t501-persg
    where persg in pnppersg.
    endselect.
    if sy-subrc <> 0.
    message e999 with 'Incorrect Employee Group Entered'(006).
    endif.
    endif.
    Validation of Employee Sub Group
    clear t503k.
    if not pnppersk[] is initial.
    select persk
    from t503k up to 1 rows
    into t503k-persk
    where persk in pnppersk.
    endselect.
    if sy-subrc <> 0.
    message e999 with 'Incorrect Employee Sub Group Entered'(007).
    endif.
    endif.
    endform. "validate_screen
    *& Form get_period
    Get the Correct Period based on Selection screen selection
    form get_period.
    clear: v_year,v_mon, v_date, v_date1.
    v_year = sy-datum+0(4).
    v_mon = sy-datum+4(2).
    if pnptimr1 = c_x. " Current Date
    pnpbegda = sy-datum.
    pnpendda = sy-datum.
    elseif pnptimr2 = c_x. " Current Month
    concatenate v_year v_mon c_val into v_date.
    concatenate v_year v_mon c_val1 into v_date1.
    pnpbegda = v_date.
    pnpendda = v_date1.
    elseif pnptimr3 = c_x. " Current Year
    concatenate v_year c_val c_val into v_date.
    concatenate v_year c_val2 c_val1 into v_date1.
    pnpbegda = v_date.
    pnpendda = v_date1.
    elseif pnptimr4 = c_x. " Upto Today
    pnpbegda = c_date1.
    pnpendda = sy-datum.
    elseif pnptimr5 = c_x. " From Today
    pnpbegda = sy-datum.
    pnpendda = c_date2.
    else.
    if ( pnpbegda is initial and pnpendda is initial ).
    pnpbegda = c_date1.
    pnpendda = c_date2.
    elseif pnpbegda is initial and not pnpendda is initial.
    pnpbegda = c_date1.
    pnpendda = pnpendda.
    elseif not ( pnpbegda is initial and pnpendda is initial ).
    pnpbegda = pnpbegda.
    pnpendda = pnpendda.
    endif.
    endif.
    endform. "get_period
    *& Form get_pers_data
    Get the Personal Data from PA0001,PA0002,PA0008, PA0041
    form get_pers_data.
    Get data from Respective Infotypes
    rp_provide_from_last p0001 space pnpbegda pnpendda.
    rp_provide_from_last p0002 space pnpbegda pnpendda.
    rp_provide_from_last p0008 space pnpbegda pnpendda.
    rp_provide_from_last p0041 space pnpbegda pnpendda.
    pers_tab-pernr = p0001-pernr.
    pers_tab-ename = p0001-ename.
    pers_tab-werks = p0001-werks.
    pers_tab-plans = p0001-plans.
    pers_tab-kostl = p0001-kostl.
    pers_tab-gbdat = p0002-gbdat.
    pers_tab-trfgr = p0008-trfgr.
    Get the Engaged Date
    read table p0041 with key dar01 = c_val.
    if sy-subrc = 0.
    pers_tab-hdate = p0041-dat01.
    endif.
    Get the Cost Center Text
    clear cskt-ltext.
    select single ltext into cskt-ltext from cskt
    where spras = sy-langu and
    kokrs = c_kokrs and
    kostl = p0001-kostl.
    if sy-subrc = 0.
    pers_tab-ctext = cskt-ltext.
    endif.
    Get the Position Text
    clear t528t-plstx.
    select single plstx into t528t-plstx from t528t
    where plans = p0001-plans and
    otype = c_type and
    sprsl = sy-langu.
    if sy-subrc = 0.
    pers_tab-ptext = t528t-plstx.
    endif.
    Get the Nationality
    clear t005t-natio.
    select single natio into t005t-natio from t005t
    where spras = sy-langu and
    land1 = p0002-natio.
    if sy-subrc = 0.
    pers_tab-ntext = t005t-natio.
    endif.
    Get the Location (Personal Area) Text
    clear t500p-name1.
    select single name1 into t500p-name1 from t500p
    where persa = p0001-werks.
    if sy-subrc = 0.
    pers_tab-name1 = t500p-name1.
    endif.
    append pers_tab.
    clear pers_tab.
    sort pers_tab by pernr.
    endform. "get_pers_data
    *& Form get_pay_data
    Get the Payroll Data from Infotype 0008
    form get_pay_data.
    Get the Payroll data from Respective Infotypes
    rp_provide_from_last p0008 space pnpbegda pnpendda.
    pay_tab-pernr = pernr-pernr.
    call function 'RP_FILL_WAGE_TYPE_TABLE_EXT'
    exporting
    appli = 'E'
    begda = p0008-begda
    endda = p0008-endda
    infty = '0008'
    objps = ' '
    tclas = 'A'
    pernr = pernr-pernr
    seqnr = ' '
    subty = '0 '
    dlspl = 'X'
    msgflg = ''
    nordct = ''
    tables
    pp0001 = p0001
    pp0007 = p0007
    pp0008 = p0008
    ppbwla = wage_tab
    PP0230 =
    PP0014 =
    PP0015 =
    PP0052 =
    EXCEPTIONS
    ERROR_AT_INDIRECT_EVALUATION = 1
    OTHERS = 2
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    loop at wage_tab.
    pay_tab-waers = wage_tab-waers.
    case wage_tab-lgart.
    when c_lga01.
    pay_tab-basic = wage_tab-betrg.
    when c_lga02.
    pay_tab-sup_allow = wage_tab-betrg.
    when c_lga03.
    pay_tab-hra_allow = wage_tab-betrg.
    when c_lga04.
    pay_tab-chl_allow = wage_tab-betrg.
    when c_lga05.
    pay_tab-soc_allow = wage_tab-betrg.
    when c_lga06.
    pay_tab-fix_allow = wage_tab-betrg.
    when c_lga07.
    pay_tab-ra_allow = wage_tab-betrg.
    when c_lga08.
    pay_tab-per_allow = wage_tab-betrg.
    when c_lga09.
    pay_tab-pen_allow = wage_tab-betrg.
    when others.
    pay_tab-oth_allow = pay_tab-oth_allow + wage_tab-betrg.
    endcase.
    pay_tab-tot_allow = pay_tab-basic + pay_tab-sup_allow +
    pay_tab-hra_allow + pay_tab-chl_allow +
    pay_tab-soc_allow + pay_tab-fix_allow +
    pay_tab-ra_allow + pay_tab-per_allow +
    pay_tab-oth_allow - pay_tab-pen_allow.
    endloop.
    append pay_tab.
    clear pay_tab.
    endform. "get_pay_data
    *& Form get_edn_data
    Get the Education Data from Infotype 0022
    form get_edn_data.
    Get the Education data from Respective Infotypes
    loop at p0022 where pernr = pernr-pernr.
    edn_tab-pernr = pernr-pernr.
    edn_tab-ausbi = p0022-ausbi.
    edn_tab-slart = p0022-slart.
    edn_tab-insti = p0022-insti.
    edn_tab-sland = p0022-sland.
    edn_tab-slabs = p0022-slabs.
    edn_tab-anzkl = p0022-anzkl.
    edn_tab-anzeh = p0022-anzeh.
    Get the Discipline Text
    clear t518b-atext.
    select single atext into t518b-atext from t518b
    where langu = sy-langu and
    ausbi = p0022-ausbi.
    if sy-subrc = 0.
    edn_tab-atext = t518b-atext.
    endif.
    Get the Edn Establishment Text
    clear t517t-stext.
    select single stext into t517t-stext from t517t
    where slart = p0022-slart and
    sprsl = sy-langu.
    if sy-subrc = 0.
    edn_tab-stext = t517t-stext.
    endif.
    Get the Certificate Text
    clear t519t-stext.
    select single stext into t519t-stext from t519t
    where slabs = p0022-slabs and
    sprsl = sy-langu.
    if sy-subrc = 0.
    edn_tab-ctext = t519t-stext.
    endif.
    Get the Unit Text
    clear t538t-etext.
    select single etext into t538t-etext from t538t
    where zeinh = p0022-anzeh and
    sprsl = sy-langu.
    if sy-subrc = 0.
    edn_tab-etext = t538t-etext.
    endif.
    Get the Country Description
    clear t005t-landx.
    select single landx into t005t-landx from t005t
    where spras = sy-langu and
    land1 = p0022-sland.
    if sy-subrc = 0.
    edn_tab-landx = t005t-landx.
    endif.
    append edn_tab.
    clear edn_tab.
    endloop.
    endform. "edn_data
    *& Form get_pemp_data
    Get the Previous Employment Data from Infotype 0023
    form get_pemp_data.
    Get the Previous Employment data from Respective Infotypes
    loop at p0023 where pernr = pernr-pernr.
    pemp_tab-pernr = pernr-pernr.
    pemp_tab-arbgb = p0023-arbgb.
    pemp_tab-begda = p0023-begda.
    pemp_tab-endda = p0023-endda.
    pemp_tab-taete = p0023-taete.
    pemp_tab-land1 = p0023-land1.
    Get the Last Job Text
    clear t513c-ltext.
    select single ltext into t513c-ltext from t513c
    where taete = pemp_tab-taete and
    spras = sy-langu.
    if sy-subrc = 0.
    pemp_tab-stltx = t513c-ltext.
    endif.
    Get the Country Description
    clear t005t-landx.
    select single landx into t005t-landx from t005t
    where spras = sy-langu and
    land1 = pemp_tab-land1.
    if sy-subrc = 0.
    pemp_tab-landx = t005t-landx.
    endif.
    append pemp_tab.
    clear pemp_tab.
    endloop.
    sort pemp_tab by pernr.
    endform. "pemp_data
    *& Form get_job_data
    Get the Job History Data from Infotype
    form get_job_data.
    Get the Job History data from Respective Infotypes
    loop at p0001 where pernr = pernr-pernr.
    job_tab-pernr = pernr-pernr.
    job_tab-begda = p0001-begda.
    job_tab-plans = p0001-plans.
    job_tab-stell = p0001-stell.
    Get the Last Job Text
    clear t513s-stltx.
    select single stltx into t513s-stltx from t513s
    where stell = job_tab-stell and
    sprsl = sy-langu.
    if sy-subrc = 0.
    job_tab-stltx = t513s-stltx.
    endif.
    Get the Position Text
    clear t528t-plstx.
    select single plstx into t528t-plstx from t528t
    where plans = job_tab-plans and
    otype = c_type and
    sprsl = sy-langu.
    if sy-subrc = 0.
    job_tab-ptext = t528t-plstx.
    endif.
    append job_tab.
    clear job_tab.
    endloop.
    sort job_tab by pernr.
    endform. "get_job_data
    *& Form get_app_data
    Get the Performance Appraisal Data from Infotype
    form get_app_data.
    clear: v_cyear, v_year1, v_year2, v_year3, v_year4,
    v_year5, v_year6, v_ayear, v_date2, v_date3.
    v_cyear = sy-datum+0(4) - 1.
    v_year1 = v_cyear - 1.
    v_year2 = v_cyear - 2.
    v_year3 = v_cyear - 3.
    v_year4 = v_cyear - 4.
    v_year5 = v_cyear - 5.
    v_year6 = v_cyear - 6.
    concatenate v_cyear c_date2+4(4) into v_date2.
    concatenate v_year6 c_date1+4(4) into v_date3.
    clear: app_in_tab, app_out_tab.
    refresh: app_in_tab, app_out_tab.
    app_in_tab-plvar = c_01.
    app_in_tab-otype = c_p.
    app_in_tab-sobid = pernr-pernr.
    append app_in_tab.
    Get Appraisals data from Respective Infotypes
    call function 'RHPA_APPRAISEES_APP_READ'
    exporting
    begda = v_date3
    endda = v_date2
    WITH_STEXT = 'X'
    WITH_ADD_INFO = 'X'
    tables
    appraisees = app_in_tab
    appraisals = app_out_tab
    exceptions
    no_authority = 1
    undefined = 2
    others = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    sort app_out_tab by sobid vbegd vendd appraisal_adate descending .
    delete adjacent duplicates from app_out_tab
    comparing sobid vbegd vendd.
    loop at app_out_tab where appraisal_histo = 'X' .
    condense app_out_tab-appraisal_result.
    app1_tab-year = app_out_tab-vendd+0(4).
    app1_tab-appr = app_out_tab-appraisal_result_text.
    append app1_tab.
    clear app1_tab.
    endloop.
    sort app1_tab by year descending.
    loop at app1_tab.
    app_tab-pernr = pernr-pernr.
    move-corresponding app1_tab to app_tab.
    append app_tab.
    clear: app1_tab, app_tab.
    endloop.
    refresh app1_tab.
    sort app_tab by pernr.
    delete app_tab where year = ' ' and appr = ' ' .
    endform. "get_app_data
    *& Form top_of_page
    Write the Report and Column Headings
    form top_of_page.
    skip.
    format color col_heading on.
    if r_all eq c_x.
    write: /1(193) 'NATIONAL DRILLING COMPANY'(009) centered,
    /1(193) 'Employee Details Report'(066) centered.
    elseif r_per eq c_x.
    write: /1(193) 'NATIONAL DRILLING COMPANY'(009) centered,
    /1(193) 'Employee Details - Personal Data'(010)
    centered.
    elseif r_pay eq c_x.
    write: /1(172) 'NATIONAL DRILLING COMPANY'(009) centered,
    /1(172) 'Employee Details - Payroll Data'(027)
    centered.
    elseif r_edn eq c_x.
    write: /1(172) 'NATIONAL DRILLING COMPANY'(009) centered,
    /1(172) 'Employee Details - Education Data'(028)
    centered.
    elseif r_pemp eq c_x.
    write: /1(97) 'NATIONAL DRILLING COMPANY'(009) centered,
    /1(97) 'Employee Details - Previous Employment Data'(029)
    centered.
    elseif r_job eq c_x.
    write: /1(75) 'NATIONAL DRILLING COMPANY'(009) centered,
    /1(75) 'Employee Details - Job History Data'(030)
    centered.
    elseif r_app eq c_x.
    write: /1(192) 'NATIONAL DRILLING COMPANY'(009) centered,
    /1(192) 'Employee Details - Performance Appraisal Data'(031)
    centered.
    endif.
    format color off.
    if pnptimr1 = c_x. " Current Date
    write: /2 'Period From :'(008), sy-datum,
    'To:'(019), sy-datum.
    elseif pnptimr2 = c_x. " Current Month
    write: /2 'Period From :'(008), v_date, 'To:'(019), v_date1.
    elseif pnptimr3 = c_x. " Current Year
    write: /2 'Period From :'(008), v_date, 'To:'(019), v_date1.
    elseif pnptimr4 = c_x. " Upto Today
    write: /2 'Period From :'(008), c_date1, 'To:'(019), sy-datum.
    elseif pnptimr5 = c_x. " From Today
    write: /2 'Period From :'(008), sy-datum, 'To:'(019), c_date2.
    else.
    if ( pnpbegda is initial and pnpendda is initial ).
    write: /2 'Period From :'(008), c_date1, 'To:'(019), c_date2.
    elseif pnpbegda is initial and not pnpendda is initial.
    write: /2 'Period From :'(008), c_date1, 'To:'(019), pnpendda.
    elseif not ( pnpbegda is initial and pnpendda is initial ).
    write: /2 'Period From :'(008), pnpbegda,
    'To:'(019), pnpendda.
    endif.
    endif.
    if not ( r_pemp eq c_x or r_job eq c_x ).
    write: 140 'Report Run Date:'(073), sy-datum.
    if not pnpkostl[] is initial.
    if pnpkostl-high is initial.
    write: /2 'Cost Center :'(074), pnpkostl-low,
    125 'Time :'(075), sy-uzeit.
    else.
    write: /2 'Cost Center From:'(076), pnpkostl-low+7(3),
    'To:'(019), pnpkostl-high,
    140 'Time :'(075), sy-uzeit.
    endif.
    else.
    write: /140 'Time :'(075), sy-uzeit.
    endif.
    if not pnppernr[] is initial.
    if pnppernr-high is initial.
    write: /2 'Personal Number :'(077), pnppernr-low,
    140 'User :'(078), sy-uname.
    else.
    write: /2 'Personal No.From:'(079), pnppernr-low,
    'To:'(019), pnppernr-high,
    140 'User :'(078), sy-uname.
    endif.
    else.
    write: /140 'User :'(078), sy-uname.
    endif.
    write: /140 'Page No :'(080), sy-pagno.
    else.
    write: 48 'Report Run Date:'(073), sy-datum.
    if not pnpkostl[] is initial.
    if pnpkostl-high is initial.
    write: /2 'Cost Center :'(074), pnpkostl-low,
    48 'Time :'(075), sy-uzeit.
    else.
    write: /2 'Cost Center From:'(076), pnpkostl-low+7(3),
    'To:'(019), pnpkostl-high,
    48 'Time :'(075), sy-uzeit.
    endif.
    else.
    write: /48 'Time :'(075), sy-uzeit.
    endif.
    if not pnppernr[] is initial.
    if pnppernr-high is initial.
    write: /2 'Personal Number :'(077), pnppernr-low,
    48 'User :'(078), sy-uname.
    else.
    write: /2 'Personal No.From:'(079), pnppernr-low,
    'To:'(019), pnppernr-high,
    48 'User :'(078), sy-uname.
    endif.
    else.
    write: /48 'User :'(078), sy-uname.
    endif.
    write: /48 'Page No :'(080), sy-pagno.
    endif.
    skip.
    if r_per eq c_x.
    write /1(193) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(40) 'Name'(012) centered,
    53 sy-vline, 54(8) 'Grade'(013) centered,
    62 sy-vline, 63(15) 'Nationality'(017) centered,
    78 sy-vline, 79(10) 'Eng.Date'(014) centered,
    89 sy-vline, 90(10) 'Birth Date'(016) centered,
    100 sy-vline,101(25) 'Location'(026) centered,
    126 sy-vline,127(25) 'Position'(015) centered,
    152 sy-vline,153(40) 'Division'(018) centered,
    193 sy-vline.
    format color off.
    write /1(193) sy-uline.
    elseif r_pay eq c_x.
    write /1(188) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(15) 'Basic'(033) centered,
    28 sy-vline, 29(15) 'Housing Allow.'(034) centered,
    44 sy-vline, 45(15) 'Sup.Allow.'(035) centered,
    60 sy-vline, 61(15) 'Social Allow.'(036) centered,
    76 sy-vline, 77(15) 'Child Allow.'(037) centered,
    92 sy-vline, 93(15) 'Fixed Overtime'(038) centered,
    108 sy-vline,109(15) 'R.A.Allow.'(041) centered,
    124 sy-vline,125(15) 'Perform.Allow.'(039) centered,
    140 sy-vline,141(15) 'Pension.Allow.'(059) centered,
    156 sy-vline,157(15) 'Others'(040) centered,
    172 sy-vline,173(15) 'Total'(042) centered,
    188 sy-vline.
    format color off.
    write /1(188) sy-uline.
    elseif r_edn eq c_x.
    write /1(172) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(25) 'Discipline'(043) centered,
    38 sy-vline, 39(20) 'Edu.Establishment'(044) centered,
    59 sy-vline, 60(45) 'Institute'(045) centered,
    105 sy-vline,106(15) 'Country'(046) centered,
    121 sy-vline,122(30) 'Certificate'(047) centered,
    152 sy-vline,153(19) 'Duration of Course'(048) centered,
    172 sy-vline.
    format color off.
    write /1(172) sy-uline.
    elseif r_pemp eq c_x.
    write /1(97) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 12 sy-vline,
    33 sy-vline, 34(21) 'Employment Period'(055) centered,
    55 sy-vline, 81 sy-vline,
    97 sy-vline.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(20) 'Employer'(049) centered,
    33 sy-vline, 34(10) 'From'(050) centered,
    44 sy-vline, 45(10) 'To'(051) centered,
    55 sy-vline, 56(25) 'Last Position'(052) centered,
    81 sy-vline, 82(15) 'Country'(053) centered,
    97 sy-vline.
    format color off.
    write /1(97) sy-uline.
    elseif r_job eq c_x.
    write /1(75) sy-uline.
    format color col_heading on.
    write:/1 sy-vline,
    12 sy-vline,13(10) 'Date of'(054) centered,
    23 sy-vline,49 sy-vline,
    75 sy-vline.
    write:/1 sy-vline,2(10) 'Employee #'(011),
    12 sy-vline,13(10) 'Upgrading/'(058) centered,
    23 sy-vline,24(25) 'Position'(015) centered,
    49 sy-vline,50(25) 'Job'(056) centered,
    75 sy-vline.
    write:/1 sy-vline, 12 sy-vline,
    13(10) 'Promotion'(057) centered,
    23 sy-vline, 49 sy-vline,
    75 sy-vline.
    format color off.
    write /1(75) sy-uline.
    elseif r_app eq c_x.
    format color col_heading on.
    write: /1 sy-vline,2(56) sy-uline, 58 sy-vline,
    /1 sy-vline, 2(56) text-025 centered color 3, 58 sy-vline.
    write /1(58) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(4) 'Year'(067),
    17 sy-vline, 18(40) 'Appraisal Text'(068) centered,
    58 sy-vline.
    format color off.
    write /1(58) sy-uline.
    endif.
    endform. "top_of_page
    *& Form end_of_page
    Write the Page footers
    form end_of_page.
    if r_per eq c_x.
    write : /(193) sy-uline.
    elseif r_pay eq c_x.
    write : /(188) sy-uline.
    elseif r_edn eq c_x.
    write : /(172) sy-uline.
    elseif r_pemp eq c_x.
    write /1(97) sy-uline.
    elseif r_job eq c_x.
    write /1(75) sy-uline.
    elseif r_app eq c_x.
    write /1(217) sy-uline.
    endif.
    endform. "end_of_page
    *& Form Display_report
    Write the Report Output
    form display_report.
    if r_all eq c_x.
    if pers_tab[] is initial.
    message i999 with
    'No Personal Data found'(061).
    else.
    write: /1 sy-vline,2(51) sy-uline, 53 sy-vline,
    /1 sy-vline, 2(50) text-020 centered color 3, 53 sy-vline.
    write /1(193) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(40) 'Name'(012) centered,
    53 sy-vline, 54(8) 'Grade'(013) centered,
    62 sy-vline, 63(15) 'Nationality'(017) centered,
    78 sy-vline, 79(10) 'Eng.Date'(014) centered,
    89 sy-vline, 90(10) 'Birth Date'(016) centered,
    100 sy-vline,101(25) 'Location'(026) centered,
    126 sy-vline,127(25) 'Position'(015) centered,
    152 sy-vline,153(40) 'Division'(018) centered,
    193 sy-vline.
    format color off.
    write /1(193) sy-uline.
    sort pers_tab by pernr.
    loop at pers_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) pers_tab-pernr,
    12 sy-vline, 13(40) pers_tab-ename,
    53 sy-vline, 56(6) pers_tab-trfgr,
    62 sy-vline, 63(15) pers_tab-ntext,
    78 sy-vline, 79(10) pers_tab-hdate,
    89 sy-vline, 90(10) pers_tab-gbdat,
    100 sy-vline,101(25) pers_tab-name1,
    126 sy-vline,127(25) pers_tab-ptext,
    152 sy-vline,153(40) pers_tab-ctext,
    193 sy-vline.
    endloop.
    write /1(193) sy-uline.
    endif.
    skip 3.
    if pay_tab[] is initial.
    message i999 with
    'No Standard Pay Data found'(062).
    else.
    write: /1 sy-vline,2(42) sy-uline, 44 sy-vline,
    /1 sy-vline, 2(42) text-021 centered color 3, 44 sy-vline.
    format color col_heading on.
    write /1(188) sy-uline.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(15) 'Basic'(033) centered,
    28 sy-vline, 29(15) 'Housing Allow.'(034) centered,
    44 sy-vline, 45(15) 'Sup.Allow.'(035) centered,
    60 sy-vline, 61(15) 'Social Allow.'(036) centered,
    76 sy-vline, 77(15) 'Child Allow.'(037) centered,
    92 sy-vline, 93(15) 'Fixed Overtime'(038) centered,
    108 sy-vline,109(15) 'R.A.Allow.'(041) centered,
    124 sy-vline,125(15) 'Perform.Allow.'(039) centered,
    140 sy-vline,141(15) 'Pension.Allow.'(059) centered,
    156 sy-vline,157(15) 'Others'(040) centered,
    172 sy-vline,173(15) 'Total'(042) centered,
    188 sy-vline.
    format color off.
    write /1(188) sy-uline.
    sort pay_tab by pernr.
    loop at pay_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) pay_tab-pernr,
    12 sy-vline,
    13(15) pay_tab-basic currency pay_tab-waers no-zero,
    28 sy-vline,
    29(15) pay_tab-hra_allow currency pay_tab-waers no-zero,
    44 sy-vline,
    45(15) pay_tab-sup_allow currency pay_tab-waers no-zero,
    60 sy-vline,
    61(15) pay_tab-soc_allow currency pay_tab-waers no-zero,
    76 sy-vline,
    77(15) pay_tab-chl_allow currency pay_tab-waers no-zero,
    92 sy-vline,
    93(15) pay_tab-fix_allow currency pay_tab-waers no-zero,
    108 sy-vline,
    109(15) pay_tab-ra_allow currency pay_tab-waers no-zero,
    124 sy-vline,
    125(15) pay_tab-per_allow currency pay_tab-waers no-zero,
    140 sy-vline.
    pay_tab-pen_allow = pay_tab-pen_allow * -1.
    write: 141(15) pay_tab-pen_allow currency pay_tab-waers no-zero,
    156 sy-vline,
    157(15) pay_tab-oth_allow currency pay_tab-waers no-zero,
    172 sy-vline,
    173(15) pay_tab-tot_allow currency pay_tab-waers no-zero,
    188 sy-vline.
    endloop.
    write /1(188) sy-uline.
    endif.
    skip 3.
    if edn_tab[] is initial.
    message i999 with
    'No Educational Data found'(063).
    else.
    write: /1 sy-vline,2(36) sy-uline, 38 sy-vline,
    /1 sy-vline, 2(36) text-022 centered color 3, 38 sy-vline.
    format color col_heading on.
    write /1(172) sy-uline.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(25) 'Discipline'(043) centered,
    38 sy-vline, 39(20) 'Edu.Establishment'(044) centered,
    59 sy-vline, 60(45) 'Institute'(045) centered,
    105 sy-vline,106(15) 'Country'(046) centered,
    121 sy-vline,122(30) 'Certificate'(047) centered,
    152 sy-vline,153(19) 'Duration of Course'(048) centered,
    172 sy-vline.
    format color off.
    write /1(172) sy-uline.
    sort edn_tab by pernr.
    loop at edn_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) edn_tab-pernr,
    12 sy-vline, 13(25) edn_tab-atext,
    38 sy-vline, 39(20) edn_tab-stext,
    59 sy-vline, 60(45) edn_tab-insti,
    105 sy-vline,106(15) edn_tab-landx,
    121 sy-vline,122(30) edn_tab-ctext,
    152 sy-vline,153(4) edn_tab-anzkl,
    157(10) edn_tab-etext,
    172 sy-vline.
    endloop.
    write /1(172) sy-uline.
    endif.
    skip 3.
    if pemp_tab[] is initial.
    message i999 with
    'No Previous Employment Data found'(064).
    else.
    write: /1 sy-vline,2(53) sy-uline, 55 sy-vline,
    /1 sy-vline, 2(53) text-023 centered color 3, 55 sy-vline.
    write /1(97) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 12 sy-vline,
    33 sy-vline, 34(21) 'Employment Period'(055) centered,
    55 sy-vline, 81 sy-vline,
    97 sy-vline.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(20) 'Employer'(049) centered,
    33 sy-vline, 34(10) 'From'(050) centered,
    44 sy-vline, 45(10) 'To'(051) centered,
    55 sy-vline, 56(25) 'Last Position'(052) centered,
    81 sy-vline, 82(15) 'Country'(053) centered,
    97 sy-vline.
    format color off.
    write /1(97) sy-uline.
    sort pemp_tab by pernr.
    loop at pemp_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) pemp_tab-pernr,
    12 sy-vline, 13(20) pemp_tab-arbgb,
    33 sy-vline, 34(10) pemp_tab-begda,
    44 sy-vline, 45(10) pemp_tab-endda,
    55 sy-vline, 56(25) pemp_tab-stltx,
    81 sy-vline, 82(15) pemp_tab-landx,
    97 sy-vline.
    endloop.
    write /1(97) sy-uline.
    endif.
    skip 2.
    new-page.
    if job_tab[] is initial.
    message i999 with
    'No Job History Data found'(065).
    else.
    write: /1 sy-vline,2(47) sy-uline, 49 sy-vline,
    /1 sy-vline, 2(47) text-024 centered color 3, 49 sy-vline.
    format color col_heading on.
    write /1(75) sy-uline.
    write:/1 sy-vline,
    12 sy-vline,13(10) 'Date of'(054) centered,
    23 sy-vline,49 sy-vline,
    75 sy-vline.
    write:/1 sy-vline,2(10) 'Employee #'(011),
    12 sy-vline,13(10) 'Upgrading/'(058) centered,
    23 sy-vline,24(25) 'Position'(015) centered,
    49 sy-vline,50(25) 'Job'(056) centered,
    75 sy-vline.
    write:/1 sy-vline, 12 sy-vline,
    13(10) 'Promotion'(057) centered,
    23 sy-vline, 49 sy-vline,
    75 sy-vline.
    format color off.
    write /1(75) sy-uline.
    sort job_tab by pernr.
    loop at job_tab.
    format color col_normal.
    at new pernr.
    write:/1 sy-vline, 2(10) job_tab-pernr.
    endat.
    write: 1 sy-vline, 12 sy-vline,
    13(10) job_tab-begda,
    23 sy-vline,24(25) job_tab-ptext,
    49 sy-vline,50(25) job_tab-stltx,
    75 sy-vline.
    new-line.
    endloop.
    write /1(75) sy-uline.
    endif.
    skip 3.
    if app_tab[] is initial.
    message i999 with
    'No Performance Appraisal Data found'(072).
    else.
    write: /1 sy-vline,2(56) sy-uline, 58 sy-vline,
    /1 sy-vline, 2(56) text-025 centered color 3, 58 sy-vline.
    write /1(58) sy-uline.
    format color col_heading on.
    write:/1 sy-vline, 2(10) 'Employee #'(011),
    12 sy-vline, 13(4) 'Year'(067),
    17 sy-vline, 18(40) 'Appraisal Text'(068) centered,
    58 sy-vline.
    format color off.
    write /1(58) sy-uline.
    sort app_tab by pernr.
    loop at app_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) app_tab-pernr,
    12 sy-vline, 13(4) app_tab-year,
    17 sy-vline, 18(40) app_tab-appr,
    58 sy-vline.
    endloop.
    write /1(58) sy-uline.
    endif.
    skip 2.
    elseif r_per eq c_x.
    if pers_tab[] is initial.
    message i999 with
    'No Data found for the entered Selection'(032).
    else.
    sort pers_tab by pernr.
    loop at pers_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) pers_tab-pernr,
    12 sy-vline, 13(40) pers_tab-ename,
    53 sy-vline, 56(6) pers_tab-trfgr,
    62 sy-vline, 63(15) pers_tab-ntext,
    78 sy-vline, 79(10) pers_tab-hdate,
    89 sy-vline, 90(10) pers_tab-gbdat,
    100 sy-vline,101(25) pers_tab-name1,
    126 sy-vline,127(25) pers_tab-ptext,
    152 sy-vline,153(40) pers_tab-ctext,
    193 sy-vline.
    endloop.
    write /1(193) sy-uline.
    endif.
    elseif r_pay eq c_x.
    if pay_tab[] is initial.
    message i999 with
    'No Data found for the entered Selection'(032).
    else.
    sort pay_tab by pernr.
    loop at pay_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) pay_tab-pernr,
    12 sy-vline,
    13(15) pay_tab-basic currency pay_tab-waers no-zero,
    28 sy-vline,
    29(15) pay_tab-hra_allow currency pay_tab-waers no-zero,
    44 sy-vline,
    45(15) pay_tab-sup_allow currency pay_tab-waers no-zero,
    60 sy-vline,
    61(15) pay_tab-soc_allow currency pay_tab-waers no-zero,
    76 sy-vline,
    77(15) pay_tab-chl_allow currency pay_tab-waers no-zero,
    92 sy-vline,
    93(15) pay_tab-fix_allow currency pay_tab-waers no-zero,
    108 sy-vline,
    109(15) pay_tab-ra_allow currency pay_tab-waers no-zero,
    124 sy-vline,
    125(15) pay_tab-per_allow currency pay_tab-waers no-zero,
    140 sy-vline.
    pay_tab-pen_allow = pay_tab-pen_allow * -1.
    write: 141(15) pay_tab-pen_allow currency pay_tab-waers no-zero,
    156 sy-vline,
    157(15) pay_tab-oth_allow currency pay_tab-waers no-zero,
    172 sy-vline,
    173(15) pay_tab-tot_allow currency pay_tab-waers no-zero,
    188 sy-vline.
    endloop.
    write /1(188) sy-uline.
    endif.
    elseif r_edn eq c_x.
    if edn_tab[] is initial.
    message i999 with
    'No Data found for the entered Selection'(032).
    else.
    sort edn_tab by pernr.
    loop at edn_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) edn_tab-pernr,
    12 sy-vline, 13(25) edn_tab-atext,
    38 sy-vline, 39(20) edn_tab-stext,
    59 sy-vline, 60(45) edn_tab-insti,
    105 sy-vline,106(15) edn_tab-landx,
    121 sy-vline,122(30) edn_tab-ctext,
    152 sy-vline,153(4) edn_tab-anzkl,
    157(10) edn_tab-etext,
    172 sy-vline.
    endloop.
    write /1(172) sy-uline.
    endif.
    elseif r_pemp eq c_x.
    if pemp_tab[] is initial.
    message i999 with
    'No Data found for the entered Selection'(032).
    else.
    sort pemp_tab by pernr.
    loop at pemp_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) pemp_tab-pernr,
    12 sy-vline, 13(20) pemp_tab-arbgb,
    33 sy-vline, 34(10) pemp_tab-begda,
    44 sy-vline, 45(10) pemp_tab-endda,
    55 sy-vline, 56(25) pemp_tab-stltx,
    81 sy-vline, 82(15) pemp_tab-landx,
    97 sy-vline.
    endloop.
    write /1(97) sy-uline.
    endif.
    elseif r_job eq c_x.
    if job_tab[] is initial.
    message i999 with
    'No Data found for the entered Selection'(032).
    else.
    sort job_tab by pernr.
    loop at job_tab.
    format color col_normal.
    at new pernr.
    write:/1 sy-vline, 2(10) job_tab-pernr.
    endat.
    write: 1 sy-vline, 12 sy-vline,
    13(10) job_tab-begda,
    23 sy-vline,24(25) job_tab-ptext,
    49 sy-vline,50(25) job_tab-stltx,
    75 sy-vline.
    new-line.
    endloop.
    write /1(75) sy-uline.
    endif.
    elseif r_app eq c_x.
    if app_tab[] is initial.
    message i999 with
    'No Data found for the entered Selection'(032).
    else.
    sort app_tab by pernr.
    loop at app_tab.
    format color col_normal.
    write:/1 sy-vline, 2(10) app_tab-pernr,
    12 sy-vline, 13(4) app_tab-year,
    17 sy-vline, 18(40) app_tab-appr,
    58 sy-vline.
    endloop.
    write /1(58) sy-uline.
    endif.
    endif.
    endform. " Display_report
    <b>Reward points if useful</b>
    Regards
    Ashu

  • About HR-ABAP Sample program.

    Hi,
    I am new to SAP.I wanna know about basics about HR-ABAP can any one help me to get very basic ideas in HR-ABAP.
    Thanks,
    Sakthi.

    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.
    http://www.sapdevelopment.co.uk/hr/hrhome.htm
    See:
    http://help.sap.com/saphelp_46c/helpdata/en/4f/d5268a575e11d189270000e8322f96/content.htm
    sites regarding hr-abap:
    http://www.sapdevelopment.co.uk/hr/hrhome.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
    http://www.erpgenie.com/faq/hr.htm.
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
    These are the FAQ's that might helps you as well.
    http://www.sap-img.com/human/hr-faq.htm
    http://www.sapgenie.com/faq/hr.htm
    http://www.planetsap.com/hr_abap_main_page.htm
    http://www.atomhr.com/library_full.htm
    HR Long texts Upload
    Look at the below link
    BDC - hr maintain text
    Please refer to the following sample program for accessing PCH LDB.
    For concept to start with refer url:
    http://www.sap-press.de/download/dateien/860/sappress_mysap_hr_technical_principles2.pdf
    It contains info regarding PCH Reporting.
    REPORT zhsol010.
    TABLES: objec, gdstr.
    INFOTYPES: 0002, 0006, 1003.
    DATA: stabs LIKE p1003-stabs,
    name LIKE p0001-ename.
    INITIALIZATION.
    pchotype = 'O'.
    pchwegid = 'O-S-P'.
    GET objec.
    IF objec-otype = 'S'.
    CLEAR stabs.
    LOOP AT p1003 WHERE begda LE pc-endda
    AND endda GE pc-begda.
    IF p1003-stabs = 'X'.
    stabs = 'X'.
    WRITE : / objec-objid, objec-short, objec-stext.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF objec-otype = 'P' AND stabs = 'X'.
    PROVIDE vorna nachn FROM p0002
    subty telnr FROM p0006
    BETWEEN pc-begda and pc-endda
    WHERE p0006-subty = '1'.
    IF p0006_valid = 'X'.
    CONCATENATE p0002-vorna p0002-nachn INTO name
    SEPARATED BY space.
    WRITE: / name, p0006-telnr.
    SKIP.
    ENDIF.
    ENDPROVIDE.
    ENDIF.
    <b>sample code:</b>
    REPORT zpwtest .
    TABLES : t001 .
    TYPE-POOLS slis .
    DATA : t_t001     TYPE TABLE OF t001        ,
           t_abaplist TYPE TABLE OF abaplist    .
    DATA : w_abaplist TYPE abaplist .
    SELECT-OPTIONS : s_bukrs FOR t001-bukrs OBLIGATORY .
    PARAMETERS     : p_list  TYPE c NO-DISPLAY .
    START-OF-SELECTION .
      IF sy-batch = 'X' AND p_list IS INITIAL .
      Submit report and get list in memory
        SUBMIT zpwtest EXPORTING LIST TO MEMORY
                       WITH s_bukrs IN s_bukrs
                       WITH p_list = 'X'
                   AND RETURN.
      Get the list from memory.
        CALL FUNCTION 'LIST_FROM_MEMORY'
             TABLES
                  listobject = t_abaplist
             EXCEPTIONS
                  not_found  = 1
                  OTHERS     = 2.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      Send report to mail receipent
        PERFORM send_mail .
      ELSE.
        PERFORM select_data .
        PERFORM display_data .
      ENDIF.
    *SO_NEW_DOCUMENT_SEND_API1
    *&      Form  select_data
    FORM select_data.
      SELECT *
        INTO TABLE t_t001
        FROM t001
       WHERE bukrs IN s_bukrs .
    ENDFORM.                    " select_data
    *&      Form  display_data
    FORM display_data.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                i_structure_name = 'T001'
           TABLES
                t_outtab         = t_t001
           EXCEPTIONS
                program_error    = 1
                OTHERS           = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " display_data
    *&      Form  send_mail
    FORM send_mail.
      DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
            receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
            packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
            listobject LIKE abaplist OCCURS 10,
            compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
            w_object_hd_change LIKE sood1,
            compressed_size LIKE sy-index.
    Fot external email id
    receiver_list-recextnam = '[email protected]'.
    receiver_list-recesc = 'E'.
    receiver_list-sndart = 'INT'.
    receiver_list-sndpri = '1'.
    FOr internal email id
      receiver_list-recnam = sy-uname .
      receiver_list-esc_des = 'B'.
      APPEND receiver_list.
    General data
      w_object_hd_change-objla = sy-langu.
      w_object_hd_change-objnam = 'Object name'.
      w_object_hd_change-objsns = 'P'.
    Mail subject
      w_object_hd_change-objdes = 'Message subject'.
    Mail body
      APPEND 'Message content' TO message_content.
      CALL FUNCTION 'TABLE_COMPRESS'
           IMPORTING
                compressed_size = compressed_size
           TABLES
                in              = t_abaplist
                out             = compressed_attachment.
      DESCRIBE TABLE compressed_attachment.
      CLEAR packing_list.
      packing_list-transf_bin = 'X'.
      packing_list-head_start = 0.
      packing_list-head_num = 0.
      packing_list-body_start = 1.
      packing_list-body_num = sy-tfill.
      packing_list-objtp = 'ALI'.
      packing_list-objnam = 'Object name'.
      packing_list-objdes = 'Attachment description'.
      packing_list-objlen = compressed_size.
      APPEND packing_list.
      CALL FUNCTION 'SO_OBJECT_SEND'
           EXPORTING
                object_hd_change = w_object_hd_change
                object_type      = 'RAW'
                owner            = sy-uname
           TABLES
                objcont          = message_content
                receivers        = receiver_list
                packing_list     = packing_list
                att_cont         = compressed_attachment.
    ENDFORM.                    " send_mail
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • About script

    i am print the item details in main window. for this i can write the external subroutine using itcsy structure.
       but my problem is in which position i can call this subroutine in main window text editor.
    (this script for rfq create , i was modify the Medruck layout set)

    I am not sure about MEDRUCK ( I am a HR person).  But you can call this subroutine anywhere (any window) before you access the variable from the subroutine.
    Please find the sample coding which I used in HR to get the benefit area passing Personnel number.
    Calling the subroutine from the main window:
    /: PERFORM GET_BENEFIT_AREA IN PROGRAM ZHBNF_BEN_ENROLL  
    /: USING &P0001-PERNR&                                   
    /: CHANGING &P_BAREA&&                                   
    /: ENDPERFORM                                            
    /: IF &P_BAREA& EQ 'H1'                                  
    /: INCLUDE ZHEX-MACRO-H1LOGO OBJECT TEXT ID ST           
    /: ELSEIF &P_BAREA& EQ 'H2'                              
    /: INCLUDE ZHEX-MACRO-H2LOGO OBJECT TEXT ID ST           
    /: ELSEIF &P_BAREA& EQ 'H3'                              
    /: INCLUDE ZHEX-MACRO-H3LOGO OBJECT TEXT ID ST           
    /: ELSEIF &P_BAREA& EQ 'U1'                              
    /: INCLUDE ZHEX-MACRO-U1LOGO OBJECT TEXT ID ST           
    /: ENDIF                                                 
    Coding inthe external program:
    *&      Form  get_benefit_area
          This subroutine is used to determine benefit area
    FORM get_benefit_area TABLES intab STRUCTURE  itcsy
                                 outtab STRUCTURE itcsy.
      DATA: l_pernr TYPE p0001-pernr,
            l_barea TYPE p0171-barea.
      READ TABLE intab WITH KEY 'P0001-PERNR'.
      CHECK sy-subrc = 0.
      l_pernr = intab-value.
      SELECT SINGLE barea INTO l_barea
                             FROM pa0171
                             WHERE pernr = l_pernr
                               AND begda <= sy-datum
                               AND endda >= sy-datum.
      READ TABLE outtab WITH KEY 'P_BAREA'.
      CHECK sy-subrc = 0.
      IF sy-subrc = 0.
        outtab-value+0(2) = l_barea.
        MODIFY outtab INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    "get_benefit_area

  • Adobe Bridge in Photoshop - How to install Bridge and camera raw? And what is it all about?

    Hi everyone! I am actually in love with this adobe photoshop. I used PSCS2 before, but later on upgraded to CS4. But I feel tired in upgrading to CS5.
    One time, I found a tutorial in youtube about camera raw, and would really want to use it. But I was wondering how to install the camera raw. I believe camera raw is a plugin? so I downloaded the plugin here, installed it in my PS. I downloaded a file Camera Raw.8bi and paste it on my C drive - C:\Program Files\Adobe\Photoshop CS4\Plug-ins\File Formats.
    I now am very confused, how will I open it? I do not have adobe bridge!  After I installed the camera raw, I opened my PS. I clicked the file>then browse in bridge. I had an error, it's "error 2 photoshop11 undefined". Which is what I thought, I might have done something wrong with installing it.
    My question is, do you still need adobe bridge installed in order to use camera raw?
    If yes, how does it work? How am I suppose to open camera raw?
    If no, how am I going to open camera raw without bridge?
    And also, where will I download adobe bridge? I cannot find one here for CS4, only adobe bridge for CS5. I am wondering, is it okay to install adobe bridge CS5 and use it with my PS CS4?
    I badly need help!

    WebDAV (Web-based Distributed Authoring and Versioning) is a set of extensions to HTTP/1.1.
    The main difference from FTP as far as I can see is that it allows you to edit documents on a remote web server.
    WebDAV was used by the Apple server - MobileMe but is not generally supported by hosting services.
    Using WebDAV you can mount a directory locally. This was how iDisk worked on your Mac and you could drag files onto it to upload them to the remote directory.
    With WebDAV, a number of users can share a directory which is why its used in local networks but presents security problems when using a remote server.
    If you are into file sharing rather than publishing, Dropbox or its new rival SugarSync are more appropriate.

  • A few days ago i bought the macbook pro in a Providence. In late Summer i will come back to my Country - Ukraine. I would like to know about a tax for my laptop. Can i return tax? Through the TAX FREE or return in airport? What should i do?

    A few days ago i bought the macbook pro in a Providence. In late Summer i will come back to my Country - Ukraine. I would like to know about a tax for my
    laptop. Can i return tax? Through the TAX FREE or return in airport? What should i do?

    You need to talk with the tax authorities in the countries to which you traveled and that of your home country. We are all end-users liek you and not Apple agents.

  • I am trying to use itunes, it will not open at all, have uninstalled and downloaded new software and 64bit for windows. i have an old ipod nano from about 5 years ago. anything i can do, even to view my purchases and watch/listen to music etc?

    ok i have a advent roma laptop with window 7. my itunes used to work fine, completely. every time i plugged in my ipod it was ok. recently my ipod was not working so i never bothered with itunes, however i have movies/tv prog that i purchased and would like to view them. i have an ipod nano from about 5 years ago, the problem with thet is, it switches on, but the circular control panel does nothing, all you can do is lock and unlock it - nothing else.
    i tried to download new version of itunes, then uninstalled my origonal version, incase it was corrupted etc, i then again tried to down load new version and also version that is windows 64bit. still when i select the downlaod to open as son as it is finnished nothing happens. and now my desktop shortcut has dissapeared. before when it was there, id double click it, nothing, right click to open it, nothing.
    im not the best technically minded but i just dont see what im doing wrong here, please help

    Perhaps it would be helpful for you to view the page source code of this page
    http://www.alanwork.com/
    As you can see, the submenu code links are immediately below the top level code, and are
    wrapped in their own  <UL> </UL> tag pairs.
    Hope that helps

  • Vendor payments and debts about an asset

    Dear sap colleages
    I need to know these information about an ASSET:
    Purchased orders,
    Items from purchase orders,
    which of these items i've received, i've paid (also date), i've not paid ( amount of debt related to asset)
    payments in advanced (date),
    wich of these payments have been cleared (clearing date) and wich not,
    who is the vendor,
    other expenses (such as delivery)
    the amount of taxes,
    invoices related and NOT RELATED TO purchase order
    payments without invoice
    Which transactions do i need to follow?
    or
    Which document flow?
    or
    Which tables? Wich keys?
    or
    Is there a standard report that can give me such information?
    Any documentation and/or code will be appreciated.
    I need to program a report to integrate all these information.
    Thanks and Kind Regards

    Hi,
    Refer to T.code AW01N - Asset Explorer .
    Additionally you cna also refer to SAP Standard reports in Asset Accounting
    Accounting - Financial Accounting - Fixed Assets - Information System - Reports on Asset Accounting
    Please let me know if you need more information.
    Assign points if useful.
    Regards
    Sridhar M

  • I cannot receive email properly now. When I open mail, it says that is downloading about 1,700 emails. At the very end, it gives me my newest ones. But this takes a long time. I've contacted the Internet service provider and verified all the right setting

    I cannot receive email properly on either my IPad or my IPhone. I have had them for over a year and they have always worked fine. Until three days ago, when they both started acting up. On the IPad, when I open mail, it says it is downloading about 1,700 emails. At the very end, which takes quite a while to get to, I finally get the most recent ones. The IPad is sending emails just fine.
    On my IPhone, when I open mail, it says it is downloading 100 emails, but it doesn't do that. And it gives me no new emails at all. The IPhone is sending email just fine.
    I have already deleted the email accounts on both devices and reinstalled them. I've contacted the Internet service provider and verified all the right settings. The Outlook email on my desktop is working perfectly.

    WMV is a heavily-compressed format/CODEC, and the processing time will depend on several factors:
    Your CPU, which is not that powerful in your case
    Your I/O sub-system, which is likely a single HDD on your laptop
    The source footage. What is your source footage?
    Any Effects added to that footage. Do you have any Effects?
    Each of those will have an impact on the time required.
    The trial has only one main limitation - the watermark. Now, there are some components, that have to be activated, but are not with the trial, but they would be evident with Import of your source footage, if it's an issue.
    Good luck,
    Hunt

  • I have had my IPAD2 for quite a while but haven't activated my cellular data for about a year.  I am now trying to activate and when I go to cellular data, turn it on and try to tap view account i just get a message that says "connection to server lost".

    I have had my IPAD2 for quite a while but haven't activated my cellular data for about a year.  I am now trying to activate and when I go to cellular data, turn it on and try to tap view account i just get a message that says "connection to server lost".  I could swear the last time I used cellular data you would see the signal in the upper left corner and I only see "no service" there, I am in a location where I know I should have service.  Is there something I should do to my IPAD?  I tried resetting, I tried clearing cookies and history in Safari (after reading a post n these discussions).  I don't know what to do next. My IOS version is 6.1.3.  I did go into Network from the general tab and I see it says "SIM not provisioned".    HELP and Thank you in advance.

    Hello Theresa818,
    Thank you for using Apple Support Communities!
    It sounds like the cellular data will not activate for some reason on the iPad.
    I found this article that will help you resolve this issue here, named iPad (Wi-Fi + Cellular Models): Troubleshooting a cellular data connection, found here http://support.apple.com/kb/TS4249
    Check for a carrier settings update.
    Update your iPad.
    Toggle the Cellular Data setting off and on under Settings > Cellular Data.
    Restart your iPad.
    Tap Settings > General > About. Locate the Carrier entry and make sure that your carrier is correct.
    If your SIM card has SIM PIN enabled, try turning it off: Tap Settings > Cellular Data > SIM PIN.
    Make sure you're in an area of good coverage. If the cellular data connection works in another area, contact your carrier to report the original affected area.
    Reset network settings: Tap Settings > General > Reset > Reset Network Settings.
    Restore the iPad as new.
    If none of the above steps resolves the issue, make an appointment at an Apple Retail Store, contact your carrier, or contact AppleCare to troubleshoot further.
    I know you may have done one or two of the steps here, so you can skip those.
    Take care,
    Sterling

  • Doubt about report FBL5N of screen field:Open items and Cleared items

    hi
    i know the report FBL5N is use DDF LDB and the report work flow is BSID->BKFP->BSEG
    but i don't know to differentiate Open Items and Cleared items in this report.
    Open items and Cleared items stand for a field flag in these table (BSID,BKFP,BSEG )? if true the field is?
    or they must be calc in program ? if true what about calc rules?
    waiting for help! thank you!

    Hi,
    Here is the difference in Open Items and Cleared Items.
    In FI first the document is Open (when it is posted) so the entry is made in table BSID. Once the document is cleared, it will move from BSID to BSAD. And for Cleared item you will see Clearing Document no and Clearing date values updated (these are blank when the item is open).
    The only difference in Open and Cleared is via Clearing Document and Clearing Date. If the values are present, it means document is cleared.
    Hope this helps.
    ashish
    Message was edited by:
            Ashish Gundawar

Maybe you are looking for

  • Refresh Variable values in WAD

    We have a strange problem in WAD. Actually we are on 731 on Hana and we have built a web report with WAD which contain 20 queries. these queries has 2 varibales: - calyear - Company code As ex when we launch the report with variable's values 2013 - C

  • Photoshop CS6 patch on OS X 10.10

    I just know about the existence of Photoshop CS6 patch on OS X 10.10. And I need to install the patch in order to use my Wacom tablet in Photoshop CS6 on my OS X 10.10.1. If I don't install the patch, the tablet works very slow. And this situation re

  • Indesign CS6 - Tooltips (Quickinfos) in Werkzeugleiste und Bedienfeldern erscheinen nicht mehr ?

    CS6 Indesign auf Windows 7 Habe schon viel ohne Erfolg gemacht, um die unentbehrlichen Tooltips wieder zum Erscheinen zu bringen. Habe Firefox gelöscht und durch Opera ersetzt, alle add-on und Kasperski Sicherheit deaktiviert, kleinere Programme gelö

  • Regarding the Smartforms

    HI All, Its an very urgent requirement . I have to create the second page in smartforms in that i need to print the text , so iam creating the second page in that i placed the normal window , in that i created the text , but in attributes i keeping b

  • Hi about bobi4

    hi  friends Iam looking to know the difference between Boxi3  and BOBI4  .what has changed and what is the extra features in bobi4 kindly give me the navigation's  to  enter the reporting tool ( which is new) or please assist me some notes or links w