UG: Employee supervisor  report in  tree  format in  xml/rdf format

Hi Experts,
i have design the query for employee supervisor bur now i have to design a report just like "TREE STRUCTURE FORMAT"
Please guide how to do the same.
It's very Urgent
Query is :
SELECT LEVEL,
LPAD(' ',10*(LEVEL-1)) || peo.full_name name,
org.name assignment,
job.name job,
loc.location_code location,
asg.person_id person_id
FROM
per_all_assignments_f asg,
per_all_people_f peo,
hr_locations_all loc,
hr_all_organization_units_tl org,
per_jobs_tl job
WHERE 1=1
AND peo.person_id = asg.person_id
AND NVL(peo.effective_end_date,TO_DATE('01-01-2200','dd-mm-yyyy')) > SYSDATE
AND NVL(asg.effective_end_date,TO_DATE('01-01-2200','dd-mm-yyyy')) > SYSDATE
AND asg.assignment_status_type_id = 1
AND loc.location_id = asg.location_id
AND org.organization_id = asg.organization_id
AND job.job_id = asg.job_id
START WITH 1=1
--AND asg.person_id = 408
AND NVL(peo.effective_end_date,TO_DATE('01-01-2200','dd-mm-yyyy')) > SYSDATE
AND NVL(asg.effective_end_date,TO_DATE('01-01-2200','dd-mm-yyyy')) > SYSDATE
--AND peo.employee_number 'iExpense_Admin'
CONNECT BY PRIOR
asg.person_id = asg.supervisor_id
AND NVL(peo.effective_end_date,TO_DATE('01-01-2200','dd-mm-yyyy')) > SYSDATE
AND NVL(asg.effective_end_date,TO_DATE('01-01-2200','dd-mm-yyyy')) > SYSDATE
--AND peo.employee_number 'iExpense_Admin'
ORDER SIBLINGS BY
peo.full_name,
org.name

Hi Pratul,
As amit requirement to get report in Tree structure. Which standards file you want to say to customize.
Amit, we was having same requirements a long back, we full fill using OAF page in HGRID form.
Thanks

Similar Messages

  • How to display a report in tree format

    hai can any one send me the code to display the report in a tree format
    if i take example of customer numbers as tree branches and if i click each customer number the tree should expand showing all sales orders for a customer
    ragrds
    afzal

    use FM HR_ALV_HIERSEQ_LIST_DISPLAY
    there are 2 internal table , one for header and one for detail
    below is code for reference
    REPORT  zinsd_quot_cont.
    TYPES : BEGIN OF ty_vbak,
             vbeln TYPE      vbeln_va,
             vkorg TYPE      vkorg,
             vtweg TYPE      vtweg,
             spart TYPE      spart,
             vkbur TYPE     vkbur,
             vkgrp TYPE     vkgrp,
             angdt  TYPE angdt_v,
             bnddt  TYPE bnddt,
             kunnr  TYPE kunnr,
             kwmeng TYPE kwmeng,
             meins  TYPE meins,
             kunwe  TYPE kunnr,
             name1  TYPE  name1_gp  ,
             name2  TYPE  name1_gp  ,
             sel(1),
             expand(1),
             salesdocument TYPE bapivbeln-vbeln,
             message TYPE bapi_msg,
            END   OF ty_vbak.
    DATA :  w_vbak TYPE ty_vbak,
            t_vbak TYPE TABLE OF ty_vbak.
    DATA :  w_update TYPE ty_vbak,
            t_update TYPE TABLE OF ty_vbak.
    TYPES : BEGIN OF ty_kna1,
             kunnr  TYPE      kunnr,
             name1  TYPE  name1_gp  ,
            END   OF ty_kna1.
    DATA :  w_kna1 TYPE ty_kna1,
            t_kna1 TYPE TABLE OF ty_kna1.
    TYPES : BEGIN OF ty_vbap,
            vbeln      TYPE vbeln_va,
            posnr      TYPE posnr_va,
            matnr      TYPE matnr,
            matkl      TYPE matkl,
            werks      TYPE werks_ext,
            kwmeng TYPE kwmeng,
            meins      TYPE meins,
            mvgr5  TYPE     mvgr5,
            maktx  TYPE     maktx,
            END   OF ty_vbap.
    DATA :  w_vbap TYPE ty_vbap,
            t_vbap TYPE TABLE OF ty_vbap.
    TYPES : BEGIN OF ty_makt,
             matnr TYPE     matnr,
             maktx TYPE     maktx,
            END   OF ty_makt.
    DATA :  w_makt TYPE ty_makt,
            t_makt TYPE TABLE OF ty_makt.
    TYPES : BEGIN OF ty_sum,
            vbeln      TYPE vbeln_va,
            kwmeng TYPE kwmeng,
            END   OF ty_sum.
    DATA :  w_sum TYPE ty_sum,
            t_sum TYPE TABLE OF ty_sum.
    TYPES : BEGIN OF ty_vbpa,
            vbeln     TYPE vbeln,
            posnr     TYPE posnr,
            parvw     TYPE parvw,
            kunnr     TYPE kunnr,
            END   OF ty_vbpa.
    DATA :  w_vbpa TYPE ty_vbpa,
            t_vbpa TYPE TABLE OF ty_vbpa.
    TYPES : BEGIN OF ty_vbup,
            vbeln      TYPE vbeln,
            posnr  TYPE posnr ,
            gbsta      TYPE gbsta  ,
            END   OF ty_vbup.
    DATA :  w_vbup TYPE ty_vbup,
            t_vbup TYPE TABLE OF ty_vbup.
    TYPE-POOLS slis.
    DATA: t_fieldcatalog  TYPE slis_t_fieldcat_alv,
          w_fieldcatalog TYPE slis_fieldcat_alv,
          w_layout    TYPE slis_layout_alv,
          gs_keyinfo  TYPE slis_keyinfo_alv.
    DATA: g_tabname_header TYPE slis_tabname,
          g_tabname_item   TYPE slis_tabname.
      data definition
          Batchinputdata of single transaction
    DATA:   bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
          messages of call transaction
    DATA:   messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA : g_lines TYPE i.
    *Selection Screen
    TABLES : vbak,vbap.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS s_vkorg FOR vbak-vkorg. " Sales Org
    SELECT-OPTIONS s_vtweg FOR vbak-vtweg. " Dist Channel
    SELECT-OPTIONS s_spart FOR vbak-spart. " Division
    SELECT-OPTIONS s_vkbur FOR vbak-vkbur. " Sales Off
    SELECT-OPTIONS s_vkgrp FOR vbak-vkgrp. " Sales Grp
    SELECT-OPTIONS s_matkl FOR vbap-matkl. " Mat Grp
    SELECT-OPTIONS s_werks FOR vbap-werks. " Plant
    SELECT-OPTIONS s_period FOR vbak-angdt. " Sales Off
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      PERFORM f_getdata.
      PERFORM f_initdata.
    END-OF-SELECTION.
      PERFORM f_createalv.
      PERFORM f_dispalv.
    *&      Form  f_getdata
          text
    -->  p1        text
    <--  p2        text
    FORM f_getdata .
    *Sales Header
      SELECT
        vbeln
        vkorg
        vtweg
        spart
        vkbur
        vkgrp
        angdt     
        bnddt
        kunnr
      INTO TABLE t_vbak
      FROM vbak
      WHERE
        vkorg IN s_vkorg      " Sales Org
        AND vtweg IN s_vtweg  " Dist Channel
        AND spart IN s_spart  " Division
        AND vkbur IN s_vkbur  " Sales Off
        AND vkgrp IN s_vkgrp  " Sales Grp
        AND angdt IN s_period
        AND bnddt IN s_period
        AND auart = 'ZQMO'
        AND vbtyp = 'B'.
    *CUST NAME
      SELECT
         kunnr
         name1
      INTO TABLE t_kna1
      FROM kna1
      FOR ALL ENTRIES IN t_vbak
      WHERE
       kunnr = t_vbak-kunnr
    *Sales Item
      SELECT
        vbeln     
        posnr     
        matnr     
        matkl     
        werks     
        kwmeng
        meins
        mvgr5
      INTO TABLE t_vbap
      FROM vbap
      FOR ALL ENTRIES IN t_vbak
      WHERE
       vbeln = t_vbak-vbeln
       AND matkl IN  s_matkl  " Mat Grp
       AND werks IN  s_werks  " Plant
    *Partners
      SELECT
       vbeln     
       posnr     
       parvw     
       kunnr     
      INTO TABLE t_vbpa
      FROM vbpa
      FOR ALL ENTRIES IN t_vbak
      WHERE
        vbeln = t_vbak-vbeln.
      IF t_vbpa[] IS NOT INITIAL.
        SELECT
            kunnr
            name1
         APPENDING TABLE t_kna1
         FROM kna1
         FOR ALL ENTRIES IN t_vbpa
         WHERE
          kunnr = t_vbpa-kunnr
      ENDIF.
    *Status - Sales Doc
      SELECT
        vbeln     
        posnr
        gbsta
      INTO TABLE t_vbup
      FROM vbup
      FOR ALL ENTRIES IN t_vbap
      WHERE
       vbeln = t_vbap-vbeln
       AND posnr = t_vbap-posnr
       AND gbsta NE 'C'.
      SELECT
          matnr
          maktx
      INTO TABLE t_makt
      FROM makt
      FOR ALL ENTRIES IN t_vbap
      WHERE
       matnr = t_vbap-matnr
       AND spras = 'E'.
    ENDFORM.                    " f_getdata
    *&      Form  f_initdata
          text
    -->  p1        text
    <--  p2        text
    FORM f_initdata .
      SORT t_vbap BY vbeln DESCENDING.
    *delete all closed stat items
      LOOP AT t_vbap INTO w_vbap.
        READ TABLE t_vbup INTO w_vbup
        WITH KEY
         vbeln = w_vbap-vbeln
         posnr = w_vbap-posnr.
        IF sy-subrc <> 0.
          DELETE t_vbap.
          CONTINUE.
        ELSE.
          READ TABLE t_makt INTO w_makt
          WITH
          KEY matnr = w_vbap-matnr.
          IF sy-subrc = 0.
            w_vbap-maktx = w_makt-maktx.
            MODIFY t_vbap FROM w_vbap.
          ENDIF.
        ENDIF.
      ENDLOOP.
    *find the total quantity
      LOOP AT t_vbap INTO w_vbap.
        w_sum-vbeln = w_vbap-vbeln.
        w_sum-kwmeng = w_vbap-kwmeng.
        COLLECT w_sum INTO t_sum.
        CLEAR w_sum.
      ENDLOOP.
    *populate header
      LOOP AT t_vbak INTO w_vbak.
      Quantity - Total
        READ TABLE t_sum INTO w_sum
        WITH KEY
         vbeln = w_vbak-vbeln.
        IF sy-subrc = 0.
          w_vbak-kwmeng = w_sum-kwmeng.
        ELSE.
          CLEAR w_vbak-kwmeng.
        ENDIF.
      UoM
        READ TABLE t_vbap INTO w_vbap
        WITH KEY
         vbeln = w_vbak-vbeln.
        IF sy-subrc = 0.
          w_vbak-meins = w_vbap-meins.
        ELSE.
          CLEAR w_vbak-meins.
        ENDIF.
      Partner
        READ TABLE t_vbpa INTO w_vbpa
        WITH KEY
         vbeln = w_vbak-vbeln
         parvw = 'WE'.
        IF sy-subrc = 0.
          w_vbak-kunwe = w_vbpa-kunnr.
        ELSE.
          CLEAR w_vbak-kunwe.
        ENDIF.
      SHIP TO PARTY NAME
        READ TABLE t_kna1 INTO w_kna1
        WITH KEY
         kunnr = w_vbak-kunwe.
        IF sy-subrc = 0.
          w_vbak-name2 = w_kna1-name1.
        ENDIF.
      CUST NAM - SOLD TO PARTY
        READ TABLE t_kna1 INTO w_kna1
        WITH KEY
         kunnr = w_vbak-kunnr.
        IF sy-subrc = 0.
          w_vbak-name1 = w_kna1-name1.
        ENDIF.
        MODIFY t_vbak FROM w_vbak.
      ENDLOOP.
      DELETE t_vbak WHERE kwmeng IS INITIAL.
      SORT t_vbak BY vbeln DESCENDING.
      SORT t_vbap BY vbeln  DESCENDING posnr ASCENDING.
    ENDFORM.                    " f_initdata
    *&      Form  f_createalv
          Create Field Cat.
    -->  p1        text
    <--  p2        text
    FORM f_createalv .
      g_tabname_header = 't_vbak'.
      g_tabname_item   = 't_vbap' .
      CLEAR gs_keyinfo.
      gs_keyinfo-header01 = 'VBELN'.
      gs_keyinfo-item01   = 'VBELN'.
    *VBAK
      w_fieldcatalog-fieldname = 'VBELN'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Sales Document'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'VKORG'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Sales Org'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'VTWEG'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Dist Channel'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'SPART'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Division'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'VKBUR'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Sales Office'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'VKGRP'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Sales GRP'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'KUNNR'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Sold to Party'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'NAME1'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-outputlen    = 35.
      w_fieldcatalog-seltext_l = 'Sold to Party Code - Name'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'KUNWE'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Ship to Party'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'NAME2'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Ship Party Code - Name'.
      w_fieldcatalog-outputlen    = 35.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'KWMENG'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Quantity'.
      w_fieldcatalog-outputlen    = 25.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'MEINS'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'UoM'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'SALESDOCUMENT'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Document'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'MESSAGE'.
      w_fieldcatalog-tabname   = 't_vbak'.
      w_fieldcatalog-seltext_l = 'Log'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
    *VBAP
      w_fieldcatalog-fieldname = 'POSNR'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'POS'.
      w_fieldcatalog-outputlen    = 6.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'MATNR'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'Material'.
      w_fieldcatalog-outputlen    = 18.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'MAKTX'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'Material Desc'.
      w_fieldcatalog-outputlen    = 40.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'MATKL'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'Material Grp'.
      w_fieldcatalog-outputlen    = 9.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'MVGR5'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'MCNO'.
      w_fieldcatalog-outputlen    = 4.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'WERKS'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'Plant'.
      w_fieldcatalog-outputlen    = 91.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'KWMENG'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'Quantity'.
      w_fieldcatalog-outputlen    = 25.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
      w_fieldcatalog-fieldname = 'MEINS'.
      w_fieldcatalog-tabname   = 't_vbap'.
      w_fieldcatalog-seltext_l = 'UoM'.
      APPEND w_fieldcatalog TO t_fieldcatalog.
      CLEAR: w_fieldcatalog.
    LAYOUT
    w_layout-colwidth_optimize  = 'X'.
      w_layout-zebra  = 'X'.
      w_layout-expand_fieldname = 'EXPAND'.
      w_layout-box_fieldname  = 'SEL'.
      w_layout-box_tabname  = 't_vbak'.
    ENDFORM.                    " f_createalv
    *&      Form  f_dispalv
          Call ALV
    -->  p1        text
    <--  p2        text
    FORM f_dispalv .
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
         EXPORTING
          i_callback_program             = sy-repid
          i_callback_pf_status_set       = 'SET_PF_STATUS'
          i_callback_user_command        = 'USER_COMMAND'
          is_layout                      = w_layout
          it_fieldcat                    = t_fieldcatalog
        IT_EXCLUDING                   =
        IT_SPECIAL_GROUPS              =
        IT_SORT                        =
        IT_FILTER                      =
        IS_SEL_HIDE                    =
        I_SCREEN_START_COLUMN          = 0
        I_SCREEN_START_LINE            = 0
        I_SCREEN_END_COLUMN            = 0
        I_SCREEN_END_LINE              = 0
        I_DEFAULT                      = 'X'
        I_SAVE                         = ' '
        IS_VARIANT                     =
        IT_EVENTS                      =
        IT_EVENT_EXIT                  =
           i_tabname_header               = g_tabname_header
           i_tabname_item                 = g_tabname_item
           is_keyinfo                     = gs_keyinfo
         TABLES
           t_outtab_header                = t_vbak
           t_outtab_item                  = t_vbap
        EXCEPTIONS
          program_error                  = 1
          OTHERS                         = 2
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " f_dispalv
    *&      Form  set_pf_status
          PF stat
         -->RT_EXTAB   text
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZINSD_QUOT_CONT_ST'.
    ENDFORM.                    "set_pf_status
    *&      Form  user_command
          Process List UCOMM
         -->R_UCOMM      text
         -->RS_SELFIELD  text
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                               rs_selfield TYPE slis_selfield.
      REFRESH t_update.
      IF r_ucomm = 'EXIT'.
        LEAVE PROGRAM.
      ENDIF.
      IF r_ucomm = 'EXECUTE'.
        LOOP AT t_vbak INTO w_update
        WHERE
         sel = 'X'
         AND salesdocument = ' '.
          APPEND w_update TO t_update.
        ENDLOOP.
        IF t_update[] IS NOT INITIAL.
          LOOP AT t_update INTO w_update.
           PERFORM f_bapi_contract_createfromdata USING w_update.
            PERFORM f_bdc_contract_from_quotation.
            MODIFY t_update FROM w_update.
          ENDLOOP.
        ELSE.
        ENDIF.
        PERFORM f_dispalv.
      ENDIF.
      IF r_ucomm  = '&IC1'.
        IF rs_selfield-sel_tab_field = 't_vbak-VBELN'.
          SET PARAMETER ID 'AGN' FIELD rs_selfield-value.
          CALL TRANSACTION 'VA23' AND SKIP FIRST SCREEN.
        ENDIF.
        IF rs_selfield-sel_tab_field = 't_vbak-SALESDOCUMENT' AND
           rs_selfield-value NE ' '.
          SET PARAMETER ID 'KTN' FIELD rs_selfield-value.
          CALL TRANSACTION 'VA43' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDIF.
    ENDFORM.                    "user_command
    *&      Form  F_BAPI_CONTRACT_CREATEFROMDATA
          BAPI CALL
         -->P_W_UPDATE  text
    FORM f_bapi_contract_createfromdata  USING  p_w_update  STRUCTURE w_update .
      DATA : w_contract_header_in  TYPE bapisdhd1  ,
             w_contract_header_inx TYPE bapisdhd1x ,
             t_contract_items_in   TYPE TABLE OF  bapisditm   WITH HEADER LINE,
             t_contract_items_inx  TYPE TABLE OF  bapisditmx  WITH HEADER LINE,
             t_contract_partners   TYPE TABLE OF  bapiparnr   WITH HEADER LINE,
             t_return              TYPE TABLE OF  bapiret2    WITH HEADER LINE.
      CLEAR : w_contract_header_in,
              w_contract_header_inx.
      REFRESH : t_contract_items_in,
                t_contract_items_inx,
                t_contract_partners,
                t_return.
      w_contract_header_in-doc_type   = 'ZCNT'.
      w_contract_header_in-sales_org  = p_w_update-vkorg.
      w_contract_header_in-distr_chan = p_w_update-vtweg.
      w_contract_header_in-division   = p_w_update-spart.
      w_contract_header_in-ct_valid_f = p_w_update-angdt.
      w_contract_header_in-ct_valid_t = p_w_update-bnddt.
      w_contract_header_inx-doc_type  = 'X'.
      w_contract_header_inx-sales_org = 'X'.
      w_contract_header_inx-distr_chan = 'X'.
      w_contract_header_inx-division  = 'X'.
      w_contract_header_inx-ct_valid_f = 'X'.
      w_contract_header_inx-ct_valid_t = 'X'.
      LOOP AT t_vbap INTO w_vbap
      WHERE
        vbeln = p_w_update-vbeln.
        t_contract_items_in-material = w_vbap-matnr.
        t_contract_items_in-plant    = w_vbap-werks.
        t_contract_items_in-target_qty = w_vbap-kwmeng.
        t_contract_items_in-target_qu  = w_vbap-meins.
        t_contract_items_in-ref_doc    = w_vbap-vbeln.
        t_contract_items_in-ref_doc_it = w_vbap-posnr.
        t_contract_items_in-ref_doc_ca = 'B'.
        t_contract_items_in-prc_group5 = w_vbap-mvgr5.
        t_contract_items_inx-material = 'X'.
        t_contract_items_inx-plant    = 'X'.
        t_contract_items_inx-target_qty = 'X'.
        t_contract_items_inx-target_qu  = 'X'.
        t_contract_items_inx-ref_doc    = 'X'.
        t_contract_items_inx-ref_doc_it = 'X'.
        t_contract_items_inx-ref_doc_ca = 'X'.
        t_contract_items_inx-prc_group5 = 'X'.
        APPEND t_contract_items_in.
        APPEND t_contract_items_inx.
      ENDLOOP.
      LOOP AT t_vbpa INTO w_vbpa
       WHERE
        vbeln =  p_w_update-vbeln.
         AND posnr = w_vbap-posnr.
        t_contract_partners-partn_role = w_vbpa-parvw.
        t_contract_partners-partn_numb = w_vbpa-kunnr.
        t_contract_partners-itm_number = w_vbpa-posnr.
        APPEND t_contract_partners.
      ENDLOOP.
      CALL FUNCTION 'BAPI_CONTRACT_CREATEFROMDATA'
        EXPORTING
      SALESDOCUMENTIN               =
        contract_header_in            = w_contract_header_in
        contract_header_inx           = w_contract_header_inx
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       = ' '
      INT_NUMBER_ASSIGNMENT         = ' '
      BEHAVE_WHEN_ERROR             = ' '
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
        salesdocument                 = p_w_update-salesdocument
    TABLES
        return                        = t_return
        contract_items_in             = t_contract_items_in
        contract_items_inx            = t_contract_items_inx
        contract_partners             = t_contract_partners
      CONTRACT_CONDITIONS_IN        =
      CONTRACT_CONDITIONS_INX       =
      CONTRACT_CFGS_REF             =
      CONTRACT_CFGS_INST            =
      CONTRACT_CFGS_PART_OF         =
      CONTRACT_CFGS_VALUE           =
      CONTRACT_CFGS_BLOB            =
      CONTRACT_CFGS_VK              =
      CONTRACT_CFGS_REFINST         =
      CONTRACT_DATA_IN              =
      CONTRACT_DATA_INX             =
      CONTRACT_TEXT                 =
      CONTRACT_KEYS                 =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
      IF p_w_update-salesdocument NE '   ' .
        p_w_update-message = 'SUCCESS'.
      ELSE.
        READ TABLE t_return INDEX 1.
        p_w_update-message =  t_return-message.
      ENDIF.
      READ TABLE t_vbak INTO w_vbak
      WITH KEY
      vbeln  = p_w_update-vbeln.
      IF sy-subrc = 0.
        MODIFY  t_vbak INDEX sy-tabix FROM p_w_update .
      ENDIF.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    ENDFORM.                    " F_BAPI_CONTRACT_CREATEFROMDATA
    *&      Form  f_bdc_contract_from_Quotation
          BAPI CALL
         -->P_W_UPDATE  text
    FORM f_bdc_contract_from_quotation.
      DATA : l_date TYPE char10.
      REFRESH : messtab, bdcdata.
      CLEAR : messtab, bdcdata.
      PERFORM bdc_dynpro      USING 'SAPMV45A' '0101'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=COPY'.
      PERFORM bdc_field       USING 'VBAK-AUART'
                                   'ZCNT'.
      PERFORM bdc_dynpro      USING 'SAPLV45C' '0100'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=RANG'.
      PERFORM bdc_dynpro      USING 'SAPLV45C' '0100'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=UEBR'.
      PERFORM bdc_field       USING 'LV45C-VBELN'
                                     w_update-vbeln.
      PERFORM bdc_dynpro      USING 'SAPMV45A' '4001'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=SICH'.
      IF NOT w_update-angdt IS INITIAL.
        CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
          EXPORTING
            date_internal            = w_update-angdt
          IMPORTING
            date_external            = l_date
          EXCEPTIONS
            date_internal_is_invalid = 1
            OTHERS                   = 2.
        PERFORM bdc_field       USING 'VBAK-GUEBG'
                                       l_date.
      ENDIF.
      IF NOT w_update-bnddt IS INITIAL.
        CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
          EXPORTING
            date_internal            = w_update-bnddt
          IMPORTING
            date_external            = l_date
          EXCEPTIONS
            date_internal_is_invalid = 1
            OTHERS                   = 2.
        PERFORM bdc_field       USING 'VBAK-GUEEN'
                                       l_date.
      ENDIF.
      CALL TRANSACTION 'VA41' USING bdcdata
                       MODE   'E'
                       UPDATE 'S'
                       MESSAGES INTO messtab.
      break abap.
      READ TABLE messtab WITH KEY msgid = 'V1'
                                  msgnr = '311'.
      IF sy-subrc EQ 0.
        w_update-message = 'SUCCESS'.
        w_update-salesdocument = messtab-msgv2.
      ELSE.
        READ TABLE messtab WITH KEY msgtyp = 'E'.
        IF sy-subrc EQ 0.
          DATA : l_info TYPE einfo.
          CLEAR l_info.
          l_info-msgid = messtab-msgid.
          l_info-msgty = messtab-msgtyp.
          l_info-msgno = messtab-msgnr.
          l_info-msgv1 = messtab-msgv1.
          l_info-msgv2 = messtab-msgv2.
          l_info-msgv3 = messtab-msgv3.
          l_info-msgv4 = messtab-msgv4.
          CALL FUNCTION 'MESSAGE_GET_TEXT'
            EXPORTING
              ieinfo        = l_info
              ilangu        = sy-langu
            IMPORTING
              etext         = w_update-message
            EXCEPTIONS
              no_t100_found = 1
              OTHERS        = 2.
        ENDIF.
      ENDIF.
      READ TABLE t_vbak INTO w_vbak WITH KEY vbeln  = w_update-vbeln.
      IF sy-subrc = 0.
        MODIFY  t_vbak INDEX sy-tabix FROM w_update transporting message
                                                                 salesdocument.
      ENDIF.
    ENDFORM.                    " f_bdc_contract_from_Quotation
           Start new screen                                              *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program  = program.
      bdcdata-dynpro   = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.                    "bdc_dynpro
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.                    "bdc_field

  • Alv report in tree format

    hi experts
    i have a report which displays out put in alv grid display with 17 fields.
    my requirement is i have to change the alvgrid display output into ALV Tree with
       9 levels with fields and their descriptions.
    i should mantain back option in alv tree output.when i press back button it should come to
      selection scree or previous screen.
    3).can any one help me in the requirement.
    thanks advanance.
    sailaja

    Hello Sailaja
    You may want to have a look at sample report ZUS_SDN_ALV_TREE_DEMO in thread
    alv tree checbox problem when attempt to get the selected checjboxes
    Regards
      Uwe

  • Project Contract BOQ Printing in Tree format

    Hello,
    I am having issue in making BOQ Printing report in Tree format in Project Contracts
    I found the option to print contract (Tools-Print ) but it doesn’t show the data in tree form,
    I tried using PARENT_LINE_ID, LSE_ID but it didn’t work
    Please  give me a clue.
    Thanks.
    i want to print like this parent then sub, then baseline.

    Hi
    There are APIs for loading Project Contracts.
    You may want to review the white paper published on Metalink - Oracle Project Contracts API Import Procedures - Doc ID: 234864.1
    I don't think Web ADI has been integrated with Project Contracts.
    Dina

  • How to send ALV Report in excel format from SAP

    Hi Gurus,
    We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.Now I want to change this pdf format to excel format.In SCOT T.Code I am able to find any excel format.Please help me out.
    I am waiting for your reply.
    Advance Thanks
    Nirmal

    Hi Nirmal,
    I have done the same in my previous organisation.For this particular solution you need to ask your basis guys to upgrade the support package so that BCS classes could be available in the system.
    API interafces five some problem with attachemnts and SAP has recommended to use BCS classes.
    Currently BCS classes won't be availbale in 4.7.
    Once the BCS classes are available
    use below code
       CONSTANTS:
        lc_tab          TYPE c VALUE cl_bcs_convert=>gc_tab,
        lc_crlf         TYPE c VALUE cl_bcs_convert=>gc_crlf,
       lc_codepage     TYPE abap_encod VALUE '4103',
    data :
       lv_string      TYPE string,
       binary_content TYPE solix_tab,
       size           TYPE so_obj_len,
       *" Set Heading of Excel File
      CONCATENATE 'Employee DATA'
                   lc_crlf lc_crlf
                   INTO lv_string.
       *" Set Header for Excel Fields
      CONCATENATE lv_string
                  lc_header1 lc_tab
                  lc_header2 lc_tab
                  lc_header3 lc_tab
                  lc_header4 lc_tab
                  lc_header5 lc_tab
                  lc_header6 lc_tab
                  lc_header7 lc_tab
                  lc_header8 lc_tab
                  lc_header9 lc_tab
                  lc_header10 lc_crlf
                  INTO lv_string.
    "lc_header1 to 10 could be your field headers
       "Move Internal table data
      LOOP AT gt_final1 INTO gwa_final1.
        CONCATENATE lv_string
                    gwa_final1-field1     lc_tab
                    gwa_final1-field2      lc_tab
                    gwa_final1-field3    lc_crlf
                    INTO lv_string.
      ENDLOOP.
       *" convert the text string into UTF-16LE binary data including
    *" byte-order-mark. Mircosoft Excel prefers these settings
    *" all this is done by new class cl_bcs_convert (see note 1151257)
      TRY.
          cl_bcs_convert=>string_to_solix(
            EXPORTING
              iv_string   = lv_string
              iv_codepage = lc_codepage  "suitable for MS Excel, leave empty
              iv_add_bom  = abap_true     "for other doc types
            IMPORTING
              et_solix  = binary_content
              ev_size   = size ).
        CATCH cx_bcs.
          MESSAGE e445(so).
      ENDTRY.
      TRY.
    *" create persistent send request
          send_request = cl_bcs=>create_persistent( ).
          document = cl_document_bcs=>create_document(
            i_type    = lc_doc
            i_text    = main_text
            i_subject = lc_sub  ).     
          document->add_attachment(
            i_attachment_type    = lc_attach                    "#EC NOTEXT
            i_attachment_subject = lc_sub                       "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
       send_request->set_document( document ).
       recipient = cl_cam_address_bcs=>create_internet_address( email ).
       CALL METHOD send_request->add_recipient
              EXPORTING
                i_recipient = recipient.
       IF recipient IS NOT INITIAL.
            sent_to_all = send_request->send( i_with_error_screen = abap_true ).
            COMMIT WORK.
    *        MESSAGE text-014 TYPE gc_succ  .
          ENDIF.
        CATCH cx_bcs INTO bcs_exception.
          MESSAGE i865(so) WITH bcs_exception->error_type.
      ENDTRY.
    For BCS decalartion u can go to se 38 and see program BCS_EXAMPLE_1 to BCS_EXAMPLE_7.
    Rewrads if helpful.
    Cheers
    Ramesh Bhatt

  • Exporting large report to Excel format (90K lines)

    Hi,
    I am trying to export a 90K line report to excel format and I get that error messsage:
    Description : Une erreur d'application s'est produite sur le serveur. Les paramètres d'erreur personnalisés actuels pour cette application empêchent l'affichage à distance des détails de l'erreur de l'application (pour des raisons de sécurité). Cependant, ils peuvent être affichés par les navigateurs qui s'exécutent sur l'ordinateur serveur local.
    Détails: Pour permettre l'affichage des détails de ce message d'erreur spécifique sur les ordinateurs distants, créez une balise <customErrors> dans un fichier de configuration "web.config" situé dans le répertoire racine de l'application Web en cours. Attribuez ensuite la valeur "off" à l'attribut "mode" de cette balise <customErrors>.
    <!-- Fichier de configuration Web.Config -->
    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>
    Remarques: La page d'erreurs actuellement affichée peut être remplacée par une page d'erreurs personnalisée. Pour ce faire, modifiez l'attribut "defaultRedirect" de la balise de configuration <customErrors> de l'application, de sorte qu'il pointe vers une URL de la page d'erreurs personnalisée.
    <!-- Fichier de configuration Web.Config -->
    <configuration>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
    </configuration>
    I believe it is a timeout problem. Any idea how work around this?
    Thanks,

    I don't have the right to create reports. With those datas, I need grouping them filtering them, commenting them, creating TCD and distributing it. I believe it is easier exporting it and handle it. Also I don't want the data changing from day to day.
    Then you are foobar'ed.
    there is nothing more you can do it the SSRS export feature is not working for you, and you don't have access to the CM12 db and you can't create report. There are no other option to access the data.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • Cannot View the Employee Salary Report in BI Publisher

    Hi, everyone,
    I have installed the Standalone version of bi publisher for windows (bipublisher_windows_x86_101341).
    I have logged in as administrator, I have connected to my oracle database 11g thru jdbc succesfully. i cannot view the Employee Salary report. It gives me the error
    Paramter name: dept Io exception: Invalid number format for port number.
    The sample schemas are also installed on my database.
    Could anyone guide me as i am very new to bi publisher.
    Thanks in advance....

    Hi Can you please let me know what did you do to fix this issue. I am having same issue. Thanks in advance.

  • HR Report in ALV format

    Hi All,
    I'm using a LDB 'PNP' and I'd like to select all the active employee in an internal table and display some info related to employee ( name , basic salary ...) in ALV.
    Can anybody help me coding it please.  Thanks

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

  • HR Employee relationship report

    Hi,
    We have a requirement to create HR--> Employee relationship report, which will display the employee details and his reporting officer details.
    Please let me know if we have a standard report for this.
    Regards,
    Nagesh.

    Hello,
    I dont think there would be any direct report available for this.
    The only way i could think of achieving this is as below:
    (1) If you have data in BI for employee manager, that is in the format employee and its manager.
    Just load it to the cube and get all needed attributes populated from reading master data table of employee.
    (2) For Creating extractor at ECC
    Use following function module to get manager details:
    HRCM_ORGUNIT_MANAGER_GET
    Regards,
    Shashank

  • HR report in particlar format

    Personal      Training     consultancy management HR
    sub area
    IT     5     4     5     4
    java     44     5     5     5
    asp     12     2     2     2
    microsoft     55     55     55     8
    When I will give a company code and date, I want to display the report in above format.
    when we give company code , it will display subarea and  releated and no of employee working in it.
    Please can anyone provide the code of this.

    post ur HR related ?'s in
    HR(ECM)

  • How to Download Employee W2 information in EFW2 format

    Hi,
    I am new to Tax Reporting in HR.
    We have a requirement to download Employee W2 information in EFW2 format and send to third party vendor after the employee's consent.
    Can you please throw some light on the procedure and pre-requisites to do this.
    Thanks
    Pramod Kumar Jonna

    You will want to do something like this:
    http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    except customize it for xml.
    hth,
    John

  • Output list in tree format!!!

    Hi,
       I want ouput in tree format. In the basic nodes, I want customer wise sales. Then if i expand that node then gives subnodes like <b>'finished goods' and 'trading goods'</b> and so on. I want to know the procedure to achieve this task.
    Regards,
    Bhavin

    Hi,
    U can use Transaction Code ->DWDM  for more examples related to Tree Column
    the list of fn modules that can be used to
    construct tree reports
    SEUT,     Hierarchy framework
    RS_TREE_ADD_NODE     Insert nodes
    RS_TREE_AUTOMATIC_REFRESH     
    RS_TREE_COMPRESS     Hide subtree(s)
    RS_TREE_CONSTRUCT     Construct new hierarchy or insert subtree
    RS_TREE_CONTROL_PREPARE     
    RS_TREE_CREATE     Create hierarchy
    RS_TREE_DELETE_NODE     Delete node with associated sub-tree
    RS_TREE_EXPAND     Expand subtree
    RS_TREE_GET_CURRENT_LAYOUT     Get layout information for displayed hierarchy
    RS_TREE_GET_CURRENT_NODE     Get node at which cursor is positioned
    RS_TREE_GET_CURRENT_ROOT     Get current root node
    RS_TREE_GET_CURRENT_TREE     Get structure information for displayed hierarchy
    RS_TREE_GET_INPUT     Get entires from input fields
    RS_TREE_GET_MARKED_NODES     Get selected nodes
    RS_TREE_GET_MODIFICATION_LOG     Get change log for hierarchy
    RS_TREE_GET_NODE     Get nodes for specified ID
    RS_TREE_GET_NODE_BY_NAME     Get node for specified node name
    RS_TREE_GET_PREDECESSOR             Get preceding node
    RS_TREE_GET_SEARCHSTRING     Get last search strinng
    RS_TREE_LIST      Simulate hierarchy or subtree display
    RS_TREE_LIST_DISPLAY     Display hierarchy
    RS_TREE_LIST_DISPLAY     Display hierarchy
    RS_TREE_MODIFY_NODE     
    RS_TREE_MOVE     Reassign node with subtree
    RS_TREE_POP     Get hierarchy from the stack and restore
    RS_TREE_PUSH     Place hierarchy on the stack
    RS_TREE_RESET_LOCK     Deselect node
    RS_TREE_SET_CURRENT_LAYOUT     Set layout with marked cursor position
    RS_TREE_SET_CURRENT_TREE     Set other hierarchy
    RS_TREE_SET_LOCK     Select node
    RS_TREE_SET_NODE     Change Nodes
    RS_TREE_SET_SCROLL_POS     Position node at the beginning of the page
    RS_TREE_SLEEP     
    RS_TREE_SORT_CHILDREN     
    A sample tree pgm.
    *******start of code
    REPORT  Ztree_TEST_PGM.
    Type-pools : fibs,stree.
    data : t_node type snodetext.
    data : node_tab like t_node occurs 0 with header line.
    clear : node_tab, node_tab[].
    node_tab-type = 'T'.
    node_tab-name = 'Earth'.
    node_tab-tlevel = '01'.
    node_tab-nlength = '5'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Europe'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Germany'.
    node_tab-tlevel = '03'.
    node_tab-nlength = '7'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 4.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Berlin'.
    node_tab-tlevel = '04'.
    node_tab-nlength = '6'.
    node_tab-color = '4'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Asia'.
    node_tab-tlevel = '02'.
    node_tab-nlength = '4'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'India'.
    node_tab-tlevel = '03-'.
    node_tab-nlength = '5'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    node_tab-type = 'P'.
    node_tab-name = 'Bombay'.
    node_tab-tlevel = '04-'.
    node_tab-nlength = '6'.
    node_tab-color = '1'.
    node_tab-text = 'Hello'.
    node_tab-tlength ='5'.
    node_tab-tcolor = 3.
    append node_tab.
    clear node_tab.
    CALL FUNCTION 'RS_TREE_CONSTRUCT'
    * EXPORTING
    *   INSERT_ID                = '000000'
    *   RELATIONSHIP             = ' '
    *   LOG                      =
      TABLES
        NODETAB                  = node_tab
    * EXCEPTIONS
    *   TREE_FAILURE             = 1
    *   ID_NOT_FOUND             = 2
    *   WRONG_RELATIONSHIP       = 3
    *   OTHERS                   = 4
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
      DATA: type_mapping TYPE stree_ctl_type_mapping_tab.
      DATA: wa_type TYPE stree_ctl_type_mapping.
      CLEAR: type_mapping[].
        wa_type-type = 'A'.
        wa_type-icon = '@BL@'.
        APPEND wa_type TO type_mapping.
    *CALL FUNCTION 'RS_TREE_CONTROL_PREPARE'
    * EXPORTING
    **   CONTROL_PATTERN             = STREE_CTL_GENERIC
    *    CONTROL_PATTERN             = 'PH'
    **   HIERARCHY_HEADER            =
    **   INITIAL_HEADER_WIDTH        =
    **   LIST_ITEM_HEADER            =
    *   MULTIPLE_SELECTION          = 'X'
    **   ITEM_SELECTION              = STREE_FALSE
    **   SUPPRESS_NODE_ICON          = STREE_FALSE
    **   SUPPRESS_FOLDER_ICON        = STREE_FALSE
    **   CALLBACK_PROGRAM            =
    **   CALLBACK_ITEM_DISPLAY       =
    **   COLOR_MAPPING               =
    *     TYPE_MAPPING                = type_mapping
    ** IMPORTING
    **   SUBSCREEN_PROGRAM           =
    **   SUBSCREEN_DYNNR             =
    ** EXCEPTIONS
    **   NOT_AVAILABLE               = 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.
    *CALL FUNCTION 'RS_TREE_SET_CURRENT_LAYOUT'
    ** EXPORTING
    **   CURSOR_COLUMN             = 3
    **   CURSOR_LINE               = 2
    **   FIRST_NODE                = 1
    **   FIRST_NODE_TYPE           = ' '
    **   LIST_COLUMN               = 1
    **   LIST_LINE                 = 1
    **   LAYOUT_MODE               = STREE_LAYOUT_NORMAL
    ** IMPORTING
    **   INCONSISTENT_LAYOUT       =
    ** TABLES
    **   LAYOUT                    =
    CALL FUNCTION 'RS_TREE_LIST_DISPLAY'
    EXPORTING
    *   CALLBACK_PROGRAM                =
    *   CALLBACK_USER_COMMAND           =
    *   CALLBACK_TEXT_DISPLAY           =
    *   CALLBACK_MOREINFO_DISPLAY       =
    *   CALLBACK_COLOR_DISPLAY          =
    *   CALLBACK_TOP_OF_PAGE            =
    *   CALLBACK_GUI_STATUS             =
    *   CALLBACK_CONTEXT_MENU           =
    *   STATUS                          = 'IMPLICIT'
    *   CHECK_DUPLICATE_NAME            = '1'
    *   COLOR_OF_NODE                   = '4'
    *   COLOR_OF_MARK                   = '3'
    *   COLOR_OF_LINK                   = '1'
    *   COLOR_OF_MATCH                  = '5'
    *   LOWER_CASE_SENSITIVE            = ' '
    *   MODIFICATION_LOG                = ' '
    *   NODE_LENGTH                     = 30
    *   TEXT_LENGTH                     = 75
    *   TEXT_LENGTH1                    = 0
    *   TEXT_LENGTH2                    = 0
    *   RETURN_MARKED_SUBTREE           = ' '
    *   SCREEN_START_COLUMN             = 0
    *   SCREEN_START_LINE               = 0
    *   SCREEN_END_COLUMN               = 0
    *   SCREEN_END_LINE                 = 0
    *   SUPPRESS_NODE_OUTPUT            = ' '
    *   LAYOUT_MODE                     = ' '
    *   USE_CONTROL                     = STREE_USE_LIST
       USE_CONTROL                     = 'L'.
    * IMPORTING
    *   F15                             =
    **********end of program           .                     .
    Refer this link also.
    http://www.kabai.com/abaps/q.htm
    Regards,
    Gayathri

  • Print a report on doc format truncate data

    hi
    I have a report launching with a form in an oracle applications, when I print a report on pdf format looks ok
    but when I print the same report on doc format truncate data on left and right side.
    Can you help me
    thanks

    Hi Herbe
    Reports does not support .doc format. Are you referring .rtf format?
    In any case, you must contact Oracle Support to get the issue resolved.
    Regards
    Sripathy

  • Issue while exporting report in Excel Format

    Hello,
    I am facing problem while exporting the report in Excel Format. After analysis, I think that it could be due to two reasons, either we are using wrong versions of Jars, or we are using wrong API. Here is the code, approaches and problems we are facing. Please help.
    First approach we are using is:
    // using basic API
    import com.crystaldecisions.reports.sdk.ReportClientDocument;
    // get client document from crystal report API and open the report by specifying the report name, with path
                   ReportClientDocument reportClientDoc = new ReportClientDocument();
                   reportClientDoc.open( reportPath, 0 );
                   // give chance to extending classes to configure the report document by POJO or by sql parameter etc, just adding the parameters infromation using ParameterFieldController
                   configureReportDocument( reportClientDoc, reportMetadata, reportData, reportContext );
                   // get data source of crystal report
                   Object reportSource = reportClientDoc.getReportSource();
                   // export the data - we have also tried with MSExcel format
                   ReportExportFormat exportFormat =  ReportExportFormat.recordToMSExcel;
                   LOGGER.debug( "exportFormat[" + exportFormat + "]" );
                   ByteArrayInputStream byteArray = (ByteArrayInputStream) reportClientDoc.getPrintOutputController().export(
                             exportFormat );
    Problem Faced: Specified Excel format is not supported.
    Second Approach: We come to know that excel format is supported with new releases and with occa package.
    Then we tried with import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument; It ask to set the ReportServer. When we are trying to set the server as
                   reportClientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
    Application is unable to find 'ReportClientDocument.inprocConnectionString' property. It seems like we are using some old jars. However we have downloaded the latest released jars for eclipse 2.
    Please help for it. Issue is to export the report in excel format, which is currently working fine for PDF. If this problem is related to Jars, please suggest the path to download the latest jars. We also looking for the latest jars like rasapp and rascore etc. But these are not available with Crystal Report for Eclipse 2 release.
    Waiting for urgent help. Thanks you..
    Regards,
    Mohit

    Hi,
    Send me Environment Details .
    Here is the code  snippet for exporting report to excel format:
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.definition.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
    <%@ page import="com.crystaldecisions.sdk.framework.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.managedreports.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>
    <%@ page import="com.crystaldecisions.sdk.occa.report.exportoptions.*" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%
    String username ="Administrator";
    String password ="";
    String cmsname ="localhost:6400";
    String Authen ="secEnterprise";
         //connecting to Enterprise
         IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon(username,password,cmsname,Authen);
         //get the report App Factory form the Crystal Enterprise
         IReportAppFactory appFactory = (IReportAppFactory) es.getService("","RASReportService");
         //get the infostore service form the Crystal Enterprise
         IInfoStore istore = (IInfoStore) es.getService("","InfoStore");
         //get the report by name from crystal Enterprise
         IInfoObjects iobjects = istore.query("Select * From CI_INFOOBJECTS Where SI_NAME = 'sampleramz2.rpt' and SI_INSTANCE = 0 ");
         //open the report in the report doc object.
         ReportClientDocument Doc = appFactory.openDocument((IInfoObject)iobjects.get(0), 0, Locale.ENGLISH);
         // WORKING WITH THE PRINT OUTPUT CONTROLLER
         //Use the report documents PrintOutputController to export the report to a ByteArrayInputStream
         ByteArrayInputStream byteIS = (ByteArrayInputStream)Doc.getPrintOutputController().export(ReportExportFormat.recordToMSExcel);
         // EXPORTING THE REPORT
         //Create a byte[] (same size as the exported ByteArrayInputStream)
         byte[] buf = new byte[2000 * 1024];
         int nRead = 0;
         //Set response headers to indicate pdf MIME type and inline file
         response.reset();
         response.setHeader("Content-disposition", "inline;filename=ramz");
         response.setContentType("application/xls");
         //Send the Byte Array to the Client
         while ((nRead = byteIS.read(buf)) != -1)
              response.getOutputStream().write(buf, 0, nRead);
         //Flush the output stream
         response.getOutputStream().flush();
         //Close the output stream
         response.getOutputStream().close();
    %>
    Let me know any information is needed,
    Regards,
    Rameez

  • Main Reports' Group Tree doesn't retain last record selected

    In Crystal 2008 Viewer, when you click one of the last tree nodes on a long Group Tree, the program jumps to that part of the report for that group.  But when you return to the Main report tab the Group Tree pane returns to the top.
    According to my users, previous Crystal versions used to outline the previously selected tree node and keep that section in the left pane, so the user could see where they just were.
    This partially works in the Crystal 2008 Developer version.  If I preview the report and drill down with the group tree, the Preview tab's group tree pane stays in place.  I do not, however, have any outline or indication of what group was just selected.
    I found this in the help text: "For longer reports or reports in which you wish to jump back and forth between different groups, the smart navigation features of the Group Tree make your work extremely efficient."  For the users to jump back and forth efficiently they need the Main Reports' group tree to remember the general location from which they came (at a minimum) AND/OR the previously drilled record also be highlighted/outlined (at best).

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

Maybe you are looking for

  • Multiple image upload mysql

    good afternoon as uploading pictures multiple, code questions? <?php require_once('../../Connections/fotos.php'); ?> <?php //initialize the session if (!isset($_SESSION)) {   session_start(); // ** Logout the current user. ** $logoutAction = $_SERVER

  • Table entries deleted in Customized table.

    Respected Guru's table entries in a customized table were deleted in production system, no transports pertaining it was found. Table entries were updated using bapi. Please help me to know how the table entries were deleted. Daya. Edited by: Dayanana

  • Messaging System in warehouse builder

    Hi all, Can anyone provide the details of messaging system in warehouse builder.

  • Downloading/installing Java(TM) 2 SDK, Standard Edition 1.4.0_02

    Hope someone can help... after I download, I click on the exe file and it defaults to install on my C: drive.. unfortunately, this is my work laptop and there is not enough room on my C: drive... I do not see a way to change the setting to install it

  • Quicktime makes Premiere Pro crash

    Premiere Pro CS4 crashes when viewing footage in the Program Monitor if Quicktime is installed. The only way I can view footage in Premiere now is by uninstalling Quicktime. It worked before the 7.6.4 update, so I tried going back to an earlier versi