Line graphs in ALV report

I need to plot a graph in which i have material number on the X-Axis and no. of days on the Y-axis.And i need to plot more than one graph using the same X and Y axis.How do i do that? please help...

Hi,
Check the link for process and sample code
Graphs in ALV
Regards,
anirban

Similar Messages

  • TOP-OF-PAGE During line-selection in alv report

    Hi Expart
    In intractive Alv report u using top-of-page during line-selection . If u using so u give me one example with codeing .
    Regards
    Bhabani

    Hi,
    try this code...
    *& Report  ZCS_PRG8
    REPORT  Z_SJALV__PRG8.
    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 IT_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.
    reward if helpful
    regards
    Shashi

  • How to read complete line displayed thru ALV report on double click? urgent

    Hi guys,
    An ALV report is displayed using 'REUSE_ALV_LIST_DISPLAY' and i have a requirement such that i have to read the line item on which double click is done.
    I have to fetch the line item, field by field and not by characters. I have attached the function code and all using PF status.
    Please tell me an approach as how to fetch the line item on which double click is done.
    Points will be rewarded.
    Regards
    Rahul

    Hi  ..
    i did  report  with  belnr  , bukrs  ,  Gjahr  . which will  call the  transcation code  FB03 displaing thedocument  ...
    please  cut and  paste the report  it will work ..
    REPORT  zdemo_alvgrid                 .
    TABLES:   bkpf . "  ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
    BUKRS   like  bkpf-BUKRS,
    BELNR like  bkpf-BELNR,
    GJAHR like  bkpf-GJAHR,
    BLART like  bkpf-BLART,
    BLDAT like  bkpf-BLDAT,
    BUDAT like  bkpf-BUDAT,
    MONAT like  bkpf-MONAT,
    XBLNR like  bkpf-XBLNR ,
    *  ebeln TYPE ekpo-ebeln,
    *  ebelp TYPE ekpo-ebelp,
    *  statu TYPE ekpo-statu,
    *  aedat TYPE ekpo-aedat,
    *  matnr TYPE ekpo-matnr,
    *  menge TYPE ekpo-menge,
    *  meins TYPE ekpo-meins,
    *  netpr TYPE ekpo-netpr,
    *  peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    * There are a number of ways to create a fieldcat.
    * For the purpose of this example i will build the fieldcatalog manualy
    * by populating the internal table fields individually and then
    * appending the rows. This method can be the most time consuming but can
    * also allow you  more control of the final product.
    * Beware though, you need to ensure that all fields required are
    * populated. When using some of functionality available via ALV, such as
    * total. You may need to provide more information than if you were
    * simply displaying the result
    *               I.e. Field type may be required in-order for
    *                    the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'BUKRS'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BELNR'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      fieldcatalog-outputlen   = 10.
       fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
        append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'GJAHR'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
        append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLART'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BLDAT'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'BUDAT'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MONAT'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'XBLNR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
    *  fieldcatalog-do_sum      = 'X'.
    *  fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    **  fieldcatalog-fieldname   = 'PEINH'.
    **  fieldcatalog-seltext_m   = 'Price Unit'.
    **  fieldcatalog-col_pos     = 8.
    **  append fieldcatalog to fieldcatalog.
    *  clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    *  gd_layout-totals_only        = 'X'.
    *  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
    *                                         "click(press f2)
    *  gd_layout-zebra             = 'X'.
    *  gd_layout-group_change_edit = 'X'.
    *  gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
    *            i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
    *            it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
    *            is_variant              = z_template
           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  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select BUKRS
    BELNR
    GJAHR
    BLART
    BLDAT
    BUDAT
    MONAT
    XBLNR  up to 10 rows
      from bkpf
      into table it_ekko.
    *select ebeln ebelp statu aedat matnr menge meins netpr peinh
    * up to 10 rows
    *  from ekpo
    *  into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    * Form  TOP-OF-PAGE                                                 *
    * ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    * Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    * Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    * Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
    *            i_logo             = 'Z_LOGO'.
    endform.
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
    *   Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'BELNR'.
    *     Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *     Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD   wa_ekko-bELNR  .
          SET PARAMETER ID 'MES' FIELD   wa_ekko-bUKRS  .
          SET PARAMETER ID 'DES' FIELD    wa_ekko-GJAHR .
    *     Sxecute transaction ME23N, and skip initial data entry screen
    *      CALL TRANSACTION 'FB03' AND SKIP first screen.
    SUBMIT RFBUEB00
    *        WITH ALCUR ...
    *        WITH ARCHOBJ ...
    *        WITH ARCH_SEL ...
    *        WITH ARUSETYP ...
    *        WITH AUTBEXNO ...
    *        WITH AUTH_BUK ...
    *        WITH AUTH_LDR ...
    *        WITH BR_AWKEY ...
    *        WITH BR_AWSYS ...
    *        WITH BR_AWTYP ...
            WITH BR_BELNR =  wa_ekko-bELNR
    *        WITH BR_BLART ...
    *        WITH BR_BLDAT ...
    *        WITH BR_BUDAT ...
            WITH BR_BUKRS =    wa_ekko-bUKRS
    *        WITH BR_CPUDT ...
            WITH BR_GJAHR  =  wa_ekko-GJAHR
    *        WITH BR_RLDNR ...
    *        WITH BR_SEQ ...
    *        WITH BR_USNAM ...
    *        WITH BR_XBLNR ...
    *        WITH EXCDT ...
    *        WITH P_STATS ...
    *        WITH STATISTK ...
    *        WITH STATUSD ...
    *        WITH STATUSL ...
    *        WITH STATUSM ...
    *        WITH STATUSS ...
    *        WITH STATUSV ...
    *        WITH TCODE ...
    *        WITH UNAME ...
    *        WITH XEMUCNV ...
    *        WITH XUSEAR ...
    *        WITH XUSEAS ...
    *        WITH XUSEDB
            AND RETURN  .
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
    *       Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
    *       Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    reward points if it is  usefull ...
    Girish

  • Displaying custom graph in ALV report

    Hi
    Can you tell me how to display a custom graph for a column in a alv report.
    That is adding a seperate button in the report and display a graph for a column when the button is clicked.
    If 'Graph_2d' function module is used can anybody tell how to pass values to the function module and display the graph using the function module.
    Thanks & regards
    Saravanakumar

    Hi,
      check out the standard program GRDEMO_D for more understanding of teh usage of FM GRAPH_2D
    regards,
    theja

  • How to include Barcharts/graphs in alv report

    Hi,
    I need to create a graph with the help of ALV Grid control. I could able to activate the graphical option through clicking the 'GRAPH' icon in the ALV display.
    But i am in need of changing the properties of graph(chart type / gridlines / chart options etc.,) display and also it have to be displayed automatically on executing the report. More than I need the graphical output in a single page with maximized window size.
    Like Sub-Total / Sorting options are possible thru REUSE_ALV_GRID_DISPLAY i am in need of activating the Graph(chart) options automatically.
    Thanks in Advance

    Hi Subhakar,
           Step by step procedure.
    1) Create a PF status and call it, create a button for the Displaying Graph/Bar Chart.
    2) In the main program include this code to handle cliking of your graph button.
    3) Include the code like the below pseudo code.
    data: begin of itab_graph occurs 0,
           status_text(10) type c,
           count1 type i,
           count2 type i,
           count3 type i,
          end of itab_graph.
    data: begin of i_graph_opt occurs 1,
               c(80) type c,
            end of i_graph_opt
    form user_command using r_ucomm like sy-ucomm
                      rs_selfield type slis_selfield.
    case r_ucomm.
    when '&DIS'.
          write 'P2TYPE = PI' to i_graph_opt .append i_graph_opt.
          write 'P2SCAL = X' to i_graph_opt .append i_graph_opt.
          write 'P2PCNT = X' to i_graph_opt .append i_graph_opt.
          write 'CLPALT = C' to i_graph_opt .append i_graph_opt.
          write 'P3CTYP = CO' to i_graph_opt .append i_graph_opt.
          write 'P3SCAL = X' to i_graph_opt .append i_graph_opt.
          write 'P3LINS = X' to i_graph_opt .append i_graph_opt.
          write 'TIFULL = X' to i_graph_opt .append i_graph_opt.
          write 'TISIZE = 3' to i_graph_opt .append i_graph_opt.
          write 'CLBACK = X' to i_graph_opt .append i_graph_opt.
    " above few lines are options for setting the graph - customizing the view....
    " Say P2TYPE = PI calls a Pie chart.
          itab_graph-status_text = 'No of Jobs'.
          itab_graph-count1 = count_1.  "( may be ur totals and subtotals )
          itab_graph-count2 = count_2.
          itab_graph-count3 = count_3.
          append itab_graph.
          call function 'GRAPH_MATRIX_3D'
            exporting
              col1 = 'Text1'
              col2 = 'Text2'
              col3 = 'Text3
              titl = 'Title of graph'
            tables
              data = itab_graph
              opts = i_graph_opt.
          clear itab_graph[].
    endform.
    Also refer function module documentatoon for complete understanding and usage.
    Thanks,
    Srinivas.

  • At line selection in alv report

    hi,
    i had developed a code in which at 1st execution the normal output is displayed and if i click on a purticular Itemid it displays the whole of items  and i want to display only that item's data which i had clicked on.
    following is the code which i am using for the at line-selection.
    **BEGIN - TEST CODE FOR LINE SELECTION**
    data: fld LIKE ITAB-ITEMID,
          val LIKE ITAB-ITEMID.
    at line-selection.
      get cursor field fld value val.
      IF fld = 'ITAB-ITEMID'.
            SET PARAMETER ID 'ANR' FIELD val.
            CLEAR ITAB-ITEMID.
      ENDIF.
        PERFORM PRN_SMSTOCK_ALV USING VAL.
        IF SY-SUBRC <> 0.
          MESSAGE 'NO RECORD FOUND' TYPE 'W'.
        ENDIF.
      FORM PRN_SMSTOCK_ALV USING VAL.
    *****END OF TEST CODE FOR LINE SELECTION******
    plzz help me out by providing the solution for this problem.

    Hi,
    You need to add extra piece of code as below:
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                I_callback_user_command = 'USER_COMMAND'   "see FORM
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
    *   Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
    *     Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *     Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
    *     Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    "For further information please refer the link below :
    http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm
    Thanks,
    Sriram Ponna.

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • 2 header lines in ALV report

    Hello All,
                Does any one have any idea how to create 2 Header lines in an ALv report
    as in 1 cummulative header and under that 2nd detailed header.
    Please help me out.
    Cheers,
    Deepthee Kasal

    Hi,
    It is not possible to have 2 detailed headers in ALV reports.
    Regards,
    Satish

  • Add new line in ALV report and Refresh button

    How to add a new line in a ALV report?
    How to add a refresh button in a report?

    Hi,
    First of all u have to Create ur own PF-status and Assign Fcode e.g 'INSERTROW'.
    So, whenevr you will click Insertrow button it will be triggered in your User Command and then just Append the blank line in your Final Internal Table.
    And Refresh Icon will be there by default...
    To Trigger it You have to write rs_selfield-refresh = 'X'
    You can also follow the below link...
    Try it.
    Link:[http://wiki.sdn.sap.com/wiki/display/ABAP/ALVeasytutorial].
    Regards
    Arbind

  • How to add field to the header for FBL5N ALV report

    Hi,
       I need to add fields to the customer line item display ALV report(FBL5N) header part.Right now there are four fields in the header like customer, company code, name and city, after that I need to add first name last name and phone no. Can any one tell me where exactly I need to add and populate there fields to be appear in ALV output list.
    Thanks in Advance
    Swapna

    Yes I have tried, I have place a break point in that perform but it does not stop. I think that is not the correct place to added and populate fields. That routine is for populate selection screen ranges single and multiple values and parameters only.
    Thanks
    Swapna

  • How can we assign different colours to different records(line items) in alv

    how can we assign different colours to different records(line items) in alv reporting?

    Hi Friend,
    Please see this SDN Wiki  for setting the color in ALV :[http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP-DevelopingInteractiveALVReportusing+OOABAP]
    There are so many SDN Wiki's on this  just try with search  Alv Color display in SDN,
    Regards,

  • Line Graph Problem when used with Series

    I am facing a problem with Line Graph in Oracle Reports 10g.
    I have made a graph having series of three curves.
    The graph is perfect when all series have similar X-Axis values. See the link
    http://www.sysautomation.com/ask/RPT_LINE_GRAPH_OK.PDF
    But same graph does not print curves properly, gives spaces in the curves, when all the series do not have similar values on X-Axis
    http://www.sysautomation.com/ask/RPT_LINE_GRAPH_NOT_OK.PDF
    Pl. guide me what to do to make this graph working.

    Thanks for reply.
    In my case, I have to plot curves.
    and some Series have different X-axis values.
    I have no choice, but to plot them.
    The same thing was working fine with Reports 6i + Graphics 6i.
    What is Scatter Plot?
    Thanks again.
    This is a limitation in the current line graph in
    Reports 10g (9.0.4). I can't recall whether this has
    improved in 10.1.2 or it was planned for the next
    rev.
    Would trying a scatter plot be better?
    Line graphs are normally meant for regular intervals
    on x-axis, so using the example of dates, Jan, Feb
    and Dec would be placed right next to each other,
    rather than scaled with the right distance between
    Feb and Dec.

  • How to set the 4th Y axis color for a line graph

    Hello experts,
    I have developed a multiple y axis line graph using oracle reports 10g.
    It has got 1 x axis and 4 axes. I am able to set the color of the the first three y axes
    but the reports designer automatically assigns yellow color to the 4th axis.
    I mean there is no option in the graph wizard for changing the 4th color)
    How to change the color of this 4th y axis to a desired color?
    Cheers
    Sri

    Assuming you mean that your graph has 4 series, not 4 Y axes, you might try something like this:
    1. Save a backup copy of your current report in case the changes you are about to make don't work out and you want to revert to the backup copy.
    2. Using the Property Inspector, display the current value of the Graph Settings property for your graph. The value of the property should be something like:
    <rw:graph id...
    </rw:graph>3. Look for a <SeriesItems> tag and a matching </SeriesItems> tag in the property value. If you don't find them, add the following two lines immediately before the </Graph> tag.
    <SeriesItems>
    </SeriesItems>4. Between the <SeriesItems> tag and the matching </SeriesItems> tag, add (or update) a <Series> tag for each series that you want to specify the color for. For example, to specify the color of the fourth series as red, you would use a <Series> tag like this:
    <Series id="3" color="#ff0000"/>Note that the id numbers start at 0 for the first series, 1 for the second, and so on. The color value is a hexadecimal number specifying the RGB value of the color.
    You can also use the <Series> tag to specify other features like the marker shape.
    For more information on what you can do using the Graph Settings property, see this FAQ and Technical Note.
    Hope this helps.

  • Hide values to be displayed along Y-axis in line graph

    Hi friends,
    I need to generate a line graph using Oracle reports. But the values along y-axis should not be displayed. Can anyone help me how to hide displaying values along the y-axis
    Thanks,
    venkat

    Venkat,
    I am not sure if it can be hidden. I will update this thread if I find something. But for now, what you can do is, create a Rectangle over the y-axis values. Change the background color of the rectangle same as graphs color, and line color as 'No Line'. It will hide the values.
    Hope this helps.

  • Urgent: about the checkbox in OOP ALV report

    Hi Experts,
    I had use OOP method to display my ALV report. In the report I have a checkbox for each line. I had set this check box use below statements:
        gt_fieldcat_record-tabname = 'GT_ISSUE_INT'.
        gt_fieldcat_record-fieldname = 'CHECKBOX'.
        gt_fieldcat_record-checkbox = 'X'.
        gt_fieldcat_record-edit = 'X'.
        APPEND gt_fieldcat_record.
    When I press the save button, then I will save the lines to my Z-table which its GT_ISSUE_INT-CHECKBOX = 'X'.
    Now I click the checkbox to select several lines in my ALV report and then press save, but it do not work. Then I check the internal table GT_ISSUE_INT in debugger, I found the GT_ISSUE_INT-CHECKBOX = ' '. Above statements is not correct for the checkbox?? Or I need additional statements to move 'X' to GT_ISSUE_INT-CHECKBOX?? Please help!!!Thanks.

    Hi,
    If u want to read check box status from list, need to call function module explicitly.
    see the sample code:
    case sy-ucomm.
    when 'SAVE'.
    Data ref1 type ref to cl_gui_alv_grid.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
               E_GRID = ref1.
           call method ref1->check_changed_data.
    loop at GT_ISSUE_INT to workarea.
    ____ continue writing ur code.
    function module read the data from list . and save the changes that made on list.
    when u debug, u can see the check box status as 'X' after exucut\ing this fm and method.
    reward if helpful.
    regards,
    swapna

Maybe you are looking for

  • Lock Box Uploading Issue

    Hi, When i upload BAI file into Lock Box...I am getting the below error in FBL2 transaction. Accounts receivable posting Error: (F5 102) Customer * is not defined in company code 1000 After that when i see in to FBL1,I am getting the below error. Pay

  • Sync Mana

    I have just upgarded to version 5 of Mediasource. Unfortunately the sync manager appears to crash with a message from microsoft that the program has called a problem and please report to microsoft. I am running windows xp2 and have a zen touch player

  • IMac G5 airport issue

    It would seem reading the rough the iMac G5 forum that many of the G5's are having issues talking to Airports. I don't believe it is an issue with the AEX / ABS since other devices work fine. However thought I'd cross post to see if anyone can shed a

  • Why can't I open new tabs in firefox 4?

    I upgraded from firefox 3 to firefox 4 when it asked me to do so. The upgrade has not gone right - I have a mixture of the two versions, with the menu across the top as in 3 but the toolbar as in 4. There isn't a button to open a new tab (I can use c

  • Functions window does not contain "Change Gain" feature

    I recently purchased Logic Pro X I have used Logic since it's inception and in this most recent upgrade I am unable to locate the :Change Gain: function. It is not showing up in my Functions drop down menu Thanks