Employee details in SAP ABAP Hr

hi folks,
do any one hav done Report -Employee details in SAP ABAP Hr.

check this code
*                        INFOTYPES                             *
INFOTYPES : 0000,     " Actions
            0001,     " Organizaiton Assignment
            0002,     " Personnel Data
            0008,     " Basic Pay
            0022,     " Education
            0025,     " Appraisals
            0077,     " Additional Personal Data
            2001,     " Absences
            9002,     " Additional Personal Data
            9545,     " Discipline data
            0000 NAME INT_PROM,
            0000 NAME INT_CHGPY,
            0302.
*                        INCLUDES                             *
*                        TABLES                                *
TABLES    : PERNR.
*                        CONSTANTS                             *
CONSTANTS : C_ONE      TYPE CHAR1  VALUE '1',
            C_EARLY    TYPE CHAR1  VALUE 'E',
            C_NEW      TYPE CHAR1  VALUE 'N',
            C_EARLYDT  TYPE SY-DATUM VALUE '20000501',
            C_JAN      TYPE CHAR2  VALUE '01',
            C_FEB      TYPE CHAR2  VALUE '02',
            C_MAR      TYPE CHAR2  VALUE '03',
            C_AWL      TYPE CHAR3  VALUE 'AWL',
            C_LWP      TYPE CHAR3  VALUE 'LWP'.
*                        TYPES                                 *
TYPE-POOLS: SLIS.                      " ALV Type Pool
TYPES  :
         BEGIN OF T_DISCACT,
           PERNR  TYPE CHAR8,
           COMM1  TYPE CHAR1,
           DESCRI TYPE CHAR40,
           COMM2  TYPE CHAR1,
           MDATE  TYPE CHAR10,
         END OF T_DISCACT,
         BEGIN OF T_INCRE,
           PERNR  TYPE CHAR8,
           INCR1 TYPE CHAR10,
           INCR2 TYPE CHAR10,
           INCR3 TYPE CHAR10,
         END OF T_INCRE,
         BEGIN OF T_OUTPUT,
           PERNR TYPE CHAR8,
           NAME  TYPE CHAR40,
           DESIG TYPE CHAR40,
           PESUB TYPE CHAR15,
           ORGUN TYPE CHAR40,
           COSTC TYPE CHAR20,
           ETHIC TYPE CHAR2,
           CPCODE TYPE ZCCODE,
           GRADE TYPE CHAR8,
           ***   TYPE CHAR6,
           DOB   TYPE CHAR10,
           DOJ   TYPE CHAR10,
           QUAL1 TYPE CHAR30,
           QUAL2 TYPE CHAR30,
           QUAL3 TYPE CHAR30,
           QUAL4 TYPE CHAR30,
           QUAL5 TYPE CHAR30,
           LPROM TYPE CHAR10,
           PROMD TYPE CHAR10,
           PROMT TYPE CHAR1,
           NOYRS TYPE CHAR2,
           AWL   TYPE CHAR9,
           LWP   TYPE CHAR9,
           APPR1 TYPE CHAR9,
           APPR2 TYPE CHAR9,
           APPR3 TYPE CHAR9,
           APPR4 TYPE CHAR9,
           APPR5 TYPE CHAR9,
           DISCI TYPE CHAR57,
         END   OF T_OUTPUT.
DATA : W_OUTPUT TYPE T_OUTPUT.
TYPES  :  BEGIN OF T_FILE.
        INCLUDE STRUCTURE W_OUTPUT.
TYPES  :   INCR1 TYPE CHAR10,
           INCR2 TYPE CHAR10,
           INCR3 TYPE CHAR10,
          END OF T_FILE.
DATA  : W_FILE TYPE T_FILE.
TYPES : BEGIN  OF T_EXCEL.
        INCLUDE STRUCTURE W_FILE.
TYPES :  END OF T_EXCEL.
*                        INTERNAL TABLES                       *
DATA   : INT_NONEXE  TYPE STANDARD TABLE OF ZHRT007   WITH HEADER LINE,
         INT_OUTPUT  TYPE STANDARD TABLE OF T_OUTPUT  WITH HEADER LINE,
         INT_DISCACT TYPE STANDARD TABLE OF T_DISCACT WITH HEADER LINE,
         INT_QUALFI  TYPE STANDARD TABLE OF T518B     WITH HEADER LINE,
         INT_INCRE   TYPE STANDARD TABLE OF T_INCRE   WITH HEADER LINE,
         INT_DISCIP  TYPE STANDARD TABLE OF ZHRT004   WITH HEADER LINE,
         INT_PESUB   TYPE STANDARD TABLE OF T001P     WITH HEADER LINE,
         INT_COSTC   TYPE STANDARD TABLE OF CSKT      WITH HEADER LINE,
         INT_EXCEL   TYPE STANDARD TABLE OF T_EXCEL   WITH HEADER LINE,
         EVENT       TYPE SLIS_T_EVENT WITH HEADER LINE,
         LISTHEAD    TYPE SLIS_T_LISTHEADER WITH HEADER LINE.
*                        VARIABLES                             *
DATA : W_HIREDATE TYPE BEGDA,
       W_WAGEGRP  TYPE TRFGR,
       W_CPCODE   TYPE ZCCODE,
       W_CAREERCD TYPE CHAR6,
       W_PROMTYPE TYPE ZTSTYPE,
       W_NOOFYRS  TYPE ZNOYRS,
       W_LASTPROM TYPE CHAR10,
       W_PROMDATE TYPE BEGDA,
       W_YEAR     TYPE CHAR4,
       W_APYEAR   TYPE CHAR4,
       W_APPRST   TYPE SY-DATUM,
       W_DISDATE  TYPE ENDDA,
       W_APPREND  TYPE ENDDA,
       W_ABSST    TYPE ENDDA,
       W_ABSEND   TYPE ENDDA,
       W_ABSYR    TYPE CHAR4,
       W_MONTH(2) TYPE N,
       W_AWL      TYPE CHAR9,
       W_LWP      TYPE CHAR9,
       W_DISCI    TYPE T_OUTPUT-DISCI,
       W_ONE(2)   TYPE N VALUE '01',
       W_CURDATE TYPE CHAR10,
       W_HEADING TYPE LVC_TITLE.
*                        SELECTION SCREEN                      *
SELECTION-SCREEN BEGIN OF BLOCK FRM1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:
  S_WAGRP    FOR  P0008-TRFGR OBLIGATORY,
  S_FROM     FOR  P0000-BEGDA OBLIGATORY NO-EXTENSION.
SELECTION-SCREEN END OF BLOCK FRM1.
* Selection screen serach help for wage groups.
INCLUDE : ZHRI0003.
*                        AT SELECTION SCREEN                   *
*                        START OF SELECTION                    *
START-OF-SELECTION.
  PERFORM PU_EXEUTIVES_PROM.
  IF S_FROM-HIGH IS INITIAL.
    S_FROM-HIGH = SY-DATUM.
  ENDIF.
*Fetching employee data for all infotypes.
GET PERNR.
  PERFORM  PU_DATA_RETRIEVAL.
*                        START OF SELECTION                    *
END-OF-SELECTION.
  PERFORM PU_FINAL_TABLE.
  PERFORM PU_GRID_DISPLAY.
  PERFORM PU_FREE_TABLES.
*                        SUBROUTINES                           *
*&      Form  PU_DATA_RETRIEVAL
FORM PU_DATA_RETRIEVAL .
* To find out date of join for employee
  PERFORM PU_DATA_OF_JOIN.
* Employee Personnel data
  RP_PROVIDE_FROM_LAST P0002 SPACE PN-BEGDA PN-ENDDA.
  IF PNP-SW-FOUND NE C_ONE.
    REJECT.
  ENDIF.
* Employee Name into output table
  INT_OUTPUT-NAME = P0002-VORNA.
*  INT_OUTPUT-DOB  = P0002-GBDAT.
  PERFORM PU_DATE_CONVERSION USING    P0002-GBDAT
                             CHANGING INT_OUTPUT-DOB.
  IF P0002-GESCH EQ 1.
    INT_OUTPUT-***  = 'Male'.
  ELSE.
    INT_OUTPUT-***  = 'Female'.
  ENDIF.
* Fetching employees from employee sub goup of Non Executive
  RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
  IF PNP-SW-FOUND NE C_ONE.
    REJECT.
  ENDIF.
  IF P0001-PERSK  EQ '30' OR P0001-PERSK  EQ '20'.
* Position for employee into output table
    PERFORM  PU_POSTION_TEXT.
  ELSE.
    REJECT.
  ENDIF.
* Position for employee into output table
  PERFORM  PU_POSTION_TEXT.
* Persoonel Sub Area text .
  READ TABLE INT_PESUB WITH KEY WERKS = P0001-WERKS
                                BTRTL = P0001-BTRTL.
  IF SY-SUBRC EQ 0.
    INT_OUTPUT-PESUB = INT_PESUB-BTEXT.
  ENDIF.
  READ TABLE INT_COSTC WITH KEY KOSTL = P0001-KOSTL.
  IF SY-SUBRC EQ 0.
    INT_OUTPUT-COSTC = INT_COSTC-KTEXT.
  ENDIF.
* Fetching employees from Additional Personal Data
  RP_PROVIDE_FROM_LAST P0077 SPACE PN-BEGDA PN-ENDDA.
  IF PNP-SW-FOUND EQ C_ONE.
* Ethnic origin of employee  into output table
    INT_OUTPUT-ETHIC = P0077-RACKY.
  ENDIF.
* Selecting data from  basic pay last record with wage group
  RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.
  IF PNP-SW-FOUND NE C_ONE.
    REJECT.
  ELSE.
    W_WAGEGRP = P0008-TRFGR.
* Employee Pay Scale Group  into output table
    INT_OUTPUT-GRADE = P0008-TRFGR.
  ENDIF.
* Selecting data from  Education with wage group
  SORT P0022 BY BEGDA.
  PROVIDE * FROM P0022 BETWEEN PN-BEGDA AND PN-ENDDA.
    IF SY-TABIX EQ 1.
      READ TABLE INT_QUALFI WITH KEY AUSBI = P0022-AUSBI.
      IF SY-SUBRC EQ 0.
        INT_OUTPUT-QUAL1 = INT_QUALFI-ATEXT.
      ENDIF.
    ELSEIF SY-TABIX EQ 2.
      READ TABLE INT_QUALFI WITH KEY AUSBI = P0022-AUSBI.
      IF SY-SUBRC EQ 0.
        INT_OUTPUT-QUAL2 = INT_QUALFI-ATEXT.
      ENDIF.
    ELSEIF SY-TABIX EQ 3.
      READ TABLE INT_QUALFI WITH KEY AUSBI = P0022-AUSBI.
      IF SY-SUBRC EQ 0.
        INT_OUTPUT-QUAL3 = INT_QUALFI-ATEXT.
      ENDIF.
    ELSEIF SY-TABIX EQ 4.
      READ TABLE INT_QUALFI WITH KEY AUSBI = P0022-AUSBI.
      IF SY-SUBRC EQ 0.
        INT_OUTPUT-QUAL4 = INT_QUALFI-ATEXT.
      ENDIF.
    ELSEIF SY-TABIX EQ 5.
      READ TABLE INT_QUALFI WITH KEY AUSBI = P0022-AUSBI.
      IF SY-SUBRC EQ 0.
        INT_OUTPUT-QUAL5 = INT_QUALFI-ATEXT.
      ENDIF.
    ENDIF.
  ENDPROVIDE.
* Carrer path code for employee from Additional Personal Data.
  RP_PROVIDE_FROM_LAST P9002 SPACE PN-BEGDA PN-ENDDA.
  IF PNP-SW-FOUND EQ C_ONE.
    W_CPCODE  = P9002-CPCODE.
    INT_OUTPUT-CPCODE = P9002-CPCODE.
    IF W_CPCODE EQ '001'.
      IF W_HIREDATE < C_EARLYDT.
        CONCATENATE W_CPCODE
                    C_EARLY
              INTO  W_CAREERCD.
      ELSE.
        CONCATENATE W_CPCODE
                    C_NEW
              INTO  W_CAREERCD.
      ENDIF.
    ELSE.
      W_CAREERCD = W_CPCODE.
    ENDIF.
  ENDIF.
* Detrmine Promotion by Test/Service
  READ TABLE INT_NONEXE WITH KEY CPCODE    = W_CAREERCD
                                 WAGEGROUP = W_WAGEGRP.
  IF SY-SUBRC EQ 0.
    W_PROMTYPE = INT_NONEXE-TSTYPE.
    W_NOOFYRS  = INT_NONEXE-NOYRS.
    INT_OUTPUT-PROMT = W_PROMTYPE.
    INT_OUTPUT-NOYRS = W_NOOFYRS.
  ENDIF.
* Retriving last promotion date from actions
  DELETE INT_PROM WHERE MASSN NE 'B3'.
  SORT INT_PROM BY BEGDA DESCENDING.
*  RP_PROVIDE_FROM_LAST INT_PROM SPACE PN-BEGDA PN-ENDDA.
  READ TABLE INT_PROM INDEX 1.
  IF SY-SUBRC EQ 0 AND INT_PROM-MASSN EQ 'B3'.
    PERFORM PU_DATE_CONVERSION USING  INT_PROM-BEGDA
                             CHANGING W_LASTPROM.
  ELSE.
    PERFORM PU_DATE_CONVERSION USING  W_HIREDATE
                               CHANGING W_LASTPROM.
  ENDIF.
*  As there is no ending date for records which happen on same date
*  for cross check to get last promotion Infotype 0302' is retived
  IF P0302[] IS NOT INITIAL.
    DELETE P0302 WHERE MASSN NE 'B3'.
    SORT  P0302 BY BEGDA DESCENDING.
    READ TABLE P0302 INDEX 1.
    IF SY-SUBRC EQ 0 AND
       INT_PROM-BEGDA IS NOT INITIAL.
      IF INT_PROM-BEGDA < P0302-BEGDA.
        PERFORM PU_DATE_CONVERSION USING  P0302-BEGDA
                                 CHANGING W_LASTPROM.
      ENDIF.
    ENDIF.
  ENDIF.
  IF W_LASTPROM+0(2) GT '01'.
    W_LASTPROM+0(2) = '01'.
    W_ONE = W_LASTPROM+3(2) + 1.
    W_LASTPROM+3(2) =  W_ONE.
  ENDIF.
* Last promaotion date for Employee into output table
  INT_OUTPUT-LPROM =  W_LASTPROM.
* To Find out promotion due date for employee.
* Fetching service availabilty data
  W_YEAR     =  W_LASTPROM+6(4).
  W_YEAR     =  W_YEAR + W_NOOFYRS.
  CONCATENATE  W_YEAR
                 W_LASTPROM+3(2)
               W_LASTPROM+0(2)
          INTO W_PROMDATE.
* Check promotion duedate is with in input range.
  IF S_FROM-LOW IS NOT INITIAL.
    CHECK W_PROMDATE GE S_FROM-LOW.
  ENDIF.
  IF S_FROM-HIGH IS NOT INITIAL.
    CHECK W_PROMDATE LE S_FROM-HIGH.
  ENDIF.
* Promaotion due date for Employee into output table
  PERFORM PU_DATE_CONVERSION USING    W_PROMDATE
                             CHANGING INT_OUTPUT-PROMD.
* Apprisal rating data.
* If promotion month is JAN,FEB,MAR deduct 6 years
  IF W_PROMDATE+4(2) EQ C_JAN OR
     W_PROMDATE+4(2) EQ C_FEB OR
     W_PROMDATE+4(2) EQ C_MAR.
    CLEAR W_YEAR.
    W_YEAR   = W_PROMDATE+0(4).
    W_APYEAR = W_YEAR - 1.
    W_YEAR   = W_YEAR - 6.
  ELSE.
* If promotion month is not JAN,FEB,MAR deduct 5 years
    W_YEAR   = W_PROMDATE+0(4).
    W_APYEAR = W_YEAR.
    W_YEAR   = W_YEAR - 5.
  ENDIF.
  CONCATENATE  W_YEAR
               '0401'
          INTO W_APPRST.
  CONCATENATE  W_APYEAR
               '0331'
          INTO W_APPREND.
  DELETE P0025 WHERE BEGDA LT W_APPRST
                  OR BEGDA GT W_APPREND.
  PROVIDE * FROM P0025 BETWEEN PN-BEGDA AND PN-ENDDA.
    IF SY-TABIX EQ 1.
      INT_OUTPUT-APPR1 = P0025-KSU01.
    ELSEIF SY-TABIX EQ 2.
      INT_OUTPUT-APPR2 = P0025-KSU01.
    ELSEIF SY-TABIX EQ 3.
      INT_OUTPUT-APPR3 = P0025-KSU01.
    ELSEIF SY-TABIX EQ 4.
      INT_OUTPUT-APPR4 = P0025-KSU01.
    ELSEIF SY-TABIX EQ 5.
      INT_OUTPUT-APPR5 = P0025-KSU01.
    ENDIF.
  ENDPROVIDE.
* Absence data.
  IF W_PROMDATE+4(2) EQ C_JAN.
    CLEAR W_YEAR.
    W_YEAR   = W_PROMDATE+0(4).
    W_ABSYR  = W_YEAR - 1.
    W_MONTH  = '11'.
    W_YEAR   = W_YEAR - 2.
  ELSE.
* If promotion month is not JAN,FEB,MAR deduct 5 years
    W_YEAR   = W_PROMDATE+0(4).
    W_ABSYR  = W_YEAR.
    W_MONTH  = W_PROMDATE+4(2).
    W_MONTH  = W_MONTH - 01.
    W_YEAR   = W_YEAR - 1.
  ENDIF.
  CONCATENATE W_YEAR
              W_MONTH
              '23'
         INTO W_ABSST.
  CONCATENATE  W_ABSYR
               W_MONTH
               '22'
          INTO W_ABSEND.
  SORT   P2001 BY BEGDA.
  DELETE P2001 WHERE ( AWART NE C_AWL AND
                       AWART NE C_LWP )  OR
                     ( BEGDA LT W_ABSST
                 OR    BEGDA GT W_ABSEND ).
  PROVIDE * FROM P2001 BETWEEN PN-BEGDA AND PN-ENDDA.
    IF P2001-AWART  EQ  C_AWL.
      W_AWL = W_AWL + P2001-ABWTG.
    ELSEIF P2001-AWART  EQ  C_LWP.
      W_LWP = W_LWP + P2001-ABWTG.
    ENDIF.
  ENDPROVIDE.
  INT_OUTPUT-AWL = W_AWL.
  INT_OUTPUT-LWP = W_LWP.
* Increments dates' data.
  DELETE INT_CHGPY WHERE MASSN NE 'B7'.
  SORT   INT_CHGPY BY BEGDA DESCENDING.
  IF INT_CHGPY[] IS NOT INITIAL.
    INT_INCRE-PERNR = INT_CHGPY-PERNR.
    PROVIDE * FROM INT_CHGPY  BETWEEN PN-BEGDA
                                  AND PN-ENDDA.
      IF SY-TABIX EQ 1.
        PERFORM PU_DATE_CONVERSION USING    INT_CHGPY-BEGDA
                                   CHANGING INT_INCRE-INCR1.
      ELSEIF SY-TABIX EQ 2.
        PERFORM PU_DATE_CONVERSION USING    INT_CHGPY-BEGDA
                                   CHANGING INT_INCRE-INCR2.
      ELSEIF SY-TABIX EQ 3.
        PERFORM PU_DATE_CONVERSION USING    INT_CHGPY-BEGDA
                                   CHANGING INT_INCRE-INCR3.
      ENDIF.
    ENDPROVIDE.
    APPEND INT_INCRE.
    CLEAR  INT_INCRE.
  ENDIF.
* Disciplinary Actions.
  CLEAR W_YEAR.
  W_YEAR = W_PROMDATE+0(4).
  W_YEAR = W_YEAR - 3.
  CONCATENATE  W_YEAR
               W_PROMDATE+4(4)
          INTO W_DISDATE.
  SORT P9545 BY MDATE.
  DELETE P9545 WHERE MDATE LT W_DISDATE
                  OR MDATE GT W_PROMDATE.
  PROVIDE * FROM P9545 BETWEEN PN-BEGDA
                          AND  PN-ENDDA.
    READ TABLE INT_DISCIP WITH KEY MCODE = P9545-MCODE.
    IF SY-SUBRC EQ 0.
      INT_DISCACT-PERNR  = P9545-PERNR.
      INT_DISCACT-DESCRI = INT_DISCIP-DESCRI.
      PERFORM PU_DATE_CONVERSION USING    P9545-MDATE
                                 CHANGING INT_DISCACT-MDATE.
      INT_DISCACT-COMM1 = ','.
      INT_DISCACT-COMM2 = ','.
      APPEND INT_DISCACT.
      CLEAR  INT_DISCACT.
    ENDIF.
  ENDPROVIDE.
  APPEND INT_OUTPUT.
  CLEAR INT_OUTPUT.
  CLEAR : W_HIREDATE,W_WAGEGRP,W_CPCODE,W_CAREERCD,W_PROMTYPE,
          W_NOOFYRS,W_LASTPROM,W_PROMDATE,W_YEAR,W_APYEAR,
          W_APPRST,W_DISDATE,W_APPREND,W_ABSST,W_ABSEND,
          W_ABSYR,W_MONTH,W_AWL,W_LWP,W_DISCI.
ENDFORM.                    " PU_DATA_RETRIEVAL
*&      Form  PU_DATA_OF_JOIN
FORM PU_DATA_OF_JOIN .
  CLEAR INT_OUTPUT.
  READ TABLE P0000 WITH KEY  MASSN = 'B1'.
  IF SY-SUBRC NE 0 OR  P0000-STAT2 NE '3'.
    REJECT.
  ELSE.
* Personnel number into output table
    INT_OUTPUT-PERNR = P0000-PERNR.
    PERFORM PU_DATE_CONVERSION USING P0000-BEGDA
                            CHANGING INT_OUTPUT-DOJ.
    W_HIREDATE = P0000-BEGDA.
  ENDIF.
ENDFORM.                    " PU_DATA_OF_JOIN
*&      Form  PU_POSTION_TEXT
FORM PU_POSTION_TEXT .
  DATA  : S_OBJECT TYPE OBJEC_T,
          PERNR_TAB  TYPE HRQUERY_PERNR_T ,
          SOBID_TAB  TYPE HRQUERY_SOBID_T ,
          WA_SOBID TYPE HRQUERY_SOBID,
          WA_PERNR TYPE HRQUERY_PERNR,
          WA_OBJECT TYPE OBJEC.
  WA_PERNR-PERNR = P0001-PERNR.
  APPEND WA_PERNR TO PERNR_TAB.
  WA_SOBID-PLVAR = '01'.
  WA_SOBID-OTYPE = P0001-OTYPE.
  WA_SOBID-SOBID = P0001-PLANS.
  APPEND WA_SOBID TO SOBID_TAB.
  WA_SOBID-PLVAR = '01'.
  WA_SOBID-OTYPE = 'O'.
  WA_SOBID-SOBID = P0001-ORGEH.
  APPEND WA_SOBID TO SOBID_TAB.
  CALL FUNCTION 'HR_GET_TEXT_FOR_OBJECTS'
    EXPORTING
      BEGDA       = PN-BEGDA
      ENDDA       = PN-ENDDA
    IMPORTING
      OBJEC_TAB   = S_OBJECT
    CHANGING
      PERNR_TAB   = PERNR_TAB
      SOBID_TAB   = SOBID_TAB
    EXCEPTIONS
      WRONG_DATES = 1
      OTHERS      = 2.
  IF SY-SUBRC EQ 0.
    LOOP AT S_OBJECT INTO WA_OBJECT.
      IF WA_OBJECT-OTYPE EQ 'O'.
        INT_OUTPUT-ORGUN = WA_OBJECT-STEXT.
      ELSEIF  WA_OBJECT-OTYPE EQ 'S'.
        INT_OUTPUT-DESIG = WA_OBJECT-STEXT.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " PU_POSTION_TEXT
*&      Form  PU_EXEUTIVES_PROM
FORM PU_EXEUTIVES_PROM .
  SELECT * FROM ZHRT007 INTO TABLE INT_NONEXE.
  SELECT * FROM ZHRT004 INTO TABLE INT_DISCIP.
  SELECT * FROM T001P   INTO TABLE INT_PESUB.
  SELECT * FROM CSKT    INTO TABLE INT_COSTC
                             WHERE SPRAS EQ SY-LANGU.
  SELECT * FROM T518B   INTO TABLE INT_QUALFI
                             WHERE LANGU EQ SY-LANGU.
ENDFORM.                    " PU_EXEUTIVES_PROM
*&      Form  PU_DATE_CONVERSION
FORM PU_DATE_CONVERSION  USING    INPUT_DATE    TYPE SY-DATUM
                         CHANGING OUTPUT_DATE   TYPE CHAR10.
  CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
    EXPORTING
      DATE_INTERNAL            = INPUT_DATE
    IMPORTING
      DATE_EXTERNAL            = OUTPUT_DATE
    EXCEPTIONS
      DATE_INTERNAL_IS_INVALID = 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.                    " PU_DATE_CONVERSION
*&      Form  PU_FINAL_TABLE
* Preparing final internal table for output to excel
FORM PU_FINAL_TABLE .
  DATA : W_STR1(4)  TYPE N,
         W_STR2(4)  TYPE N,
         W_STR3(4)  TYPE N,
         W_EXSTR(4) TYPE N,
         W_ORSTR(4) TYPE N,
         W_INSTR(4) TYPE N,
         W_ONSTR(4) TYPE N,
         W_DISFLAG  TYPE CHAR1,
         W_INCFLAG  TYPE CHAR1.
  LOOP AT INT_OUTPUT.
    MOVE-CORRESPONDING INT_OUTPUT TO INT_EXCEL.
    LOOP AT INT_DISCACT WHERE PERNR = INT_OUTPUT-PERNR.
      IF SY-TABIX EQ 1.
        CONCATENATE INT_DISCACT-DESCRI
                     SPACE
                    INT_DISCACT-MDATE
               INTO W_DISCI.
        INT_EXCEL-DISCI = W_DISCI.
      ELSE.
        W_DISFLAG = 1.
      ENDIF.
    ENDLOOP.
    LOOP AT INT_INCRE WHERE PERNR = INT_OUTPUT-PERNR.
      INT_EXCEL-INCR1 =  INT_INCRE-INCR1.
      INT_EXCEL-INCR2 =  INT_INCRE-INCR2.
      INT_EXCEL-INCR3 =  INT_INCRE-INCR3.
    ENDLOOP.
    APPEND INT_EXCEL.
    CLEAR  INT_EXCEL.
    CLEAR : W_STR1,W_STR2,W_STR3.
    IF W_DISFLAG EQ 1.
      W_ORSTR = W_EXSTR.
      LOOP AT INT_DISCACT WHERE PERNR = INT_OUTPUT-PERNR.
        IF SY-TABIX NE 1.
          CONCATENATE INT_DISCACT-DESCRI
                       SPACE
                      INT_DISCACT-MDATE
                 INTO W_DISCI.
          INT_EXCEL-DISCI = W_DISCI.
          APPEND INT_EXCEL.
          CLEAR  INT_EXCEL.
          CLEAR : W_STR2,W_EXSTR.
        ENDIF.
      ENDLOOP.
    ENDIF.
  ENDLOOP.
ENDFORM.                    " PU_FINAL_TABLE
*&      Form  PU_GRID_DISPLAY
*       text
*  -->  p1        text
*  <--  p2        text
FORM PU_GRID_DISPLAY .
  DATA W_GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
  PERFORM F_FIELDCAT_INIT USING 'IT_HEADER' W_GT_FIELDCAT[].
  IF INT_EXCEL[] IS NOT INITIAL.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM = SY-CPROG
        IT_FIELDCAT        = W_GT_FIELDCAT[]
        IT_EVENTS          = EVENT[]
      TABLES
        T_OUTTAB           = INT_EXCEL
      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.
  ELSE.
    MESSAGE S011(ZHR).
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " PU_GRID_DISPLAY
*&      Form  F_FIELDCAT_INIT
FORM F_FIELDCAT_INIT USING IT_TABLE
                           LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
  DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'PERNR'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 14.
  LS_FIELDCAT-SELTEXT_L = 'Personnel Number'.
  LS_FIELDCAT-FIX_COLUMN = 'X'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'NAME'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 30.
  LS_FIELDCAT-SELTEXT_L    = 'Name'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'DESIG'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 25.
  LS_FIELDCAT-SELTEXT_L    = 'Desigination'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'PESUB'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 16.
  LS_FIELDCAT-SELTEXT_L    = 'Personnel Sub Area'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'ORGUN'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 25.
  LS_FIELDCAT-SELTEXT_L    = 'Organization Unit'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'COSTC'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 14.
  LS_FIELDCAT-SELTEXT_L    = 'Cost Center'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'ETHIC'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 6.
  LS_FIELDCAT-SELTEXT_L    = 'Ethic'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'CPCODE'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 7.
  LS_FIELDCAT-SELTEXT_L    = 'CPCode'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'GRADE'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    =  12.
  LS_FIELDCAT-SELTEXT_L    = 'Current Grade'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = '***'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 6.
  LS_FIELDCAT-SELTEXT_L    = 'Gender'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'DOB'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 11.
  LS_FIELDCAT-SELTEXT_L    = 'Date of Birth'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'DOJ'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 11.
  LS_FIELDCAT-SELTEXT_L    = 'Date of Join'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'QUAL1'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 13.
  LS_FIELDCAT-SELTEXT_L    = 'Qualification 1'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'QUAL2'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 13.
  LS_FIELDCAT-SELTEXT_L    = 'Qualification 2'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'QUAL3'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 13.
  LS_FIELDCAT-SELTEXT_L    = 'Qualification 3'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'QUAL4'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 13.
  LS_FIELDCAT-SELTEXT_L    = 'Qualification 4'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'QUAL5'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 13.
  LS_FIELDCAT-SELTEXT_L    = 'Qualification 5'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'LPROM'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 16.
  LS_FIELDCAT-SELTEXT_L    = 'Last Promotion Date'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'PROMD'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 16.
  LS_FIELDCAT-SELTEXT_L    = 'Promotion Due Date'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'PROMT'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 14.
  LS_FIELDCAT-SELTEXT_L    = 'Promotion Type'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'NOYRS'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = 'Number of Years'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'AWL'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 22.
  LS_FIELDCAT-SELTEXT_L    = 'Absence Without Leave'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'LWP'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 22.
  LS_FIELDCAT-SELTEXT_L    = 'Leave Without Pay'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'APPR1'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = 'Apprisal 1st'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'APPR2'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = 'Apprisal 2nd'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'APPR3'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = 'Apprisal 3rd'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'APPR4'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = 'Apprisal 4th'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'APPR5'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = 'Apprisal 5th'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'DISCI'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 60.
  LS_FIELDCAT-SELTEXT_L    = 'Disciplinary Actions - Date'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'INCR1'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = '1st Increment'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'INCR2'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = '2nd Increment'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
  CLEAR LS_FIELDCAT.
  LS_FIELDCAT-FIELDNAME    = 'INCR3'.
  LS_FIELDCAT-TABNAME      = INT_EXCEL.
  LS_FIELDCAT-OUTPUTLEN    = 15.
  LS_FIELDCAT-SELTEXT_L    = '3rd Increment'.
  APPEND LS_FIELDCAT TO LT_FIELDCAT.
ENDFORM.                    " F_FIELDCAT_INIT
*&      Form  PU_FREE_TABLES
FORM PU_FREE_TABLES .
  FREE :  INT_NONEXE  ,
          INT_OUTPUT  ,
          INT_DISCACT ,
          INT_QUALFI  ,
          INT_INCRE   ,
          INT_DISCIP  ,
          INT_PESUB   ,
          INT_COSTC   ,
          INT_EXCEL   ,
          EVENT       ,
          LISTHEAD    .
ENDFORM.                    " PU_FREE_TABLES
reward points if helpful
Edited by: mohammed  abdul hai on Jul 25, 2008 7:21 PM

Similar Messages

  • Report for time log on detail for each employees in SAP ABAP-HR report

    hi experts,
          please help me .how to create a report for time log on detail for each employees in SAP ABAP-HR report.please help me.
                                                      thank you

    Hi,
    For Time Management Infotypes , If you want to read the data using macro you need to use the Macro called RP_READ_ALL_TIME_ITY
    Example:
    DATA: BEGDA LIKE P2001-BEGDA, ENDDA LIKE P2001-ENDDA.
       INFOTYPES:  0000, 0001, 0002, ...
                         2001 MODE N, 2002 MODE N, ...
         GET PERNR.
       BEGDA = '19900101'. ENDDA = '19900131'.
       RP_READ_ALL_TIME_ITY BEGDA ENDDA.
       IF PNP-SW-AUTH-SKIPPED-RECORD NE '0'.
          WRITE: / 'Authorization for time data missing'.
          WRITE: / 'for personnel number', PERNR-PERNR. REJECT.
       ENDIF.

  • Detail info on SAP-ABAP interfaces

    Hi experts,
                     i need detailed info on abap interfaces,  means  what are all interfaces in ABAP & how that will work ......i would like to know that BDC program  comes under interface or not .....
    Thanks in advance

    Hi Narayana,
                                   R/3 Application
                              ==================
                               ABAP work bench
       uesr interface  ================== commntn interface
                             R/3 Basis(middleware)
                             ===================
                              System software(OS)
    Integration of R/3 with the external application via open interface
    OLE,RFC,ALE,EDI,CPI-C etc are  the interfaces ...
    Thanks
    Mohinder Singh Chauhan

  • What is main deff  between indian payroll and us payroll in sap abap hr

    HI Experts,
    what is main deff  between indian payroll and us payroll in sap abap hr.
    Regards
    Naresh

    Hi,
    U.S payrolls:
    SAP has given country specific payrolls for more than 40countries Each country specific version is called country version.  Every country has a country specific payroll driver and pay roll schema based on modular international payroll driver and schema.  When sap says country version it includes country specific civil, tax laws, contributory and other tax laws (all these details are populated in the country specific info types).
    Some of them are:
    - Personnel data -address-6, bank details-7, personal data-2, challenges-4 etc..
    - Actions -0000 info type
    - Organizational data
    So when you run a payroll for a specific country, besides general information valid for the international pay roll, one needs to enter specific details in the particular info types for example if you are running U.S  pay roll you need enter SSN no. to uniquely identify an employee in the info type 0002-personal data.
    Besides the common infotypes these are some of the U.S pay roll specific infotypes that one has to configure in U.S pay roll.
    - Garnishment Order - Info type 019
    - Creating a Garnishment Order - Info type 0195
    Inidan PayRolls:-
    Indian pay roll besides common info types, uses specific info types from 0580 to 0590 and 0045 (loans infotype) -- these info types will capture the data related to all the major components of Indian pay roll.
    Hope this is helpful,
    Thanks
    Kalyan

  • Employee Check in SAP

    Hi Experts,
    I have a query regarding Employee Validation in SAP System.
    Is there any way to give a validation check while hiring an employee. Here we have close to 5000 temporary hourly wage earners and we will not know if that employee is already in the system. Before generating a new employee number, I would like a validity check to show if that employee is already in the system.
    If it is not available in standard SAP, please let me know if this can be done through ABAP and some inputs on ABAP.
    Thanks in advance!

    As per my knowledge there is no standard functionality like this.
    But we can do the validations using screen and Field validations
    You need to take the fields Date of Birth, First Name, Last Name.
    Giving option Save details with a warning message because there is always chance to have persons with same name with same Date of Birth.
    Warm Regards

  • How to log in to the new installed SAP ABAP instance ?

    Dear Experts,
    In SAP ERP 2005 installation,
    I have done central system installation, Now I need to perform postinstallation steps,
    Could you please tell me,  how to log in to the new installed SAP ABAP instance and do the post installation?
    Regards,
    Madhavan K

    Hi,
    Check the list of post installation steps:
    http://www.saptechies.com/post-installation-steps-for-ecc-60/
    From my point of view basic post installation steps are:
    - Installing SAP License (from http://service.sap.com/licensekeys)
    - Setup TMS  (STMS)
    - Import profiles (RZ10)
    - Client Copy (SCC*)
    - Create users (SU01)
    However further many steps are required as per your requirements. Cehck the link for more detailed steps.
    Regards,
    Srikishan

  • Facing problem in Fetching Employee details

    Hello All,
    i need to write a abap coding to fetch the employee details from the corresponding table,i worte a code but its is not fetching the details of the employess in to the output,am sending my code along with this thread its great if any body help me out in ths regard,thanks in advance...
    NAME        : Chandeep Singh
    DESCRIPTION : TO GENERATE SIMPLE REPORT USING HR ABAP
                   LOGICAl DATABASE- PNP .
    REPORT zchandeep_hr_prog_1
    LINE-SIZE 200 .
    *Database Table
    TABLES: pernr,           " Pernr structure for Logical database
    pa0001,           " Actions
    pa0002.           " Personnel Info
    *Infotypes
    INFOTYPES: 0001,         " Actions
               0002.         " personnel info
    *Variable Declaration
    DATA: form_nam LIKE p0001-ename,
          v_age(5) TYPE c,       "variable for calculating age in days
          v_ctr1 TYPE i VALUE 0, "counter
          v_ctr2 TYPE i VALUE 0, "counter
          var(5) TYPE c ,        " variable to store btrtl
          var1(5) TYPE c  .      " variable to store werks
    *Internal Table Decalartion
    DATA: BEGIN OF i_tab1 OCCURS 0,
           pernr LIKE pa0001-pernr,  "employee number
           ename LIKE pa0001-ename,  "employee name
           begda LIKE pa0002-begda,  "employee join date
           werks LIKE pa0001-werks,  "personnel area
           btrtl LIKE pa0001-btrtl,  "personnel sub area
           persg LIKE pa0001-persg,  "employee group
           persk LIKE pa0001-persk,  "employee sub-group
           plans LIKE pa0001-plans,  "position
           gbdat LIKE p0002-gbdat,   "date of birth
         END OF i_tab1.
    *START-OF-SELECTION
    START-OF-SELECTION .
    GET pernr .
      rp-provide-from-last p0001 space pn-begda pn-endda .   " Macro for IFT-0001
      rp-provide-from-last p0002 space pn-begda pn-endda .   " Macro for IFT-0002
    **--> Populate internal table
      MOVE p0001-pernr TO i_tab1-pernr .
      MOVE p0001-ename TO i_tab1-ename .
      MOVE p0002-begda TO i_tab1-begda .
      MOVE p0001-werks TO i_tab1-werks .
      MOVE p0001-btrtl TO i_tab1-btrtl .
      MOVE p0001-persg TO i_tab1-persg .
      MOVE p0001-persk TO i_tab1-persk .
      MOVE p0001-plans TO i_tab1-plans .
      MOVE p0002-gbdat TO i_tab1-gbdat .
    **--> Append data to internal table
      APPEND i_tab1 .
      CLEAR i_tab1 .                                       " Clear header I_TAB1******************************
    *END-OF-SELECTION
    END-OF-SELECTION.
    *****sorting the internal table on personnel area & personnel sub-area
      SORT i_tab1 BY werks btrtl.
    *TOP_OF_PAGE
      PERFORM top_of_page.
    *Output Display
    LOOP AT I_TAB1.
    *for calculating the age in days
      v_age = sy-datum - i_tab1-gbdat.
    *control break on Personal Sub Area
      LOOP.
        AT NEW pnpbtrtl .
          IF sy-tabix NE 1.
            FORMAT COLOR COL_NORMAL ON.
            WRITE:/5 'Total Number of Employees for personnel Sub-Area:',
            var  , 'is ',
            v_ctr1.
            CLEAR v_ctr1.
            FORMAT COLOR OFF.
          ENDIF.
        ENDAT .
      ENDLOOP.
    **Control Break on personnel Area
      LOOP.
        AT NEW pnpwerks.
          IF sy-tabix NE 1.
            FORMAT COLOR COL_TOTAL ON.
            WRITE:/5 'Total Number of Employees for Personal Area: ',
             var1 ,'is    ', v_ctr2. "color col_total.        CLEAR V_CTR2.
            SKIP 1.
            FORMAT COLOR OFF.
          ENDIF.
        ENDAT .
        WRITE:/5
        i_tab1-pernr,   "personnel number
      16 i_tab1-ename,   "emp name
      47 i_tab1-begda,   "join date
      60  v_age,         "age in days
      74  i_tab1-werks,  "P area
      84  i_tab1-btrtl,  "P sub Area
      94  i_tab1-persg,  "emp group
      104  i_tab1-persk, "emp sub group
      114  i_tab1-plans. "position
        v_ctr1 = v_ctr1 + 1.
        v_ctr2 = v_ctr2 + 1.
        var = i_tab1-btrtl .
        var1 = i_tab1-werks .
      ENDLOOP.
    *&      Form  top_of_page
          Header Output
    FORM top_of_page.
      FORMAT COLOR COL_HEADING ON.
      WRITE:/5 'Employee',
            16 'Employee',
            47 'Join Date',
            62 'Age',
            74 'Personal',
            84 'Personal',
            94 'Employee',
            104 'Employee',
            114 'Position ',
          /5 'Number',
          16 'Name',
          60 '(In Days)',
          74 'Area',
          84 'Sub-Area',
          94 'Group',
          104 'Sub-Group'.
      FORMAT COLOR OFF.
      SKIP 1.
    ENDFORM.                    " top_of_page

    After tables pernr.
    write this code :
       GET PERNR.
    and check the program
    Regards,
    Srinivas

  • Sap-abap faq's

    hi,
      i want abap faq's which is used to face an interview, please help me, the different types of questions asked in the interview. please send an attachment to my mail my mail id is [email protected]
    thanks and regards
    chandra sekhar.

    1. How data is stored in cluster table?
    Each field of cluster table behaves as tables which contains the no. of entries.
    2. What are client dependant objects in abap/sap?
    SAP Script layout, text element, and some DDIC objects.
    3. On which even we can validate the input fields in module progams?
    In PAI (Write field statement on field you want to validate, if you want to validate group of fields put in chain and End chain statement.)
    4. In selection screen I have three fields, plant mat no and material group. If I input plant how do I get the mat no and material group based on plant dynamically?
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR MATERIAL.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' to get material and material group for the plant.
    5. How do you get output from IDOC?
    Data in IDOc is stored in segments, the output from Idoc is obtained by reading the data stored in its respective segments.
    6. When top of the page event is triggered?
    After excuteing first write statement in start-of-selection event.
    7. Can we create field without data element and how?
    In SE11 one option is available above the fields strip. Data element/ direct type.
    8. How do we debug sapscript?
    Go to SE71 give lay set name , go to utilities select debugger mode on.
    9. Which transaction code can I used to analyze the performance of ABAP program.
    TCode AL21.
    10. How can I copy a standard table to make my own z_table.
    Go to transaction SE11. Then there is one option to copy table. Press that button. Enter the name of the standard table and in the Target table enter Z table name and press enter.
    Following are some of the answers which I gave upto my knowledge.
    1. What is the use of 'outerjoin'
    Ans. With the use of outer join you can join the tables even there is no entry in all the tables used in the view.
    In case of inner join there should be an entry in al the tables use in the view.
    2. When to use logical database?
    Ans. Advantage of Logical databases:
    less coding s required to retrieve data compared to normal internel tables.
    Tables used LDB are in hierarchial structure.
    3. What is the use of 'table index'?
    Ans .Index is used for faster access of data base tables.
    4. What is the use of 'FOR ALL ENTRIES'?
    Ans. To avoid nested select statements we use SELECT FOR ALL ENTRIES statement.
    If there r more than 10000 records SELECT FOR ALL ENTRIES is used.
    Performance wise SELECT FOR ALL ENTRIES is better to use.
    5. Can you set up background processing using CALL TRANSACTION?
    Yes,Using No Screen Mode.
    6. What are table buffers?
    Table buffers reside locally on each application server in the system. The data of buffered tables can thus be accessed
    directly from the buffer of the application server. This avoids the time-consuming process of accessing the database.
    Buffering is useful if table needs to be accessed more no. of times in a program.
    ABAP Technical Interview Questions:
    1. What is the typical structure of an ABAP program?
    2. What are field symbols and field groups.? Have you used "component idx of structure" clause with field groups?
    3. What should be the approach for writing a BDC program?
    4. What is a batch input session?
    5. What is the alternative to batch input session?
    6. A situation: An ABAP program creates a batch input session. We need to submit the program and the batch session in background. How to do it?
    7. What is the difference between a pool table and a transparent table and how they are stored at the database level?
    8. What are the problems in processing batch input sessions? How is batch input process different from processing on line?
    9. What do you define in the domain and data element?
    10. What are the different types of data dictionary objects?
    11. How many types of tables exist and what are they in data dictionary?
    12. What is the step-by-step process to create a table in data dictionary?
    13. Can a transparent table exist in data dictionary but not in the database physically?
    14. What are the domains and data elements?
    15. Can you create a table with fields not referring to data elements?
    16. What is the advantage of structures? How do you use them in the ABAP programs?
    17. What does an extract statement do in the ABAP program?
    18. What is a collect statement? How is it different from append?
    19. What is open sql vs native sql?
    20. What does an EXEC SQL stmt do in ABAP? What is the disadvantage of using it?
    21. What is the meaning of ABAP editor integrated with ABAP data dictionary?
    22. What are the events in ABAP language?
    23. What is an interactive report? What is the obvious diff of such report compared with classical type reports?
    24. What is a drill down report?
    25. How do you write a function module in SAP? Describe.
    26. What are the exceptions in function module?
    27. What is a function group?
    28. How are the date abd time field values stored in SAP?
    29. What are the fields in a BDC_Tab Table?
    30. Name a few data dictionary objects?
    31. What happens when a table is activated in DD?
    32. What is a check table and what is a value table?
    33. What are match codes? Describe?
    34. What transactions do you use for data analysis?
    35. What is table maintenance generator?
    36. What are ranges? What are number ranges?
    37. What are select options and what is the diff from parameters?
    38. How do you validate the selection criteria of a report? And how do you display initial values in a selection screen?
    39. What are selection texts?
    40. What is CTS and what do you know about it?
    41. When a program is created and need to be transported to prodn does selection texts always go with it? if not how do you make sure? Can you change the CTS entries? How do you do it?
    42. What is the client concept in SAP? What is the meaning of client independent?
    43. Are programs client dependent?
    44. Name a few system global variables you can use in ABAP programs?
    45. What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement?
    46. How do you take care of performance issues in your ABAP programs?
    47. What are datasets?
    48. How to find the return code of a stmt in ABAP programs?
    49. What are interface/conversion programs in SAP?
    50. Have you used SAP supplied programs to load master data?
    2. Adapted from response by Maram Roja on Tuesday, June 15, 2004
    1. What are the techniques involved in using SAP supplied programs? Do you prefer to write your own programs to load master data? Why?
    2. What are logical databases? What are the advantages/disadvantages of logical databases?
    3. What specific statements do you using when writing a drill down report?
    4. What are different tools to report data in SAP? What all have you used?
    5. What are the advantages and disadvantages of ABAP query tool?
    6. What are the functional areas? User groups? How does ABAP query work in relation to these?
    7. Is a logical database a requirement/must to write an ABAP query?
    8. What is the structure of a BDC sessions.
    9. What are Change header/detail tables? Have you used them?
    10. What do you do when the system crashes in the middle of a BDC batch session?
    11. What do you do with errors in BDC batch sessions?
    12. How do you set up background jobs in SAP? What are the steps? What are the event driven batch jobs?
    13. Is it possible to run host command from SAP environment? How do you run?
    14. What kind of financial periods exist in SAP? What is the relevant table for that?
    15. Does SAP handle multiple currencies? Multiple languages?
    16. What is a currency factoring technique?
    17. How do you document ABAP programs? Do you use program documentation menu option?
    18. What is SAPscript and layout set?
    19. What are the ABAP commands that link to a layout set?
    20. What is output determination?
    ABAP Interview Questions
    1.Without using Tcode SE11, How can we enter the values in to the table???
    2.What is the difference between Collect statement and Append Statement???
    3.What do you mean by correction and Transportation system???
    4.What is the difference between User Exits and BADI????
    5.How can we identify User exits in our screen???
    6.What do you mean by Inbound and Outbound interface???
    7.In realtime do we configure ALE systems or Administator will take care of that??
    8.How to release an object???
    9.What is the flow of a Sales document???
    10.What is the flow of Purchase order???
    12.What is the flow of Invoice???
    13.What are the standard IDOC's used???
    14.What do you mean by table control???Where will we use this???
    15.What are field symbols??Where will we use these symbols???
    Deepti
    1. There are other ways of entering data into a DB table. ex. B D C
    2. Collect statement collect/adds the records basing on a key field. allows to create summarised data sets.
    Append will append/add a record at the end of existing records
    8. to release an object - use se10/se9
    9. sales doc flow: S. A. - S. O. - Delivery - Billing
    12. Delivery - invoice.
    15. field symbols are used for dynamic allocation. at runtime u can assign a concrete field to field-symbol.
    Kishore
    1. you can go to abap editor (se38) and use insert statement for insertion update for update and modify for modifications.
    2. collect will not allow duplicate entries, while append can allow duplicates.
    3. if any changes are made to objects they are to be transported to different systems i.e, change and transport.
    4. in user exits we go by general method for enhancements while BADIs we use objects (oops concepts)
    methods for enhancement.
    14. table controls are enhanced version for step loops where we can expand rows .main difference between these two
    is step loop can be expanded to two lines table controls can`t.
    15. field symbols are just like pointers concept which are used in C language. We use them when we want to refer to
    the fields considered,it doesnt allocate any memory for it.
    Venu Rapolu
    1. Ans: Using BDC., LSMW,,ALE., BAPI
    2. Ans: Collect: it adds the numeric fields to the existing non numeric key field records., thereby avoiding duplicate
    values., and append will simply adds the record
    3 . Ans: The CTS contains work bench organizer and transport system :
    The workbench organizer is used to record and contol changes to the ABAP/4 development objects;
    The transport system is used to move objects from an SAP dev.system to production system
    6. Ans: Outbound interface is used to send IDocs to the ALE server.,
    Inbound interface is used to Analyse the received Idoc.
    7. Ans: We (ABAPers) don't do.
    8. Ans: se09 or se10
    13. Ans: MATMAS
    CREMAS
    DEBMAS
    GLMAST etc...
    14. Ans: to display records in table format., we use in Screens
    15. Ans: we assign the field content at run time with ASSIGN stmt.
    Satish D
    1. goto se16 u can view the table contents
    2. collect will collects all the numeric fields of nonnumeric field values
    append will append record at the end of table
    3. when we are creatiing new task like dev. a new prg.. after completion of dev. that will be trnsported to testing system or production system to do that we are assigning an
    transport request from our dev.class(system) by using se09
    4. badis are dev. by class and inheritence methods where as user exitsdev by SAP only and empty shells filled wit user logic
    5. go to system then status
    6. outbound generating an idoc in ale layer with master_idoc_create_messgetype,
    inbound is receivng system with idoc_inbound_process, gives an return variable wether it is sucess or not
    7. no we have to configur that
    8. go to se09 or se01 there write your task no and use release button it will asks whats the other system name
    and number enter them and relase by pressing jeep button
    9. inquiry
    quotation
    sales order
    shipping
    delivery
    invoice
    return goods
    12. after creation of delivry note invoice is prepared
    13. master_idoc_distribute will generate standard idoc
    Deepti
    I am enclosing some of answers which I know.
    1. We can use t.Code SE16 to enter values into table only if table maintainence is allowed for that table.
    2. Append will add new entries into the table where as collect add into the numeric type fields if other charatcer fields
    matches to your selection criteria.
    3. CTS used for creation of ABAP development transport requests.The transaction code for this is SE10.
    4. UserExits r used for adding additional functionality to the existing SAP standard transactions.Using UserExits we can add additional functionality standard SAP functionality without making any changes to the original code.BADI is a standardized interface for ABAP sources that enables partners and customers to enhance SAP-delivered programs in their namespace.
    5 .We can identify User exits by using transactions CMOD and SMOD.
    6. After entering transaction code SE10 select the transport request which u want to transport and click on transport icon(Truck symbol) to release it.
    10. Purchase Requistion->RFQ->Vendor Evaluation->Purchase Order(ME21).
    14. Table control is the only facility provide thru dialog programming when we come acrosse the use of updating standared,deletion,insertion and all database operations.
    15. Field symbols r pointers to the existing data types(like 'C') which does not allocate any memory space. These are used faster access of data.
    Answers to some ABAP Interview Questions:
    Questions which I have faced in an interview:
    1) What is runtime analysis? Have you used this?
    2) What is meant by performance analysis? Have done anything to improve the performance?
    3) How to transfer the objects? Have to transferred any objects?
    4) How did you test the developed objects?
    5) What is the difference between SAP Memory and ABAP Memory?
    6) In order to upload Purchase order details, how you handle multiple values for a single field?
    Eg: Item field may contain no. of values for a record
    7) What is the procedure you followed to upload the data?
    8) How did you handle errors in Call Transaction?
    9) Among the Call Transaction and Session Method, which is faster?
    10) What are the difference between Interactive and Drill Down Reports?
    11) How to pass the variables to forms?
    12) How to create a link between modified form and modified print program?
    13) What is the table, which contain the details of all the name of the programs and forms?
    14) How did you test the form u developed? How did you taken print?
    15) What are Standard Texts?
    16) What is the difference between Clustered Tables and Pooled Tables?
    17) What is pf-status?
    18) Among "Move" and "Move Corresponding", which is efficient one?
    19) What are the output type and Tcodes?
    20) Where we use Chain and Endchain?
    21) Do you use select statement in loop endloop, how will be the performance? To improve the performance?
    22) In select-options, how to get the default values as current month first date and last date by default?
    Eg: 1/12/2004 and 31/12/2004
    Go thru these answers:
    1) What is runtime analysis? Have you used this?
    It's checks program execution time in microseconds. When you go to se30.if you give desired program name in performance file. It will take you to below screen. You can get how much past is your program.
    2) What is meant by performance analysis? Have done
    3) How to transfer the objects? Have you transferred any objects?
    4) How did you test the developed objects?
    I was testing a developed object. There are two types of testing
    - Negative testing
    - Positive testing
    In negative testing we will give negative data in input and we check any errors occurs.
    In positive testing we will give positive data in input for checking errors.
    8) How did you handle errors in Call Transaction?
    We can create a internal table like 'bsgmcgcoll'. All the messages will go to internal table. We can get errors in this internal table.
    Below messages are go to internal table. when you run the call transaction.
    - Message type
    - Message id
    - Message Number
    - Variable1
    - Variable2
    - Variable3
    9) Among the Call Transaction and Session Method, which is faster?
    Call transaction is faster then session method. But usually we use session method in real time...because we can transfer large amount of data from internal table to database and if any errors in a session. Process will not complete until session get correct.
    10) What are the difference between Interactive and Drill Down Reports?
    ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). You can use these events to move through layers of information about individual items in a list.
    Drill down report is nothing but interactive report...drilldown means above paragraph only.
    11) How to pass the variables to forms?
    12) What is the table, which contain the details of all the name of the programs and forms?
    Table contains vertical and horizontal lines. We can store the data in table as blocks. We can scroll depends upon your wish. And these all are stored in database (data dictionary).
    Which contain the details of all the name of the programs and forms? (I don't know).
    13) How did you test the form u developed? How did you taken print?
    14) What are Standard Texts?
    16) What is the difference between Clustered Tables and Pooled Tables?
    A pooled table is used to combine several logical tables in the ABAP/4 dictionary. Pooled tables are logical tables that must be assigned to a table pool when they are defined.
    Cluster table are logical tables that must be assigned to a table cluster when they are defined.
    Cluster table can be used to store control data they can also used to store temporary data or text such as documentation.
    17) What is pf-status?
    Pf status is used in interactive report for enhancing the functionality. If we go to se41, we can get menus, items and different function keys, which we are using for secondary list in interactive report.
    18) Among "Move" and "Move Corresponding", which is efficient one?
    I guess, 'move corresponding' is very efficient then 'move' statement. Because usually we use this stamtent for internal table fields only...so if we give move corresponding. Those fields only moving to other place (what ever you want).
    19) What are the output type and Tcodes?
    20) Where we use Chain and End chain?
    21) Do you use select statement in loop end loop, how will be the performance? To improve the performance?
    22) In select-options, how to get the default values as current month first date and last date by default?
    Eg: 1/12/2004 and 31/12/2004
    SAP ABAP interview questions
    Thanks to the reader who sent in this question set:
    1. What is an ABAP data dictionary?- ABAP 4 data dictionary describes the logical structures of the objects used in application development and shows how they are mapped to the underlying relational database in tables/views.
    2. What are domains and data element?- Domains:Domain is the central object for describing the technical characteristics of an attribute of an business objects. It describes the value range of the field. Data Element: It is used to describe the semantic definition of the table fields like description the field. Data element describes how a field can be displayed to end-user.
    3. What is foreign key relationship?- A relationship which can be defined between tables and must be explicitly defined at field level. Foreign keys are used to ensure the consistency of data. Data entered should be checked against existing data to ensure that there are now contradiction. While defining foreign key relationship cardinality has to be specified. Cardinality mentions how many dependent records or how referenced records are possible.
    4. Describe data classes.- Master data: It is the data which is seldomly changed. Transaction data: It is the data which is often changed. Organization data: It is a customizing data which is entered in the system when the system is configured and is then rarely changed. System data:It is the data which R/3 system needs for itself.
    5. What are indexes?- Indexes are described as a copy of a database table reduced to specific fields. This data exists in sorted form. This sorting form ease fast access to the field of the tables. In order that other fields are also read, a pointer to the associated record of the actual table are included in the index. Yhe indexes are activated along with the table and are created automatically with it in the database.
    6. Difference between transparent tables and pooled tables.- Transparent tables: Transparent tables in the dictionary has a one-to-one relation with the table in database. Its structure corresponds to single database field. Table in the database has the same name as in the dictionary. Transparent table holds application data. Pooled tables. Pooled tables in the dictionary has a many-to-one relation with the table in database. Table in the database has the different name as in the dictionary. Pooled table are stored in table pool at the database level.
    7. What is an ABAP/4 Query?- ABAP/4 Query is a powerful tool to generate simple reports without any coding. ABAP/4 Query can generate the following 3 simple reports: Basic List: It is the simple reports. Statistics: Reports with statistical functions like Average, Percentages. Ranked Lists: For analytical reports. - For creating a ABAP/4 Query, programmer has to create user group and a functional group. Functional group can be created using with or without logical database table. Finally, assign user group to functional group. Finally, create a query on the functional group generated.
    8. What is BDC programming?- Transferring of large/external/legacy data into SAP system using Batch Input programming. Batch input is a automatic procedure referred to as BDC(Batch Data Communications).The central component of the transfer is a queue file which receives the data vie a batch input programs and groups associated data into “sessions”.
    9. What are the functional modules used in sequence in BDC?- These are the 3 functional modules which are used in a sequence to perform a data transfer successfully using BDC programming: BDC_OPEN_GROUP - Parameters like Name of the client, sessions and user name are specified in this functional modules. BDC_INSERT - It is used to insert the data for one transaction into a session. BDC_CLOSE_GROUP - This is used to close the batch input session.
    10. What are internal tables?- Internal tables are a standard data type object which exists only during the runtime of the program. They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.
    11. What is ITS? What are the merits of ITS?- ITS is a Internet Transaction Server. ITS forms an interface between HTTP server and R/3 system, which converts screen provided data by the R/3 system into HTML documents and vice-versa. Merits of ITS: A complete web transaction can be developed and tested in R/3 system. All transaction components, including those used by the ITS outside the R/3 system at runtime, can be stored in the R/3 system. The advantage of automatic language processing in the R/3 system can be utilized to language-dependent HTML documents at runtime.
    12. What is DynPro?- DynPro is a Dynamic Programming which is a combination of screen and the associated flow logic Screen is also called as DynPro.
    13. What are screen painter and menu painter?- Screen painter: Screen painter is a tool to design and maintain screen and its elements. It allows user to create GUI screens for the transactions. Attributes, layout, filed attributes and flow logic are the elements of Screen painter. Menu painter: Menu painter is a tool to design the interface components. Status, menu bars, menu lists, F-key settings, functions and titles are the components of Menu painters. Screen painter and menu painter both are the graphical interface of an ABAP/4 applications.
    14. What are the components of SAP scripts?- SAP scripts is a word processing tool of SAP which has the following components: Standard text. It is like a standard normal documents. Layout sets. - Layout set consists of the following components: Windows and pages, Paragraph formats, Character formats. Creating forms in the R/3 system. Every layout set consists of Header, paragraph, and character string. ABAP/4 program.
    15. What is ALV programming in ABAP? When is this grid used in ABAP?- ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.
    16. What are the events in ABAP/4 language?- Initialization, At selection-screen, Start-of-selection, end-of-selection, top-of-page, end-of-page, At line-selection, At user-command, At PF, Get, At New, At LAST, AT END, AT FIRST.
    17. What is CTS and what do you know about it?- The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in Customizing, and then transport the changes between the SAP Systems and clients in your system landscape. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project.
    18. What are logical databases? What are the advantages/ dis-advantages of logical databases?- To read data from a database tables we use logical database. A logical database provides read-only access to a group of related tables to an ABAP/4 program. Advantages: i)check functions which check that user input is complete, correct,and plausible. ii)Meaningful data selection. iii)central authorization checks for database accesses. iv)good read access performance while retaining the hierarchical data view determined by the application logic. dis advantages: i)If you donot specify a logical database in the program attributes,the GET events never occur. ii)There is no ENDGET command,so the code block associated with an event ends with the next event statement (such as another GET or an END-OF-SELECTION).
    19. What is a batch input session?- BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session ie data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.
    20. How to upload data using CATT ?- These are the steps to be followed to Upload data through CATT: Creation of the CATT test case & recording the sample data input. Download of the source file template. Modification of the source file. Upload of the data from the source file.
    21. What is Smart Forms?- Smart Forms allows you to create forms using a graphical design tool with robust functionality, color, and more. Additionally, all new forms developed at SAP will be created with the new Smart Form solution.
    22. How can I make a differentiation between dependent and independent data?- Client dependent or independent transfer requirements include client specific or cross client objects in the change requests. Workbench objects like SAPscripts are client specific, some entries in customizing are client independent. If you display the object list for one change request, and then for each object the object attributes, you will find the flag client specific. If one object in the task list has this flag on, then that transport will be client dependent.
    23. What is the difference between macro and subroutine? - Macros can only be used in the program the are defined in and only after the definition are expanded at compilation / generation. Subroutines (FORM) can be called from both the program the are defined in and other programs . A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.
    Please check these links.
    http://www.sap-img.com/abap/abap-interview-question.htm
    http://www.sap-img.com/abap/answers-to-some-abap-interview-questions.htm
    http://sap.ittoolbox.com/documents/document.asp?i=3240
    http://www.techinterviews.com/?p=198

  • New to Enhancements and Modifications in SAP ABAP

    Hi experts,
    Could anyone has a tutorials or ebooks on this topic? I need to learn more about this.. tnx in advance!!!

    Hi
    Enhancements and User Exits
    User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a function module. The code for the function module is written by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
    The naming standard of function modules for functionmodule exits is:
    EXIT_<program name><3 digit suffix>
    The call to a functionmodule exit is implemented as:
    CALL CUSTOMER.-FUNCTION <3 digit suffix>
    To find a Exit.
    Goto Transaction -- Find The Package
    SMOD >f4>Use the Package here to Find the Exits In the Package.
    Else if you Want to search by Application Area wise ,
    There is one more tab to find the Exits in the Respective Application Area.
    Implementing the Exit-- CMOD Create ProjectsAssgn your Component .
    Now Run ur Transaction to Check if it Triggers.
    Thats it..
    Suppose you need to find out all the user exits related to a tcode.
    1. Execute the Tcode.
    2. Open the SAP program.
    3. Get the Development Class.
    4. Execute Tcode SE84.
    5. Open the Node 'Envir. -> Exit Techniques -> 'Customer Exits -> Enhancements'
    6. Enter the Development class and execute.
    Check out this thread..
    The specified item was not found.
    1. Type the transaction : system->status-> <PROG. NAME>
    2 open SE37 , type EXIT<PROG NAME> and press F4 to get the list of function exits available.
    3. Open CMOD utilities->SAP enhancements
    EDIT->All selections
    4.type the function module name obtained in step 2, in fields 'component name' in 'additional selections' block. and execute.
    5. The displayed list contains the enhancements names for the transaction You were looking for.
    6. Create a project in CMOD and the code in default include->activate.
    http://www.erpgenie.com/sap/abap/code/abap26.htm
    which gives the list of exits for a tcode
    http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm
    For information on Exits, check these links
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.planetsap.com/userexit_main_page.htm
    User-Exits
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/ab038.htm
    http://www.planetsap.com/userexit_main_page.htm
    http://www.sap-basis-abap.com/sapab013.htm
    http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283
    These links will help you to learn more on user exits.
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm
    http://www.planetsap.com/userexit_main_page.htm
    http://www.allsaplinks.com/user_exit.html
    www.sap-img.com/abap/what-is-user-exits.htm
    Also please check these threads for more details about user exits.
    Re: Screen exit
    user exit and customer exit
    user exit
    1. Document on UserExits in FI/CO
    http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc
    2. Finding User Exits...
    http://sap.ionelburlacu.ro/abap/sap2/Other_Useful_Tips.html#Finding_User_Exits
    3. List of all User Exits...
    http://www.planetsap.com/userexit_main_page.htm
    ENHANCEMENT-POINT
    ENHANCEMENT-POINT can either be static (for example, additional data declaration) or dynamic (for example, additional coding).
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/ee9441026aae5fe10000000a1550b0/content.htm
    Refer the very useful links below:
    Enhancement-Point is a part of the new enhancement framework. He is some lite reading.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/94/9cdc40132a8531e10000000a1550b0/frameset.htm
    Please check this blogs and wiki as well.
    /people/thomas.weiss/blog/2006/05/03/source-code-enhancements--part-5-of-the-series-on-the-new-enhancement-framework
    /people/thomas.weiss/blog/2006/03/15/the-new-enhancement-framework-part-2--what-else-you-need-to-know-before-building-an-enhancement
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/thenewEnhancementFrameworkandthenewkernel-basedBAdI&
    Please check these weblog for more information and sample codes.
    /people/thomas.weiss/blog/2006/01/24/what-the-new-enhancement-framework-is-for-150-its-basic-structure-and-elements-for-beginners
    /people/thomas.weiss/blog/2006/03/15/the-new-enhancement-framework-part-2--what-else-you-need-to-know-before-building-an-enhancement
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    /people/thomas.weiss/blog/2006/05/03/source-code-enhancements--part-5-of-the-series-on-the-new-enhancement-framework
    Look at this articles:
    New Enhancement Framework
    Enhancement Framework
    Enhancement Framework - The New Way to Enhance Your ABAP Systems
    Switch Framework Demo
    Introduction to the Enhancement Framework
    To now more about BADi Implementation see:
    How To Define a New BAdI Within the Enhancement Framework
    How to implement a BAdI And How to Use a Filter
    Enhancement-Point is a part of the new enhancement framework. He is some lite reading.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/94/9cdc40132a8531e10000000a1550b0/frameset.htm
    Please check this blogs .
    /people/thomas.weiss/blog/2006/05/03/source-code-enhancements--part-5-of-the-series-on-the-new-enhancement-framework
    /people/thomas.weiss/blog/2006/03/15/the-new-enhancement-framework-part-2--what-else-you-need-to-know-before-building-an-enhancement
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/thenewEnhancementFrameworkandthenewkernel-basedBAdI&
    Enhancement frame work is the new concept using which SAP allows you to change the existing programs
    See the following blogs that talk about the same in detail
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    /people/thomas.weiss/blog/2006/05/03/source-code-enhancements--part-5-of-the-series-on-the-new-enhancement-framework
    Defines a position in an ABAP program as an enhancement option, at which one or more source code plug-ins can be inserted.
    Syntax
    ENHANCEMENT-POINT enh_id SPOTS spot1 spot2 ...
                      [STATIC]
                      [INCLUDE BOUND].
    Extras:
    1. ... STATIC
    2. ... INCLUDE BOUND
    Effect
    : This statement defines an explicit enhancement option at the current position in the program at which a source code enhancement can be made. In program generation, the source code plug-ins of the assigned enhancement implementation that are available in the current system and have a switch in the status stand-by or on, are inserted at this position.
    If the addition STATIC is not specified, the source code enhancement is dynamic. This means that in program execution, only those source code plug-ins are executed whose switch has the status on. If a source code plug-in does not have a switch assigned to it, it is handled in the same way as a plug-in with a switch in the status on.
    With enh_id, an ID must be specified directly for the enhancement option, which is unique in the current compilation unit without the addition INCLUDE BOUND, and with this addition, is unique in current Include program. At least one enhancement spot must be assigned to the enhancement option using the specification simple enhancement spots spot1, spot2, and so on.
    Within enhancements, one or more source code plug-ins can be created for one enhancement option. A source code plug-in is created by the assignment of an enhancement implementation in the Enhancement Builder. This automatically generates an empty source code plug-in with a unique ID, which is displayed underneath ENHANCEMENT-POINT in the Editor, where the actual enhancement can be implemented between ENHANCEMENT and ENDENHANCEMENT.
    A source code plug-in is assigned to only one enhancement option. Multiple source code plug-ins of one enhancement implementation and the source code plug-ins of multiple enhancement implementations can be assigned to one enhancement point.
    Notes
    : In the terminology of the enhancement concept, the statement ENHANCEMENT-POINT includes both the enhancement spot element definition and the enhancement spot invocation of the enhancement option.
    The statement ENHANCEMENT-POINT can either be entered directly or created by choosing Edit ? Enhancement operations ? Create enhancement in the Enhancement Builder. After the program has been saved or created using Edit ? Enhancement operations ? Create enhancement, the statement can only be deleted by choosing Edit ? Enhancement operations ? Delete enhancement.
    In addition to the enhancement options explicitly specified by ENHANCEMENT-POINT, ABAP programs also contain implicit enhancement points, which can also be enhanced using source code plug-ins.
    Addition 1
    ... STATIC
    Effect
    : The addition STATIC is used to define a static source code enhancement. In a static source code enhancement, all incorporated source code plug-ins are taken into account when the program is executed, including those whose switch is in the status stand-by.
    Note
    : The STATIC addition is intended for the enhancement of data declarations, while the statement ENHANCEMENT-POINT without the STATIC addition is designed for the enhancement of executable coding. When the statement is executed using Enhancements ? Create enhancement, the addition is set according to this selection.
    Addition 2
    ... INCLUDE BOUND
    Effect
    : This addition can be entered in Include programs. It links the source code enhancement to the current Include program. Each program that incorporates an Include program only includes the source code enhancements that are defined with this addition. Source code enhancements created using the INCLUDE BOUND addition have their own namespace in each Include program. This ensures that if several Include programs are integrated into one compilation unit, no namespace conflicts arise, either between Include programs, or with the source code enhancements of the compilation unit.
    Without the addition INCLUDE BOUND, a source code enhancement is assigned to only one compilation unit. If the statement ENHANCEMENT-POINT is executed in an Include program without this addition, a compilation unit must be assigned to it in the Enhancement Builder.
    Note
    : In an Include program, Include-bound and non-Include-bound source code enhancements can not be defined at the same time. This also applies if an Include program incorporates other Include programs.
    Enhancement points are points provided by sap in standard programs to modify the source code. Go to any standard program, Locate the spiral button on the toolbar. Then press it and then navigate to edit->enhancement operations->display enhancement point menu. Then a no of yellow lines would appear, which are the available en points. You would have to change it and write the applicable source code.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/2342e1f3-0b01-0010-a186-fdd404884050 [original link is broken]
    Please try the link given below
    http://help.sap.com/saphelp_nw2004s/helpdata/en/94/9cdc40132a8531e10000000a1550b0/frameset.htm
    Regards
    Anji

  • SAP ABAP Online Training | Online SAP ABAP Training in usa, uk, Canada, Malaysia, Australia, India, Singapore.

    SAP ABAP (Advanced Business Application Programming) is one of the most sought-after modules of SAP. In accordance with its manifold returns the trend for training of SAP ABAP Online Training  is constantly on a sharp upsurge.
    In the first phase of the SAP ABAP Online Training the core emphasis is laid upon the general outline of the SAP. To get more specific, the learner is precisely told about the multifarious modules of the SAP ABAP Online Training (just a basic know-how, no detailed analysis). Furthermore the ERP and ABAP review is being presented. Some spotlight is also being flung on the design and database layout etc.
    In the next phase, SAP ABAP Online Training  is taught in pretty much detailed and comprehensive manner. Learner is being showered with loads of information on data glossary, control reports etc. This phase by large involves much of the programming, reports, tasks, controls, counting, tables and arrangements etc. The student also gets specific knowledge with regard to the avowal of variables.

  • Pronlem in LOP while retrieving the employee details

    Hi,
    I am new to HR for ABAP developing,
    I have a Pronlem in a report for LOP (loss of pay) while retrieving the employee details.
    (i.e) while retrieving employee details by individual it shows the correct details.
    But, in the group of 10 employess out of 9 doesn't have the LOP and the 1 is having LOP. While retrieving this it shows all the
    10 members have LOP.  It shows some amount for that 1 person also.
    Kindly i need ur help for the above issues.
    Waiting for ur valuable replies.

    Hi swarna,
             Herewith i attached my code, would u please suggest me wer shud i make changes.
    Rgds,
    Karthik
    START-OF-SELECTION.
      IF P_1 = 'X'.
        W_EXT = '.csv'.
      ELSE.
        W_EXT = 'err.csv'.
        PR_PATH = '/obrm/in/asset/'.
      ENDIF.
      CLEAR:W_PR_FNAME,
            W_STR,
            W_PATH1,
            W_LEN,
            W_F6_TMP.
      CLEAR:WA_MESSTAB,WA_UP_SUCC,WA_FINAL,WA_FILE.
      REFRESH:IT_FINAL, IT_MESSTAB,IT_UP_ERROR,IT_UP_SUCC,ITFILE,ITFILE1 .
      W_GO = 'X'.
      CALL FUNCTION 'SUBST_GET_FILE_LIST'
        EXPORTING
          DIRNAME      = PR_PATH
          FILENM       = '*'
        TABLES
          FILE_LIST    = ITFILE
        EXCEPTIONS
          ACCESS_ERROR = 1
          OTHERS       = 2.
      IF SY-SUBRC <> 0.
        MESSAGE TEXT-102 TYPE C_I.
        EXIT.
      ENDIF.
      LOOP AT ITFILE INTO WA_FILE.
        IF WA_FILE-NAME CS W_EXT.
          APPEND  WA_FILE TO ITFILE1.
          CLEAR WA_FILE.
        ENDIF.
      ENDLOOP.
      LOOP AT ITFILE1 INTO WA_FILE.
        IF SY-TABIX > 1.
          CLEAR IT_FINAL[].
        ENDIF.
        CONCATENATE PR_PATH WA_FILE-NAME INTO W_PR_FNAME.
        OPEN DATASET W_PR_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        CLEAR : IT_SOURCE[].
        DO.
          READ DATASET W_PR_FNAME INTO W_STR.
          IF SY-SUBRC NE 0.
            EXIT.
          ENDIF.
          SPLIT W_STR AT ';' INTO
                WA_FINAL-F1
                WA_FINAL-F2
            WA_FINAL-F3.
          CLEAR WA_SOURCE.
          WA_SOURCE-F1 = WA_FINAL-F1.
          WA_SOURCE-F2 = WA_FINAL-F2.
          WA_SOURCE-F3 = WA_FINAL-F3.
          SO_SER-LOW = WA_FINAL-F1.
          SO_SER-SIGN = 'I'.
          SO_SER-OPTION = 'EQ'.
          APPEND SO_SER.
          APPEND WA_SOURCE TO IT_SOURCE.
          APPEND WA_FINAL TO IT_FINAL.
        ENDDO.
        CLOSE DATASET W_PR_FNAME.
        IF IT_FINAL[] IS INITIAL.
          MESSAGE TEXT-E01 TYPE C_I.
          EXIT.
        ENDIF.
        PERFORM MATERIAL_DOCS_GET.
        IF SY-SUBRC NE 0.
          MESSAGE TEXT-M01 TYPE 'S'.
          RETURN.
        ENDIF.
        DELETE IT_MDOCS WHERE BWART = '102'.
        LOOP AT IT_MDOCS INTO WA_MDOCS.
          WA_AMT_SUM-EBELN = WA_MDOCS-EBELN.
          WA_AMT_SUM-SHKZG = WA_MDOCS-SHKZG.
          WA_AMT_SUM-DMBTR = WA_MDOCS-DMBTR.
          COLLECT WA_AMT_SUM INTO IT_AMT_SUM.
        ENDLOOP.
        PERFORM SERIAL_NUMBERS_GET.
        IF IT_SRNO[] IS INITIAL.
          RETURN.
        ENDIF.
      ENDLOOP.
      CALL SCREEN 100.
    END-OF-SELECTION.
      IF PR_TEST NE 'X'.
        PERFORM DISPLAY_LOG.
      ENDIF.
    FORM MATERIAL_DOCS_GET .
      SELECT MATNR
             FROM MARA INTO TABLE IT_MATNR
             WHERE MATKL in ('DTH_STB','DTH_STBSC') AND
                   MTART EQ 'UNBW'    AND
                   LVORM EQ ' '.
      IF IT_MATNR IS NOT INITIAL.
        LOOP AT IT_MATNR INTO WA_MATNR.
          SO_MATNR-SIGN   = 'I'.
          SO_MATNR-OPTION = 'EQ'.
          SO_MATNR-LOW    =  WA_MATNR-MATNR.
          APPEND SO_MATNR.
        ENDLOOP.
      ELSE.
        MESSAGE TEXT-M06 TYPE 'S'.
        RETURN.
      ENDIF.
      SELECT A~OBKNR A~SERNR A~MATNR B~OBKNR B~MBLNR B~MJAHR B~BWART
             FROM OBJK AS A INNER JOIN SER03 AS B ON A~OBKNR = B~OBKNR
             INTO CORRESPONDING FIELDS OF TABLE IT_SER03
             WHERE A~SERNR IN SO_SER AND
                   A~MATNR IN SO_MATNR AND
                   B~BWART IN ('101','102','122') and
                   B~LIEFERANT <> ' '.
      IF IT_SER03 IS NOT INITIAL.
        SELECT MBLNR MJAHR ZEILE EBELN EBELP LFBNR LFBJA LFPOS SJAHR SMBLN SMBLP BWART SHKZG WAERS MENGE MEINS KUNNR
               FROM MSEG INTO CORRESPONDING FIELDS OF TABLE IT_MSEG
               FOR ALL ENTRIES IN IT_SER03
               WHERE MBLNR = IT_SER03-MBLNR       AND
                     MJAHR = IT_SER03-MJAHR       AND
                     BWART IN ('101','102','122') AND
                     MATNR IN SO_MATNR            AND
                     DMBTR > 0 .
      ENDIF.
      IF IT_MSEG IS NOT INITIAL.
        SELECT * FROM ZPOVAL_ASSET INTO CORRESPONDING FIELDS OF TABLE IT_PO
                 FOR ALL ENTRIES IN IT_MSEG
                 WHERE EBELN = IT_MSEG-EBELN.
        SELECT KUNNR REGIO
               FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE IT_KNA1
               FOR ALL ENTRIES IN IT_MSEG
               WHERE KUNNR = IT_MSEG-KUNNR.
      ENDIF.
      DELETE IT_MSEG WHERE EBELN = '6100000124'.
      LOOP AT IT_SER03 INTO WA_SER03.
        WA_MDOCS-SERNR = WA_SER03-SERNR.
        WA_MDOCS-MATNR = WA_SER03-MATNR.
        READ TABLE IT_MSEG INTO WA_MSEG1 WITH KEY MBLNR = WA_SER03-MBLNR.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING WA_MSEG1 TO WA_MDOCS.
          READ TABLE IT_PO INTO WA_PO WITH KEY EBELN = WA_MSEG1-EBELN.
          IF SY-SUBRC = 0.
            WA_MDOCS-DMBTR = WA_PO-DMBTR.
          ENDIF.
          READ TABLE IT_KNA1 INTO WA_KNA1 WITH KEY KUNNR = WA_MSEG1-KUNNR.
          IF SY-SUBRC = 0.
            WA_MDOCS-KUNNR = WA_KNA1-KUNNR.
            WA_MDOCS-REGIO = WA_KNA1-REGIO.
          ENDIF.
          APPEND WA_MDOCS TO IT_MDOCS.
        ENDIF.
      ENDLOOP.
      SORT IT_MDOCS BY SERNR MJAHR MBLNR DESCENDING.
      DELETE ADJACENT DUPLICATES FROM IT_MDOCS COMPARING SERNR.
      IF SY-SUBRC EQ 0.
        LOOP AT IT_ZFT_POSTED_MDOCS1 INTO WA_ZFT_POSTED_MDOCS1.
          CONCATENATE TEXT-M09 WA_ZFT_POSTED_MDOCS1-MBLNR TEXT-M10 INTO WA_LOG-MSG SEPARATED BY SPACE.
          WRITE: /5 WA_LOG-MSG.
          DELETE IT_MDOCS WHERE MBLNR EQ WA_ZFT_POSTED_MDOCS1-MBLNR.
        ENDLOOP.
      ENDIF.
      CLEAR WA_LOG.
      REFRESH IT_LOG[].
      IF IT_MDOCS[] IS INITIAL.
        SY-SUBRC = 4.
        RETURN.
      ENDIF.
    *copy material docs for dumping in ZFT_POSTED_ASSET
      IT_ZFT_POSTED_ASSET[] = IT_MDOCS[].
    ENDFORM.                    " material_docs_get
    FORM DISPLAY_LOG .
      IF IT_LOG[] IS INITIAL.
        RETURN.
      ENDIF.
      LOOP AT IT_LOG INTO WA_LOG.
        WRITE: /5 WA_LOG-MSG.
      ENDLOOP.
    ENDFORM.                    " display_log
    FORM SERIAL_NUMBERS_GET.
      DATA: WA_SRNO1 TYPE TY_SRNO.
      SELECT MBLNR MJAHR BUDAT
             FROM MKPF INTO CORRESPONDING FIELDS OF TABLE IT_MKPF
             FOR ALL ENTRIES IN IT_MDOCS
             WHERE MBLNR = IT_MDOCS-MBLNR AND
                   MJAHR = IT_MDOCS-MJAHR.
      LOOP AT IT_MDOCS INTO WA_MDOCS.
        MOVE-CORRESPONDING WA_MDOCS TO WA_SRNO.
        READ TABLE IT_MKPF INTO WA_MKPF WITH KEY MBLNR = WA_MDOCS-MBLNR MJAHR = WA_MDOCS-MJAHR.
        IF SY-SUBRC = 0.
          WA_SRNO-BUDAT = WA_MKPF-BUDAT.
        ENDIF.
        APPEND WA_SRNO TO IT_SRNO.
      ENDLOOP.
      LOOP AT IT_SRNO INTO WA_SRNO WHERE BWART EQ '101'.
        READ TABLE IT_SRNO INTO WA_SRNO1 WITH KEY SERNR = WA_SRNO-SERNR
                                                  BWART = '122'.
        IF SY-SUBRC EQ 0 AND WA_SRNO-MBLNR LT WA_SRNO1-MBLNR.
          DELETE IT_SRNO.
        ENDIF.
      ENDLOOP.
      DELETE IT_SRNO WHERE BWART = '122'.
      DESCRIBE TABLE IT_SRNO LINES W_COUNT.
      SORT IT_MDOCS BY SERNR.
      SORT IT_SRNO BY SERNR.
      SORT IT_FINAL BY F1.
      LOOP AT IT_SRNO.
        READ TABLE IT_MDOCS WITH KEY SERNR = IT_SRNO-SERNR.
        IF SY-SUBRC = 0 .
          IT_SRNO-VALUE = IT_MDOCS-DMBTR.
          IT_SRNO-EBELN = IT_MDOCS-EBELN.
          READ TABLE IT_FINAL WITH KEY F1 = IT_SRNO-SERNR.
          IT_SRNO-CAPDT = IT_FINAL-F2.
          CONCATENATE     IT_FINAL-F26(4) IT_FINAL-F20(2) IT_FINAL-F2+3(2)   INTO IT_SRNO-CAPDT.
          CLEAR KNA1.
          SELECT SINGLE * FROM KNA1 WHERE KUNNR = IT_FINAL-F3.
          IF SY-SUBRC = 0 .
            IT_SRNO-KUNNR = IT_FINAL-F2.
            IT_SRNO-REGIO = KNA1-REGIO.
          ENDIF.
          SELECT SINGLE * FROM ZFT_100_ASSET WHERE SERNR = IT_SRNO-SERNR.
          IF SY-SUBRC = 0.
            IT_SRNO-VALUE = 0 .
          ENDIF.
          MODIFY IT_SRNO.
          MOVE-CORRESPONDING IT_SRNO TO IT_ASSET  .
          IT_ASSET-ASSET_ACT_DT = IT_SRNO-CAPDT.
          CONCATENATE 'A' W_FREENUM2  INTO IT_ASSET-ASSET_ID.
          COLLECT IT_ASSET.
          MOVE-CORRESPONDING IT_ASSET TO IT_ASSET_POST.
          COLLECT IT_ASSET_POST.
        ENDIF.
      ENDLOOP .
      SORT IT_ASSET_POST BY ASSET_ID ASSET_ACT_DT REGIO.
      IF PR_TEST NE 'X'.
        LOOP AT IT_ASSET_POST.
          CLEAR W_FREENUM2.
          SELECT SINGLE * FROM ZFT_STATE_COST WHERE REGIO = IT_ASSET_POST-REGIO AND TYPE  = 'E' .
          IF SY-SUBRC <> 0 .
            MESSAGE X899(FI) WITH 'No cost center for the region'.
          ENDIF.
          CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING
              NR_RANGE_NR             = '01'
              OBJECT                  = C_NRANGE1
            IMPORTING
              NUMBER                  = W_FREENUM2
            EXCEPTIONS
              INTERVAL_NOT_FOUND      = 1
              NUMBER_RANGE_NOT_INTERN = 2
              OBJECT_NOT_FOUND        = 3
              QUANTITY_IS_0           = 4
              QUANTITY_IS_NOT_1       = 5
              INTERVAL_OVERFLOW       = 6
              BUFFER_OVERFLOW         = 7
              OTHERS                  = 8.
          IF SY-SUBRC = 0.
          ENDIF.
          CONCATENATE 'A' W_FREENUM2  INTO IT_ASSET_POST-ASSET_ID.
          IT_ASSET_POST-KOSTL = ZFT_STATE_COST-KOSTL.
          MODIFY IT_ASSET_POST.
        CLEAR ZFT_100_ASSET.
        ENDLOOP.
      ENDIF.
      SORT IT_ASSET_POST BY ASSET_ACT_DT REGIO.
      SORT IT_ASSET BY ASSET_ACT_DT REGIO.
      LOOP AT IT_ASSET.
        READ TABLE IT_ASSET_POST WITH KEY ASSET_ACT_DT =  IT_ASSET-ASSET_ACT_DT REGIO = IT_ASSET-REGIO MATNR = IT_ASSET-MATNR.
        IF SY-SUBRC = 0 .
          IT_ASSET-ASSET_ID =  IT_ASSET_POST-ASSET_ID .
          IF IT_ASSET-VALUE = 0.
            IT_ASSET-TEXT = 'Asset Already Created'.
          ELSE.
          ENDIF.
          MODIFY IT_ASSET.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " serial_numbers_get
    FORM ASSET_CREATE .
      DATA :LW_CNT TYPE I.
      LOOP AT IT_ASSET_POST WHERE VALUE > 0.
        CLEAR: IT_ASSET1[],LW_CNT.
        IT_ASSET1[] = IT_ASSET[].
        DELETE IT_ASSET1 WHERE ASSET_ID <> IT_ASSET_POST-ASSET_ID.
        DESCRIBE TABLE IT_ASSET1 LINES LW_CNT.
        MOVE IT_ASSET_POST-ASSET_ID TO WA_ANLA-ANLN1.
        CALL FUNCTION 'ASSET_EXISTENCE_CHECK'
          EXPORTING
            I_ANLN1          = WA_ANLA-ANLN1
            I_BUKRS          = '5100'
          EXCEPTIONS
            ANLAGE_DEAKTIV   = 1
            ANLAGE_GELOESCHT = 2
            ANLAGE_GESPERRT  = 3
            ANLAGE_NOT_FOUND = 4
            ANLAGE_IST_INVM  = 5
            OTHERS           = 6.
        IF SY-SUBRC EQ 0.
          CONCATENATE TEXT-M02 IT_ASSET_POST-ASSET_ID TEXT-M05 INTO W_MSG SEPARATED BY SPACE.
          WA_LOG-MSG = W_MSG.
          APPEND WA_LOG TO IT_LOG.
          CLEAR: WA_LOG, W_MSG.
          CONTINUE.
        ENDIF.
        IF SY-SUBRC <> 0.
        ENDIF.
        WA_ANLA-BUKRS = '5100'.  "company code
        IF IT_ASSET_POST-MATNR = '000000000030000452'.
          WA_ANLA-ANLKL = '00009021'.  "asset class for STB
        ELSEIF IT_ASSET_POST-MATNR = '000000000030000700'.
          WA_ANLA-ANLKL = '00009033'.  "asset class for HD STB Box
        ENDIF.
        WA_ANLA-ANLN1 = IT_ASSET_POST-ASSET_ID. "wa_srno-sernr.
        CONCATENATE 'STB - ' IT_ASSET_POST-ASSET_ID INTO WA_ANLA-TXT50 SEPARATED BY SPACE.
        WA_ANLA-AKTIV = IT_ASSET_POST-ASSET_ACT_DT.
        WA_ANLZ-KOSTL =  IT_ASSET_POST-KOSTL .                  "'1711121'.
        WA_ANLA-MENGE = LW_CNT.
        WA_ANLA-MEINS = 'EA'.
        CALL FUNCTION 'CREATE_ASSET'
          EXPORTING
            I_ANLA                     = WA_ANLA
      I_ANLV                           =
            I_ANLZ                     = WA_ANLZ
           I_DARK                      = 'X'
           I_NASSETS_FIX               = ' '
           I_CALLED_BY_PURCHASE_ORDER  = ' '
          TABLES
            T_ASSETS                   = IT_ASSETS
         EXCEPTIONS
           MISSING_COMPANY_CODE        = 1
           MISSING_ASSET_CLASS         = 2
           MISSING_ASSET_MAINNUMBER    = 3
           INTERNAL_ERROR              = 4
           OTHERS                      = 5
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        IF SY-SUBRC EQ 0.
          COMMIT WORK.
          SELECT SINGLE * FROM ANLB WHERE BUKRS = '5100' AND ANLN1 = WA_ANLA-ANLN1 AND AFASL = 'Z001'.
          IF SY-SUBRC = 0 .
            ANLB-AFABG = '20071201'.
            MODIFY ANLB.
            COMMIT WORK.
          ENDIF.
          SELECT SINGLE * FROM ANLB WHERE BUKRS = '5100' AND ANLN1 = WA_ANLA-ANLN1 AND AFASL = 'IN14'.
          IF SY-SUBRC = 0 .
            ANLB-AFABG = '20071201'.
            MODIFY ANLB.
            COMMIT WORK.
          ENDIF.

  • I want to display the Employee details in table format without using iGrid

    Hi all,
    Can anybody help me that I want to display the Employee details return by transaction in table  format without using iGrid.

    Hi, view the link below.
    http://help.sap.com/saphelp_xmii115/helpdata/en/Advanced_Topics/Customizing_Output/Customizing_Output.htm
    Hope this help.
    Danilo Santos

  • SAP ABAP Query not generated after upgrade

    Hi All,
    Our client has upgraded from 4.6c to ECC 6.0
    In the upgraded server some SAP Queries have not been generated…and others have generated. I wanted to know why all are not generated….
    I also wanted to know if any table name exists which maintains query with generated program name…
    Please let me know your learning’s on SAP/ABAP Query if any…
    Thanks in advance

    I forgot to mention that FM will just give u the report name..wont generate it.
    I dont think the report name is saved in any tables... it is generated ...
    but u can derive the report name..if u know the user group and query name.. by concatenating those ..
    for details..look into the code for that FM

  • Career in SAP ABAP

    Hello Everybody
    I just need your help and suggestions . It will be really worthwhile if anybody can come up with answers to my question below.
    I have 4 years IT experience and have been working on Project Management of Web Development Field for 1st three years and last year in Adobe Flex and have good knowledge of OOPs concepts . I have decided to switch to SAP for better prospect in order to secure my future along with handsome income. Today I went to JKT SAP ACADEMY ( SAP Authorised Training Partner listed in SAP page ) in kolkata and they suggested me to go for SAP ABAP with e-learning module upto maximum 5 months for 200 Hrs duration with a course fee of 1,76,000/- along with materials and after that pay 33K  for examination fees to get SAP GERMANY CERTIFICATE after clearing it. They will provide placements like arranging interview .
    Now i am thinking whether its useful to join or not after paying hefty sum ?? Is there any chances of getting job for Fresher in SAP as certified ? Can anyone suggest me please ? I also understand that ABAP is suitable for programmers with OOps concepts . Instead of joining it how good will it be to learn from Online Tutorials on our own and also with books.
    Looking forward to hear from you soon all.
    Thanks
    Edited by: raviktg1982 on Apr 16, 2011 9:45 PM
    Edited by: raviktg1982 on Apr 16, 2011 10:06 PM

    Hi Angelo
    First of all many thanks for your reply to my query. God bless you with loads of happiness and success.
    Kindly let me know about SAP Young Professionals Program available in India . I am residing in Kolkata ( West Bengal) .
    Any contact details if.
    Thanks

  • Resigned employee details reflecting in Customer Advisor Search

    Dear Experts,
    In DBM while creating a sales order we need to assign the customer advisor for each sales. Based on the employee master data which we have maintained in SAP ECC. Automatically the employee details are reflecting Customer Advisor search column, but it is also showing the resigned employee details in F4 search.
    Even though have changed the status of employee as resigned and still its showing the details in DBM.
    Kindly advise how to eliminate or restrict the values in search. Kindly share any user manual or procedure document to update the same in DBM.
    Thanks & Regards,
    Pradeep Krishnamurthy

    Dear Experts,
    In DBM while creating a sales order we need to assign the customer advisor for each sales. Based on the employee master data which we have maintained in SAP ECC. Automatically the employee details are reflecting Customer Advisor search column, but it is also showing the resigned employee details in F4 search.
    Even though have changed the status of employee as resigned and still its showing the details in DBM.
    Kindly advise how to eliminate or restrict the values in search. Kindly share any user manual or procedure document to update the same in DBM.
    Thanks & Regards,
    Pradeep Krishnamurthy

Maybe you are looking for