Template for ALV

anyone have a template for ALV with FM reuse_alv_grid
PLS////

Hope you mean to ask a sample program for ALV GRID report
Here you go.
RANGES: r_fiscal_period     FOR  s600-spmon.
DATA:   gt_fieldcat         TYPE slis_t_fieldcat_alv,
        gt_fcat             TYPE slis_t_fieldcat_alv,
        gs_fieldcat         LIKE LINE OF gt_fieldcat,
        gs_fcat             LIKE LINE OF gt_fcat,
        gt_fldcat           TYPE lvc_t_fcat,
        gs_fldcat           TYPE lvc_s_fcat,
        gt_layout           TYPE slis_layout_alv,
        gt_events           TYPE slis_t_event,
        gt_list_top_of_page TYPE slis_t_listheader,
        gv_repid            LIKE sy-repid,
        gv_beg_period       LIKE /irm/s_ipcisel-etprd,
        gv_line(2)          TYPE c.
DATA:   gv_year(4)          TYPE c,
        gv_month(2)         TYPE c,
        gv_count            TYPE i,
        gv_total            TYPE mc_umnetwr,
        gv_num_lines        TYPE i,
        gv_text1(100)       TYPE c.
DATA:   gt_dyn_table TYPE REF TO data,
        gs_dyn_line  TYPE REF TO data.
FIELD-SYMBOLS: <fs_quota>   TYPE STANDARD TABLE,
               <fs_amount>,
               <fs_quota_wa>.
*                C O N S T A N T S
CONSTANTS: c_600                  TYPE tabname VALUE 'S600',
           c_601                  TYPE tabname VALUE 'S601',
           c_602                  TYPE tabname VALUE 'S602',
           c_603                  TYPE tabname VALUE 'S603',
           c_a00                  TYPE vrsio   VALUE 'A00',
           c_01(2)                TYPE c       VALUE '01',
           c_formname_top_of_page TYPE slis_formname
                                  VALUE 'TOP_OF_PAGE'.
*   I N T E R N A L  T A B L E S     &      W O R K  A R E A S
*structure to hold the quotas
TYPES: BEGIN OF ty_quotas,
         umnetwr   TYPE mc_umnetwr,                  "Net Value
       END OF ty_quotas.
*list of months
DATA: BEGIN OF gs_months,
        field_1      LIKE s600-umnetwr,
        field_2      LIKE s600-umnetwr,
        field_3      LIKE s600-umnetwr,
        field_4      LIKE s600-umnetwr,
        field_5      LIKE s600-umnetwr,
        field_6      LIKE s600-umnetwr,
        field_7      LIKE s600-umnetwr,
        field_8      LIKE s600-umnetwr,
        field_9      LIKE s600-umnetwr,
        field_10     LIKE s600-umnetwr,
        field_11     LIKE s600-umnetwr,
        field_12     LIKE s600-umnetwr,
        total        LIKE s600-umnetwr,
      END OF gs_months.
DATA: gs_quotas TYPE ty_quotas,
      gt_quotas LIKE gs_quotas OCCURS 0 WITH HEADER LINE.
*            S E L E C T I O N - S C R E E N
SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-013.
PARAMETER: p_lis  TYPE tabname,                "plan input
           p_date LIKE /irm/s_ipcisel-etprd,   "end period
           p_emp  TYPE /irm/ip_ktonr,          "sales participant
           p_terr LIKE ztip_sales-zzterritory, "territory
           p_dis  TYPE zzdistrict,             "district
           p_reg  TYPE zzregion.               "region
SELECTION-SCREEN END OF BLOCK bl1.
*          S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
*clear all tables, work areas, variables etc
  PERFORM clear_variables.
*get all the months in the period range
  PERFORM get_periods.
*retrieve component quotas
  PERFORM component_quota_amt.
*build field catalogue using internal table
  PERFORM field_catalog_create.
*build dynamic table
  PERFORM build_dynamic_table.
*build layout for the ALV list
  PERFORM build_layout.
*event table to trigger the TOP OF PAGE event to display the heading
  PERFORM eventtab_build USING gt_events[].
*subroutine for displaying the header which contains the number of
*datasets selected or displayed
  PERFORM header_build  USING gt_list_top_of_page[].
*ALV grid display
  PERFORM display_alv_grid.
*&      Form  clear_variables
*       text
*  -->  p1        text
*  <--  p2        text
FORM clear_variables.
  CLEAR:     gs_quotas,
             gv_count,
             gv_beg_period,
             gv_total.
  REFRESH:   gt_quotas.
  MOVE sy-repid TO gv_repid.
ENDFORM.                    " clear_variables
*&      Form  get_periods
*       text
*  -->  p1        text
*  <--  p2        text
FORM get_periods.
*get the fiscal year
  gv_month = p_date+4(2).
  gv_year  = p_date+0(4).
  MOVE gv_month TO gv_count.
  CONCATENATE gv_year c_01 INTO gv_beg_period.
  r_fiscal_period-low    = gv_beg_period.
  r_fiscal_period-high   = p_date.
  r_fiscal_period-sign   = 'I'.
  r_fiscal_period-option = 'BT'.
  APPEND r_fiscal_period.
ENDFORM.                    " get_periods
*&      Form  field_catalog_create
*       text
*  -->  p1        text
*  <--  p2        text
FORM field_catalog_create.
  DESCRIBE TABLE gt_quotas LINES sy-tabix.
  gv_num_lines = sy-tabix.
  gv_num_lines = gv_num_lines - 1.
  DO gv_num_lines TIMES.
    MOVE sy-index TO gv_line.
    CONCATENATE 'FIELD_' gv_line INTO gs_fldcat-fieldname.
    APPEND gs_fldcat TO gt_fldcat.
  ENDDO.
  MOVE 'TOTAL' TO gs_fldcat-fieldname.
  APPEND gs_fldcat TO gt_fldcat.
*build field catalog and change the field texts of some of the amount
*fields more specific
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
            i_program_name         = gv_repid
            i_internal_tabname     = 'GS_MONTHS'
            i_inclname             = gv_repid
            i_bypassing_buffer     = 'X'
       CHANGING
            ct_fieldcat            = gt_fieldcat[]
       EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
  LOOP AT gt_fieldcat INTO gs_fieldcat.
*condition to check for building a dynamic ALV grid
    CHECK sy-tabix LE gv_count.
    CASE gs_fieldcat-fieldname.
      WHEN 'FIELD_1'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-001 TO gs_fcat-seltext_l.
        MOVE text-001 TO gs_fcat-seltext_m.
        MOVE text-001 TO gs_fcat-seltext_s.
        MOVE text-001 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_2'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-002 TO gs_fcat-seltext_l.
        MOVE text-002 TO gs_fcat-seltext_m.
        MOVE text-002 TO gs_fcat-seltext_s.
        MOVE text-002 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_3'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-003 TO gs_fcat-seltext_l.
        MOVE text-003 TO gs_fcat-seltext_m.
        MOVE text-003 TO gs_fcat-seltext_s.
        MOVE text-003 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_4'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-004 TO gs_fcat-seltext_l.
        MOVE text-004 TO gs_fcat-seltext_m.
        MOVE text-004 TO gs_fcat-seltext_s.
        MOVE text-004 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_5'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-005 TO gs_fcat-seltext_l.
        MOVE text-005 TO gs_fcat-seltext_m.
        MOVE text-005 TO gs_fcat-seltext_s.
        MOVE text-005 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_6'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-006 TO gs_fcat-seltext_l.
        MOVE text-006 TO gs_fcat-seltext_m.
        MOVE text-006 TO gs_fcat-seltext_s.
        MOVE text-006 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_7'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-007 TO gs_fcat-seltext_l.
        MOVE text-007 TO gs_fcat-seltext_m.
        MOVE text-007 TO gs_fcat-seltext_s.
        MOVE text-007 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_8'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-008 TO gs_fcat-seltext_l.
        MOVE text-008 TO gs_fcat-seltext_m.
        MOVE text-008 TO gs_fcat-seltext_s.
        MOVE text-008 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_9'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-009 TO gs_fcat-seltext_l.
        MOVE text-009 TO gs_fcat-seltext_m.
        MOVE text-009 TO gs_fcat-seltext_s.
        MOVE text-009 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_10'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-010 TO gs_fcat-seltext_l.
        MOVE text-010 TO gs_fcat-seltext_m.
        MOVE text-010 TO gs_fcat-seltext_s.
        MOVE text-010 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_11'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-011 TO gs_fcat-seltext_l.
        MOVE text-011 TO gs_fcat-seltext_m.
        MOVE text-011 TO gs_fcat-seltext_s.
        MOVE text-011 TO gs_fcat-reptext_ddic.
      WHEN 'FIELD_12'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-012 TO gs_fcat-seltext_l.
        MOVE text-012 TO gs_fcat-seltext_m.
        MOVE text-012 TO gs_fcat-seltext_s.
        MOVE text-012 TO gs_fcat-reptext_ddic.
    ENDCASE.
    APPEND gs_fcat   TO gt_fcat.
  ENDLOOP.
  LOOP AT gt_fieldcat INTO gs_fieldcat.
    CASE gs_fieldcat-fieldname.
      WHEN 'TOTAL'.
        MOVE-CORRESPONDING gs_fieldcat TO gs_fcat.
        MOVE text-015 TO gs_fcat-seltext_l.
        MOVE text-015 TO gs_fcat-seltext_m.
        MOVE text-015 TO gs_fcat-seltext_s.
        MOVE text-015 TO gs_fcat-reptext_ddic.
        APPEND gs_fcat   TO gt_fcat.
    ENDCASE.
  ENDLOOP.
ENDFORM.                    " field_catalog_create
*&      Form  component_quota_amt
*       text
*  -->  p1        text
*  <--  p2        text
FORM component_quota_amt.
*convert the user to a valid format
  PERFORM partid_input_conversion CHANGING p_emp.
  IF p_lis EQ c_600.
*Employee Monthly Quota Targets
    SELECT   umnetwr
      INTO   TABLE gt_quotas
      FROM   s600                      "Employee Monthly Quota Targets
     WHERE   ssour  EQ space
       AND   vrsio  EQ c_a00
       AND   spmon  IN r_fiscal_period
       AND   pvrtnr EQ p_emp.
  ELSEIF p_lis EQ c_601.
*Territory monthly quota targets
    SELECT   umnetwr
      INTO   TABLE gt_quotas
      FROM   s601                      "Territory monthly quota targets
     WHERE   ssour      EQ space
       AND   vrsio      EQ c_a00
       AND   spmon      IN r_fiscal_period
       AND   zzterritor EQ p_terr.
  ELSEIF p_lis EQ c_602.
*District Monthly Quota Targets
    SELECT   umnetwr
      INTO   TABLE gt_quotas
      FROM   s602                      "District  Monthly Quota Targets
     WHERE   ssour      EQ space
       AND   vrsio      EQ c_a00
       AND   spmon      IN r_fiscal_period
       AND   zzdistrict EQ p_dis.
  ELSEIF p_lis EQ c_603.
*Region Monthly Quota Targets
    SELECT   umnetwr
      INTO   TABLE gt_quotas
      FROM   s603                      "Region Monthly Quota Targets
     WHERE   ssour      EQ space
       AND   vrsio      EQ c_a00
       AND   spmon      IN r_fiscal_period
       AND   zzregion   EQ p_reg.
  ENDIF.
  LOOP AT gt_quotas INTO gs_quotas.
    gv_total = gv_total + gs_quotas-umnetwr.
  ENDLOOP.
  MOVE gv_total    TO gs_quotas-umnetwr.
  APPEND gs_quotas TO gt_quotas.
ENDFORM.                    " component_quota_amt
*&      Form  build_dynamic_table
*       text
*  -->  p1        text
*  <--  p2        text
FORM build_dynamic_table.
*Create dynamic internal table
  CALL METHOD cl_alv_table_create=>create_dynamic_table
               EXPORTING
                  it_fieldcatalog = gt_fldcat
               IMPORTING
                  ep_table        = gt_dyn_table.
  ASSIGN gt_dyn_table->* TO <fs_quota>.
  CREATE DATA gs_dyn_line LIKE LINE OF <fs_quota>.
  ASSIGN gs_dyn_line->* TO <fs_quota_wa>.
  LOOP AT gt_quotas INTO gs_quotas.
    ASSIGN COMPONENT sy-tabix OF STRUCTURE <fs_quota_wa> TO <fs_amount>.
    <fs_amount> = gs_quotas-umnetwr.
  ENDLOOP.
  IF sy-subrc = 0.
    APPEND <fs_quota_wa> TO <fs_quota>.
  ENDIF.
ENDFORM.                    " build_dynamic_table
*&      Form  display_alv_grid
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_alv_grid.
  IF NOT <fs_quota> IS INITIAL.
* ALV grid display
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              i_callback_program = gv_repid
              is_layout          = gt_layout
              it_fieldcat        = gt_fcat
*              it_sort            = gt_sortcat
              i_save             = 'A'
              it_events          = gt_events
         TABLES
              t_outtab           = <fs_quota>
         EXCEPTIONS
              program_error      = 1
              OTHERS             = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
  ELSE.
    MESSAGE i013(zip).
  ENDIF.
ENDFORM.                    " display_alv_grid
*&      Form  build_layout
*       text
*  -->  p1        text
*  <--  p2        text
FORM build_layout.
  gt_layout-zebra             = 'X'.
  gt_layout-no_vline          = ' '.
  gt_layout-reprep            = 'X'.
  gt_layout-detail_popup      = 'X'.
  gt_layout-window_titlebar   = text-014.
  gt_layout-no_scrolling      = ' '.
  gt_layout-detail_titlebar   = text-014.
  gt_layout-numc_sum          = 'X'.
  gt_layout-colwidth_optimize = 'X'.
ENDFORM.                    " build_layout
*&      Form  partid_input_conversion
*       text
*      <--P_P_EMP  text
FORM partid_input_conversion CHANGING p_emp.
  DATA: lv_pernr  TYPE pernr_d.
  lv_pernr  = p_emp.
  p_emp     = lv_pernr.
ENDFORM.                    " partid_input_conversion
*&      Form  eventtab_build
*       text
*      -->P_GT_EVENTS[]  text
FORM eventtab_build USING p_lt_events TYPE slis_t_event.
  DATA: ls_event TYPE slis_alv_event.
*top of page event is read here to display the heading
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
            i_list_type = 0
       IMPORTING
            et_events   = p_lt_events.
  READ TABLE p_lt_events WITH KEY name =  slis_ev_top_of_page
                         INTO ls_event.
  IF sy-subrc = 0.
    MOVE c_formname_top_of_page TO ls_event-form.
    MODIFY p_lt_events FROM  ls_event TRANSPORTING form
                       WHERE name =  slis_ev_top_of_page.
  ENDIF.
ENDFORM.                    " eventtab_build
*&      FORM  TOP-OF-PAGE
*       text
FORM top_of_page.
  IF NOT gt_quotas[] IS INITIAL.
* function module which displayes the number of records selected in the
*  header part
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
         EXPORTING
              it_list_commentary = gt_list_top_of_page.
  ENDIF.
ENDFORM.                    " TOP-OF-PAGE
*&      Form  header_build
*       text
*      -->P_GT_LIST_TOP_OF_PAGE[]  text
FORM header_build USING p_lt_list_top_of_page TYPE slis_t_listheader.
  DATA: ls_line       TYPE slis_listheader,
        lv_amount(20) TYPE c.
  MOVE gv_total TO lv_amount.
  CONCATENATE text-016 lv_amount INTO gv_text1.
  CONCATENATE gv_text1 'USD' INTO gv_text1 SEPARATED BY space.
  CLEAR ls_line.
  ls_line-typ  = 'H'.
  ls_line-info = gv_text1.
  APPEND ls_line TO p_lt_list_top_of_page.
ENDFORM.                    " header_build
Thanks,

Similar Messages

  • Type groups for alv

    how many type groups r there for ALV reports

    Hi,
    The following Groups are used in ALV Reports.
    ALVHT     ALV Control: HTML Templates
    KKBHT     Type pool for hierarchy component KKRT
    KKBLO     Type group for dynamic list output
    SLIS         Global types for generic list modules
    Regards,
    Mehul Shah.

  • Dynamically set template for Print Quote report

    We need to customize "Print Quote" in Quoting
    As part of this we will be having 2 custom templates (will be related to data definition "Quote Printing", ASOPRT).
    These two templates have to be defaulted based on the quote status - one for status "Approved", and the other template for other non "Approved" statuses.
    How can this be achieved dynamically? (OAF CO customization / personilization)
    There doesn't seem to be any setup for assigning different templates based on status.
    Profile option "ASO: Default Layout Template" can be utilized to change the default template, but we need this template to be defaulted dynamically based on the Quote status.
    Thanks,
    Sumanth
    Edited by: user1131947 on Oct 25, 2011 3:51 AM

    If you want to create a custom report using concurrent program then refer:
    http://apps2fusion.com/apps/apps/63-xml-publisher-concurrent-program-xmlp
    If you want to create a custom report using OAF page then refer:
    http://apps2fusion.com/at/51-ps/260-integrating-xml-publisher-and-oa-framework
    -Anand

  • How to use one WAD template for all the available queries

    Hi,
    I have created a WAD template... Now we have close to 25 queries which will use that template for displaying their output at Portal...
    Is there any way that i don`t have to create multiple copies of my WAD template...
    I.e. all queries would call that same template through portal...

    Hi,
    The Bex report uses the Standard Template 0ANALYSIS_PATTERN while it is executed.
    So if your sure that the look and feel of all the Reports is going to remain same, you don't need to even attach all these Queries to Templates in WAD.
    When you execute the BEx query, it would pick up the standard template and run it in portal.
    But if you want to customize the Report Template:
    1) You can change this standard template 0ANALYSIS_PATTERN  and customize it according to ur requrement in WAD.
    2) Or you can create a copy of this standard template and change it as required. Then change the template in spro (transaction RSCUSTV27) to point to this Z template.
    Let me know if you need more details.
    Regards,
    Forum

  • How to crate a page template for multiple page instances?

    Hello,
    When I use the Administration Portal to create a page with portlets in the Portal Resource Library, I can choose to use that page it in my portal. The problem is that I can use it only once. How can I crate a page template with portlets so I can use use it as a template for many page instances in one portal?
    I'm using Portal 8.1.6.
    Regards,
    Eirik

    Hey Dave, See the image below:

  • Oracle Sesame Adaptater - missing template for creation of a new SAIL repo.

    Hi,
    I'm trying to deploy the Sesame Adaptater on my TOMCAT server.
    At the point 8.9 of the doc ( http://docs.oracle.com/cd/E18283_01/appdev.112/e11828/sem_sesame.htm#BABFFEFA) I'm suppose to type in the sesame console the following comand :
    "create oracle."
    I got this error :
    ERROR : No template called Oracle found in C:\Users\<Username>\AppData\Roaming\Aduna\OpenRDF Sesame Console\templates
    By reading the Sesame doc and according to this page (http://www.openrdf.org/doc/sesame2/users/ch07.html) I suppose that I have to add in the "C:\Users\<Username>\AppData\Roaming\Aduna\OpenRDF Sesame Console\templates" directory a file based on this template :
    # Sesame configuration template for a main-memory repository
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
    @prefix rep: <http://www.openrdf.org/config/repository#>.
    @prefix sr: <http://www.openrdf.org/config/repository/sail#>.
    @prefix sail: <http://www.openrdf.org/config/sail#>.
    @prefix ms: <http://www.openrdf.org/config/sail/memory#>.
    [] a rep:Repository ;
    rep:repositoryID "{%Repository ID|memory%}" ;
    rdfs:label "{%Repository title|Memory store%}" ;
    rep:repositoryImpl [
    rep:repositoryType "openrdf:SailRepository" ;
    sr:sailImpl [
    sail:sailType "openrdf:MemoryStore" ;
    ms:persist {%Persist|true|false%} ;
    ms:syncDelay {%Sync delay|0%}
    Do anyone have the correct template ?
    I didn't find any other thread about this problem, so I supose it's an easy issue to solve, but the Semantic Technologies are totally new for me.
    Arthur

    I finally find the answer to my question. The template used in the tutorial is present in the sesame adapter.
    I just had to extract the files into the "sdordfsesame.jar", the template is locate in "sdordfsesame.jar/org/openrdf/console/oracle.ttl".
    After adding the "oracle.ttl" to the correct directory, it's work fine.
    Arthur

  • Help needed for ALV report

    Hi,
    i need to add coloums for the existing report which picks from G/L account.
    in this report I need to add some more columns from COSP-KSTAR, which shows the cost element details from G/L account.
    I need to restrict that cost element number according to the company code.
    Plz see this and let me know the things.
    1. I need to add FISCAL YEAR(COEP-GJAHR) in selection screen.
    2. I need to add column: Employee Cost (CSKS-KOSTL)
    3. add a column Staff Welfare (COSP-KSTAR) this is to restrict for the cost element 3000200 from G/L account
    4. add a column Recruitment restrict for the cost element(COSP-KSTAR) 3100040 from G/L account
    5. add a column Travels (suppressing some cost elements(COSP-KSTAR) and putting into Travels)
    6. add a column Subcontracts restrict for the cost element (COSP-KSTAR)3100360 from G/L account
    7. add a column Communication suppressing some cost elements and putting into Communication)
    8. add a column Rent restrict for the cost element (COSP-KSTAR)3100055 from G/L account
    9. add a column Back end Cost restrict for the cost element (COSP-KSTAR)3100065 from G/L account
    i can hardcode these cost elements.
    i did according to some of our sdn friends guidence but it is going to dump.
    hear i am sending the code what i changed.
    it is giving the error with the select.
    SELECT BUKRS KOKRS gjahr kstar OBJNR OBJNR_N1 PERIO  BEKNZ WKGBTR WOGBTR  FROM
    COEP  INTO TABLE
    IT_COEP FOR ALL ENTRIES IN IT_AUFK WHERE OBJNR = IT_AUFK-OBJNR and
    perio in S_PERIO.
    plz try to help me out in this issue.
    hear i am sending the complete code what i worte.
    *& Report  ZPROJECT_PROFIT2
    REPORT  ZPROJECT_PROFIT2.
    *********************MAIN DOCUMENTATION BLOCK*************************
    Project Code           :
    Program Name           :Zproject_profit1.
    Purpose of program     :This report will give the gross margin for a project as
    *a whole based on some selected input criteria.
    Author of program      :JAYA KRISHNA .B.
    INPUT/OUTPUT FILE      :nil
    TYPE-POOLS : SLIS."For ALV display.
    TABLES : COEP,  "CO Object: Line Items  (by period).
             AUFK,   "Order master data.
             csks,    "Cost center master data
             cosp.    "CO Objects
    *&  Include           ZSTRUCTURE
    types:    BEGIN OF TY_COEP ,            "structure of table COEP.
              BUKRS LIKE COEP-BUKRS,
              KOKRS LIKE COEP-KOKRS,
              OBJNR LIKE COEP-OBJNR,
               gjahr like coep-gjahr,
              kstar like coep-kstar,
              OBJNR_N1 LIKE COEP-OBJNR_N1,
              PERIO LIKE COEP-PERIO,
              BEKNZ LIKE COEP-BEKNZ,
              WKGBTR LIKE COEP-WKGBTR,
              WOGBTR LIKE COEP-WOGBTR,
              BELNR LIKE COEP-BELNR,
              END OF TY_COEP,
             BEGIN OF TY_AUFK ,             "structure of table AUFK.
             BUKRS LIKE AUFK-BUKRS,
             KOKRS LIKE AUFK-KOKRS,
             OBJNR LIKE AUFK-OBJNR,
             KTEXT LIKE AUFK-KTEXT,
             ANFAUFNR LIKE AUFK-ANFAUFNR,
             AUFEX LIKE AUFK-AUFEX,
             USER2 LIKE AUFK-USER2,
             USER0 LIKE AUFK-USER0,
             USER1 LIKE AUFK-USER1,
             USER3 LIKE AUFK-USER3,
             USER6 LIKE AUFK-USER6,
             USER7 LIKE AUFK-USER7,
             USER8 LIKE AUFK-USER8,
             ABKRS(10) TYPE C,
             USER9 LIKE AUFK-USER9,
             AUFNR LIKE AUFK-AUFNR,
           END OF TY_AUFK,
           begin of ty_csks,
           kokrs like csks-kokrs,
            kostl like csks-kostl,
            bukrs like csks-bukrs,
            objnr like csks-objnr,
                 end of ty_csks.
    DATA :   BEGIN OF IT_COSP occurs 100,
           OBJNR LIKE COSP-OBJNR,
           GJAHR LIKE COSP-GJAHR,
           KSTAR LIKE COSP-KSTAR,
           END OF IT_COSP.
    DATA : IT_COEP TYPE TABLE OF TY_COEP,     " Declaraton of tables COEP and AUFK.
           IT_AUFK TYPE TABLE OF TY_AUFK,
           IT_CSKS TYPE TABLE OF TY_CSKS.
          IT_COSP TYPE TABLE OF TY_COSP.
    DATA : WA_COEP LIKE LINE OF IT_COEP,      " Declaration of work areas for tables COEP and AUFK.
           WA_AUFK LIKE LINE OF IT_AUFK,
           WA_CSKS LIKE LINE OF IT_CSKS.
          WA_COSP LIKE LINE OF IT_COSP.
    DATA : BEGIN OF IT_DISPLAY OCCURS 0,      " Declaration of display table.
            OBJNR_N1 LIKE COEP-OBJNR_N1,
            OBJNR_N12 LIKE COEP-OBJNR_N1,
            KTEXT1 LIKE AUFK-KTEXT,
            WKGBTR LIKE COEP-WKGBTR,
            WOGBTR LIKE COEP-WOGBTR,
            WKGBTR1  LIKE COEP-WTGBTR,
            WOGBTR1 LIKE COEP-WOGBTR,
            ADDK LIKE COEP-WOGBTR,
            ADDO LIKE COEP-WOGBTR,
            ADDK1 LIKE COEP-WOGBTR,
            ADDO1 LIKE COEP-WOGBTR,
            PROFIT1 LIKE COEP-WOGBTR,
            PROFIT2 LIKE COEP-WOGBTR,
            BEKNZ LIKE COEP-BEKNZ,
            BUKRS LIKE AUFK-BUKRS,
            anfaufnr LIKE AUFK-anfaufnr,
            aufex like aufk-aufex,
            OBJNR LIKE AUFK-OBJNR,
            USER2 LIKE AUFK-USER2,
            USER0 LIKE AUFK-USER0,
            USER1 LIKE AUFK-USER1,
            USER3 LIKE AUFK-USER3,
            USER6 LIKE AUFK-USER6,
            USER7 LIKE AUFK-USER7,
            USER8 LIKE AUFK-USER8,
            ABKRS LIKE AUFK-ABKRS,
            USER9 LIKE AUFK-USER9,
            PERIO LIKE COEP-PERIO,
            AUFNR LIKE AUFK-AUFNR,
            STR(5) TYPE C,
            WORK(10) TYPE C,
           END OF IT_DISPLAY,
      : BEGIN OF IT_DISPLAY1 OCCURS 0,      " Declaration of second display table.
         OBJNR_N1 LIKE COEP-OBJNR_N1,
         OBJNR_N12 LIKE COEP-OBJNR_N1,
         KTEXT1 LIKE AUFK-KTEXT,
         WKGBTR LIKE COEP-WKGBTR,
         WOGBTR LIKE COEP-WOGBTR,
         WKGBTR1  LIKE COEP-WTGBTR,
         WOGBTR1 LIKE COEP-WOGBTR,
         ADDK LIKE COEP-WOGBTR,
         ADDO LIKE COEP-WOGBTR,
         ADDK1 LIKE COEP-WOGBTR,
         ADDO1 LIKE COEP-WOGBTR,
         PROFIT1 LIKE COEP-WOGBTR,
         PROFIT2 LIKE COEP-WOGBTR,
         BEKNZ LIKE COEP-BEKNZ,
         BUKRS LIKE AUFK-BUKRS,
         anfaufnr like aufk-anfaufnr,
         aufex like aufk-aufex,
         OBJNR LIKE AUFK-OBJNR,
         USER2 LIKE AUFK-USER2,
         USER0 LIKE AUFK-USER0,
         USER1 LIKE AUFK-USER1,
         USER3 LIKE AUFK-USER3,
         USER6 LIKE AUFK-USER6,
         USER7 LIKE AUFK-USER7,
         USER8 LIKE AUFK-USER8,
         ABKRS LIKE AUFK-ABKRS,
         USER9 LIKE AUFK-USER9,
         PERIO LIKE COEP-PERIO,
         AUFNR LIKE AUFK-AUFNR,
         STR(5) TYPE C,
         WORK(10) TYPE C,
        END OF IT_DISPLAY1.
    data : it_field type slis_fieldcat_alv,        " Declaration of ALV variables
           it_field_t type slis_t_fieldcat_alv,
            xlayout    TYPE slis_layout_alv.
    data : it_event type slis_t_event,
          wa_event like line of it_event.
    DATA : WA_TOP TYPE SLIS_LISTHEADER,
           IT_TOP TYPE SLIS_T_LISTHEADER.
    data:w_lines type i,
          w_occurs type i,
          STR(5) TYPE C,
          WORK(10) TYPE C.
          constants : c_selection type char20 value 'Selection based on'. " Declaration of a constant.
    selection-screen BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS S_BUKRS FOR AUFK-BUKRS OBLIGATORY.
    SELECT-OPTIONS S_OBJNR FOR AUFK-AUFNR.
    SELECT-OPTIONS S_ANF FOR AUFK-ANFAUFNR.
    SELECT-OPTIONS S_AUFEX FOR AUFK-AUFEX.
    SELECT-OPTIONS S_USER2 FOR AUFK-USER2.
    SELECT-OPTIONS S_USER0 FOR AUFK-USER0.
    SELECT-OPTIONS S_USER1 FOR AUFK-USER1.
    SELECT-OPTIONS S_USER3 FOR AUFK-USER3.
    SELECT-OPTIONS S_USER6 FOR AUFK-USER6.
    SELECT-OPTIONS S_ABKRS FOR AUFK-ABKRS.
    SELECT-options s_gjahr for coep-gjahr obligatory.
    SELECT-OPTIONS S_PERIO FOR COEP-PERIO OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK BLK .
    SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : ONSITE RADIOBUTTON GROUP RADI.
    PARAMETERS : OFFSHORE RADIOBUTTON GROUP RADI.
    PARAMETERS : BOTH RADIOBUTTON GROUP RADI.
    SELECTION-SCREEN END OF BLOCK BLK1 .
    start-of-selection.
    *ZAUFK
                                  " Selection of records from aufk to internal table.
    IF ONSITE EQ 'X' .
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN s_anf AND
    aufex in s_aufex and
    aufnr IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS AND
    USER9 EQ 'X' .
    ENDIF.
    IF OFFSHORE EQ 'X'.
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN S_anf AND
    aufex in s_aufex and
    aufnR IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS AND
    USER9 <> 'X'.
    ENDIF.
    IF BOTH EQ 'X'.
    SELECT
    BUKRS
    KOKRS
    OBJNR
    KTEXT
    anfaufnr
    aufex
    USER2
    USER0
    USER1
    USER3
    USER6
    USER7
    USER8
    ABKRS
    USER9
    AUFNR
    FROM AUFK INTO TABLE IT_AUFK WHERE BUKRS IN S_BUKRS AND
    anfaufnr IN S_anf AND
    aufex in s_aufex and
    aufNR IN S_OBJNR AND
    USER2 IN S_USER2 AND
    USER0 IN S_USER0 AND
    USER1 IN S_USER1 AND
    USER3 IN S_USER3 AND
    USER6 IN S_USER6 AND
    ABKRS IN S_ABKRS.
    ENDIF.
    *&  Include           ZCOEP
                                  " Selection of records from coep to internal table.
    SELECT BUKRS KOKRS gjahr kstar OBJNR OBJNR_N1 PERIO  BEKNZ WKGBTR WOGBTR  FROM
    COEP  INTO TABLE
    IT_COEP FOR ALL ENTRIES IN IT_AUFK WHERE OBJNR = IT_AUFK-OBJNR and
    perio in S_PERIO.
    *&  Include           ZPROFIT_CALC
                                 " Calculations for income and Profit of the employee.
    if not it_coep[] is initial.
        select objnr gjahr wrttp versn kstar from cosp into TABLE It_cosp for
    all entries in it_coep where objnr = IT_COEP-objnr .
    endif.
      LOOP AT IT_coep INTO WA_coep.
        read table IT_aufk into WA_aufk with key OBJNR = wa_coep-OBJNR.
    case it_cosp-kstar.
    when '3000200'.
    it_cosp-kstar = cosp-kstar.
    when '3100040'.
    it_cosp-kstar = cosp-kstar.
    when '3100360'.
    it_cosp-kstar = cosp-kstar.
    when '3100055'.
    it_cosp-kstar = cosp-kstar.
    when '3100065'.
    it_cosp-kstar = cosp-kstar.
    when '3100115'.
    it_cosp-kstar = cosp-kstar.
    when '3100120'.
    it_cosp-kstar = cosp-kstar.
    when '3100130'.
    it_cosp-kstar = cosp-kstar.
    when '3100135'.
    it_cosp-kstar = cosp-kstar.
    when '3100140'.
    it_cosp-kstar = cosp-kstar.
    when '3100145'.
    it_cosp-kstar = cosp-kstar.
    when '3100150'.
    it_cosp-kstar = cosp-kstar.
    when '3100155'.
    it_cosp-kstar = cosp-kstar.
    when '3100160'.
    it_cosp-kstar = cosp-kstar.
    when '3100165'.
    it_cosp-kstar = cosp-kstar.
    when '3100170'.
    it_cosp-kstar = cosp-kstar.
    endcase.
        IT_DISPLAY-BUKRS = WA_AUFK-BUKRS.
        IT_DISPLAY-anfaufnr = WA_AUFK-anfaufnr.
        it_display-aufex  = wa_aufk-aufex.
        IT_DISPLAY-OBJNR = WA_AUFK-OBJNR.
        IT_DISPLAY-USER2 = WA_AUFK-USER2.
        IT_DISPLAY-USER0 = WA_AUFK-USER0.
        IT_DISPLAY-USER1 = WA_AUFK-USER1.
        IT_DISPLAY-USER3 = WA_AUFK-USER3.
        IT_DISPLAY-USER6 = WA_AUFK-USER6.
        IT_DISPLAY-USER7 = WA_AUFK-USER7.
        IT_DISPLAY-USER8 = WA_AUFK-USER8.
        IT_DISPLAY-ABKRS = WA_AUFK-ABKRS.
        IT_DISPLAY-USER9 = WA_AUFK-USER9.
        IT_DISPLAY-KTEXT1 =  WA_AUFK-KTEXT.
        if WA_AUFK-abkrs = 01.
          IT_DISPLAY-STR = 'TM'.
        ENDIF.
        IF WA_AUFK-ABKRS = 02.
          IT_DISPLAY-STR = 'FP'.
        ENDIF.
        IF WA_AUFK-USER9 = 'X'.
          IT_DISPLAY-WORK = 'ONSITE'.
        ENDIF.
        IF WA_AUFK-USER9 <> 'X'.
          IT_DISPLAY-WORK = 'OFFSHORE'.
        ENDIF.
        it_display-ABKRS = it_display-user7.
        IF wa_coep-BEKNZ = 'S'.
          IT_DISPLAY-WKGBTR = WA_COEP-WKGBTR.
          IT_DISPLAY-WOGBTR = WA_COEP-WOGBTR.
          IT_DISPLAY-ADDK = IT_DISPLAY-ADDK + IT_DISPLAY-WKGBTR.
          IT_DISPLAY-ADDO = IT_DISPLAY-ADDO + IT_DISPLAY-WOGBTR.
          IT_DISPLAY-ADDK1 = 0.
          IT_DISPLAY-ADDO1 = 0.
          IT_DISPLAY-PROFIT1 = IT_DISPLAY-ADDK1 +  IT_DISPLAY-ADDK.
          IT_DISPLAY-PROFIT2 = IT_DISPLAY-ADDO1 +  IT_DISPLAY-ADDO.
          APPEND IT_DISPLAY.
        ENDIF.
        IF WA_COEP-BEKNZ = 'H'.
          IT_DISPLAY-WKGBTR1 = WA_COEP-WKGBTR.
          IT_DISPLAY-WOGBTR1 = WA_COEP-WOGBTR.
          IT_DISPLAY-ADDK1 = IT_DISPLAY-ADDK + IT_DISPLAY-WKGBTR1.
          IT_DISPLAY-ADDO1 = IT_DISPLAY-ADDO + IT_DISPLAY-WOGBTR1.
          IT_DISPLAY-ADDK = 0.
          IT_DISPLAY-ADDO = 0.
          IT_DISPLAY-PROFIT1 = IT_DISPLAY-ADDK1 +  IT_DISPLAY-ADDK.
          IT_DISPLAY-PROFIT2 = IT_DISPLAY-ADDO1 +  IT_DISPLAY-ADDO.
          APPEND IT_DISPLAY.
        ENDIF.
        collect it_display into it_display1.
        clear it_display.
      ENDLOOP.
                        "calc
    *&  Include           ZPROFIT_DISPLAY
      LOOP AT IT_DISPLAY1.                                         "it_display.
        read table IT_COEP into WA_COEP with key OBJNR =
        IT_DISPLAY-OBJNR.
        read table IT_AUFK into WA_AUFK with key aufnr = IT_DISPLAY-aufnr.
        if WA_AUFK-abkrs = 01.
          STR = 'TM'.
        ENDIF.
        IF WA_AUFK-ABKRS = 02.
          STR = 'FP'.
        ENDIF.
        IF WA_AUFK-USER9 = 'X'.
          WORK = 'ONSITE'.
        ENDIF.
        IF WA_AUFK-USER9 <> 'X'.
          WORK = 'OFFSHORE'.
        ENDIF.
      endloop.
      clear it_field.
      it_field-col_pos = 1.
      it_field-fieldname = 'AUFNR'.
      it_field-seltext_l = 'project id.'.
      it_field-outputlen = 15.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 2.
      it_field-fieldname = 'KTEXT1'.
      it_field-seltext_l = 'Project Name'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 3.
      it_field-fieldname = 'USER7'.
      it_field-seltext_l = 'Start Date'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 4.
      it_field-fieldname = 'USER8'.
      it_field-seltext_l = 'End Date'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 5.
      it_field-fieldname = 'USER2'.
      it_field-seltext_l = 'Location'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      clear it_field.
      it_field-col_pos = 6.
      it_field-fieldname = 'USER0'.
      it_field-seltext_l = 'Vertical'.
      it_field-do_sum = 'X'.
      it_field-outputlen = 20.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 7.
      it_field-fieldname = 'USER1'.
      it_field-seltext_l = 'Sub_vertical'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 8.
      it_field-fieldname = 'USER3'.
      it_field-seltext_l = 'Technology'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 9.
      it_field-fieldname = 'USER6'.
      it_field-seltext_l = 'Department'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 10.
      it_field-fieldname = 'WORK'.
      it_field-seltext_l = 'Onsite/Offshore'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 11.
      it_field-fieldname = 'STR'.
      it_field-seltext_l = 'T&M/FP'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 12.
      it_field-fieldname = 'KOSTL'.
      it_field-seltext_l = 'EMP COST'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 13.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'STAFF WELFARE'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 14.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'RECRUITMENT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 15.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'TRAVELS'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 16.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'SUBCONTRACT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 17.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'COMMUNICATION'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 18.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'RENT'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 19.
      it_field-fieldname = 'KSTAR'.
      it_field-seltext_l = 'BACKEND COST (PROJECT EXP)'.
      it_field-outputlen = 10.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
    it_field-col_pos = 20.
      it_field-fieldname = 'ADDO'.
      it_field-seltext_l = 'Direct costs'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 21.
      it_field-fieldname = 'ADDO1'.
      it_field-seltext_l = 'Income'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 22.
      it_field-fieldname = 'PROFIT2'.
      it_field-seltext_l = 'Profit(income-costs)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 23.
      it_field-fieldname = 'ADDK'.
      it_field-seltext_l = 'Direct costs(Grp cur)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 24.
      it_field-fieldname = 'ADDK1'.
      it_field-seltext_l = 'Income(Grp Cur)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      it_field-col_pos = 25.
      it_field-fieldname = 'PROFIT1'.
      it_field-seltext_l = 'Profit(income-costs)'.
      it_field-outputlen = 20.
      it_field-do_sum = 'X'.
      append it_field to it_field_t.
      CLEAR it_field.
      xlayout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = 'ZPROJECT_PROFIT1'
      I_CALLBACK_PF_STATUS_SET          = ' '
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE_PROFIT'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
         IS_LAYOUT                         = xlayout
         IT_FIELDCAT                       =  it_field_t
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
       TABLES
          T_OUTTAB                          = IT_DISPLAY1
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      clear it_field_t.
      "it_display.
    FORM USER_COMMAND using r_ucomm like sy-ucomm rs type slis_selfield.
      include zinteractive_profit."Secondary list for calling KO03.
    ENDFORM.                    "USER_COMMAND.
    Thanks & Regards,
    Lakshmi..

    Hi,
    i did according to ur suggession.
    now it is going dump.
    and it is telling like this.
    2629               i_event_name      = 'SUBTOTAL_TEXT'
    2630               is_subtottxt_info = ls_subtot_info
    2631               ip_subtot_line    = lr_data
    2632             changing
    2633               c_subtottxt       = l_subtottxt.
    2634           ls_lvc_data-value = l_subtottxt.
    2635
    2636           append ls_lvc_data to ct_lvc_data.
    2637         endif.
    2638
    2639 ************************************
    2640 * Column per Fieldcat Entry
    2641 ************************************
    2642         clear ls_lvc_data-style.
    2643         loop at it_fcat_local assigning <ls_fcat>
    2644                 where tech ne 'X' and no_out ne 'X'.
    2645           if l_invisible eq 'X'.
    2646             clear l_invisible.
    2647             if <ls_fcat>-do_sum is initial.
    2648               continue.
    2649             else.
    2650               clear ls_lvc_data-col_pos.
    2651             endif.
    2652           endif.
    2653
    2654           add 1 to ls_lvc_data-col_pos.
    2655
    2656           assign component <ls_fcat>-fieldname
    2657                            of structure <ls_data> to <l_field_val
    2658           if sy-subrc ne 0.
    >>>>>             message x000(0k).
    2660           endif.
    2661
    2662 *... work on average
    2663           if <ls_fcat>-do_sum eq 'C'.
    2664             clear l_entries.
    2665
    2666             assign space to <l_unit>.
    2667             if not <ls_fcat>-cfieldname is initial.
    2668               assign component <ls_fcat>-cfieldname
    2669                      of structure <ls_data> to <l_unit>.
    2670             endif.
    2671             if not <ls_fcat>-qfieldname is initial.
    2672               assign component <ls_fcat>-qfieldname
    2673                      of structure <ls_data> to <l_unit>.
    2674             endif.
    2675
    2676             l_from = ls_grpl-index_from.
    2677             l_to   = ls_grpl-index_to.
    2678             if ls_grpl-index_from is initial and
    plz any of u help me to come out with solution.
    Thanks & Regards,
    Lakshmi..

  • Reseting page number in Word RTF template for BI Publisher PDF generation

    Hi!
    Apex 4.0.2, Oracle 10.2.0.4, BIP 10.2
    Bills are created based on Word RTF file with BI Publisher. Reszulting file is one big PDF file, which has many pages.
    Word RTF template is grouped on BILLS.ID field with page break option. So one BILLS.ID may have one or many pages (according data).
    How to create RTF template (for PDF BI Publisher generation) with reseting page numbers when grouping value change.
    Page numbers are in footer in format
    curr_group_page/total_group_pages
    where:
    curr_group_page is current page number in group (defined with BILLS.ID field),
    total_group_pages is total page number of pages in group (defined with BILLS.ID field).
    I need to reset numbering whenever BILLS.ID (group) change.
    Example:
    ID=1 (4 pages)
    1/4, 2/4, 3/4, 4/4
    ID=2 (1 pages)
    1/1
    ID=3 (2 pages)
    1/2, 2/2
    ID=4 (3 pages)
    1/3, 2/3, 3/3
    etc.
    How to achieve that kind of numbering?
    Any help appreciated.
    Regards,
    Damir Vadas
    Edited by: Damir Vadas on May 16, 2011 12:49 PM

    Simple question.. Does your posting deal with an APEX issue or a BI Publisher issue? The posting you have deals with the RTF add-on for Word that builds report layouts for BI Publisher. I suggested in my response that you move it to a more relevant forum..
    If you feel that me alerting you to the fact your are VIOLATING forum policy is an issue, please feel free to ask others their view.. (posting to a 3 year old closed thread, creating MULTIPLE threads for a single issue..) You do NOT seem to get the idea that posting this in the Bi Publisher support forum would probably get you a BETTER response than here.. Asking pl/sql questions here will also get people to refer your questions to the PL/Sql Support forum..
    Also, here is a POSSIBLE answer from the BI Publisher Forum: http://forums.oracle.com/forums/thread.jspa?threadID=594805
    This Is The APEX SUPPORT forum, we deal with SUPPORT questions on APEX (Application Express)..
    Thank you,
    Tony Miller
    Webster, TX
    You know, I used to think that it was awful that life was so unfair. Then I thought, wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? So, now I take great comfort in the general hostility and unfairness of the universe.
    If this question is answered, please mark the thread as closed and assign points where earned..

  • Creating Parameters in RTF Template for BI Publisher Report

    hi,
    I have created Parameters in my BI Publisher Report and in SQL query. But i need to create same parameters in RTF Template , so that when i publish this report in dashboard , parameters will be visible. Can you please tell me how to create Parameters in RTF Template for BI Publisher Report ? I am not finding option. Please let me know .
    Thanks in advance
    Gayathri.

    all the parameter's value will be there in your xml .
    just you need to add parameter heading and corresponding xml tag name to get the parameter value on the report.
    if u dont have you can try like below
    https://blogs.oracle.com/xmlpublisher/entry/get_your_parameters_here_guv
    Declare Parameter in RTF Template
    Before you use the parameter in the RTF template file you need to declare it first. You can do so by having the following syntax.
    <?param@begin:%parameter_name%?>
    Note: where %parameter_name% is the parameter name that you have created at the BI Publisher Server UI.
    Here is an example:
    <?param@begin:param1?>
    Use it in RTF Template!
    Once it’s declared in the RTF template you can start using it as the same way you use the variable. You need to just add ‘$’ prefix in front of the parameter name. Here is the example:
    <?$param1?>
    The above example would print the parameter value in the report output. If you want to use this value in your condition or calculation you can simply use it as ‘$param1’. Yes, it’s that simple.
    If you are not sure if and how the parameter values are passed to the report when you run the report you can use this command in your RTF template, which will return all the parameter values passed to the RTF template at the runtime.
    <?xdoxslt:getXDOProperties($_XDOCTX)?>
    http://kirti-bi-solutions.blogspot.com/2009/06/passing-parameters-from-obiee.html

  • Fix Cheque position in RTF Templates for AP Payments R12

    Hi,
    I created rtf template for check printing. I have to print invoices details first and after that check at the bottom of the page. I need to print invoices on the cheque page only when total invoice count < = 3 which I am able to control. I am facing issue when for 3 invoices the table height is variable, depends on invoice description this table size is changing. How I can give the fixed-height for invoice table or how I can specify exact place for check (at the bottom of each page )
    Thanks
    Mital

    Hi Prakhar,
    Please note the cheque is not an image its in a table.
    Even if I fix a table using table positioning in the output it doesnot print at the fixed position which I have provided in my RTF.
    Please let me know if you would want to see the sample XML Data and RTF that I have created which can be easier to debug.
    Thanks for your help,
    Mital

  • Help with trying to locate Illustrator templates for CS version 1

    I'm trying to locate a copy of the templates that were issued as part of Illustrator CS version 1. Specifically, I'm looking for a file by the name of "flyer3.ait". I would, ideally, like to access all of the templates for CS, version 1, because I am reading the Adobe Illustrator CS, Idea Kit book by Jerome Holder & Barbara Mulligan. and they use these templates as starter files for their book. Thank you in advance.

    I really doubt that you are going to find them unless someone has a version of CS1 installed somewhere on an old machine. In the newer versions the template files are in a folder called Cool Extras which may or may not have been installed. Installation of this folder was an option in the newer versions. In AICS3, there is a template called flyer.ait in the above folder.

  • How do I create my own favorite template for DVD slideshows? I used to be able to select this from pulldown menu, but cannot now do so. I am directed straight to templates, which take more memory. I have a large slideshow, and need all the space I can get

    First, how do I create my own favorite theme template for DVD slideshows? I used to be able to select this from pulldown menu, but cannot now do so. I am directed straight to already existing themes, which take more memory. I have a large slideshow, and need all the space I can get. I just want to use a picture as my DVD cover, and then insert a slideshow. Also, when I try to burn my 8.5gb double sided slideshow, all that burns is the music. It is a large slideshow, a memorial on the life of my now deceased brother. This means a lot to me and to my family, and I am having so much trouble trying to burn it. I have gone into Project View and selected appropriately. The bar shows I have room to burn this DVD, but it does not burn.  I have burned so many DVDs in the past, but this one just will not burn. I am so confused at this point. I will say this is the first 8.5gb I have attempted to create and burn. My specs list a 7.7gb or 4.7gb as operable....but there are no 7.7gb dvds. I had to purchase 8.5gb. Help? What am I doing wrong? I have spent so much time on this, and just cannot figure it out.

    Final Cut is a separate, higher end video editor.  The pro version of iMovie.
    Give iPhoto a look at for creating the slideshow.  It's easy to assemble the photos in an album in iPhoto, put them in the order you want and then make a slideshow of them.  You can select from various themes and transitions between slides and add music from your iTunes library.
    When you have the slidshow as you want use the Export button at the bottom of the iPhoto window and export with Size = Medium or Large.
    Save the resulting Quicktime movie file in your Movies folder.
    Next, open iDVD, choose your theme and drag the QT movie file into the menu window being careful to avoid any drop zones.
    Then follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    The reason I suggest iPhoto is that I find it much easier to use than iMovie (except for the older iMovie 6 HD version).  Personal preferences showing here.

  • Creating your own theme-templates for printing?

    Can I create my own theme-templates for printing?
    /BonneSwe

    No, iTunes printing is quite simple and only works off it's own templates. If you want to customise templates you'd be better advised to look at on of the specialised cover printing programs that are available. DiskLabel is one that springs to mind.

  • User Interface Template for Interactive Report Region

    In 3.2, where do we set the user interface template for Interactive Reports region?
    No matter what out of the box theme I switch to, the Interactive Reports region shows the same. What and where do I change the template so that alternating rows use two different colors?

    There is no template for Interactive Reports like for a "normal" report. You need to modify the CSS and supply your own for this to happen.
    I believe most things are tagged with #apexir - firebug with Firebox is invaluable. This thread may help:
    Re: changing the look and feel of interactive report.

  • #REGION_STATIC_ID# does not work in report template for PPR

    I was hoping to use the new substitution string #REGION_STATIC_ID# for a PPR report, because when we do Export/Import of the app the Region ID changes and we have to manually change the Pager Header Javascript to get the PPR to work. A real pain.
    So I changed the Region template to use #REGION_STATIC_ID# and set the Static id in the region definition - this worked fine. Next, I modified the Report template for PPR to use #REGION_STATIC_ID#, but at runtime this resolves to a blank! I assumed it would pick up the static ID for the region it was in. Is this a bug or am I just not understanding the way it is supposed to work?
    Regards,
    Steve

    Hello,
    #REGION_STATIC_ID# is available in some places in the report template. But the PPR javascript uses the APEX engine created ID get into the fast track report engine so it's not going to work that way.
    But you can still do what you want to do what you want to do. Use the #REGION_STATIC_ID# in your region say something like this #REGION_STATIC_ID#_body the use the javascript to get that element and then use that element
    along with getElementsByClass(searchClass,node,tag)
    http://apex.oracle.com/pls/otn/f?p=38704:2:::NO::P2_ID1:22
    to grab the report table and then it's ID which you can then feed into your javascript. It will only be 2-3 more lines of javascript.
    Carl

Maybe you are looking for

  • SAP GUI Compatibility issue with Windows 2008R2 64 Bit

    Hi Gurus Is anyone experienced connectivity issue with SAP GUI (32bit)  on Windows 2008R2 64bit? Except base version of 7.3 every Service Pack failing to connect, Strange thing was it was working with SP5 in WINDOWS 7 64bit. Your inputs greatly appre

  • Library acting strange in CS4?

    I've been wondering why items in my library disappear occasionally - including the library buttons and column headers! For anyone else's information, I've narrowed the problem down to a CS4 bug. Steps to reproduce bug: 1.Create a MovieClip 2. Select

  • External sounds quit working

    I have reseached this and find that many have asked questions about sounds on their Ipod touch.  My 8G external sound has quitl.  I just downloaded the latest update and now I have no sound when I type, unlock or play games.  I do have sound using he

  • How to preview mail??

    If I scroll down my emails (titles) in inbox i would like to preview the content of the email in a separate window which will always show the content of the selected mail. Currently I have to click each title to open the email in a new window which i

  • Can i have 2 screens go Full screen

    I am trying to get my second screen to go full screen as well when running full screen apps. Can this be done?