Examples of Z reports?

Hello All,
Can anybody provide any examples of Z reports that they have created in their past exp? FI or FI-MM?
I need to know the scenario under which the report had to be prepared (meaning why did you take a step of going for the z report as against the std report/report painter) ??
Any input is highly appreciated.
Thanks a ton!
Jyoti

HI,
There can be various scenario when the business need the custom report againest the standard report, e.g.:-
(1) The selection screen of the standard report does not have the sufficient creterias available.
(2) The output data of the report does not have data required by the business.
(3) The presentation format of the report is not in line with the business format
(4) The user needed to be restricted for some variant of the transaction
(5) A new functionality not provided by SAP to be introduced
(6) The standard functionality is to be modified to meet any business or legal requirement.
There can be more scenarios in rela life, which you will see in your future experience with SAP.
Regards,
Gaurav

Similar Messages

  • Example of appraisals report

    Hi can anyone give me example of appraisals report? with real-time scenario?
    Thanks and points will be rewarded for all helpful answers.

    Hi
    Thereis  one Transaction Code which compares the Appraisal in Part and Final..  It means you have to run the Report twice for Part and Final status. You have the option of Downloading into Excel file or directly printing as Smartform output.
    So the T-Code is code :PHAP_SEARCH_PA.[/code]
    Hope this will solve your problem and fetch good points to me.

  • Simple example of alv report.

    hi.
    can anyone have simple example of ALV report?

    Hi Puru,
    Check out this simple ALV report,
    TABLES : vbak,vbap.
    TYPE-POOLS : slis.
    DATA:  repid                LIKE sy-repid,                             "Report ID
               is_layout            TYPE slis_layout_alv,                      "Layout For ALV
               it_fieldcat          TYPE slis_t_fieldcat_alv,                  "ITAB for field
               it_events            TYPE slis_t_event,                         "ITAB for event
               it_sub               TYPE slis_layout_alv_spec1,                "subtotals
               i_header             TYPE slis_t_listheader,                    "Itab for listheader
               lt_sort              TYPE  slis_t_sortinfo_alv,                 "itab for sorting
               wa_sort              LIKE LINE OF lt_sort."  slis_t_sortinfo_alv.
    DATA : BEGIN OF itab OCCURS 0,
                   vbeln LIKE vbak-vbeln,
                   erdat LIKE vbak-erdat,
                   kunag LIKE vbak-kunnr,
                  ernam LIKE vbak-ernam,
              END OF itab.
    DATA : BEGIN OF it_disp OCCURS 0,
                vbeln LIKE vbak-vbeln,
                erdat LIKE vbak-erdat,
                kunag LIKE vbak-kunnr,
                ernam LIKE vbak-ernam,
                posnr LIKE vbap-posnr,
                matnr LIKE vbap-matnr,
             END OF it_disp.
    ****selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    SELECT-OPTIONS : s_vbeln FOR vbak-vbeln,
                                   s_date FOR vbak-erdat.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM modify_data.
      PERFORM disp_data  .
    END-OF-SELECTION.
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_data .
      SELECT avbeln aerdat akunnr aernam bposnr bmatnr
             INTO TABLE it_disp FROM vbak AS a
             INNER JOIN vbap AS b ON
             avbeln = bvbeln
             WHERE a~vbeln IN s_vbeln.
    ENDFORM.                    " get_data
    *&      Form  modify_data
          text
    -->  p1        text
    <--  p2        text
    FORM modify_data .
      MOVE-CORRESPONDING itab TO it_disp.
      APPEND it_disp.
      CLEAR it_disp.
    ENDFORM.                    " modify_data
    *&      Form  Disp_data
          text
    -->  p1        text
    <--  p2        text
    FORM disp_data .
      PERFORM fill_layout_structure.
      PERFORM fill_field_catalog_table.
      PERFORM alv_header USING i_header.
      PERFORM call_alv_function.
    ENDFORM.                    " Disp_data
    *&      Form  fill_layout_structure
          text
    -->  p1        text
    <--  p2        text
    FORM fill_layout_structure .
      CLEAR is_layout.
      is_layout-colwidth_optimize = 'X'.
      is_layout-zebra = 'X'.
      is_layout-no_input          = 'X'.
      is_layout-colwidth_optimize = 'X'.
      is_layout-totals_text       = 'Totals'(201).
      is_layout-totals_only        = 'X'.
      is_layout-zebra             = 'X'.
      is_layout-group_change_edit = 'X'.
      is_layout-header_text       = 'helllllo'.
    ENDFORM.                    " fill_layout_structure
    *&      Form  fill_field_catalog_table
          text
    -->  p1        text
    <--  p2        text
    FORM fill_field_catalog_table .
      DATA : gls1(10).
    BREAK-POINT.
      PERFORM fill_field_catalog  USING :
                      'VBELN'             'SALES DOC NO.'  '10'   'IT_FINAL' space    space    'C11'     ' '  ' ',
                      'ERDAT'             'DATE'           '40'   'IT_FINAL' space    space    'C11'     ' '  ' ',
                      'KUNAG'             'CUSTOMER'       '6'    'IT_FINAL' space    space    'C11'     'X '  ' ',
                      'ERNAM'             'NAME'           '20'   'IT_FINAL' space    space    'C11'     'X'  ' ',
                      'POSNR'             'ITEM'           '10'   'IT_FINAL' space    space    'C11'     ' '  ' ',
                      'MATNR'             'MATERIAL'       '20'   'IT_FINAL' space    space    'C11'     ' '  ' '.
    ENDFORM.                    " fill_field_catalog_table
    *&      Form  fill_field_catalog
          text
    FORM fill_field_catalog USING f d l t s z y a b.
      DATA t_fld TYPE slis_fieldcat_alv.
      STATICS pos LIKE sy-index VALUE 0.
      pos = pos + 1.
      CLEAR t_fld.
      MOVE 1 TO   t_fld-row_pos.
      MOVE pos TO t_fld-col_pos.
      MOVE f TO   t_fld-fieldname.
      MOVE d TO   t_fld-seltext_m.
      MOVE l TO   t_fld-outputlen.
      MOVE t TO   t_fld-tabname.
      MOVE s TO   t_fld-do_sum.
      MOVE z TO   t_fld-no_zero.
      MOVE y TO   t_fld-emphasize.
      MOVE a TO   t_fld-no_out.
      MOVE b TO   t_fld-no_sum.
      APPEND t_fld TO it_fieldcat.
    ENDFORM.                    " fill_field_catalog
    *&      Form  alv_header
          text
         -->P_I_HEADER  text
    FORM alv_header  USING    p_i_header.
      DATA: wa_line TYPE slis_listheader.
      CLEAR wa_line.
      wa_line-typ = 'H'.
      wa_line-info = 'Walvoil Fluid Power India Limited'.
      APPEND wa_line TO i_header.
    ENDFORM.                    " alv_header
    *&      Form  call_alv_function
          text
    -->  p1        text
    <--  p2        text
    FORM call_alv_function .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = REPID
       I_CALLBACK_PF_STATUS_SET          = ' '
       IS_LAYOUT                         = IS_LAYOUT
       IT_FIELDCAT                       = IT_FIELDCAT
      TABLES
        t_outtab                          = IT_DISP.
    IF sy-subrc <> 0.
    ENDIF.
    ENDFORM.                    " call_alv_function
    reward it it useful to u,
    Best Wishes,
    regards
    Guna..

  • Can anyone plz send a simple example of interactive reports

    Hi gurus,
    Can anyone plz send a simple example of interactive reports using subscreenswhich contains at line-selection, at user-command, pf and other commands.
    Thanks in advance.

    Hi,
    * Macro definition
    DEFINE m_fieldcat.
      add 1 to ls_fieldcat-col_pos.
      ls_fieldcat-fieldname   = &1.
      ls_fieldcat-ref_tabname = &2.
      ls_fieldcat-cfieldname  = &3.
      ls_fieldcat-qfieldname  = &4.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    TYPES:
      BEGIN OF ty_vbak,
        vkorg TYPE vbak-vkorg,             " Sales organization
        kunnr TYPE vbak-kunnr,             " Sold-to party
        vbeln TYPE vbak-vbeln,             " Sales document
        netwr TYPE vbak-netwr,             " Net Value of the Sales Order
        waerk TYPE vbak-waerk,             " Currency
      END OF ty_vbak,
      BEGIN OF ty_vbap,
        vbeln  TYPE vbap-vbeln,            " Sales document
        posnr  TYPE vbap-posnr,            " Sales document item
        matnr  TYPE vbap-matnr,            " Material number
        arktx  TYPE vbap-arktx,            " Short text for sales order item
        kwmeng TYPE vbap-kwmeng,           " Order quantity
        vrkme  TYPE vbap-vrkme,            " Quantity Unit
        netwr  TYPE vbap-netwr,            " Net value of the order item
        waerk  TYPE vbap-waerk,            " Currency
      END OF ty_vbap.
    DATA :
      gs_vbak TYPE ty_vbak,
    * Data displayed in the first list
      gt_vbak TYPE TABLE OF ty_vbak,
    * Data displayed in the second list
      gt_vbap TYPE TABLE OF ty_vbap.
    SELECT-OPTIONS :
      s_vkorg FOR gs_vbak-vkorg,           " Sales organization
      s_kunnr FOR gs_vbak-kunnr,           " Sold-to party
      s_vbeln FOR gs_vbak-vbeln.           " Sales document
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data_vbak.
      PERFORM f_display_data_vbak.
    *      Form  f_read_data_vbak
    FORM f_read_data_vbak.
      SELECT vkorg kunnr vbeln netwr waerk
        INTO CORRESPONDING FIELDS OF TABLE gt_vbak
          UP TO p_max ROWS
        FROM vbak
       WHERE kunnr IN s_kunnr
         AND vbeln IN s_vbeln
         AND vkorg IN s_vkorg
         and vbtyp = 'C'.                  " C = Sales Orders.
    ENDFORM.                               " F_READ_DATA_VBAK
    *      Form  f_display_data_vbak
    FORM f_display_data_vbak.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    * Build the field catalog
      m_fieldcat 'VKORG' 'VBAK' '' ''.
      m_fieldcat 'KUNNR' 'VBAK' '' ''.
      m_fieldcat 'VBELN' 'VBAK' ''  ''.
      m_fieldcat 'NETWR' 'VBAK' 'WAERK' ''.
      m_fieldcat 'WAERK' 'VBAK' ''  ''.
    * Display the first list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = lt_fieldcat
        TABLES
          t_outtab                = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA_VBAK
    *       FORM USER_COMMAND                                             *
    FORM user_command USING u_ucomm     TYPE syucomm
                            us_selfield TYPE slis_selfield.     "#EC CALLED
      CASE u_ucomm.
        WHEN '&IC1'.
          READ TABLE gt_vbak INDEX us_selfield-tabindex INTO gs_vbak.
          CHECK sy-subrc EQ 0.
          PERFORM f_read_data_vbap.        " Read data from VBAP
          PERFORM f_display_data_vbap.
      ENDCASE.
    ENDFORM.                               " USER_COMMAND
    *      Form  f_read_data_vbap
    FORM f_read_data_vbap.
      SELECT vbeln posnr matnr arktx kwmeng vrkme netwr waerk
        INTO CORRESPONDING FIELDS OF TABLE gt_vbap
        FROM vbap
       WHERE vbeln = gs_vbak-vbeln.
    ENDFORM.                               " F_READ_DATA_VBAP
    *      Form  f_display_data_vbap
    FORM f_display_data_vbap.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    * Build the field catalog
      m_fieldcat 'VBELN'  'VBAP' '' ''.
      m_fieldcat 'POSNR'  'VBAP' '' ''.
      m_fieldcat 'MATNR'  'VBAP' '' ''.
      m_fieldcat 'ARKTX'  'VBAP' '' ''.
      m_fieldcat 'KWMENG' 'VBAP' '' 'VRKME'.
      m_fieldcat 'VRKME'  'VBAP' '' ''.
      m_fieldcat 'NETWR'  'VBAP' 'WAERK' ''.
      m_fieldcat 'WAERK'  'VBAP' '' ''.
    * Display the second list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = gt_vbap.
    ENDFORM.                               " F_DISPLAY_DATA_VBAP
    2nd example
    * Macro definition
    DEFINE m_fieldcat.
      add 1 to ls_fieldcat-col_pos.
      ls_fieldcat-fieldname   = &1.
      ls_fieldcat-ref_tabname = &2.
      append ls_fieldcat to lt_fieldcat.
    END-OF-DEFINITION.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    TYPES:
    * Data displayed in the first list
      BEGIN OF ty_kna1,
        kunnr TYPE kna1-kunnr,             " Customer number
        name1 TYPE kna1-name1,             " Customer name
        ort01 TYPE kna1-ort01,             " Customer city
      END OF ty_kna1,
    * Data displayed in the second list
      BEGIN OF ty_vbak,
        vkorg TYPE vbak-vkorg,             " Sales organization
        kunnr TYPE vbak-kunnr,             " Sold-to party
        vbeln TYPE vbak-vbeln,             " Sales document
        netwr TYPE vbak-netwr,             " Net Value of the Sales Order
      END OF ty_vbak,
    * Data displayed in the third list
      BEGIN OF ty_vbap,
        vbeln  TYPE vbap-vbeln,            " Sales document
        posnr  TYPE vbap-posnr,            " Sales document item
        matnr  TYPE vbap-matnr,            " Material number
        arktx  TYPE vbap-arktx,            " Short text for sales order item
        kwmeng TYPE vbap-kwmeng,           " Order quantity
        netwr  TYPE vbap-netwr,            " Net value of the order item
      END OF ty_vbap.
    DATA:
      gs_kna1 TYPE ty_kna1,
      gt_kna1 TYPE TABLE OF ty_kna1,
      gs_vbak TYPE ty_vbak,
      gt_vbak TYPE TABLE OF ty_vbak,
      gt_vbap TYPE TABLE OF ty_vbap.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data_kna1.
    END-OF-SELECTION.
      PERFORM f_display_data_kna1.
    *      Form  f_read_data_kna1
    FORM f_read_data_kna1.
    * Read customer data with a least one order
      SELECT kunnr name1 ort01 INTO TABLE gt_kna1
               FROM kna1 AS k
                 UP TO p_max ROWS
              WHERE EXISTS
           ( SELECT kunnr FROM vbak WHERE kunnr = k~kunnr ).
    ENDFORM.                               " F_READ_DATA_KNA1
    *      Form  f_display_data_kna1
    FORM f_display_data_kna1.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    * Build the field catalog
      m_fieldcat 'KUNNR' 'KNA1'.
      m_fieldcat 'NAME1' 'KNA1'.
      m_fieldcat 'ORT01' 'KNA1'.
    * Display the first list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND_KNA1'
          it_fieldcat             = lt_fieldcat
        TABLES
          t_outtab                = gt_kna1.
    ENDFORM.                               " F_DISPLAY_DATA_KNA1
    *       FORM USER_COMMAND_KNA1                                        *
    FORM user_command_kna1 USING u_ucomm     TYPE sy-ucomm
                                 us_selfield TYPE slis_selfield."#EC CALLED
      CASE u_ucomm.
        WHEN '&IC1'.
          READ TABLE gt_kna1 INDEX us_selfield-tabindex INTO gs_kna1.
          CHECK sy-subrc EQ 0.
          PERFORM f_read_data_vbak.        " Read data from VBAK
          PERFORM f_display_data_vbak.     " Display orders
      ENDCASE.
    ENDFORM.                               " USER_COMMAND_KNA1
    *      Form  f_read_data_vbak
    FORM f_read_data_vbak.
      SELECT vkorg kunnr vbeln netwr
        INTO TABLE gt_vbak
        FROM vbak
          UP TO p_max ROWS
       WHERE kunnr = gs_kna1-kunnr.
    ENDFORM.                               " F_READ_DATA_VBAK
    *      Form  f_display_data_vbak
    FORM f_display_data_vbak.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    * Build the field catalog
      m_fieldcat 'VKORG' 'VBAK'.
      m_fieldcat 'KUNNR' 'VBAK'.
      m_fieldcat 'VBELN' 'VBAK'.
      m_fieldcat 'NETWR' 'VBAK'.
    * Display the second list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND_VBAK'
          it_fieldcat             = lt_fieldcat
        TABLES
          t_outtab                = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA_VBAK
    *       FORM USER_COMMAND_VBAK                                        *
    FORM user_command_vbak USING u_ucomm     TYPE sy-ucomm
                                 us_selfield TYPE slis_selfield."#EC CALLED
      CASE u_ucomm.
        WHEN '&IC1'.
          READ TABLE gt_vbak INDEX us_selfield-tabindex INTO gs_vbak.
          CHECK sy-subrc EQ 0.
          PERFORM f_read_data_vbap.        " Read data from VBAP
          PERFORM f_display_data_vbap.     " Display items
      ENDCASE.
    ENDFORM.                               " USER_COMMAND_VBAK
    *      Form  f_read_data_vbap
    FORM f_read_data_vbap.
      SELECT vbeln posnr matnr arktx kwmeng netwr
        INTO TABLE gt_vbap
        FROM vbap
       WHERE vbeln = gs_vbak-vbeln.
    ENDFORM.                               " F_READ_DATA_VBAP
    *      Form  f_display_data_vbap
    FORM f_display_data_vbap.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    * Build the field catalog
      m_fieldcat 'VBELN'  'VBAP'.
      m_fieldcat 'POSNR'  'VBAP'.
      m_fieldcat 'MATNR'  'VBAP'.
      m_fieldcat 'ARKTX'  'VBAP'.
      m_fieldcat 'KWMENG' 'VBAP'.
      m_fieldcat 'NETWR'  'VBAP'.
    * Display the third list
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = gt_vbap.
    ENDFORM.                               " F_DISPLAY_DATA_VBAP
    3rd Example
    ** Macro definition*
    *DEFINE m_fieldcat.*
      *add 1 to ls_fieldcat-col_pos.*
      *ls_fieldcat-fieldname   = &1.*
      *ls_fieldcat-ref_tabname = &2.*
      *append ls_fieldcat to lt_fieldcat.*
    *END-OF-DEFINITION.*
    *CONSTANTS :*
      *c_x VALUE 'X'.*
    *TYPE-POOLS: slis.                      " ALV Global types*
    *TYPES:*
    ** Data displayed in the first list*
      *BEGIN OF ty_vbak,*
        *vkorg TYPE vbak-vkorg,             " Sales organization*
        *kunnr TYPE vbak-kunnr,             " Sold-to party*
        *vbeln TYPE vbak-vbeln,             " Sales document*
        *netwr TYPE vbak-netwr,             " Net Value of the Sales Order*
      *END OF ty_vbak,*
    ** Data displayed in the popup list*
      *BEGIN OF ty_vbap,*
        *posnr  TYPE vbap-posnr,            " Sales document item*
        *matnr  TYPE vbap-matnr,            " Material number*
        *arktx  TYPE vbap-arktx,            " Short text for sales order item*
        *kwmeng TYPE vbap-kwmeng,           " Order quantity*
        *netwr  TYPE vbap-netwr,            " Net value of the order item*
      *END OF ty_vbap.*
    *DATA :*
      *g_vkorg TYPE vbak-vkorg,*
      *g_kunnr TYPE vbak-kunnr,*
      *g_vbeln TYPE vbak-vbeln,*
      *gt_vbak TYPE TABLE OF ty_vbak,*
      *gt_vbap TYPE TABLE OF ty_vbap.*
    *SELECT-OPTIONS :*
      *s_vkorg FOR g_vkorg,                 " Sales organization*
      *s_kunnr FOR g_kunnr,                 " Sold-to party*
      *s_vbeln FOR g_vbeln.                 " Sales document*
    *SELECTION-SCREEN :*
      *SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.    "#EC NEEDED*
    *PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.*
    *SELECTION-SCREEN END OF LINE.*
    *INITIALIZATION.*
      *v_1 = 'Maximum of records to read'.*
    *START-OF-SELECTION.*
      *PERFORM f_read_data_vbak.*
      *PERFORM f_display_data_vbak.*
    **      Form  f_read_data_vbak*
    *FORM f_read_data_vbak.*
      *SELECT vkorg kunnr vbeln netwr*
        *INTO TABLE gt_vbak*
        *FROM vbak*
          *UP TO p_max ROWS*
       *WHERE kunnr IN s_kunnr*
         *AND vbeln IN s_vbeln*
         *AND vkorg IN s_vkorg.*
    *ENDFORM.                               " F_READ_DATA_VBAK*
    **      Form  f_display_data_vbak*
    *FORM f_display_data_vbak.*
      *DATA:*
        *ls_fieldcat TYPE slis_fieldcat_alv,*
        *lt_fieldcat TYPE slis_t_fieldcat_alv.*
    ** Build the field catalog*
      *m_fieldcat 'VKORG' 'VBAK'.*
      *m_fieldcat 'KUNNR' 'VBAK'.*
      *m_fieldcat 'VBELN' 'VBAK'.*
      *m_fieldcat 'NETWR' 'VBAK'.*
    ** Display the first list*
      *CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'*
        *EXPORTING*
          *i_callback_program      = sy-cprog*
          *i_callback_user_command = 'USER_COMMAND'*
          *it_fieldcat             = lt_fieldcat*
        *TABLES*
          *t_outtab                = gt_vbak.*
    *ENDFORM.                               " F_DISPLAY_DATA_VBAK*
    **       FORM USER_COMMAND                                             **
    *FORM user_command USING u_ucomm     TYPE sy-ucomm*
                            *us_selfield TYPE slis_selfield.     "#EC CALLED*
      *DATA:*
        *ls_vbak TYPE ty_vbak.*
      *CASE u_ucomm.*
        *WHEN '&IC1'.*
          *READ TABLE gt_vbak INDEX us_selfield-tabindex INTO ls_vbak.*
          *CHECK sy-subrc EQ 0.*
          *PERFORM f_read_data_vbap         " Read data from VBAP*
            *USING ls_vbak-vbeln.*
          *PERFORM f_display_data_vbap.*
      *ENDCASE.*
    *ENDFORM.                               " USER_COMMAND*
    **      Form  f_read_data_vbap*
    *FORM f_read_data_vbap USING u_vbeln TYPE vbeln_va.*
      *SELECT posnr matnr arktx kwmeng netwr*
        *INTO TABLE gt_vbap*
        *FROM vbap*
       *WHERE vbeln = u_vbeln.*
    *ENDFORM.                               " F_READ_DATA_VBAP*
    **      Form  f_display_data_vbap*
    *FORM f_display_data_vbap.*
      *DATA:*
        *ls_private  TYPE slis_data_caller_exit,*
        *ls_fieldcat TYPE slis_fieldcat_alv,*
        *lt_fieldcat TYPE slis_t_fieldcat_alv.*
    ** Build the field catalog*
      *m_fieldcat 'POSNR'  'VBAP'.*
      *m_fieldcat 'MATNR'  'VBAP'.*
      *m_fieldcat 'ARKTX'  'VBAP'.*
      *m_fieldcat 'KWMENG' 'VBAP'.*
      *m_fieldcat 'NETWR'  'VBAP'.*
      *ls_private-columnopt = c_x.          " Optimize width*
    ** Display items in a POPUP*
      *CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'*
        *EXPORTING*
          *i_selection = ' '*
          *i_tabname   = 'GT_VBAP'*
          *it_fieldcat = lt_fieldcat*
          *is_private  = ls_private*
        *TABLES*
          *t_outtab    = gt_vbap.*
    *ENDFORM.                               " F_DISPLAY_DATA_VBAP*
    ***************** END OF PROGRAM Z_ALV_GRID_AND_POPUP *******************
    reward if helpful
    raam

  • Example "sample test report" doesn't run - Error -1073741819

    I am trying to run the "Sample Test Report.vi" example in a totally unmodified version. I receive the message
    "Unknown System Error in Font Style.vi->Set Report Font.vi->Sample Test Report.vi"
    I have some trouble finding where the error occurs exactly. Any ideas?
    Best regards
    Matthias
    Attachments:
    Sample_Test_Report_-_Error.PDF ‏67 KB

    Hi Matthias
    Check this knowledgebase:
    http://digital.ni.com/public.nsf/websearch/5A42F1725790DFBC86256B900075F884?OpenDocument
    Hope this helps
    Luca
    Regards,
    Luca

  • Example Named Column Report Layout?

    Howdy,
    Using APEX 3.1.2, I've successfully setup and tested Apache FOP for a print server. I'm hoping to create a multi-line report layout to emulate the MS Access (of Evil) one this app is replacing, but I'm having trouble getting started.
    It seems that I need to create a Named Column report layout. I've been scouring this forum, the web, and even the new Pro APEX book to find an example of the contents of even the simplest of these XSL-FO files, but I can't find one anywhere. Granted, a little XSL-FO experience would help here, but I can't seem to glean enough from the web to put the pieces together, at least as it applies to APEX. It seems that the examples I do find contain static data, whereas it looks like I should be creating a template form for APEX to populate for passing onto the FOP engine.
    Does anyone have a simple two-column layout they'd be willing to share? Or a good weblink?
    TIA!
    Rich

    Hi Rich,
    This is an example we use in our training:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:fox="http://xml.apache.org/fop/extensions" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" extension-element-prefixes="saxon" >
    <xsl:template match="DOCUMENT">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
    <fo:simple-page-master master-name="pagemaster1" page-height="845.0pt" page-width="598.0pt" margin-top="10.0pt" margin-left="10.0pt" margin-bottom="10.0pt" margin-right="10.0pt">
    <fo:region-body margin-left="28.0pt" margin-top="28.0pt" margin-bottom="28.0pt" margin-right="28.0pt"/>
    <fo:region-before extent="28.0pt" precedence="true"/>
    <fo:region-after extent="28.0pt" precedence="true"/>
    <fo:region-start extent="28.0pt" precedence="false"/>
    <fo:region-end extent="28.0pt" precedence="false"/>
    </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-name="pagemaster1" master-reference="pagemaster1">
    <xsl:attribute name="force-page-count">no-force</xsl:attribute>
    <fo:static-content flow-name="xsl-region-before">
    <fo:block-container position="absolute" top="3.0pt" left="357.0pt" height="25.0pt" width="216.0pt">
    <fo:block line-height="14.399999999999999pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" position="relative" top="3.0pt" left="357.0pt" height="25.0pt" width="216.0pt" color="#000000" font-family="Arial" font-size="12.0pt" font-style="italic">
    <fo:block text-align="left" white-space-collapse="false"  linefeed-treatment="preserve" >
    <fo:inline>
    <xsl:text>Report ran by: </xsl:text></fo:inline>
    <fo:inline>
    <xsl:value-of disable-output-escaping="no" select="USER_NAME"/>
    </fo:inline>
    </fo:block>
    </fo:block>
    </fo:block-container>
    </fo:static-content>
    <fo:static-content flow-name="xsl-region-after"/>
    <fo:static-content flow-name="xsl-region-start"/>
    <fo:static-content flow-name="xsl-region-end"/>
    <fo:flow flow-name="xsl-region-body">
    <fo:block/>
    <fo:block-container position="absolute" top="4pt" left="2pt" height="752.0pt" width="536.0pt" border-width="1.0pt"> <fo:block span="none" white-space-collapse="false" font-family="Helvetica" font-size="12pt" text-align="start" position="relative" top="44pt" left="27pt" height="752.0pt" width="536.0pt"><fo:instream-foreign-object xmlns:xlink="http://www.w3.org/1999/xlink"></fo:instream-foreign-object></fo:block></fo:block-container><fo:block span="none"><!-- GENERATE TABLE START-->
    <fo:table table-layout="fixed">
    <fo:table-column column-width="80.0pt"/>
    <fo:table-column column-width="80.0pt"/>
    <fo:table-column column-width="80.0pt"/>
    <fo:table-column column-width="80.0pt"/>
    <fo:table-body>
    <fo:table-row>
    <fo:table-cell display-align="before" background-color="#cccccc">
    <fo:block line-height="19.2pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" background-color="#cccccc" color="#000000" font-family="Arial" font-size="16.0pt" font-weight="bold">
    <xsl:text>Ename</xsl:text></fo:block>
    </fo:table-cell>
    <fo:table-cell display-align="before" background-color="#cccccc">
    <fo:block line-height="19.2pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" background-color="#cccccc" color="#000000" font-family="Arial" font-size="16.0pt" font-weight="bold">
    <xsl:text>Hiredate</xsl:text></fo:block>
    </fo:table-cell>
    <fo:table-cell display-align="before" background-color="#cccccc">
    <fo:block line-height="19.2pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" background-color="#cccccc" color="#000000" font-family="Arial" font-size="16.0pt" font-weight="bold">
    <xsl:text>Job</xsl:text></fo:block>
    </fo:table-cell>
    <fo:table-cell display-align="before" background-color="#cccccc">
    <fo:block line-height="19.2pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" background-color="#cccccc" color="#000000" font-family="Arial" font-size="16.0pt" font-weight="bold">
    <xsl:text>Salary</xsl:text></fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell display-align="before">
    <fo:block line-height="14.5pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" color="#000000" font-family="Arial" font-size="12.0pt">
    <xsl:value-of disable-output-escaping="no" select="REGION/ROWSET/ROW/ENAME"/>
    </fo:block>
    </fo:table-cell>
    <fo:table-cell display-align="before">
    <fo:block line-height="14.5pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" color="#000000" font-family="Arial" font-size="12.0pt">
    <xsl:value-of disable-output-escaping="no" select="REGION/ROWSET/ROW/HIREDATE"/>
    </fo:block>
    </fo:table-cell>
    <fo:table-cell display-align="before">
    <fo:block line-height="14.5pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" color="#000000" font-family="Arial" font-size="12.0pt">
    <xsl:value-of disable-output-escaping="no" select="REGION/ROWSET/ROW/JOB"/>
    </fo:block>
    </fo:table-cell>
    <fo:table-cell display-align="before">
    <fo:block line-height="14.5pt" white-space-collapse="false"  linefeed-treatment="preserve"  text-align="start" color="#000000" font-family="Arial" font-size="12.0pt">
    <xsl:value-of disable-output-escaping="no" select="REGION/ROWSET/ROW/SAL"/>
    </fo:block>
    </fo:table-cell>
    </fo:table-row>
    <fo:table-row>
    <fo:table-cell/><fo:table-cell/><fo:table-cell/><fo:table-cell/></fo:table-row>
    </fo:table-body>
    </fo:table>
    </fo:block></fo:flow>
    </fo:page-sequence>
    </fo:root>
    </xsl:template>
    </xsl:stylesheet>XSL-FO is not the easiest thing to learn ;-) but hopefully the above gives you a headstart.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • Example in jasper report

    Hi
    pls give me the soln...
    how to create jasper report in java. and how the jrxml convert to jasper ..and where we need to comopile these files....
    how to use these in tomcat...pls give me a suggestion...

    Although this is not a relevant post . Let me tell you.
    You will need an IREPORT tool to make templates for the Jasperrepot. Then you will have to create a servlet in Java which will read this template XML and popultae the data with either request variables or through query.
    You will easliy get that sample servlet on IBM developers network.
    But you will need to learn IREPORT for creating templates for Reports.

  • Quick QBE - query by example with updateable report ?

    Hi,
    I'm using the function quick_qbe (thanks a lot to Scott Spendolino) and the report
    works fine.
    My problem is, what is the easiest way to make this report updateable ?
    The report should have an separate column for the edit-icon and link this record to another form page.
    It's necessary to create a new column for my table ?
    Thanks in advance
    Holger

    Hi Holger -
    You do need to create an extra column containing the ID field of the underlying table.
    You can then set the link attributes of that column to specify:
    1. The page you want to link to; and
    2. The ID value to pass to the new page.
    The 'edit' page will then use the value you passed to fetch a row from the table in order to populate the page's items.
    If you create a Form and Report on a Table using the wizard, you will see how it's done.
    Regards,
    John.

  • Report Example

    Hi All,
    I need the example of Vendor performance report..
    If anyone already did it then please send the example of that report..
    Note ::: I am not asking for General Examples of reports.
    Thanks in advance
    Raj

    Hi Raj,,
    This may help you.......
    see the sample code
    *& Report ZRFQ_COMP
    *& Quotation Comparison Report
    REPORT ZRFQ_COMP no standard page heading line-size 187 line-count 35.
    *&Tables
    Tables : ekko,
    ekpo,
    konp,
    a016.
    *&Data Decleration
    Data : v_pos type i value 19.
    Data : begin of it_rfq occurs 0,
    ebeln type ekko-ebeln,
    ekorg type ekko-ekorg,
    lifnr type ekko-lifnr,
    matnr type ekpo-matnr,
    WERKS type ekpo-WERKS,
    end of it_rfq.
    Data : begin of it_a016 occurs 0,
    ebeln type ekko-ebeln,
    knumh type knumh,
    end of it_a016.
    Data : begin of it_a363 occurs 0,
    werks type werks,
    lifnr type lifnr,
    matnr type matnr,
    knumh type knumh,
    end of it_a363.
    Data : begin of it_pr_details occurs 0,
    knumh type knumh,
    kschl type kschl,
    kbetr type kwert,
    end of it_pr_details.
    Data : begin of it_final occurs 0,
    ebeln type ebeln,
    lifnr type lifnr,
    name1 type lfa1-name1,
    pb00 type kbetr,
    zpac type kbetr,
    zb00 type kbetr,
    ZIN1 type kbetr,
    JEC1 type kbetr,
    JHX1 type kbetr,
    JMOP type kbetr,
    JMX1 type kbetr,
    JMX3 type kbetr,
    JSEP TYPE KBETR,
    JVRD type kbetr,
    end of it_final.
    Data : begin of it_vendorname occurs 0,
    lifnr type lifnr,
    name1 type lfa1-name1,
    end of it_vendorname.
    *&Selection Screen
    Selection-screen: begin of block blk1 with frame title text-001.
    parameters : p_matnr like ekpo-matnr obligatory.
    select-options : s_ebeln for ekko-ebeln,
    s_ekorg for ekko-ekorg,
    s_lifnr for ekko-lifnr.
    Selection-screen: end of block blk1.
    *&Start-of-Selection.
    Start-of-selection.
    Select ekko~ebeln
    ekko~ekorg
    ekko~lifnr
    ekpo~matnr
    ekpo~werks
    into table it_rfq
    from ekko
    inner join ekpo
    on ekkoebeln eq ekpoebeln
    where ekko~ebeln in s_ebeln
    and ekko~ekorg in s_ekorg
    and ekko~lifnr in s_lifnr
    and ekpo~matnr eq p_matnr
    and ekko~bstyp eq 'A'.
    if sy-subrc eq 0.
    *--> Condition number from A tables.
    Perform get_connum.
    *--> Getting the Pricing Details from Konp Table.
    Perform get_prices.
    *--> Populate Vendor Name.
    Perform pop_vendor_name.
    *--> Populating the Final Internal table for Report.
    Perform pop_final_tab.
    else.
    message 'Purchase Document does not exist' type 'E'.
    endif.
    *&End-of-Selection.
    End-of-Selection.
    write :/ sy-vline,
    2 'Vendor Number',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 1.
    write at v_pos it_final-lifnr.
    v_pos = v_pos + 35.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Gross Price',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-pb00.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Packing & Forward',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-zpac.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Surcharge',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-zb00.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Installation',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-zin1.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Ed cess on BED%',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-jec1.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'A/P Secess set off',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-jhx1.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Basic Excise Duty',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-zpac.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'A/P BED set off',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-jmx1.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Ecess % set off',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-jmx3.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'Sec ED Cess on BED',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-jsep.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    write :/ sy-vline,
    2 'VAT%',
    19 sy-vline.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 20.
    write at v_pos it_final-jvrd.
    v_pos = v_pos + 16.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    *&Top-of-Page.
    Top-of-Page.
    format color 1.
    Write: 'Material Number :' color 1, p_matnr color 1.
    loop at it_final.
    v_pos = v_pos + 1.
    v_pos = v_pos + 35.
    endloop.
    write at: /(v_pos) sy-uline,/ sy-vline,2 'Vendor Name'.
    v_pos = 19.
    loop at it_final.
    write at v_pos sy-vline.
    v_pos = v_pos + 1.
    write at v_pos it_final-name1.
    v_pos = v_pos + 35.
    endloop.
    write at: v_pos sy-vline,
    /(v_pos) sy-uline.
    *& Form get_connum
    Condition number from A tables
    form get_connum .
    Select EVRTN
    knumh
    from a016
    into table it_a016
    for all entries in it_rfq
    where EVRTN eq it_rfq-ebeln.
    Select werks
    lifnr
    matnr
    knumh
    from a363
    into table it_a363
    for all entries in it_rfq
    where werks eq it_rfq-werks
    and lifnr eq it_rfq-lifnr
    and matnr eq it_rfq-matnr.
    endform. " get_connum
    *& Form get_prices
    Getting the Pricing Details from Konp Table.
    form get_prices .
    if not it_a016[] is initial.
    select knumh
    kschl
    kbetr
    from konp
    into table it_pr_details
    for all entries in it_a016
    where knumh eq it_a016-knumh.
    endif.
    if not it_a363[] is initial.
    select knumh
    kschl
    kbetr
    from konp
    appending table it_pr_details
    for all entries in it_a016
    where knumh eq it_a016-knumh.
    endif.
    endform. " get_prices
    *& Form pop_final_tab
    Populating the Final Internal table for Report
    form pop_final_tab .
    data : l_subrc like sy-subrc.
    sort it_a016 by ebeln.
    loop at it_rfq.
    clear l_subrc.
    read table it_a016 with key ebeln = it_rfq-ebeln
    binary search.
    if sy-subrc eq 0.
    loop at it_pr_details where knumh eq it_a016-knumh.
    it_final-ebeln = it_rfq-ebeln.
    it_final-lifnr = it_rfq-lifnr.
    read table it_vendorname with
    key lifnr = it_rfq-lifnr.
    it_final-name1 = it_vendorname-name1.
    case it_pr_details-kschl.
    when 'PBOO'.
    it_final-pb00 = it_pr_details-kbetr.
    if it_pr_details-kbetr eq 0.
    clear it_final.
    continue.
    endif.
    when 'ZPAC'.
    it_final-zpac = it_pr_details-kbetr.
    when 'ZB00'.
    it_final-ZB00 = it_pr_details-kbetr.
    when 'ZIN1'.
    it_final-ZIN1 = it_pr_details-kbetr.
    endcase.
    endloop.
    else.
    l_subrc = sy-subrc.
    endif.
    read table it_a363 with key lifnr = it_rfq-lifnr
    werks = it_rfq-werks
    matnr = it_rfq-matnr.
    if sy-subrc eq 0.
    loop at it_pr_details where knumh eq it_a016-knumh.
    it_final-ebeln = it_rfq-ebeln.
    it_final-lifnr = it_rfq-lifnr.
    read table it_vendorname with
    key lifnr = it_rfq-lifnr.
    it_final-name1 = it_vendorname-name1.
    case it_pr_details-kschl.
    when 'JEC1'.
    it_final-JEC1 = it_pr_details-kbetr.
    when 'JHX1'.
    it_final-JHX1 = it_pr_details-kbetr.
    when 'JMOP'.
    it_final-JMOP = it_pr_details-kbetr.
    when 'JMX1'.
    it_final-JMX1 = it_pr_details-kbetr.
    when 'JMX3'.
    it_final-JMX3 = it_pr_details-kbetr.
    when 'JSEP'.
    it_final-JSEP = it_pr_details-kbetr.
    when 'JVRD'.
    it_final-JVRD = it_pr_details-kbetr.
    endcase.
    endloop.
    elseif l_subrc ne 0.
    continue.
    endif.
    append it_final.
    clear it_final.
    endloop.
    endform. " pop_final_tab
    *& Form pop_vendor_name
    Populate Vendor Name
    form pop_vendor_name .
    if not it_rfq[] is initial.
    Select lifnr
    name1
    from lfa1
    into table it_vendorname
    where lifnr eq it_rfq-lifnr.
    endif.
    <i><b>
    "Plz dnt Forget to reward points"</b></i>
    Regards,
    Mandeep.

  • Alv report with grid example

    i want some example alv grid report example

    Hi Raghu,
    Check this out.
    sample report for interactive report for purchase order.
    REPORT YMS_ALVINTERSAMPLE NO STANDARD PAGE HEADING LINE-SIZE 650
    MESSAGE-ID ZZ_9838.
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
    EBELN LIKE EKKO-EBELN,
    AEDAT LIKE EKKO-AEDAT,
    BUKRS LIKE EKKO-BUKRS,
    BSART LIKE EKKO-BSART,
    LIFNR LIKE EKKO-LIFNR,
    END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
    WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
    EBELN LIKE EKPO-EBELN,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    MENGE LIKE EKPO-MENGE,
    MEINS LIKE EKPO-MEINS,
    NETPR LIKE EKPO-NETPR,
    END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
    WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    declaration for events table where user comand or set PF status will
    be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
    WA_EVENT TYPE SLIS_ALV_EVENT.
    declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
    I_VARIANT1 TYPE DISVARIANT,
    I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA: I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
    V_REPID = SY-REPID.
    PERFORM BUILD_FIELDCATLOG.
    PERFORM EVENT_CALL.
    PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
    PERFORM DISPLAY_ALV_REPORT.
    *& Form BUILD_FIELDCATLOG
    Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'EBELN'.
    WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'AEDAT'.
    WA_FIELDCAT-SELTEXT_M = 'DATE.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'BUKRS'.
    WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'BUKRS'.
    WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'LIFNR'.
    WA_FIELDCAT-NO_OUT = 'X'.
    WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM. "BUILD_FIELDCATLOG
    *& Form EVENT_CALL
    we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = V_EVENTS
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. "EVENT_CALL
    *& Form POPULATE_EVENT
    Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
    READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
    ENDIF.
    READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'USER_COMMAND'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
    ENDIF.
    ENDFORM. "POPULATE_EVENT
    *& Form data_retrieval
    retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
    SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM. "data_retrieval
    *& Form bUild_listheader
    text
    -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA HLINE TYPE SLIS_LISTHEADER.
    HLINE-INFO = 'this is my first alv pgm'.
    HLINE-TYP = 'H'.
    ENDFORM. "build_listheader
    *& Form display_alv_report
    text
    FORM DISPLAY_ALV_REPORT.
    V_REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = V_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
    I_GRID_TITLE = I_TITLE_EKKO
    I_GRID_SETTINGS =
    IS_LAYOUT = ALV_LAYOUT
    IT_FIELDCAT = I_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    i_default = 'ZLAY1'
    I_SAVE = 'A'
    is_variant = i_variant
    IT_EVENTS = V_EVENTS
    TABLES
    T_OUTTAB = IT_EKKO
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. "display_alv_report
    *& Form TOP_OF_PAGE
    text
    FORM TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo =
    I_END_OF_LIST_GRID =
    ENDFORM. "TOP_OF_PAGE
    *& Form USER_COMMAND
    text
    -->R_UCOMM text
    -->, text
    -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
    PERFORM BUILD_FIELDCATLOG_EKPO.
    PERFORM EVENT_CALL_EKPO.
    PERFORM POPULATE_EVENT_EKPO.
    PERFORM DATA_RETRIEVAL_EKPO.
    PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
    PERFORM DISPLAY_ALV_EKPO.
    ENDCASE.
    ENDFORM. "user_command
    *& Form BUILD_FIELDCATLOG_EKPO
    text
    FORM BUILD_FIELDCATLOG_EKPO.
    WA_FIELDCAT-TABNAME = 'IT_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'EBELN'.
    WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'EBELP'.
    WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'MATNR'.
    WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'MENGE'.
    WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'MEINS'.
    WA_FIELDCAT-SELTEXT_M = 'UOM'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'NETPR'.
    WA_FIELDCAT-SELTEXT_M = 'PRICE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM. "BUILD_FIELDCATLOG_EKPO
    *& Form event_call_ekpo
    we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = V_EVENTS
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. "event_call_ekpo
    *& Form POPULATE_EVENT
    Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
    READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
    ENDIF.
    ENDFORM. "POPULATE_EVENT
    *& Form TOP_OF_PAGE
    text
    FORM F_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo =
    I_END_OF_LIST_GRID =
    ENDFORM. "TOP_OF_PAGE
    *& Form USER_COMMAND
    text
    -->R_UCOMM text
    -->, text
    -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = V_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
    I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE = I_TITLE_EKPO
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = I_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT =
    I_SAVE = 'A'
    IS_VARIANT =
    IT_EVENTS = V_EVENTS
    TABLES
    T_OUTTAB = IT_EKPO
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Interactive report(need example)

    I want complete example of interactive report using all the events in proper sequence. Any one could help me out. Plz use three to four tables.
    Thanks & regards......

    REPORT ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
    MESSAGE-ID ZZ_9838 .
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
    EBELN LIKE EKKO-EBELN,
    AEDAT LIKE EKKO-AEDAT,
    BUKRS LIKE EKKO-BUKRS,
    BSART LIKE EKKO-BSART,
    LIFNR LIKE EKKO-LIFNR,
    END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
    WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
    EBELN LIKE EKPO-EBELN,
    EBELP LIKE EKPO-EBELP,
    MATNR LIKE EKPO-MATNR,
    MENGE LIKE EKPO-MENGE,
    MEINS LIKE EKPO-MEINS,
    NETPR LIKE EKPO-NETPR,
    END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
    WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    declaration for events table where user comand or set PF status will
    be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
    WA_EVENT TYPE SLIS_ALV_EVENT.
    declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
    I_VARIANT1 TYPE DISVARIANT,
    I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA: I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA: I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
    V_REPID = SY-REPID.
    PERFORM BUILD_FIELDCATLOG.
    PERFORM EVENT_CALL.
    PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
    PERFORM DISPLAY_ALV_REPORT.
    *& Form BUILD_FIELDCATLOG
    Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'EBELN'.
    WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'AEDAT'.
    WA_FIELDCAT-SELTEXT_M = 'DATE.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'BUKRS'.
    WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'BUKRS'.
    WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
    WA_FIELDCAT-FIELDNAME = 'LIFNR'.
    WA_FIELDCAT-NO_OUT = 'X'.
    WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM. "BUILD_FIELDCATLOG
    *& Form EVENT_CALL
    we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = V_EVENTS
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. "EVENT_CALL
    *& Form POPULATE_EVENT
    Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
    READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
    ENDIF.
    READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'USER_COMMAND'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
    ENDIF.
    ENDFORM. "POPULATE_EVENT
    *& Form data_retrieval
    retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
    SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM. "data_retrieval
    *& Form bUild_listheader
    text
    -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA HLINE TYPE SLIS_LISTHEADER.
    HLINE-INFO = 'this is my first alv pgm'.
    HLINE-TYP = 'H'.
    ENDFORM. "build_listheader
    *& Form display_alv_report
    text
    FORM DISPLAY_ALV_REPORT.
    V_REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = V_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
    I_GRID_TITLE = I_TITLE_EKKO
    I_GRID_SETTINGS =
    IS_LAYOUT = ALV_LAYOUT
    IT_FIELDCAT = I_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    i_default = 'ZLAY1'
    I_SAVE = 'A'
    is_variant = i_variant
    IT_EVENTS = V_EVENTS
    TABLES
    T_OUTTAB = IT_EKKO
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. "display_alv_report
    *& Form TOP_OF_PAGE
    text
    FORM TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo =
    I_END_OF_LIST_GRID =
    ENDFORM. "TOP_OF_PAGE
    *& Form USER_COMMAND
    text
    -->R_UCOMM text
    -->, text
    -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    CASE R_UCOMM.
    WHEN '&IC1'.
    READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
    PERFORM BUILD_FIELDCATLOG_EKPO.
    PERFORM EVENT_CALL_EKPO.
    PERFORM POPULATE_EVENT_EKPO.
    PERFORM DATA_RETRIEVAL_EKPO.
    PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
    PERFORM DISPLAY_ALV_EKPO.
    ENDCASE.
    ENDFORM. "user_command
    *& Form BUILD_FIELDCATLOG_EKPO
    text
    FORM BUILD_FIELDCATLOG_EKPO.
    WA_FIELDCAT-TABNAME = 'IT_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'EBELN'.
    WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'EBELP'.
    WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'MATNR'.
    WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'MENGE'.
    WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'MEINS'.
    WA_FIELDCAT-SELTEXT_M = 'UOM'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
    WA_FIELDCAT-FIELDNAME = 'NETPR'.
    WA_FIELDCAT-SELTEXT_M = 'PRICE'.
    APPEND WA_FIELDCAT TO I_FIELDCAT.
    CLEAR WA_FIELDCAT.
    ENDFORM. "BUILD_FIELDCATLOG_EKPO
    *& Form event_call_ekpo
    we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = V_EVENTS
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. "event_call_ekpo
    *& Form POPULATE_EVENT
    Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
    READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
    IF SY-SUBRC EQ 0.
    WA_EVENT-FORM = 'TOP_OF_PAGE'.
    MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
    ENDIF.
    ENDFORM. "POPULATE_EVENT
    *& Form TOP_OF_PAGE
    text
    FORM F_TOP_OF_PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = IT_LISTHEADER
    i_logo =
    I_END_OF_LIST_GRID =
    ENDFORM. "TOP_OF_PAGE
    *& Form USER_COMMAND
    text
    -->R_UCOMM text
    -->, text
    -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = V_REPID
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'F_USER_COMMAND'
    I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE = I_TITLE_EKPO
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = I_FIELDCAT[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT =
    I_SAVE = 'A'
    IS_VARIANT =
    IT_EVENTS = V_EVENTS
    TABLES
    T_OUTTAB = IT_EKPO
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    regards
    aswin

  • Alv reports sample example req..

    can anybody help me out with a simple example regarding ALV Reports.(simple ALV Reports , Blocked ALV Reports & Hierarchy ALV Reports).
    or pls send me a word document regarding the same ..to [email protected]
    response is highly appreciated..
    bye--
    Pradeepa

    Following document should get you started.
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference For ALV Grid Control.pdf</a>
    tip : if you do a <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/advancedsearch?query=alv%20grid&cat=sdn_all">search for alv grid</a> on the sdn homepage, this is the first result.
    Message was edited by:
            Dries Horions

  • How to open a report without refreshing  and sending some param value

    we have a summary report which has links to the detail report.For example the summary report has data like
    Countries        EmployeeCount
    UK                5
    US                6
    China                7
    Total                18
    When we click on China it must show the Employees whose country is China (detail report) When we click on Total it shows Employee of all countries UK,US,China...
    Now when we run the summary report online say at 5:10 it shows the staus of countries at 5:10.Say the report is open while an employee of china is moved from China to Uk.But when we open the detail report it shows China count as 6 which should actually be 7 according to the summary report run time.
    A similar problem exist when we schedule the report .When we schedule the summary report and detail report at same time..And then try to open the scheduled instance of detail report from summary scheduled instance ,It only works fine if no parameter is passed to openDocument url.
    Say suppose I click China on summary report the Value China should be passed to detail report as Country.But whenever we try to open a scheduled instance of Detail Report along with a parameter using openDocument Url.It refreshes the whole data even though refresh is set to 'N'.So the scheduled data is lost..Even if we try for Drillfilters in detail Report we cannot set it at runtime using open document Url.

    Mihail - I detailed a couple of approaches here: Re: Application Link
    Scott

  • Need help in Report Painter

    Can anybody help me in Report Painter? I need a link.
    Regards,
    Subhasish

    Please go through the enclosed document. This will give you step-by-step approach for Report painter:
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    Check url
    http://help.sap.com/saphelp_47x200/helpdata/en/da/6ada3889432f48e10000000a114084/frameset.htm
    Check Report Painter Step-by-Step example under Tools->Report Painter / Report Writer->Report Painter->Creating a Report Painter Report.
    Just go through These Links to learn about report Painter.
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    I have a standard report and it uses a structure to pull the data for the report. I need to create a custom report which uses the same structure, selection screen but a different layout. Could any of u plz advice, if its doable in report painter or just plain abap program?? Also I am interested to know how the report painter stores the actual report?? as ABAP program?? Please help..urgent..
    check the SAP help ..
    http://help.sap.com/saphelp_47x200/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/content.htm
    I had made couple of SD reports in report painter 4 year ago .. as far as process is concern you have create library , but it deals with information structure which start with s0* , after defining information structure in library it take to select the fields and display them on your out put . information structure have the statistical data most of the time . As i worked on information structure , so31,32,33 .....
    I t creates ABAP program like ABAP query creates in background . if you execute Customer Over due analysis or in Co02 cost analysis report or MC* ( MM stock reports ) those are in report painter .
    Hope this'll give you some guide line ...
    As far as I know about report painter, It create a report in background..Like when you make ABAP query (SQ01, 02, 03 ) .. It will create a report. You cant modify the report . You have to get OSS id in order to do that. if you're ready do it then you can pass it to Memory and can achieve your goal ...
    I think it will give you some hint. I wish I could have authorization to use report painter on my this project so I can help you out practically.
    Please see these steps , it`ll help you ...
    http://www.thespot4sap.com/Articles/Code_CostCentreReport.asp
    The variation objects are coming from the sets.
    For example, when you read the report 'Cost Centers: Actual/Plan/Variance'(T-code : S_ALR_87013611), you can find the characteristic 'Cost Center' is set as a 'set variable'. So the cost center in the report left side are coming from the cost center group that you input.
    Does any know if we could use Report Painter across two controlling areas? Any documentation available will be great. Yes. When setting up a report in CCA you can have multiple controlling areas. In the General data selection you will have the option for the CA as a selection.
    You can also use standard references objects to construct your own reports: libraries, standard layouts, default columns, and row and column models, all in the standard R/3 System, are available for custom reports.
    Report Painter report definition requires several Preparatory Steps, depending on the complexity of the report to be generated.
    1) Create a library and pick your reporting tables.
    2) Create your report
    3) define your set up within the report
    a)General data selections
    b)Colimns
    c) rows
    d) formulas
    Standard layouts are maintained in the IMG "Financial Accounting" under "Special Ledger -> Information System -> Maintain standard layout.
    Create libraries, which means assigning the
    characteristics
    key figures
    Predefined columns
    For each of these categories you need to select the objects to be used in reports of the specific library. You define the sequence of the objects in the selection lists of the Report Painter in field "Position". Frequently used objects should be at the top of the list.
    go to
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22ba743c611d182b30000e829fbfe/frameset.htm
    I have created a report through report writer/Painter(GR51). My query here is to link this report to a transaction code. Could you please suggest me how can I acheive this?
    Go to SE93 and select the Transaction with Parameters ( Parameter Transaction)
    Then in the Transaction field give: START_REPORT
    Skip initial screen
    Screen 0
    In the default value for the parameters give
    D_SREPOVARI-REPORTTYPE RW
    D_SREPOVARI-REPORT ( Give your Report Group )
    If you have any doubt pick any report painter tcode and check in SE93
    Follow below steps
    1) Execute report through report painter
    2) From system status get the program name
    3 ) go to se93 and select report transaction and assign
    program name .
    Is it possible to make bigger the text a I have on a text field?, Im using the screen painter and I need to put the title bigger (as a requirment).
    You can define your text as any length.If you are talking about the font,i am afraid you cannot do that.
    No, you can not change the size(font) of the text on the dynpro, you can hightlight it, which changes the color to "blue" to make it stand out. You can change this on the attributes tab when double-clicking on the element in screen painter.
    what is the sentence that open a screen painter file
    Don´t really understand what you mean with "open a screen painter file".
    If you are speaking about showing a form generated with the screen painter,
    Dim oXMLDoc As New MSXML2.DOMDocument
    oXMLDoc.load("Form.xml")
    SBO_Application.LoadBatchActions(oXMLDoc.xml)
    Dim oForm As SAPbouiCOM.Form
    oForm = SBO_Application.Forms.Item("YourFormID")
    oForm.Visible = True
    regards
    vinod

  • Data of the Report Painter report

    Dear ALL,
    I have the Report Painter report. When I'm executing this report I can save the data into the extract.
    Could you tell me where are these data in the system(table?)? I want use these data for SAP script form.
    Best regards,
    Igor

    Please go through the enclosed document. This will give you step-by-step approach for Report painter:
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    Check url
    http://help.sap.com/saphelp_47x200/helpdata/en/da/6ada3889432f48e10000000a114084/frameset.htm
    Check Report Painter Step-by-Step example under Tools->Report Painter / Report Writer->Report Painter->Creating a Report Painter Report.
    Just go through These Links to learn about report Painter.
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    Please go through the enclosed document. This will give you step-by-step approach for Report painter:
    http://www.virtuosollc.com/PDF/Get_Reporter.pdf
    Check url
    http://help.sap.com/saphelp_47x200/helpdata/en/da/6ada3889432f48e10000000a114084/frameset.htm
    Check Report Painter Step-by-Step example under Tools->Report Painter / Report Writer->Report Painter->Creating a Report Painter Report.
    Just go through These Links to learn about report Painter.
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/bc7d2543c211d182b30000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/5b/d22cee43c611d182b30000e829fbfe/frameset.htm
    I think it will give you some hint. I wish I could have authorization to use report painter on my this project so I can help you out practically.
    Please see these steps , it`ll help you ...
    http://www.thespot4sap.com/Articles/Code_CostCentreReport.asp
    regards
    vinod

Maybe you are looking for