Monday, 2 February 2015

                        HR-Programs

REPORT ZRTEST.
TABLES PERNR.
INFOTYPES: 0000, 0006.
START-OF-SELECTION.
GET PERNR.
  WRITE: PERNR-PERNR, PERNR-ENAME, P0000-MASSN,
                P0000-STAT2, P0006-ORT01, P0006-STRAS.


input:
output:

REPORT Z_HR_HIRE_FIRE.
TABLES PERNR.
INFOTYPES: 0000, 0001.
DATA: ITAB TYPE PHIFI OCCURS 0.
DATA: G_BEGDA TYPE P0000-BEGDA,
            G_ENDDA TYPE P0000-ENDDA.

INITIALIZATION.
RP-SEL-EIN-AUS-INIT.
START-OF-SELECTION.
GET PERNR.
RP-LOWDATE-HIGHDATE.

CALL FUNCTION 'RP_HIRE_FIRE'

 IMPORTING
   FIRE_DATE       = G_BEGDA
   HIRE_DATE       = G_ENDDA
  TABLES
    PPHIFI          = ITAB
    PP0000          = P0000
    PP0001          = P0001.

 WRITE: / P0000-PERNR, G_BEGDA, G_ENDDA, P0001-WERKS.

input:
output:
REPORT ZR_H109_PERNR.
TYPE-POOLS: SLIS.
TABLES PERNR.
TYPES : BEGIN OF TY_PERNR,
         PERNR TYPE PERNR-PERNR,          "PERSONNEL NUMBER
         MASSN TYPE PERNR-MASSN,          "Acton-Type
         mntxt  type t529t-mntxt,                        "Name of Action type
         STAT2 TYPE PERNR-STAT2,             "Employee Status
         BUKRS TYPE PERNR-BUKRS,          "Company code
         BUTXT TYPE T001-BUTXT,
         WERKS TYPE PERNR-WERKS,          "Personnel Area
         PERSG TYPE PERNR-PERSG,           "Employee Group
         PERSK TYPE PERNR-PERSK,           "Employee Subgroup
         BTRTL TYPE PERNR-BTRTL,            "Personnel Subarea
         ABKRS TYPE PERNR-ABKRS,          "Payroll Area
         ENAME TYPE PERNR-ENAME,         "Employee Name
         CHK,
       END OF TY_PERNR,

       begin of ty_t529t,
             massn type t529t-massn,
             mntxt type t529t-mntxt,                        "Name of Action type
       end of ty_t529t,

       begin of ty_t001,
            bukrs type t001-bukrs,
            butxt type t001-butxt,
       end of ty_t001.
 
DATA: IT_PERNR TYPE TABLE OF TY_PERNR,
           WA_PERNR TYPE TY_PERNR,
          it_t529t type table of ty_t529t,
          wa_t529t type ty_t529t,
         it_t001 type table of ty_t001,
         wa_t001 type ty_t001,
      IT_FIELD TYPE SLIS_T_FIELDCAT_ALV,
      WA_FIELD TYPE SLIS_FIELDCAT_ALV.

START-OF-SELECTION.

PERFORM GET_TEXT.                   "TEXT-TABLES


GET PERNR.

read table it_t529t into wa_t529t with key massn = pernr-massn.
READ TABLE IT_T001 INTO WA_T001 WITH KEY BUKRS = PERNR-BUKRS.

  MOVE : PERNR-PERNR TO WA_PERNR-PERNR,
         PERNR-MASSN TO WA_PERNR-MASSN,
         wa_t529t-mntxt to wa_pernr-mntxt,
         PERNR-STAT2 TO WA_PERNR-STAT2,
         PERNR-BUKRS TO WA_PERNR-BUKRS,
         wa_t001-butxt to wa_pernr-butxt,
         PERNR-WERKS TO WA_PERNR-WERKS,
         PERNR-PERSG TO WA_PERNR-PERSG,
         PERNR-PERSK TO WA_PERNR-PERSK,
         PERNR-BTRTL TO WA_PERNR-BTRTL,
         PERNR-ABKRS TO WA_PERNR-ABKRS,
         PERNR-ENAME TO WA_PERNR-ENAME.

  APPEND WA_PERNR TO IT_PERNR.
  CLEAR WA_PERNR.

END-OF-SELECTION.

  PERFORM GET_FIELD USING 'CHK'   'Check Box'        'X' 'X'.
  PERFORM GET_FIELD USING 'PERNR' 'PERSONNEL NUMBER' ' ' ' '.
  PERFORM GET_FIELD USING 'MASSN' 'Acton-Type'       ' ' ' '.
  PERFORM GET_FIELD USING 'MNTXT' 'Name Of Action'   ' ' ' '.
  PERFORM GET_FIELD USING 'STAT2' 'Emp Status'       ' ' ' '.
  PERFORM GET_FIELD USING 'BUKRS' 'Company Code'     ' ' ' '.
  PERFORM GET_FIELD USING 'BUTXT' 'Name Of COMAPNY CODE'   ' ' ' '.
  PERFORM GET_FIELD USING 'WERKS' 'Personnel Area'   ' ' ' '.
  PERFORM GET_FIELD USING 'PERSG' 'EMP group'        ' ' ' '.
  PERFORM GET_FIELD USING 'PERSK' 'EMP Sub Grp'      ' ' ' '.
  PERFORM GET_FIELD USING 'ABKRS' 'Payroll'          ' ' ' '.
  PERFORM GET_FIELD USING 'ENAME' 'EMP NAME'         ' ' ' '.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM                = SY-REPID
     I_CALLBACK_PF_STATUS_SET          = 'MENU_PAINT'
     IT_FIELDCAT                       = IT_FIELD
    TABLES
      T_OUTTAB                          = IT_PERNR
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

FORM GET_FIELD USING    VALUE (P_0126)
                                                VALUE (P_0127)
                                                VALUE (P_CHK)
                                                VALUE (P_EDIT).

  WA_FIELD-FIELDNAME = P_0126.
  WA_FIELD-SELTEXT_L = P_0127.
  WA_FIELD-CHECKBOX = P_CHK.
  WA_FIELD-EDIT      = P_EDIT.

  APPEND WA_FIELD TO IT_FIELD.
  CLEAR WA_FIELD.

ENDFORM.                    " GET_FIELD


FORM MENU_PAINT USING T_EXTAB TYPE SLIS_T_EXTAB.

SET PF-STATUS 'PER'.

ENDFORM.

FORM GET_TEXT .

select massn
            mntxt into table it_t529t
                       from t529t
                       where sprsl = 'E'.

SELECT BUKRS
               BUTXT INTO TABLE IT_T001
                            FROM T001.
ENDFORM.                    " GET_TEXT

input:

OUTPUT:


REPORT  ZR_KVR_HR17.
TABLES PERNR.
INFOTYPES: 0000 MODE N,
           0006,0001.

TYPES: BEGIN OF IT1,
        MASSN TYPE T529T-MASSN,
        MNTXT TYPE T529T-MNTXT,
       END OF IT1.

TYPES: BEGIN OF IT2,
        BUKRS TYPE T001-BUKRS,
        BUTXT TYPE T001-BUTXT,
       END OF IT2.

TYPES: BEGIN OF ITAB,
        PERNR TYPE PERNR-PERNR,
        ENAME TYPE PERNR-ENAME,
        MASSN TYPE P0000-MASSN,
        MNTXT TYPE T529T-MNTXT,
        STAT2 TYPE P0000-STAT2,
        STRAS TYPE P0006-STRAS,
        ORT01 TYPE P0006-ORT01,
        PSTLZ TYPE P0006-PSTLZ,
        BUKRS TYPE P0001-BUKRS,
        BUTXT TYPE T001-BUTXT,
       END OF ITAB.

DATA: WA1  TYPE IT1,
      OUT1 TYPE TABLE OF IT1.

DATA: WA2  TYPE IT2,
      OUT2 TYPE TABLE OF IT2.

DATA: WA  TYPE ITAB,
      OUT TYPE TABLE OF ITAB.

START-OF-SELECTION.

  SELECT MASSN
         MNTXT INTO TABLE OUT1 FROM T529T
               WHERE SPRSL = SY-LANGU.

  SELECT BUKRS
         BUTXT INTO TABLE OUT2 FROM T001.

GET PERNR.

  RP-READ-INFOTYPE PERNR-PERNR 0000 P0000 PN-BEGDA PN-ENDDA.
  READ TABLE OUT1 INTO WA1 WITH KEY MASSN = P0000-MASSN.
  READ TABLE OUT2 INTO WA2 WITH KEY BUKRS = P0001-BUKRS.
  MOVE: PERNR-PERNR TO WA-PERNR,
        PERNR-ENAME TO WA-ENAME,
        WA1-MASSN   TO WA-MASSN,
        WA1-MNTXT   TO WA-MNTXT,
        WA2-BUKRS   TO WA-BUKRS,
        WA2-BUTXT   TO WA-BUTXT,
        P0000-STAT2 TO WA-STAT2,
        P0006-STRAS TO WA-STRAS,
        P0006-ORT01 TO WA-ORT01,
        P0006-PSTLZ TO WA-PSTLZ.
  APPEND WA TO OUT.
  CLEAR WA.

END-OF-SELECTION.

  DATA: O_ALV TYPE REF TO CL_SALV_TABLE.

    TRY.
        CALL METHOD CL_SALV_TABLE=>FACTORY
          IMPORTING
            R_SALV_TABLE   = O_ALV
          CHANGING
            T_TABLE        = OUT.
      CATCH CX_SALV_MSG .
    ENDTRY.
    CALL METHOD O_ALV->DISPLAY.
input:

output:


REPORT  ZRad LINE-SIZE 200.

TABLES PERNR.

INFOTYPES: 0000,0001.

TYPES: BEGIN OF ITAB1,
       MASSN TYPE T529T-MASSN,
       MNTXT TYPE T529T-MNTXT,
       END OF ITAB1.

TYPES: BEGIN OF ITAB2,
        BUKRS TYPE T001-BUKRS,
        BUTXT TYPE T001-BUTXT,
       END OF ITAB2.

TYPES: BEGIN OF ITAB3,
        PERNR TYPE PERNR-PERNR,
        ENAME TYPE PERNR-ENAME,
        MASSN TYPE T529T-MASSN,
        MNTXT TYPE T529T-MNTXT,
        STAT2 TYPE P0000-STAT2,
        BUKRS TYPE T001-BUKRS,
        BUTXT TYPE T001-BUTXT,
       END OF ITAB3.

DATA: WA1 TYPE ITAB1,
      OUT1 TYPE TABLE OF ITAB1.

DATA: WA2 TYPE ITAB2,
      OUT2 TYPE TABLE OF ITAB2.

DATA: WA3 TYPE ITAB3,
      OUT3 TYPE TABLE OF ITAB3.

PARAMETERS: R1 RADIOBUTTON GROUP GP1,
            R2 RADIOBUTTON GROUP GP1.
******************************************************

START-OF-SELECTION.

SELECT MASSN
       MNTXT INTO TABLE OUT1 FROM T529T.

SELECT BUKRS
       BUTXT INTO TABLE OUT2 FROM T001.

GET PERNR.


********************************************************


READ TABLE OUT1 INTO WA1 WITH KEY MASSN = P0000-MASSN.
READ TABLE OUT2 INTO WA1 WITH KEY BUKRS = P0001-BUKRS.

MOVE: PERNR-PERNR TO WA3-PERNR,
      PERNR-ENAME TO WA3-ENAME,
      WA1-MASSN   TO WA3-MASSN,
      WA1-MNTXT   TO WA3-MNTXT,
      P0000-STAT2 TO WA3-STAT2,
      WA2-BUKRS   TO WA3-BUKRS,
      WA2-BUTXT   TO WA3-BUTXT.

APPEND WA3 TO OUT3.
CLEAR WA3.

*ENDLOOP.

END-OF-SELECTION.

IF R1 EQ 'X'.

*LOOP AT P0000..

LOOP AT OUT3 INTO WA3.

WRITE: '1', PERNR-PERNR COLOR 1,
       '2', PERNR-ENAME COLOR 3,
       '3', P0000-MASSN,
       '4', WA3-MNTXT,
       '5', P0000-STAT2,
       '6', P0001-BUKRS,
       '7', WA3-BUTXT.

ENDLOOP.

ELSEIF R2 EQ  'X'.

LOOP AT P0000.

DATA: O_ALV TYPE REF TO CL_SALV_TABLE.

TRY.
CALL METHOD CL_SALV_TABLE=>FACTORY

  IMPORTING
    R_SALV_TABLE   = O_ALV
  CHANGING
    T_TABLE        = OUT3.

 CATCH CX_SALV_MSG .
ENDTRY.

CALL METHOD O_ALV->DISPLAY.

ENDLOOP.

ENDIF.

input:

output:

input:

output:

REPORT  ZR_H116_HRMACRO LINE-SIZE 300.

TABLES PERNR.

INFOTYPES: 0000,0006.

START-OF-SELECTION.

GET PERNR.

END-OF-SELECTION.

RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA.

IF PNP-SW-FOUND EQ 1.
WRITE:/ P0000-PERNR,P0000-BEGDA,P0000-ENDDA,P0000-MASSN.
ENDIF.

RP-PROVIDE-FROM-LAST P0006 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ 1.
WRITE:/ P0006-PERNR,P0006-UNAME,P0006-STRAS,P0006-ORT01.
ENDIF.

input:


output:

REPORT  ZR_KVR_HR6 LINE-SIZE 400.

TABLES PERNR.

INFOTYPES:0000,0006.

START-OF-SELECTION.

GET PERNR.

RP-PROVIDE-FROM-LAST P0006 1 PN-BEGDA PN-ENDDA.

WRITE: 'Perminante Address:' color 2,
       PERNR-PERNR COLOR 1,
       PERNR-ENAME COLOR 3,
       P0000-STAT2 COLOR 4,
       P0006-BEGDA COLOR 5,
       P0006-STRAS COLOR 6,
       P0006-ORT01 COLOR 7,
       P0006-TELNR COLOR 2,
       'Temperory Address: ' color 1,
        PERNR-PERNR COLOR 1,
        PERNR-ENAME COLOR 3,
        P0000-STAT2 COLOR 4,
        P0006-BEGDA COLOR 5,
        P0006-STRAS COLOR 6,
        P0006-ORT01 COLOR 7,
        P0006-TELNR COLOR 2.

input:


output:


REPORT ZR_hr LINE-SIZE 200.
TABLES PERNR.
INFOTYPES: 0000, 0006.
TYPES: BEGIN OF IT1,
                SUBTY TYPE T591S-SUBTY,
                STEXT TYPE T591S-STEXT,
       END OF IT1.
TYPES: BEGIN OF IT2,
                 PERNR TYPE PERNR-PERNR,
                 ENAME TYPE PERNR-ENAME,
                  STAT2 TYPE P0000-STAT2,
                  BEGDA TYPE P0006-BEGDA,
                 SUBTY TYPE P0006-SUBTY,
                 STRAS TYPE P0006-STRAS,
                 ORT01 TYPE P0006-ORT01,
                 PSTLZ TYPE P0006-PSTLZ,
                 TELNR TYPE P0006-TELNR,
       END OF IT2.
TYPES: BEGIN OF ITAB,
                  PERNR TYPE PERNR-PERNR,
                  ENAME TYPE PERNR-ENAME,
                  STAT2 TYPE P0000-STAT2,
                  SUBTY TYPE P0006-SUBTY,
                  STEXT TYPE T591S-STEXT,
                  BEGDA TYPE P0006-BEGDA,
                  STRAS TYPE P0006-STRAS,
                  ORT01 TYPE P0006-ORT01,
                   PSTLZ TYPE P0006-PSTLZ,
                   TELNR TYPE P0006-TELNR,
       END OF ITAB.
DATA: WA1    TYPE IT1,
           OUT1   TYPE TABLE OF IT1.
DATA: WA2    TYPE IT2,
           OUT2   TYPE TABLE OF IT2.
DATA: WA      TYPE ITAB,
         OUTPUT TYPE TABLE OF ITAB.

START-OF-SELECTION.
  SELECT SUBTY
                STEXT INTO TABLE OUT1 FROM T591S
                                   WHERE SPRSL = SY-LANGU.
GET PERNR.
  READ TABLE OUT1 INTO WA1 WITH KEY SUBTY = P0006-SUBTY.

  MOVE: WA2-PERNR TO WA-PERNR,
              WA2-ENAME TO WA-ENAME,
              WA2-STAT2 TO WA-STAT2,
              WA1-SUBTY TO WA-SUBTY,
              WA1-STEXT TO WA-STEXT,
              WA2-BEGDA TO WA-BEGDA,
              WA2-STRAS TO WA-STRAS,
              WA2-ORT01 TO WA-ORT01,
              WA2-PSTLZ TO WA-PSTLZ,
              WA2-TELNR TO WA-TELNR.
  APPEND WA TO OUTPUT.
  CLEAR WA.

END-OF-SELECTION.
  RP-PROVIDE-FROM-LAST P0006 1 PN-BEGDA PN-ENDDA.

  LOOP AT OUTPUT INTO WA.
    WRITE:  WA-PERNR, WA-ENAME, WA-STAT2,
                   WA-SUBTY, WA-STEXT, WA-BEGDA,
                   WA-STRAS, WA-ORT01, WA-PSTLZ, WA-TELNR.

  ENDLOOP.
input
output:






REPORT  ZR_H109_PERNR_MACROS.

type-pools slis.

TABLES PERNR.                      "Sturcture Creating

INFOTYPES : 0000, 0006.            "Internal Table with Headerline

TYPES: BEGIN OF TY_FINAL,
         PERNR TYPE PA0000-PERNR,       "emp no
         ENAME TYPE PERNR-ENAME,        "emp name
         STAT2 TYPE PERNR-STAT2,        "status
         BEGDA    TYPE PA0000-BEGDA,       "joining date
        P_STRAS   TYPE PA0006-STRAS,      "Street and House Number
        P_ORT01   TYPE PA0006-ORT01,      "City
        P_PSTLZ   TYPE PA0006-PSTLZ,      "Postal code
        P_LAND1   TYPE PA0006-LAND1,      "Country code
        P_COUNTRY TYPE LANDX,
        T_STRAS   TYPE PA0006-STRAS,      "Street and House Number
        T_ORT01   TYPE PA0006-ORT01,      "City
        T_PSTLZ   TYPE PA0006-PSTLZ,      "Postal code
        T_LAND1   TYPE PA0006-LAND1,      "Country code
        T_COUNTRY TYPE LANDX,
      END OF TY_FINAL.

DATA: IT_FINAL TYPE TABLE OF TY_FINAL,
       WA_FINAL TYPE TY_FINAL,

       it_field TYPE  SLIS_T_FIELDCAT_ALV,
       wa_field TYPE  SLIS_FIELDCAT_ALV.

DATA: COUNTRY TYPE  LANDX.

START-OF-SELECTION.

GET PERNR.

    RP-PROVIDE-FROM-FRST P0000 SPACE '18000101' '99991231'.    "Join Date will Come
    RP-PROVIDE-FROM-LAST P0006 SPACE  '18000101' '99991231'.

      MOVE: P0000-PERNR TO WA_FINAL-PERNR,
          PERNR-ENAME  TO WA_FINAL-ENAME,
          P0000-STAT2 TO WA_FINAL-STAT2,
          P0000-BEGDA TO WA_FINAL-BEGDA.

      IF P0006-SUBTY = 1.                                "Permanent Address

     PERFORM COUNTRY_NAME USING P0006-LAND1.

        MOVE:  P0006-STRAS TO WA_FINAL-P_STRAS,
               P0006-ORT01 TO WA_FINAL-P_ORT01,
               P0006-PSTLZ TO WA_FINAL-P_PSTLZ,
               P0006-LAND1 TO WA_FINAL-P_LAND1,
               COUNTRY     TO WA_FINAL-P_COUNTRY.

   RP-PROVIDE-FROM-LAST P0006 '02'  '18000101' '99991231'.

      IF P0006-SUBTY = 2.                                   " Temporay Address
       PERFORM COUNTRY_NAME USING P0006-LAND1.

      MOVE: P0006-STRAS TO WA_FINAL-T_STRAS,
            P0006-ORT01 TO WA_FINAL-T_ORT01,
            P0006-PSTLZ TO WA_FINAL-T_PSTLZ,
            P0006-LAND1 TO WA_FINAL-T_LAND1,
            COUNTRY     TO WA_FINAL-T_COUNTRY.
            ENDIF.

      ENDIF.

      append wa_final to it_final.
      clear wa_final.

END-OF-SELECTION.

perform get_field using 'PERNR' 'PERSONNEL NO'.
perform get_field using 'ENAME' 'PERSONNEL NAME'.
perform get_field using 'STAT2' 'EMPLOYMENT STATUS'.
perform get_field using 'BEGDA' 'JOIN DATE'.
perform get_field using 'P_STRAS' 'Street(PR)'.
perform get_field using 'P_ORT01' 'City(PR)'.
perform get_field using 'P_PSTLZ' 'Postal Code(PR)'.
*perform get_field using 'P_LAND1' 'Country Code(PR)'.
perform get_field using 'P_COUNTRY' 'Country (PR)'.
perform get_field using 'T_STRAS' 'Street(TR)'.
perform get_field using 'T_ORT01' 'City(TR)'.
perform get_field using 'T_PSTLZ' 'Postal Code(TR)'.
*perform get_field using 'T_LAND1' 'Country Code(TR)'.
perform get_field using 'T_COUNTRY' 'Country (TR)'.


CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
 EXPORTING

   IT_FIELDCAT                    = IT_FIELD

  TABLES
    T_OUTTAB                       = it_final

          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

FORM GET_FIELD  USING    VALUE(P_0170)
                         VALUE(P_0171).

WA_FIELD-FIELDNAME = P_0170.
WA_FIELD-SELTEXT_L = P_0171.

APPEND WA_FIELD TO IT_FIELD.
CLEAR WA_FIELD.

ENDFORM.                    " GET_FIELD

FORM COUNTRY_NAME  USING    VALUE(P_0121).


CALL FUNCTION 'IGN_COUNTRYNAME_GET'
  EXPORTING
    I_COUNTRY               = P_0121
IMPORTING
   E_COUNTRYNAME           = COUNTRY

          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.


ENDFORM.                    " COUNTRY_NAME.

input:


output:




*&---------------------------------------------------------------------*
*& Report  ZR_H109_PERNR_WAGETYPE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZR_H109_PERNR_WAGETYPE.

TABLES PERNR.

DATA : g_str TYPE string.

INFOTYPES : 0000, 0006, 0008 MODE N.

TYPES: BEGIN OF TY_FINAL,
          PERNR TYPE PERNR-PERNR,
          ENAME TYPE PERNR-ENAME,       "Emp Name
          BEGDA TYPE P0000-BEGDA,       "Hire Date
          STAT2 TYPE P0000-STAT2,
          LAND1 TYPE P0006-LAND1,      " Country Key
          TRFAR TYPE P0008-TRFAR,       "Scale Type
          TRFGB TYPE P0008-TRFGB,       "Scale Area
          TRFGR TYPE P0008-TRFGR,       "Pay Scale Group
          TRFST TYPE P0008-TRFST,       "Pay Scale Level
       END OF TY_FINAL.

DATA: IT_FINAL TYPE TABLE OF TY_FINAL,
      WA_FINAL TYPE TY_FINAL,
      G_OBJ TYPE REF TO CL_SALV_TABLE.

PARAMETERS : CHK AS CHECKBOX DEFAULT 'X' USER-COMMAND U1.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : F_PATH TYPE STRING MODIF ID M1..

SELECTION-SCREEN END OF BLOCK B1.

*********************************************************************************
*               AT-SELECTION-SCREEN OUTPUT
**********************************************************************************

AT SELECTION-SCREEN OUTPUT.

  IF CHK = 'X'.

    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M1'.
        SCREEN-ACTIVE = 0.
      ENDIF.

      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

 LOOP AT SCREEN .
    IF screen-name CS 'PNPSTAT2'.
      screen-active = 0.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

  DEFINE CLOCK.                                       "mACRO
   CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      PERCENTAGE       = space
      TEXT             = &1
             .

 END-OF-DEFINITION.

*********************************************************************************
*               AT-SELECTION-SCREEN ON VALUE REQUEST
**********************************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_PATH.

  CALL METHOD CL_RSAN_UT_FILES=>F4
    EXPORTING
      I_APPLSERV              = SPACE
      I_TITLE                 = 'PC File Pick.....'
      I_GUI_EXTENSION         = SPACE
      I_GUI_EXT_FILTER        = SPACE

    CHANGING
      C_FILE_NAME             = F_PATH

          .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

*********************************************************************************
*               START-OF-SELECTION
**********************************************************************************
START-OF-SELECTION.

GET PERNR.

CONCATENATE pernr-pernr pernr-ename INTO g_str SEPARATED BY space.

CLOCK  g_str.


    RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA.

    IF PNP-SW-FOUND = '1' AND  P0000-STAT2 = '3'.

      MOVE: PERNR-PERNR TO WA_FINAL-PERNR,
            PERNR-ENAME TO WA_FINAL-ENAME,
            P0000-BEGDA TO WA_FINAL-BEGDA,
            P0000-STAT2 TO WA_FINAL-STAT2.

   ELSE.

    REJECT.

  ENDIF.


    RP-PROVIDE-FROM-LAST P0006 SPACE PN-BEGDA PN-ENDDA.

    IF PNP-SW-FOUND = '1'.

      MOVE:P0006-LAND1 TO WA_FINAL-LAND1.

    ENDIF.

    RP-READ-INFOTYPE PERNR-PERNR 0008 P0008 PN-BEGDA PN-ENDDA.

    RP-PROVIDE-FROM-LAST P0008 SPACE PN-BEGDA PN-ENDDA.

    IF PNP-SW-FOUND = '1'.


      MOVE:    P0008-TRFAR TO WA_FINAL-TRFAR,
               P0008-TRFGB TO WA_FINAL-TRFGB,
               P0008-TRFGR TO WA_FINAL-TRFGR,
               P0008-TRFST TO WA_FINAL-TRFST.

    ENDIF.

APPEND WA_FINAL TO IT_FINAL.

  CLEAR WA_FINAL.

*****************************************end-of-selection.*************************************
END-OF-SELECTION.



IF CHK = 'X'.

*  TRY.
  CALL METHOD CL_SALV_TABLE=>FACTORY
*    EXPORTING
*      LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
*      R_CONTAINER    =
*      CONTAINER_NAME =
    IMPORTING
      R_SALV_TABLE   = G_OBJ
    CHANGING
      T_TABLE        = IT_FINAL
      .
*   CATCH CX_SALV_MSG .
*  ENDTRY.





  CALL METHOD G_OBJ->DISPLAY.

*******************************************************************************
*******************
ELSE.



CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                    =
    FILENAME                        = F_PATH
*   FILETYPE                        = 'ASC'
*   APPEND                          = ' '
   WRITE_FIELD_SEPARATOR           = 'X'

  TABLES
    DATA_TAB                        = IT_FINAL

          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.


ENDIF.

INPUT:

OUTPUT:

INPUT:

output:




REPORT  ZR_H109_PERNR_WAGETYPE1.

TABLES PERNR.

DATA : G_STR TYPE STRING.

INFOTYPES : 0000, 0006, 0001,0007,0008 MODE N.

TYPES: BEGIN OF TY_FINAL,
          PERNR TYPE PERNR-PERNR,
          ENAME TYPE PERNR-ENAME,       "Emp Name
          BEGDA TYPE P0000-BEGDA,       "Hire Date
          STAT2 TYPE P0000-STAT2,
          LAND1 TYPE P0006-LAND1,      " Country Key
          TRFAR TYPE P0008-TRFAR,       "Scale Type
          TRFGB TYPE P0008-TRFGB,       "Scale Area
          TRFGR TYPE P0008-TRFGR,       "Pay Scale Group
          TRFST TYPE P0008-TRFST,       "Pay Scale Level
          BET01 TYPE P0008-BET01,       "Basic Salary
          BET02 TYPE P0008-BET01,
          BET03 TYPE P0008-BET01,
          BET04 TYPE P0008-BET01,
       END OF TY_FINAL.

DATA: IT_FINAL TYPE TABLE OF TY_FINAL,
      WA_FINAL TYPE TY_FINAL,

      G_OBJ TYPE REF TO CL_SALV_TABLE,
      IT_IND TYPE TABLE OF PTBINDBW,
      WA_IND TYPE PTBINDBW,

      IT_F TYPE SLIS_T_FIELDCAT_ALV,
      WA_F TYPE SLIS_FIELDCAT_ALV.

DATA : V_LGA TYPE P0008-LGA01,            "Var for Storing Wage Type
       V_BET TYPE P0008-BET01,            ""Var for Storing Amount (BAsic Salary)
       V_IND TYPE P0008-IND01,            "Var for Storing Indirect Or direct
       V_BET1 TYPE P0008-BET01,           "Hra
       V_BET2 TYPE P0008-BET01,           " Uniform Allowence
       V_BET3 TYPE P0008-BET01.           "Children allowence

PARAMETERS : CHK AS CHECKBOX DEFAULT 'X' USER-COMMAND U1.


SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : F_PATH TYPE STRING MODIF ID M1..
SELECTION-SCREEN END OF BLOCK B1.

*********************************************************************************
*               AT-SELECTION-SCREEN OUTPUT
**********************************************************************************

AT SELECTION-SCREEN OUTPUT.

  IF CHK = 'X'.

    LOOP AT SCREEN.

      IF SCREEN-GROUP1 = 'M1'.
        SCREEN-ACTIVE = 0.
      ENDIF.

      MODIFY SCREEN.
    ENDLOOP.


  ENDIF.

  LOOP AT SCREEN .
    IF SCREEN-NAME CS 'PNPSTAT2'.
      SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.



*********************************************************************************
*               AT-SELECTION-SCREEN ON VALUE REQUEST
**********************************************************************************

AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_PATH.

  CALL METHOD CL_RSAN_UT_FILES=>F4
    EXPORTING
      I_APPLSERV              = SPACE
      I_TITLE                 = 'PC File Pick.....'
      I_GUI_EXTENSION         = SPACE
      I_GUI_EXT_FILTER        = SPACE
*    I_GUI_INITIAL_DIRECTORY =
*    I_APPLSERV_LOGICAL      = 'X'
*    I_APPLSERV_AL11         = 'X'
*  IMPORTING
*    E_CANCELED              =
*    E_LOGICAL_FILE          =
*    E_AL11_CHOSEN           =
    CHANGING
      C_FILE_NAME             = F_PATH
*  EXCEPTIONS
*    FAILED                  = 1
*    OTHERS                  = 2
          .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

*********************************************************************************
*               START-OF-SELECTION
**********************************************************************************
START-OF-SELECTION.

GET PERNR.


  RP-PROVIDE-FROM-LAST P0000 SPACE PN-BEGDA PN-ENDDA.

  IF PNP-SW-FOUND = '1' AND  P0000-STAT2 = '3'.

    MOVE: PERNR-PERNR TO WA_FINAL-PERNR,
          PERNR-ENAME TO WA_FINAL-ENAME,
          P0000-BEGDA TO WA_FINAL-BEGDA,
          P0000-STAT2 TO WA_FINAL-STAT2.

  ELSE.

    REJECT.

  ENDIF.


  RP-PROVIDE-FROM-LAST P0006 SPACE PN-BEGDA PN-ENDDA.

  IF PNP-SW-FOUND = '1'.

    MOVE:P0006-LAND1 TO WA_FINAL-LAND1.

  ENDIF.

  RP-READ-INFOTYPE PERNR-PERNR 0008 P0008 PN-BEGDA PN-ENDDA.

  RP-PROVIDE-FROM-LAST P0008 SPACE PN-BEGDA PN-ENDDA.

  IF PNP-SW-FOUND = '1'.


    MOVE:    P0008-TRFAR TO WA_FINAL-TRFAR,
             P0008-TRFGB TO WA_FINAL-TRFGB,
             P0008-TRFGR TO WA_FINAL-TRFGR,
             P0008-TRFST TO WA_FINAL-TRFST.

    PERFORM GET_WAGETYPES.

    MOVE V_BET TO WA_FINAL-BET01.
    MOVE V_BET1 TO WA_FINAL-BET02.
    MOVE V_BET2 TO WA_FINAL-BET03.
    MOVE V_BET3 TO WA_FINAL-BET04.

  ENDIF.

  APPEND WA_FINAL TO IT_FINAL.

  CLEAR WA_FINAL.

*****************************************end-of-selection.*************************************
END-OF-SELECTION.



  IF CHK = 'X'.

    PERFORM GET_ALV.

  ELSE.

    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
*   BIN_FILESIZE                    =
        FILENAME                        = F_PATH
*   FILETYPE                        = 'ASC'
*   APPEND                          = ' '
       WRITE_FIELD_SEPARATOR           = 'X'

      TABLES
        DATA_TAB                        = IT_FINAL

              .
    IF SY-SUBRC <> 0.
* Implement suitable error handling here
    ENDIF.


  ENDIF.

FORM GET_WAGETYPES .

  PERFORM GET_WAGE2 USING 'MB10' CHANGING V_BET .

  PERFORM GET_WAGE2 USING 'M230' CHANGING V_BET1.

  PERFORM GET_WAGE2 USING 'M200' CHANGING V_BET2.
  PERFORM GET_WAGE2 USING 'M260' CHANGING V_BET3.

  EXIT.


ENDFORM.                    " GET_WAGETYPES


FORM GET_WAGE2  USING    VALUE(P_0362)
                             CHANGING P_V_BET..

  DO 40 TIMES
          VARYING V_LGA FROM P0008-LGA01 NEXT P0008-LGA02
          VARYING P_V_BET FROM P0008-BET01 NEXT P0008-BET02
          VARYING V_IND FROM P0008-IND01 NEXT P0008-IND02.

    IF V_LGA = P_0362.

      IF V_IND = 'I'.

        WA_IND-LGART = V_LGA.
        WA_IND-INDBW = V_IND.

        APPEND WA_IND TO IT_IND.
        CLEAR WA_IND.

        CALL FUNCTION 'RP_EVALUATE_INDIRECTLY_P0008'
          EXPORTING
*         APPLI                              = 'M'
            PBEGDA                             = P0008-BEGDA
            PMOLGA                             = '40'
            PP0001                             = P0001
            PP0007                             = P0007
            PP0008                             = P0008
            PTCLAS                             = 'A'
            PPERNR                             = P0008-PERNR

          TABLES
            PTBINDBW                           = IT_IND

                  .
        IF SY-SUBRC <> 0.
* Implement suitable error handling here
        ENDIF.


        READ TABLE IT_IND INTO WA_IND WITH KEY LGART = V_LGA.

        IF SY-SUBRC = 0.


          P_V_BET = WA_IND-BETRG.
          EXIT.

        ENDIF.


        CLEAR : WA_IND,V_LGA.

      ELSE.
        EXIT.


      ENDIF.

    ENDIF.

  ENDDO.

ENDFORM.                    " GET_WAGE2

FORM GET_ALV .

  PERFORM GET_F USING: 'PERNR'  'Emp No',
                       'ENAME'  'Ename',
                       'BEGDA'  'Start Date',
                       'STAT2'  'Status',
                       'LAND1'  'Country Key',
                       'TRFAR'  'Scale Type',
                       'TRFGB'  'Scale Area',
                       'TRFGR'  'Payscale Group',
                       'TRFST'  'Payscale Level',
                       'BET01'  'Basic sal(MB10)',
                       'BET02'  'HRA (M230)',
                       'BET03' 'Uniform All(M200)',
                       'BET04'  'Child Allo (M260)'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING

     IT_FIELDCAT                       = IT_F

    TABLES
      T_OUTTAB                          = IT_FINAL

            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.


ENDFORM.                    " GET_ALV

FORM GET_F  USING    VALUE(P_0511)
                     VALUE(P_0512).

  WA_F-FIELDNAME = P_0511.
  WA_F-SELTEXT_L = P_0512.

  APPEND WA_F TO IT_F.
  CLEAR WA_F.

ENDFORM.                    " GET_F

input:

output:

input:

output:



REPORT  ZRAOM.

TABLES OBJEC.

START-OF-SELECTION.

GET OBJEC.

WRITE:/ OBJEC-OTYPE, OBJEC-OBJID, OBJEC-BEGDA, OBJEC-ENDDA, OBJEC-STEXT.
Input:


output:

REPORT  ZRAOM LINE-SIZE 400.

TABLES OBJEC.

DATA: ITAB TYPE  OBJEC OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

GET OBJEC.

  CALL FUNCTION 'RH_PM_GET_STRUCTURE'
    EXPORTING
      PLVAR                    = OBJEC-PLVAR
      OTYPE                    = OBJEC-OTYPE
      OBJID                    = OBJEC-OBJID
      BEGDA                    = PCHBEGDA
      ENDDA                    = PCHENDDA
*   STATUS                   = '1'
      WEGID                    = 'O-S-P'

 TABLES
   OBJEC_TAB                = ITAB
            .
  IF SY-SUBRC = 0.

  ENDIF.

END-OF-SELECTION.

  LOOP AT ITAB INTO OBJEC.
    IF OBJEC-OTYPE = 'O'.
      WRITE: 01 OBJEC-PLVAR,05 OBJEC-OTYPE,08 OBJEC-OBJID,18 OBJEC-STEXT.
    ELSEIF OBJEC-OTYPE = 'S'.
      WRITE: 55 OBJEC-OTYPE,58 OBJEC-OBJID,68 OBJEC-STEXT.
    ELSEIF OBJEC-OTYPE = 'P'.
      WRITE: 105 OBJEC-OTYPE,108 OBJEC-OBJID,118 OBJEC-STEXT.
      SKIP.
    ENDIF.
  ENDLOOP.

input:


output:


input:


output:


input:


output:


REPORT  ZRA100_HR_OM01 LINE-SIZE 400.

TABLES PERNR.
INFOTYPES: 0008, 0001, 0007, 1000, 1001.

TYPES: BEGIN OF TY_ST1,
         PERNR TYPE PERNR-PERNR,
         ENAME TYPE PERNR-ENAME,
         HDATE TYPE DATUM,
         BUKRS TYPE P0001-BUKRS,
         BUTXT TYPE BUTXT,
         WERKS TYPE P0001-WERKS,
         WETXT TYPE T500P-NAME1,
         BTRTL TYPE P0001-BTRTL,
         PERSG TYPE P0001-PERSG,
         PERSK TYPE P0001-PERSK,
         ABKRS TYPE P0001-ABKRS,
         PLANS TYPE P0001-PLANS,
         PLTXT TYPE HRP1000-STEXT,
         STELL TYPE P0001-STELL,
         JTEXT TYPE HRP1000-STEXT,
         ORGEH TYPE P0001-ORGEH,
         ORGTXT TYPE HRP1000-STEXT,
         TRFAR TYPE P0008-TRFAR,
         TRFGB TYPE P0008-TRFGB,
         TRFGR TYPE P0008-TRFGR,
         LGART TYPE P0008-LGA01,
         BETRG TYPE P0008-BET01,
       END OF TY_ST1.

DATA: ITAB TYPE TABLE OF TY_ST1,
      WA   TYPE TY_ST1.

DATA: ITAB1 TYPE PTBINDBW OCCURS 0 WITH HEADER LINE.
DATA: G_LGA TYPE P0008-LGA01,
      G_BET TYPE P0008-BET01,
      G_IND TYPE P0008-IND01,
      G_MOLGA TYPE MOLGA.

PARAMETERS: P_FILE TYPE STRING.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

  CALL METHOD CL_RSAN_UT_FILES=>F4
    EXPORTING
      I_APPLSERV              = SPACE
      I_TITLE                 = 'Choose Path...'
      I_GUI_EXTENSION         = 'XLS'
      I_GUI_EXT_FILTER        = SPACE
    CHANGING
      C_FILE_NAME             = P_FILE.

  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

START-OF-SELECTION.

GET PERNR.

  RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA.

  RP-PROVIDE-FROM-LAST P0008 SPACE PN-BEGDA PN-ENDDA.

  PERFORM GET_HIRE USING PERNR-PERNR WA-HDATE.
  PERFORM GET_BUKRS_TXT USING P0001-BUKRS WA-BUTXT.
  PERFORM GET_WERKS_TXT USING P0001-WERKS WA-WETXT.
  PERFORM GET_OBJ_TXT USING P0001-PLANS 'S' WA-PLTXT.
  PERFORM GET_OBJ_TXT USING P0001-STELL 'C' WA-JTEXT.
  PERFORM GET_OBJ_TXT USING P0001-ORGEH 'O' WA-ORGTXT.

  MOVE: PERNR-PERNR TO WA-PERNR,
        PERNR-ENAME TO WA-ENAME,
        P0001-BUKRS TO WA-BUKRS,
        P0001-WERKS TO WA-WERKS,
        P0001-BTRTL TO WA-BTRTL,
        P0001-PERSG TO WA-PERSG,
        P0001-PERSK TO WA-PERSK,
        P0001-ABKRS TO WA-ABKRS,
        P0001-PLANS TO WA-PLANS,
        P0001-STELL TO WA-STELL,
        P0001-ORGEH TO WA-ORGEH,
        P0008-TRFAR TO WA-TRFAR,
        P0008-TRFGB TO WA-TRFGB,
        P0008-TRFGR TO WA-TRFGR.

  DO 40 TIMES
        VARYING G_LGA FROM P0008-LGA01 NEXT P0008-LGA02
        VARYING G_BET FROM P0008-BET01 NEXT P0008-BET02
        VARYING G_IND FROM P0008-IND01 NEXT P0008-IND02.

    IF G_LGA EQ 'MB10'.
       WA-LGART = G_LGA.

      IF NOT G_IND IS INITIAL.

        ITAB1-LGART = G_LGA.
        ITAB1-INDBW = G_IND.
        APPEND ITAB1.

        CALL FUNCTION 'HR_PERNR_COUNTRY_GET'
          EXPORTING
            PERNR           = PERNR-PERNR
         IMPORTING
           MOLGA           = G_MOLGA.

        IF SY-SUBRC <> 0.
* Implement suitable error handling here
        ENDIF.

        CALL FUNCTION 'RP_EVALUATE_INDIRECTLY_P0008'
          EXPORTING
            PBEGDA   = P0008-BEGDA
            PMOLGA   = G_MOLGA
            PP0001   = P0001
            PP0007   = P0007
            PP0008   = P0008
            PPERNR   = P0008-PERNR
          TABLES
            PTBINDBW = ITAB1.

        READ TABLE ITAB1 WITH KEY LGART = G_LGA.

        IF SY-SUBRC = 0.
          WA-BETRG = ITAB1-BETRG.
        ENDIF.
      ELSE.
        WA-BETRG = G_BET.
      ENDIF.

    ENDIF.

  ENDDO.

  APPEND WA TO ITAB.
  CLEAR WA.


END-OF-SELECTION.

  LOOP AT ITAB INTO WA.

    WRITE:/ WA-PERNR, WA-ENAME, WA-HDATE, WA-BUKRS, WA-BUTXT, WA-WERKS, WA-WETXT, WA-BTRTL,
            WA-PERSG, WA-PERSK, WA-ABKRS, WA-PLANS, WA-PLTXT, WA-STELL, WA-JTEXT,
            WA-ORGEH, WA-ORGTXT, WA-TRFAR, WA-TRFGB, WA-TRFGR, WA-LGART,
            WA-BETRG.
  ENDLOOP.

  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      FILENAME                        = P_FILE

     WRITE_FIELD_SEPARATOR           = 'X'

    TABLES
      DATA_TAB                        = ITAB
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.


FORM GET_HIRE  USING    P_PERNR
                        P_HDATE.


  CALL FUNCTION 'RP_GET_HIRE_DATE'
    EXPORTING
      PERSNR          = P_PERNR
      CHECK_INFOTYPES = '0000'
    IMPORTING
      HIREDATE        = P_HDATE.

ENDFORM.                    " GET_HIRE

FORM GET_BUKRS_TXT  USING    P_BUKRS
                             P_BUTXT.

  CALL FUNCTION 'HRWPC_RFC_BUKRS_TEXT_GET'
    EXPORTING
      BUKRS      = P_BUKRS
      LANGU      = SY-LANGU
    IMPORTING
      BUKRS_TEXT = P_BUTXT.
  .


ENDFORM.                    " GET_BUKRS_TXT

FORM GET_WERKS_TXT  USING    P_WERKS
                             P_WETXT.

  CALL FUNCTION 'HRWPC_RFC_WERKS_TEXT_GET'
    EXPORTING
      WERKS      = P_WERKS
    IMPORTING
      WERKS_TEXT = P_WETXT.



ENDFORM.                    " GET_WERKS_TXT

FORM GET_OBJ_TXT  USING    P_OBJID
                           P_OTYPE
                           P_TEXT.

  CALL FUNCTION 'RH_READ_INFTY_1000'
    EXPORTING

      PLVAR            = '01'
      OTYPE            = P_OTYPE
      OBJID            = P_OBJID

    TABLES
      I1000            = P1000
*     OBJECTS          =
    EXCEPTIONS
      NOTHING_FOUND    = 1
      WRONG_CONDITION  = 2
      WRONG_PARAMETERS = 3
      OTHERS           = 4.
  IF SY-SUBRC = 0.

    READ TABLE P1000 WITH KEY LANGU = SY-LANGU.

    MOVE: P1000-STEXT TO P_TEXT.
  ENDIF.
ENDFORM.                    " GET_PLANS_TXT

input:

output:


REPORT  ZRA100_HR_OM02 LINE-SIZE 250.

TABLES PERNR.
INFOTYPES: 0001, 0002, 1000, 1001.

TYPES: BEGIN OF TY_ST1,
         PERNR TYPE PERNR-PERNR,
         ENAME TYPE PERNR-ENAME,
         PLANS TYPE P0001-PLANS,
         PLTXT TYPE P1000-STEXT,
         ORGEH TYPE P0001-ORGEH,
         OTEXT TYPE P1000-STEXT,
         REPORT TYPE P0001-PLANS,
         REPTXT TYPE P1000-STEXT,
         REPEMP TYPE PERNR-PERNR,
         REPNAME TYPE PERNR-ENAME,
       END OF TY_ST1.

DATA: ITAB TYPE TABLE OF TY_ST1,
      WA   TYPE TY_ST1.

START-OF-SELECTION.
GET PERNR.

  RP-PROVIDE-FROM-LAST P0001 SPACE PN-BEGDA PN-ENDDA.

  MOVE: PERNR-PERNR TO WA-PERNR,
        PERNR-ENAME TO WA-ENAME,
        P0001-PLANS TO WA-PLANS,
        P0001-ORGEH TO WA-ORGEH.

  PERFORM GET_1000 USING 'S' P0001-PLANS WA-PLTXT.
  PERFORM GET_1000 USING 'O' P0001-ORGEH WA-OTEXT.


  CALL FUNCTION 'RH_READ_INFTY_1001'
    EXPORTING
      PLVAR            = '01'
      OTYPE            = 'S'
      OBJID            = P0001-PLANS
    TABLES
      I1001            = P1001
    EXCEPTIONS
      NOTHING_FOUND    = 1
      WRONG_CONDITION  = 2
      WRONG_PARAMETERS = 3
      OTHERS           = 4.
  IF SY-SUBRC = 0.

    READ TABLE P1001 WITH KEY RSIGN = 'A' RELAT = '002'.
    MOVE: P1001-SOBID TO WA-REPORT.
    PERFORM GET_1000 USING 'S' WA-REPORT WA-REPTXT.

  ENDIF.

  CALL FUNCTION 'RH_READ_INFTY_1001'
    EXPORTING
      PLVAR            = '01'
      OTYPE            = 'S'
      OBJID            = WA-REPORT
    TABLES
      I1001            = P1001
    EXCEPTIONS
      NOTHING_FOUND    = 1
      WRONG_CONDITION  = 2
      WRONG_PARAMETERS = 3
      OTHERS           = 4.
  IF SY-SUBRC = 0.

    READ TABLE P1001 WITH KEY RSIGN = 'A' RELAT = '008'.
    MOVE: P1001-SOBID TO WA-REPEMP.

    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        PERNR                 = WA-REPEMP
        INFTY                 = '0002'
      TABLES
        INFTY_TAB             = P0002
     EXCEPTIONS
       INFTY_NOT_FOUND       = 1
       OTHERS                = 2
              .
    IF SY-SUBRC = 0.

      READ TABLE P0002 WITH KEY PERNR = P1001-SOBID.

      CONCATENATE P0002-VORNA
                  P0002-NACHN INTO WA-REPNAME.


    ENDIF.

  ENDIF.
  APPEND WA TO ITAB.
  CLEAR WA.

END-OF-SELECTION.

  LOOP AT ITAB INTO WA.

    WRITE:/ WA-PERNR,
            WA-ENAME,
            WA-PLANS,
            WA-PLTXT,
            WA-ORGEH,
            WA-OTEXT,
            WA-REPORT,
            WA-REPTXT,
            WA-REPEMP,
            WA-REPNAME.

  ENDLOOP.

FORM GET_1000  USING    VALUE(P_0098)
                        P_OBJID
                        P_OBTXT.
  CALL FUNCTION 'RH_READ_INFTY_1000'
    EXPORTING
      PLVAR            = '01'
      OTYPE            = P_0098
      OBJID            = P_OBJID
    TABLES
      I1000            = P1000
    EXCEPTIONS
      NOTHING_FOUND    = 1
      WRONG_CONDITION  = 2
      WRONG_PARAMETERS = 3
      OTHERS           = 4.
  IF SY-SUBRC = 0.

    READ TABLE P1000 WITH KEY LANGU = SY-LANGU.
    MOVE: P1000-STEXT TO P_OBTXT.
  ENDIF.

ENDFORM.                    " GET_1000.

input:
output:


REPORT  ZR_H109_OM1.
tables : pernr.
infotypes : 1000 ,0001.

types: begin of ty_final,
        pernr type pernr-pernr,
        ename type pernr-ename,
        werks type pernr-werks,

        stext type hrp1000-stext,                  "Des PA
        orgeh type p0001-orgeh,                  " Org Unit

        plans type p0001-plans,                  "Position
        stext2 type hrp1000-stext,                  "Description  of Position
      end of ty_final.

data : it_final type table of ty_final,
       wa_final type ty_final.

start-of-selection.
get pernr.

perform get_desc using : '1000' 'O'  p0001-orgeh.
wa_final-stext = p1000-stext.

perform get_desc using : '1000' 'S'  p0001-plans.
wa_final-stext2 = p1000-stext.
perform move_data.

perform dis_data.

FORM MOVE_DATA .

wa_final-pernr = pernr-pernr.
wa_final-ename = p0001-ename.
wa_final-werks = p0001-werks.

wa_final-orgeh = p0001-orgeh.
wa_final-plans = p0001-plans.

append wa_final to it_final.
clear wa_final.

ENDFORM.                    " MOVE_DATA


FORM GET_DESC  USING    VALUE(P_0061)
                        VALUE(P_0062)
                        value(p_id).

CALL FUNCTION 'RH_READ_INFTY'
 EXPORTING
   PLVAR                      = '01'
   OTYPE                      = p_0062
   OBJID                      = p_id
   INFTY                      = p_0061
  TABLES
    INNNN                      = p1000
          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

read table p1000 with key langu = sy-langu.

ENDFORM.                    " GET_DESC

FORM DIS_DATA .

data : obj  TYPE REF TO CL_SALV_TABLE.


CALL METHOD CL_SALV_TABLE=>FACTORY

  IMPORTING
    R_SALV_TABLE   = obj
  CHANGING
    T_TABLE        = it_final.

CALL METHOD OBJ->DISPLAY.
ENDFORM.                    " DIS_DATA.

input:


output:




REPORT  UAE_HR_PAYROLL01.

TABLES PERNR.

DATA:ITAB TYPE PC261 OCCURS 0 WITH HEADER LINE.

DATA: G_SEQNR TYPE PC261-SEQNR.

DATA: IT_RESULT TYPE PAYae_RESULT.

DATA: WA_RT TYPE PC207.

START-OF-SELECTION.

GET PERNR.

  CALL FUNCTION 'CU_READ_RGDIR'
    EXPORTING
      PERSNR                   = PERNR-PERNR

    TABLES
      IN_RGDIR                 = ITAB

            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  CALL FUNCTION 'CD_READ_LAST'
    EXPORTING
      BEGIN_DATE            = PN-BEGDA
      END_DATE              = PN-ENDDA
   IMPORTING
     OUT_SEQNR             = G_SEQNR
    TABLES
      RGDIR                 = ITAB

            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
    EXPORTING
*   CLUSTERID                          =
      EMPLOYEENUMBER                     = PERNR-PERNR
      SEQUENCENUMBER                     = G_SEQNR

    CHANGING
      PAYROLL_RESULT                     = IT_RESULT

            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  LOOP AT IT_RESULT-INTER-RT INTO WA_RT.

    WRITE:/ WA_RT-LGART, WA_RT-BETRG.

  ENDLOOP.

input:



output:

REPORT  ZUAE_HR_PAYROLL02 LINE-SIZE 200.

TABLES PERNR.

DATA:ITAB TYPE PC261 OCCURS 0 WITH HEADER LINE.

DATA: G_SEQNR TYPE PC261-SEQNR.

DATA: IT_RESULT TYPE PAYae_RESULT.

DATA: WA_WPBP TYPE PC205.

DATA: WA_RT TYPE PC207.
DATA: G_IND TYPE SY-TABIX.

START-OF-SELECTION.

GET PERNR.

  CALL FUNCTION 'CU_READ_RGDIR'
    EXPORTING
      PERSNR                   = PERNR-PERNR

    TABLES
      IN_RGDIR                 = ITAB

            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  CALL FUNCTION 'CD_READ_LAST'
    EXPORTING
      BEGIN_DATE            = PN-BEGDA
      END_DATE              = PN-ENDDA
   IMPORTING
     OUT_SEQNR             = G_SEQNR
    TABLES
      RGDIR                 = ITAB
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.



  CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
    EXPORTING
*   CLUSTERID                          =
      EMPLOYEENUMBER                     = PERNR-PERNR
      SEQUENCENUMBER                     = G_SEQNR

    CHANGING
      PAYROLL_RESULT                     = IT_RESULT

            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  LOOP AT IT_RESULT-INTER-WPBP INTO WA_WPBP.

    WRITE:/ PERNR-PERNR, PERNR-ENAME color 1, WA_WPBP-BEGDA, WA_WPBP-ENDDA,
            WA_WPBP-MASSN COLOR 5, WA_WPBP-WERKS color 3.
    LOOP AT IT_RESULT-INTER-RT INTO WA_RT WHERE LGART = 'MB10'.


      IF SY-TABIX > G_IND.
        WRITE: WA_RT-BETRG.
        G_IND = SY-TABIX.
        EXIT.
      ENDIF.

    ENDLOOP.

  ENDLOOP.

input:


output:






REPORT  ZR_H109_TM1 LINE-SIZE 200.

TYPE-POOLS SLIS.
TABLES: PERNR.
INFOTYPES : 2006 MODE N, 0000.

TYPES : BEGIN OF TY_FINAL,
          PERNR   TYPE PERNR-PERNR,     "Emp No
          ENAME   TYPE PERNR-ENAME,     "Emp Name
          H_DATE  TYPE P0000-BEGDA,
          EX_YEAR TYPE C LENGTH 5,
          Y_BEGDA TYPE N LENGTH 4,
          KTART   TYPE P2006-KTART,     "Absences Quota Type
          T_KTART TYPE C LENGTH 3,    "Text of AQT
          ANZHL   TYPE N LENGTH 2,      "No Of Emp Time Quta
        END OF TY_FINAL.

DATA: IT_FINAL TYPE TABLE OF TY_FINAL,
      WA_FINAL TYPE TY_FINAL.

DATA: EXP_YEARS  TYPE C LENGTH 2,
      EXP_MONTHS TYPE C LENGTH 2.

DATA: IT_FIELD TYPE  SLIS_T_FIELDCAT_ALV,
      WA_FIELD TYPE  SLIS_FIELDCAT_ALV.

START-OF-SELECTION.
GET PERNR.
  RP-READ-ALL-TIME-ITY PN-BEGDA PN-ENDDA.

*  PROVIDE * FROM P2006 BETWEEN PN-BEGDA AND PN-ENDDA.

    MOVE:  P2006-PERNR TO WA_FINAL-PERNR,
           PERNR-ENAME TO WA_FINAL-ENAME,
           P0000-BEGDA TO WA_FINAL-H_DATE,
           P2006-KTART TO WA_FINAL-KTART,
           P2006-ANZHL TO WA_FINAL-ANZHL.

    PERFORM GET_YEAR USING P2006-BEGDA.

    PERFORM GET_TEXT USING WA_FINAL-KTART .

    PERFORM GET_EXP USING WA_FINAL-H_DATE.



    APPEND WA_FINAL TO IT_FINAL.
    CLEAR WA_FINAL.


END-OF-SELECTION.

  PERFORM GET_FIELD USING 'PERNR' 'Personnel No'.
  PERFORM GET_FIELD USING 'ENAME' 'Emp Name'.
  PERFORM GET_FIELD USING 'H_DATE' 'Hire Date'.
  PERFORM GET_FIELD USING 'EX_YEAR' 'Year Of Exp'.
  PERFORM GET_FIELD USING 'Y_BEGDA' 'Years'.
  PERFORM GET_FIELD USING 'KTART' 'Absence Of Quota Type'.
  PERFORM GET_FIELD USING 'T_KTART' 'Leave Type'.
  PERFORM GET_FIELD USING 'ANZHL' 'Days'.


  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING

*   IS_LAYOUT                         =
     IT_FIELDCAT                       = IT_FIELD

    TABLES
      T_OUTTAB                          = IT_FINAL
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.


FORM GET_TEXT  USING    P_WA_FINAL_KTART.

  CASE P_WA_FINAL_KTART.

    WHEN 20.
      WA_FINAL-T_KTART = 'PL'.

    WHEN 40.
      WA_FINAL-T_KTART = 'PL1'.

    WHEN 41.
      WA_FINAL-T_KTART = 'CL'.

    WHEN OTHERS.
      WA_FINAL-T_KTART = 'OTH'.

  ENDCASE.

ENDFORM.                    " GET_TEXT

FORM GET_YEAR  USING    P_P2006_BEGDA.

  MOVE: P_P2006_BEGDA+0(4) TO wa_final-Y_BEGDA.

ENDFORM.                    " GET_YEAR

FORM GET_EXP  USING    P_WA_FINAL_H_DATE.


  EXP_YEARS  = SY-DATUM+0(4) -  P_WA_FINAL_H_DATE+0(4).

  IF SY-DATUM+4(2) > P_WA_FINAL_H_DATE+4(2).
    EXP_MONTHS = SY-DATUM+4(2) -  P_WA_FINAL_H_DATE+4(2).
  ELSE.
    EXP_MONTHS =   P_WA_FINAL_H_DATE+4(2) - SY-DATUM+4(2) .

  ENDIF.
  CONCATENATE EXP_YEARS
              EXP_MONTHS INTO WA_FINAL-EX_YEAR SEPARATED BY '.'.



ENDFORM.                    " GET_EXP

FORM GET_FIELD  USING    VALUE(P_0168)
                         VALUE(P_0169).


  WA_FIELD-FIELDNAME = P_0168.
  WA_FIELD-SELTEXT_L = P_0169.

  APPEND WA_FIELD TO IT_FIELD.
  CLEAR WA_FIELD.
ENDFORM.                    " GET_FIELD

input:

output:


REPORT  ZRD.

DATA: OBJ TYPE REF TO CX_SY_FILE_CLOSE.
TABLES PERNR.
INFOTYPES: 0000,0001.

TYPES: BEGIN OF IT1,
        MASSN TYPE T529T-MASSN,
        MNTXT TYPE T529T-MNTXT,
       END OF IT1.

TYPES: BEGIN OF IT2,
        STATV TYPE T529U-STATV,
        TEXT1 TYPE T529U-TEXT1,
       END OF IT2.

TYPES: BEGIN OF IT3,
        BUKRS TYPE T001-BUKRS,
        BUTXT TYPE T001-BUTXT,
       END OF IT3.

TYPES: BEGIN OF IT4,
        PERSG TYPE T501T-PERSG,
        PTEXT TYPE T501T-PTEXT,
       END OF IT4.

TYPES: BEGIN OF IT5,
        PERSK TYPE T503T-PERSK,
        PTXT1 TYPE T503T-PTEXT,
       END OF IT5.

TYPES: BEGIN OF IT6,
        ABKRS TYPE T549T-ABKRS,
        ATEXT TYPE T549T-ATEXT,
       END OF IT6.

TYPES: BEGIN OF IT7,
        PERNR TYPE PERNR-PERNR,
        ENAME TYPE PERNR-ENAME,
        MASSN TYPE P0000-MASSN,
        STATV TYPE P0000-STAT2,
        BUKRS TYPE P0001-BUKRS,
        WERKS TYPE P0001-WERKS,
        PERSG TYPE P0001-PERSG,
        PERSK TYPE P0001-PERSK,
        ABKRS TYPE P0001-PERSK,
       END OF IT7.

TYPES: BEGIN OF ITAB,
        PERNR TYPE PERNR-PERNR,
        ENAME TYPE PERNR-ENAME,
        MASSN TYPE P0000-MASSN,
        MNTXT TYPE T529T-MNTXT,
        STATV TYPE T529U-STATV,
        TEXT1 TYPE T529U-TEXT1,
        BUKRS TYPE T001-BUKRS,
        BUTXT TYPE T001-BUTXT,
        WERKS TYPE P0001-WERKS,
        PERSG TYPE T501T-PERSG,
        PTEXT TYPE T501T-PTEXT,
        PERSK TYPE T503T-PERSK,
        PTXT1 TYPE T503T-PTEXT,
        ABKRS TYPE T549T-ABKRS,
        ATEXT TYPE T549T-ATEXT,
       END OF ITAB.

DATA: WA1  TYPE IT1,
      OUT1 TYPE TABLE OF IT1.

DATA: WA2 TYPE IT2,
      OUT2 TYPE TABLE OF IT2.

DATA: WA3 TYPE IT3,
      OUT3 TYPE TABLE OF IT3.

DATA: WA4 TYPE IT4,
      OUT4 TYPE TABLE OF IT4.

DATA: WA5 TYPE IT5,
      OUT5 TYPE TABLE OF IT5.

DATA: WA6 TYPE IT6,
      OUT6 TYPE TABLE OF IT6.

DATA: WA7 TYPE IT7,
      OUT7 TYPE TABLE OF IT7.

DATA: WA     TYPE ITAB,
      OUTPUT TYPE TABLE OF ITAB.

***************************************************
PARAMETERS: TXT  RADIOBUTTON GROUP GP1 USER-COMMAND 123,
            DOW  RADIOBUTTON GROUP GP1 ,
            SER  RADIOBUTTON GROUP GP1.

PARAMETERS: P_FILE TYPE STRING MODIF ID 111,
            FILE   TYPE STRING MODIF ID QQQ.

***************************************************
AT SELECTION-SCREEN OUTPUT.

  IF TXT EQ 'X'.

    LOOP AT SCREEN.

      IF SCREEN-GROUP1 = 'QQQ' OR SCREEN-GROUP1 =  '111'.
        SCREEN-INVISIBLE = 1.
        SCREEN-INPUT     = 0.
        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.

**************************************
  ENDIF.

  IF DOW EQ 'X'.

    LOOP AT SCREEN.

      IF SCREEN-GROUP1 = 'QQQ'.
        SCREEN-INVISIBLE = 1.
        SCREEN-INPUT     = 0.

        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.

  ENDIF.
**********************************
  IF SER EQ 'X'.

    LOOP AT SCREEN.

      IF SCREEN-GROUP1 = '111'.
        SCREEN-INVISIBLE = 1.
        SCREEN-INPUT     = 0.

        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.

  ENDIF.

***************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

  CALL METHOD CL_RSAN_UT_FILES=>F4
    EXPORTING
      I_APPLSERV       = SPACE
      I_TITLE          = SPACE
      I_GUI_EXTENSION  = 'XLS'
      I_GUI_EXT_FILTER = 'FILE..............'
    CHANGING
      C_FILE_NAME      = P_FILE
    EXCEPTIONS
      FAILED           = 1
      OTHERS           = 2.
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

***************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR  FILE.

  CALL METHOD CL_RSAN_UT_FILES=>F4
    EXPORTING
      I_APPLSERV              = 'X'
      I_TITLE                 = 'TXT'
      I_GUI_EXTENSION         = SPACE
      I_GUI_EXT_FILTER        = SPACE

    CHANGING
      C_FILE_NAME             = FILE
    EXCEPTIONS
      FAILED                  = 1
      OTHERS                  = 2
          .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.
***************************************************
START-OF-SELECTION.

  SELECT MASSN
         MNTXT INTO TABLE OUT1 FROM T529T
                    WHERE SPRSL = SY-LANGU.
  SELECT STATV
         TEXT1 INTO TABLE OUT2 FROM T529U
                    WHERE SPRSL = SY-LANGU.
  SELECT BUKRS
         BUTXT INTO TABLE OUT3 FROM T001.

  SELECT PERSG
         PTEXT INTO TABLE OUT4 FROM T501T
                    WHERE SPRSL = SY-LANGU.
  SELECT PERSK
         PTEXT INTO TABLE OUT5 FROM T503T
                    WHERE SPRSL = SY-LANGU.
  SELECT ABKRS
         ATEXT INTO TABLE OUT6 FROM T549T
                    WHERE SPRSL = SY-LANGU.

GET PERNR.
**********************************************
  LOOP AT P0000.

    READ TABLE OUT1 INTO WA1 WITH KEY MASSN = P0000-MASSN.
    READ TABLE OUT2 INTO WA2 WITH KEY STATV = P0000-STAT2.
    READ TABLE OUT3 INTO WA3 WITH KEY BUKRS = P0001-BUKRS.
    READ TABLE OUT4 INTO WA4 WITH KEY PERSG = P0001-PERSG.
    READ TABLE OUT5 INTO WA5 WITH KEY PERSK = P0001-PERSK.
    READ TABLE OUT6 INTO WA6 WITH KEY ABKRS = P0001-ABKRS.

    MOVE: PERNR-PERNR TO WA-PERNR,
          PERNR-ENAME TO WA-ENAME,
          WA1-MASSN   TO WA-MASSN,
          WA1-MNTXT   TO WA-MNTXT,
          WA2-STATV   TO WA-STATV,
          WA2-TEXT1   TO WA-TEXT1,
          WA3-BUKRS   TO WA-BUKRS,
          WA3-BUTXT   TO WA-BUTXT,
          WA7-WERKS   TO WA-WERKS,
          WA4-PERSG   TO WA-PERSG,
          WA4-PTEXT   TO WA-PTEXT,
          WA5-PERSK   TO WA-PERSK,
          WA5-PTXT1   TO WA-PTXT1,
          WA6-ABKRS   TO WA-ABKRS,
          WA6-ATEXT   TO WA-ATEXT.

    APPEND WA TO OUTPUT.
    CLEAR WA.

  ENDLOOP.

END-OF-SELECTION.
*********************************************
  IF TXT = 'X'.

    DATA: O_ALV TYPE REF TO CL_SALV_TABLE.
    TRY.
        CALL METHOD CL_SALV_TABLE=>FACTORY
          IMPORTING
            R_SALV_TABLE = O_ALV
          CHANGING
            T_TABLE      = OUTPUT.
      CATCH CX_SALV_MSG .
    ENDTRY.

    CALL METHOD O_ALV->DISPLAY.
*****************************************
*        DOWNLOADING PART               *
*****************************************
  ELSEIF DOW = 'X'.

    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
*   BIN_FILESIZE                    =
        FILENAME                        = P_FILE
       WRITE_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                        = OUTPUT
     EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20

       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
              .
    IF SY-SUBRC <> 0.
* Implement suitable error handling here
    ENDIF.
*****************************************
  ELSEIF SER = 'X'.


    OPEN DATASET FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

    IF SY-SUBRC = 0.

      LOOP AT OUTPUT INTO WA.
*        TRY.
        TRANSFER WA TO FILE.
*          CATCH CX_SY_FILE_OPEN_MODE INTO OBJ.
*        ENDTRY.
      ENDLOOP.

      TRY.
          CLOSE DATASET 'FILE'.
        CATCH CX_SY_FILE_CLOSE  INTO OBJ.
      ENDTRY.
      MESSAGE 'SCCESSFULLY UPLOADING IN SERVER' TYPE 'S'.

    ENDIF.
  ENDIF.

input:

output:

input:
output:
input:
output:



REPORT  ZR_TM01.
TABLES PERNR.
INFOTYPES: 0007, 2006 MODE N, 2001 MODE N.
START-OF-SELECTION.
GET PERNR.
  RP-READ-ALL-TIME-ITY PN-BEGDA PN-ENDDA.
  PROVIDE * FROM P2001 BETWEEN PN-BEGDA AND PN-ENDDA.
    RP-PROVIDE-FROM-LAST P2006 41 PN-BEGDA PN-ENDDA
    WRITE:/ P2001-PERNR, PERNR-ENAME, P2006-ANZHL, P2001-ABRTG, P2001-BEGDA, P2001-ENDDA.
  ENDPROVIDE.




REPORT  ZR_H109_PERNR_BANK LINE-SIZE 300.

TABLES PERNR.
INFOTYPES : 0000, 0001, 0006 MODE N, 0009 .

TYPES : BEGIN OF TY_FINAL,
         PERNR   TYPE PERNR-PERNR,
         ENAME   TYPE PERNR-ENAME,
         STAT2   TYPE PERNR-STAT2,
         STRAS   TYPE PA0006-STRAS,      "Street and House Number
         ORT01   TYPE PA0006-ORT01,      "City
         PSTLZ   TYPE PA0006-PSTLZ,      "Postal code
         LAND1   TYPE PA0006-LAND1,      "Country code
        END OF TY_FINAL.


START-OF-SELECTION.
GET PERNR.

    RP-READ-INFOTYPE PERNR-STAT2 0006  P0006
                       '18000101'  '99991231'.



    WRITE:/    P0000-PERNR,
               PERNR-ENAME,
               P0000-STAT2,
               P0006-STRAS,
               P0006-ORT01,
               P0006-PSTLZ,
               P0006-LAND1,
               P0009-BANKL,
               P0009-BANKN.
    END-OF-SELECTION.



























No comments:

Post a Comment