Navigation from ALV

Hi all,
On executing my program i get ALV with names of reports displayed. My requirement is that on clicking on the report name, I should be directed to SE38, where the corresponding report is opened in 'Change' mode.
Please suggest how I can achieve this.

REPORT  zvishal_alv.
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_data,
       sr_no    TYPE i,
       rep_name TYPE string,
       END OF ty_data.
DATA: itab        TYPE TABLE OF ty_data,
      wa          TYPE ty_data,
      it_fcat     TYPE SLIS_T_FIELDCAT_ALV,
      wa_fcat     LIKE LINE OF it_fcat,
      bdcdata_tab TYPE TABLE OF bdcdata,
      opt         TYPE ctu_params,
      bdcdata_wa  TYPE bdcdata,
      it_evt      TYPE slis_t_event,
      wa_evt      LIKE LINE OF it_evt.
wa_evt-form = 'USER_COMMAND'.
wa_evt-name = 'USER_COMMAND'.
APPEND wa_evt TO it_evt.
*fill test data
wa-sr_no = '1'.
wa-rep_name = 'ZTEST1'.
APPEND wa TO itab.
wa-sr_no = '2'.
wa-rep_name = 'ZTEST2'.
APPEND wa TO itab.
wa-sr_no = '3'.
wa-rep_name = 'ZTEST3'.
APPEND wa TO itab.
wa_fcat-col_pos   = '1'.
wa_fcat-fieldname =  'SR_NO'.
wa_fcat-tabname   = 'ITAB'.
wa_fcat-seltext_m   = 'Serial no'.
append wa_fcat to it_fcat.
wa_fcat-col_pos   = '2'.
wa_fcat-fieldname =  'REP_NAME'.
wa_fcat-tabname   = 'ITAB'.
wa_fcat-seltext_m   = 'Report Name'.
append wa_fcat to it_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
    i_callback_program                = sy-repid
    i_callback_user_command           = 'USER_COMMAND'
   IT_FIELDCAT                        = it_fcat
   it_events                          = it_evt
  TABLES
    t_outtab                          = itab
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.
FORM user_command USING v_ucomm LIKE sy-ucomm
                        wa_selrow TYPE slis_selfield.
CASE v_ucomm.
  WHEN '&IC1'.
READ TABLE itab INTO wa INDEX wa_selrow-tabindex.
CLEAR bdcdata_wa.
bdcdata_wa-program  = 'SAPLWBABAP'.
bdcdata_wa-dynpro   = '0100'.
bdcdata_wa-dynbegin = 'X'.
bdcdata_wa-fnam = 'RS38M-PROGRAMM'.
bdcdata_wa-fval = wa-rep_name.
APPEND bdcdata_wa TO bdcdata_tab.
*CLEAR bdcdata_wa.
*bdcdata_wa-fnam = 'PROGRAMM'.
*bdcdata_wa-fval = wa-rep_name.
*APPEND bdcdata_wa TO bdcdata_tab.
opt-dismode = 'E'.
opt-defsize = 'X'.
CALL TRANSACTION 'SE38' USING bdcdata_tab OPTIONS FROM opt.
ENDCASE.
  ENDFORM.
activate this code and test
Thanks
Vishal kapoor

Similar Messages

  • Navigation from ALV  Record to Tcode

    Hello All,
    I have  a requirement like this,
    My zPROGARM is displaying one ALV output. When an user select one record/cell
    it has to navigate to particular Tcode  .
    Is it Possible?
    Kindly advice me on this.
    Thankyou,
    Ram.

    HI...,,
    Check this program...
    REPORT  YH627_PO_CHANGES_SOX_REPORTING MESSAGE-ID M8.
    *"Table declarations...................................................
    TABLES:
      EKKO,                                " Purchasing Document Header
      CDHDR,                               " Change document header
      SSCRFIELDS.                          " Fields on selection screens
    *"Selection screen elements............................................
    SELECT-OPTIONS:
      S_EBELN FOR EKKO-EBELN,              " Purchasing Document Number
      S_LIFNR FOR EKKO-LIFNR,              " Vendor's account number
      S_EKGRP FOR EKKO-EKGRP,              " Purchasing group
      S_BEDAT FOR EKKO-BEDAT,              " Purchasing Document Date
      S_UDATE FOR CDHDR-UDATE.             " Creation date of the change
                                           " document
    *" Data declarations...................................................
    Field String to hold Purchase Document Number                       *
    DATA:
      BEGIN OF FS_EBELN,
        EBELN(90) TYPE C,                  " Purchase Document Number
        ERNAM     TYPE EKKO-ERNAM,         " Name of Person who Created
                                           " the Object
        LIFNR     TYPE EKKO-LIFNR,         " Vendor's account number
        EKGRP     TYPE EKKO-EKGRP,         " Purchasing group
        BEDAT     TYPE EKKO-BEDAT,         " Purchasing Document Date
      END OF FS_EBELN,
    Internal table to hold Purchase Document Number                     *
      T_EBELN LIKE STANDARD TABLE
                OF FS_EBELN.
    Field String to hold Purchase Document Header                       *
    DATA:
      BEGIN OF FS_EKKO,
        EBELN TYPE EKKO-EBELN,             " Purchasing Document Number
        ERNAM TYPE EKKO-ERNAM,             " Name of Person who Created the
                                           " Object
        LIFNR TYPE EKKO-LIFNR,             " Vendor's account number
        EKGRP TYPE EKKO-EKGRP,             " Purchasing group
        BEDAT TYPE EKKO-BEDAT,             " Purchasing Document Date
      END OF FS_EKKO,
    Internal table to hold Purchase Document Header                     *
    T_EKKO LIKE STANDARD TABLE
              OF FS_EKKO.
    Field String to hold Account Number and name of the Vendor          *
    DATA:
      BEGIN OF FS_LFA1,
        LIFNR TYPE LFA1-LIFNR,             " Account Number of Vendor
        NAME1 TYPE LFA1-NAME1,             " Name1
      END OF FS_LFA1,
    Internal table to hold Account number and Name of the Vendor        *
      T_LFA1 LIKE STANDARD TABLE
               OF FS_LFA1.
    Field String to hold Change date and the name of the user           *
    DATA:
      BEGIN OF FS_CDHDR,
        OBJECTCLAS TYPE CDHDR-OBJECTCLAS,  " Object Class
        OBJECTID   TYPE CDHDR-OBJECTID,    " Object value
        CHANGENR   TYPE CDHDR-CHANGENR,    " Document change number
        USERNAME   TYPE CDHDR-USERNAME,    " User name
        UDATE      TYPE CDHDR-UDATE,       " Creation date of the change
                                           " document
      END OF FS_CDHDR,
    Internal Table to hold Change date and the name of the user         *
      T_CDHDR LIKE STANDARD TABLE
                OF FS_CDHDR.
    Field String to hold Change document items                          *
    DATA:
      BEGIN OF FS_CDPOS,
        OBJECTCLAS   TYPE CDPOS-OBJECTCLAS," Object class
        OBJECTID(10) TYPE C,               " Object Value
        CHANGENR     TYPE CDPOS-CHANGENR,  " Document change number
        TABNAME      TYPE CDPOS-TABNAME,   " Table Name
        FNAME        TYPE CDPOS-FNAME,     " Field Name
        VALUE_NEW    TYPE CDPOS-VALUE_NEW, " New contents of changed field
        VALUE_OLD    TYPE CDPOS-VALUE_OLD, " Old contents of changed field
      END OF FS_CDPOS,
    Internal Table to hold Change document items                        *
      T_CDPOS LIKE STANDARD TABLE
                OF FS_CDPOS.
    Field String to hold Date Element Name                              *
    DATA:
      BEGIN OF FS_DATAELE,
        TABNAME   TYPE DD03L-TABNAME,      " Table Name
        FIELDNAME TYPE DD03L-FIELDNAME,    " Field Name
        ROLLNAME  TYPE DD03L-ROLLNAME,     " Data element
      END OF FS_DATAELE,
    Internal Table to hold Data Element Name                            *
      T_DATAELE LIKE STANDARD TABLE
                  OF FS_DATAELE.
    Field String to hold Short Text of the Date Element                 *
    DATA:
      BEGIN OF FS_TEXT,
        ROLLNAME TYPE DD04T-ROLLNAME,      " Data element
        DDTEXT   TYPE DD04T-DDTEXT,        " Short Text
      END OF FS_TEXT,
    Internal Table to hold Short Text of the Date Element               *
      T_TEXT LIKE STANDARD TABLE
               OF FS_TEXT.
    Field String to hold data to be displayed on the ALV grid           *
    DATA:
      BEGIN OF FS_OUTTAB,
        EBELN      TYPE EKKO-EBELN,        " Purchasing Document Number
        ERNAM      TYPE EKKO-ERNAM,        " Name of Person who Created the
                                           " Object
        LIFNR      TYPE EKKO-LIFNR,        " Vendor's account number
        EKGRP      TYPE EKKO-EKGRP,        " Purchasing group
        BEDAT      TYPE EKKO-BEDAT,        " Purchasing Document Date
        WERKS      TYPE LFA1-WERKS,        " Plant
        NAME1      TYPE LFA1-NAME1,        " Name1
        USERNAME   TYPE CDHDR-USERNAME,    " User name
        UDATE      TYPE CDHDR-UDATE,       " Creation date of the change
                                           " document
        DDTEXT     TYPE DD04T-DDTEXT,      " Short Text Describing R/3
                                           " Repository Objects
        VALUE_NEW  TYPE CDPOS-VALUE_NEW,   " New contents of changed field
        VALUE_OLD  TYPE CDPOS-VALUE_OLD,   " Old contents of changed field
      END OF FS_OUTTAB,
    Internal Table to hold data to be displayed on the ALV grid         *
      T_OUTTAB LIKE STANDARD TABLE
                 OF FS_OUTTAB.
                   C L A S S   D E F I N I T I O N                      *
      CLASS LCL_EVENT_HANDLER  DEFINITION DEFERRED.
    *" Data declarations...................................................
    Work variables                                                      *
      DATA:
        W_EBELN     TYPE EKKO-EBELN,       " Purchasing Document Number
        W_LIFNR     TYPE EKKO-LIFNR,       " Vendor's account number
        W_EKGRP     TYPE EKKO-EKGRP,       " Purchasing group
        W_VALUE     TYPE EKKO-EBELN,       " Reflected Value
        W_SPACE     VALUE ' ',             " Space
    *--- ALV Grid
        W_GRID      TYPE REF TO CL_GUI_ALV_GRID,
    *--- Event Handler
        EVENT_CLICK TYPE REF TO LCL_EVENT_HANDLER,
    *--- Field catalog table
        T_FIELDCAT  TYPE LVC_T_FCAT.
                          AT SELECTION-SCREEN EVENT                     *
    AT SELECTION-SCREEN ON S_EBELN.
      PERFORM VALIDATE_PD_NUM.
    AT SELECTION-SCREEN ON S_LIFNR.
      PERFORM VALIDATE_VEN_NUM.
    AT SELECTION-SCREEN ON S_EKGRP.
      PERFORM VALIDATE_PUR_GRP.
                          START-OF-SELECTION EVENT                      *
    START-OF-SELECTION.
      PERFORM SELECT_PO.
      PERFORM SELECT_OBJ_ID.
      PERFORM SELECT_CHANGED_VALUE.
      PERFORM SELECT_PUR_DOC.
      PERFORM SELECT_VENDOR.
      PERFORM DESCRIPTION.
                          END-OF-SELECTION EVENT                        *
    END-OF-SELECTION.
      IF NOT T_EKKO IS INITIAL.
        PERFORM FILL_OUTTAB.
      ENDIF.                               " IF NOT T_EKKO...
      PERFORM PREPARE_FIELD_CATALOG CHANGING T_FIELDCAT .
      CALL SCREEN 100.
          CLASS LCL_EVENT_HANDLER DEFINITION
    <b>CLASS LCL_EVENT_HANDLER DEFINITION .
      PUBLIC SECTION .
        METHODS:
            HANDLE_HOTSPOT_CLICK
                 FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
                           IMPORTING E_ROW_ID E_COLUMN_ID.
    ENDCLASS.                              " LCL_EVENT_HANDLER</b> DEFINITION
          CLASS LCL_EVENT_HANDLER IMPLEMENTATION
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION .
    *---Handle Double Click
    <b>  METHOD HANDLE_HOTSPOT_CLICK .
        PERFORM GET_CELL_INFO.
        SET PARAMETER ID 'BES' FIELD W_VALUE.
        CALL TRANSACTION 'ME23N'.
      ENDMETHOD.                           " HANDLE_HOTSPOT_CLICK</b>
    ENDCLASS.                              " LCL_EVENT_HANDLER
    *&      Module  STATUS_0100  OUTPUT
          PBO Event
    MODULE STATUS_0100 OUTPUT.
      IF T_OUTTAB IS INITIAL.
        LEAVE PROGRAM.
      ENDIF.                               " IF T_OUTTAB...
      SET PF-STATUS 'OOPS'.
      SET TITLEBAR 'TIT'.
      IF W_GRID IS INITIAL.
        CREATE OBJECT W_GRID
          EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
            I_PARENT       = CL_GUI_CONTAINER=>SCREEN0
       I_APPL_EVENTS     =
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
       I_FCAT_COMPLETE   = SPACE
          EXCEPTIONS
            ERROR_CNTL_CREATE = 1
            ERROR_CNTL_INIT   = 2
            ERROR_CNTL_LINK   = 3
            ERROR_DP_CREATE   = 4
            OTHERS            = 5.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.                             " IF SY-SUBRC <> 0
        CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
         EXPORTING
           I_BUFFER_ACTIVE               =
           I_BYPASSING_BUFFER            =
           I_CONSISTENCY_CHECK           =
           I_STRUCTURE_NAME              =
           IS_VARIANT                    =
           I_SAVE                        =
           I_DEFAULT                     = 'X'
           IS_LAYOUT                     =
           IS_PRINT                      =
           IT_SPECIAL_GROUPS             =
           IT_TOOLBAR_EXCLUDING          =
           IT_HYPERLINK                  =
           IT_ALV_GRAPHICS               =
           IT_EXCEPT_QINFO               =
           IR_SALV_ADAPTER               =
          CHANGING
            IT_OUTTAB                     = T_OUTTAB
            IT_FIELDCATALOG               = T_FIELDCAT
           IT_SORT                       =
           IT_FILTER                     =
          EXCEPTIONS
            INVALID_PARAMETER_COMBINATION = 1
            PROGRAM_ERROR                 = 2
            TOO_MANY_LINES                = 3
            OTHERS                        = 4
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.                             " IF SY-SUBRC <> 0.
      ENDIF.                               " IF W_GRID IS INITIAL
      CREATE OBJECT EVENT_CLICK.
      SET HANDLER EVENT_CLICK->HANDLE_HOTSPOT_CLICK FOR W_GRID.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          PAI Event
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
        WHEN 'EXIT'.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Form  PREPARE_FIELD_CATALOG
          Subroutine to build the Field catalog
          <--P_T_FIELDCAT  Field Catalog Table
    FORM PREPARE_FIELD_CATALOG  CHANGING PT_FIELDCAT TYPE LVC_T_FCAT .
      DATA LS_FCAT TYPE LVC_S_FCAT.
      LS_FCAT-FIELDNAME = 'EKGRP'(011).
      LS_FCAT-REF_TABLE = 'EKKO'(002).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    <b>  LS_FCAT-FIELDNAME = 'EBELN'(001).
      LS_FCAT-REF_TABLE = 'EKKO'(002) .
      LS_FCAT-EMPHASIZE = 'C411'(007).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '10'.
      LS_FCAT-HOTSPOT   = 'X'(004).
      APPEND LS_FCAT TO PT_FIELDCAT .
      CLEAR LS_FCAT .</b>
      LS_FCAT-FIELDNAME = 'ERNAM'(006) .
      LS_FCAT-REF_TABLE = 'EKKO'(002) .
      LS_FCAT-OUTPUTLEN = '15' .
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'BEDAT'(013).
      LS_FCAT-REF_TABLE = 'EKKO'(002).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'LIFNR'(009).
      LS_FCAT-REF_TABLE = 'EKKO'(002).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'NAME1'(015).
      LS_FCAT-REF_TABLE = 'LFA1'(016).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'UDATE'(021).
      LS_FCAT-REF_TABLE = 'CDHDR'(019).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'USERNAME'(018).
      LS_FCAT-REF_TABLE = 'CDHDR'(019).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '10'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'DDTEXT'(023).
      LS_FCAT-REF_TABLE = 'DD04T'(024).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '15'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'VALUE_OLD'(029).
      LS_FCAT-REF_TABLE = 'CDPOS'(027).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '12'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
      LS_FCAT-FIELDNAME = 'VALUE_NEW'(026).
      LS_FCAT-REF_TABLE = 'CDPOS'(027).
      LS_FCAT-INTTYPE   = 'C'(003).
      LS_FCAT-OUTPUTLEN = '12'.
      APPEND LS_FCAT TO PT_FIELDCAT.
      CLEAR LS_FCAT.
    ENDFORM.                               " PREPARE_FIELD_CATALOG
    *& Form  SELECT_PO
    Subroutine to select all the Purchase Orders
    There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PO .
      SELECT EBELN                         " Purchasing Document Number
             ERNAM                         " Name of Person who Created
                                           " the Object
             LIFNR                         " Vendor's account number
             EKGRP                         " Purchasing group
             BEDAT                         " Purchasing Document Date
        FROM EKKO
        INTO TABLE T_EBELN
       WHERE EBELN IN S_EBELN
         AND BEDAT IN S_BEDAT.
    IF SY-SUBRC NE 0.
       MESSAGE S401(M8).
    ENDIF.                                " IF SY-SUBRC NE 0
    ENDFORM.                               " SELECT_PO
    *&  Form  SELECT_OBJ_ID
      Subroutine to select Object ID
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_OBJ_ID .
      IF NOT T_EBELN IS INITIAL.
        SELECT OBJECTCLAS                  " Object Class
               OBJECTID                    " Object value
               CHANGENR                    " Document change number
               USERNAME                    " User name
               UDATE                       " Creation date
          FROM CDHDR
          INTO TABLE T_CDHDR
       FOR ALL ENTRIES IN T_EBELN
         WHERE OBJECTID EQ T_EBELN-EBELN
           AND UDATE IN S_UDATE
           AND TCODE IN ('ME21N','ME22N','ME23N').
       IF SY-SUBRC NE 0.
         MESSAGE S833(M8) WITH 'Header Not Found'(031).
       ENDIF.                              " IF SY-SUBRC NE 0.
    ENDIF.                                " IF NOT T_EBELN IS INITIAL
    ENDFORM.                               " SELECT_OBJ_ID
    *&  Form  SELECT_CHANGED_VALUE
      Subroutine to select Changed Values
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_CHANGED_VALUE .
      IF NOT T_CDHDR IS INITIAL.
        SELECT OBJECTCLAS                  " Object class
               OBJECTID                    " Object value
               CHANGENR                    " Document change number
               TABNAME                     " Table Name
               FNAME                       " Field Name
               VALUE_NEW                   " New contents of changed field
               VALUE_OLD                   " Old contents of changed field
          FROM CDPOS
          INTO TABLE T_CDPOS
       FOR ALL ENTRIES IN T_CDHDR
         WHERE OBJECTCLAS EQ T_CDHDR-OBJECTCLAS
           AND OBJECTID   EQ T_CDHDR-OBJECTID
           AND CHANGENR   EQ T_CDHDR-CHANGENR.
        IF SY-SUBRC NE 0.
          MESSAGE S833(M8) WITH 'Item Not Found'(032).
        ENDIF.                             " IF SY-SUBRC NE 0.
      ENDIF.                               " IF NOT T_CDHDR IS INITIAL
    ENDFORM.                               " SELECT_CHANGED_VALUE
    *&   Form  SELECT_PUR_DOC
       Subroutine to select Purchase Order Details
       There are no interface parameters to be passed to this subroutine.
    FORM SELECT_PUR_DOC .
      IF NOT T_CDPOS IS INITIAL.
        SORT T_EBELN BY EBELN.
        LOOP AT T_CDPOS INTO FS_CDPOS.
          READ TABLE T_EBELN INTO FS_EBELN WITH KEY EBELN =
                                          FS_CDPOS-OBJECTID BINARY SEARCH.
          IF SY-SUBRC NE 0.
            DELETE TABLE T_EBELN FROM FS_EBELN.
          ENDIF.                           " IF SY-SUBRC NE 0.
        ENDLOOP.                           " LOOP AT T_CDPOS...
        LOOP AT T_EBELN INTO FS_EBELN.
          MOVE FS_EBELN-EBELN TO FS_EKKO-EBELN.
          MOVE FS_EBELN-ERNAM TO FS_EKKO-ERNAM.
          MOVE FS_EBELN-LIFNR TO FS_EKKO-LIFNR.
          MOVE FS_EBELN-EKGRP TO FS_EKKO-EKGRP.
          MOVE FS_EBELN-BEDAT TO FS_EKKO-BEDAT.
          APPEND FS_EKKO TO T_EKKO.
        ENDLOOP.                           " LOOP AT T_EBELN...
      ENDIF.                               " IF NOT T_CDPOS IS INITIAL
    ENDFORM.                               " SELECT_PUR_DOC
    *&  Form  SELECT_VENDOR
      Subroutine to select Vendor details
      There are no interface parameters to be passed to this subroutine.
    FORM SELECT_VENDOR .
      IF NOT T_EKKO IS INITIAL.
        SELECT LIFNR                       " Account Number of Vendor or
                                           " Creditor
               NAME1                       " Name 1
          FROM LFA1
          INTO TABLE T_LFA1
       FOR ALL ENTRIES IN T_EKKO
         WHERE LIFNR EQ T_EKKO-LIFNR.
       IF SY-SUBRC NE 0.
         MESSAGE S002(M8) WITH 'Master Details'(033).
       ENDIF.                              " IF SY-SUBRC NE 0.
      ENDIF.                               " IF NOT T_EKKO IS INITIAL
    ENDFORM.                               " SELECT_VENDOR
    *&  Form  DESCRIPTION
      Subroutine to get the description
      There are no interface parameters to be passed to this subroutine.
    FORM DESCRIPTION .
      IF NOT T_CDPOS IS INITIAL.
        SELECT TABNAME                     " Table Name
               FIELDNAME                   " Field Name
               ROLLNAME                    " Data element
          FROM DD03L
          INTO TABLE T_DATAELE
       FOR ALL ENTRIES IN T_CDPOS
         WHERE TABNAME EQ T_CDPOS-TABNAME
           AND FIELDNAME EQ T_CDPOS-FNAME.
        IF NOT T_DATAELE IS INITIAL.
          SELECT ROLLNAME                  " Data element
                 DDTEXT                    " Short Text Describing R/3
                                           " Repository Objects
            FROM DD04T
            INTO TABLE T_TEXT
         FOR ALL ENTRIES IN T_DATAELE
           WHERE ROLLNAME EQ T_DATAELE-ROLLNAME
             AND DDLANGUAGE EQ 'EN'.
          IF SY-SUBRC NE 0.
            EXIT.
          ENDIF.                           " IF SY-SUBRC NE 0.
        ENDIF.                             " IF NOT T_DATAELE IS INITIAL.
      ENDIF.                               " IF NOT T_CDPOS IS INITIAL.
    ENDFORM.                               " DESCRIPTION
    *&  Form  FILL_OUTTAB
      Subroutine to populate the Outtab
      There are no interface parameters to be passed to this subroutine.
    FORM FILL_OUTTAB .
      SORT T_CDHDR BY OBJECTID.
      SORT T_CDPOS BY OBJECTCLAS OBJECTID CHANGENR.
      SORT T_LFA1  BY LIFNR.
      SORT T_DATAELE BY TABNAME FIELDNAME.
      SORT T_TEXT BY ROLLNAME.
      LOOP AT T_EKKO INTO FS_EKKO.
        MOVE FS_EKKO-EBELN TO FS_OUTTAB-EBELN.
        MOVE FS_EKKO-ERNAM TO FS_OUTTAB-ERNAM.
        MOVE FS_EKKO-LIFNR TO FS_OUTTAB-LIFNR.
        MOVE FS_EKKO-EKGRP TO FS_OUTTAB-EKGRP.
        MOVE FS_EKKO-BEDAT TO FS_OUTTAB-BEDAT.
        READ TABLE T_CDHDR INTO FS_CDHDR WITH KEY OBJECTID = FS_EKKO-EBELN
                                                              BINARY SEARCH.
          IF SY-SUBRC EQ 0.
            MOVE FS_CDHDR-USERNAME TO FS_OUTTAB-USERNAME.
            MOVE FS_CDHDR-UDATE    TO FS_OUTTAB-UDATE.
            READ TABLE T_CDPOS INTO FS_CDPOS WITH KEY
                                          OBJECTCLAS = FS_CDHDR-OBJECTCLAS
                                          OBJECTID   = FS_CDHDR-OBJECTID
                                          CHANGENR   = FS_CDHDR-CHANGENR
                                                              BINARY SEARCH.
             IF SY-SUBRC EQ 0.
               MOVE FS_CDPOS-VALUE_OLD TO FS_OUTTAB-VALUE_OLD.
               MOVE FS_CDPOS-VALUE_NEW TO FS_OUTTAB-VALUE_NEW.
               READ TABLE T_DATAELE INTO FS_DATAELE WITH KEY
                                         TABNAME = FS_CDPOS-TABNAME
                                         FIELDNAME = FS_CDPOS-FNAME
                                                           BINARY SEARCH.
                 IF SY-SUBRC EQ 0.
                   READ TABLE T_TEXT INTO FS_TEXT WITH KEY
                                         ROLLNAME = FS_DATAELE-ROLLNAME
                                                          BINARY SEARCH.
                     IF SY-SUBRC EQ 0.
                       MOVE FS_TEXT-DDTEXT TO FS_OUTTAB-DDTEXT.
                     ENDIF.                " IF SY-SUBRC EQ 0.
                 ENDIF.                    " IF SY-SUBRC EQ 0.
             ENDIF.                        " IF SY-SUBRC EQ 0.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        READ TABLE T_LFA1 INTO FS_LFA1 WITH KEY LIFNR = FS_EKKO-LIFNR
                                                         BINARY SEARCH.
          IF SY-SUBRC EQ 0.
            MOVE FS_LFA1-NAME1 TO FS_OUTTAB-NAME1.
          ENDIF.                           " IF SY-SUBRC EQ 0.
      APPEND FS_OUTTAB TO T_OUTTAB.
      ENDLOOP.                             " LOOP AT T_EKKO...
    ENDFORM.                               " FILL_OUTTAB
    *&   Form  GET_CELL_INFO
       Subroutine to get the Cell Information
    -->  W_VALUE   Holds the value of Hotspot clicked
    FORM GET_CELL_INFO .
      CALL METHOD W_GRID->GET_CURRENT_CELL
        IMPORTING
         E_ROW     =
          E_VALUE   = W_VALUE
         E_COL     =
         ES_ROW_ID =
         ES_COL_ID =
         ES_ROW_NO =
    ENDFORM.                               " GET_CELL_INFO
    *&   Form  VALIDATE_PD_NUM
       Subroutine to validate Purchase Document Number
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PD_NUM .
      IF NOT S_EBELN[] IS INITIAL.
        SELECT EBELN                       " Purchase Document Number
          FROM EKKO
          INTO W_EBELN
         UP TO 1 ROWS
         WHERE EBELN IN S_EBELN.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          MESSAGE E717(M8).
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_EBELN[]...
    CLEAR SSCRFIELDS-UCOMM.
    ENDFORM.                               " VALIDATE_PD_NUM
    *&   Form  VALIDATE_VEN_NUM
       Subroutine to validate Vendor Number
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_VEN_NUM .
      IF NOT S_LIFNR[] IS INITIAL.
        SELECT LIFNR                       " Vendor Number
          FROM LFA1
          INTO W_LIFNR
         UP TO 1 ROWS
         WHERE LIFNR IN S_LIFNR.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          MESSAGE E002(M8) WITH W_SPACE.
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_LIFNR[]...
    CLEAR SSCRFIELDS-UCOMM.
    ENDFORM.                               " VALIDATE_VEN_NUM
    *&   Form  VALIDATE_PUR_GRP
       Subroutine to validate the Purchase Group
       There are no interface parameters to be passed to this subroutine.
    FORM VALIDATE_PUR_GRP .
      IF NOT S_EKGRP[] IS INITIAL.
        SELECT EKGRP                       " Purchase Group
          FROM T024
          INTO W_EKGRP
         UP TO 1 ROWS
         WHERE EKGRP IN S_EKGRP.
        ENDSELECT.
        IF SY-SUBRC NE 0.
          MESSAGE E622(M8) WITH W_SPACE.
        ENDIF.                             " IF SY-SUBRC NE 0
      ENDIF.                               " IF NOT S_EKFRP[]...
    CLEAR SSCRFIELDS-UCOMM.
    ENDFORM.                               " VALIDATE_PUR_GRP

  • Navigate from ALV list to normal Report

    Hi ,
    I am working on a ALV report where it will display the list of materials and by selecting these materials from the list and process them using a custom button , it should take me to the normal report which give the log from that material processing.
    Any ideas navigating from AVL to normal report in the same program would be appriciated.
    Thank you.

    Hi,
    if you use drill down you have to define header print twice:
    TOP-OF-PAGE.
      perform 050print_header .
    END-OF-PAGE.
    TOP-OF-PAGE DURING LINE-SELECTION.
      perform 050print_header .
    END-OF-PAGE.

  • Taking download into excel from ALV Grid - header is printing in two lines

    Hi All,
    I have a scenario where I am taking the download from ALV grid to an excel sheet. Now the header of the ALV (column names) is appearing in two lines in the downloaded excel sheet while items (records of the ALV table) are getting displayed in a single line.
    This download is taken from the standard download to local file (spreadsheet) button provided by SAP for ALVs.
    I am using function module "Reuse_alv_grid_display" for the purpose.
    Can somebody provide an idea how I can avoid the header printing in two lines and keep the length as it is.
    Thanks in Advance,
    Chandan

    Hi..
    1. Pass header name in internal table appned first line.
    2. after that pass u r data .
    3. Use  FM. WS_DOWNLOAD 
    Salil ......
    Edited by: salil chavan on Nov 26, 2008 11:07 AM

  • Downloading records in in excel sheet from ALV.

    Hi,
    I am downloading Records from ALV GRID DIsplay to Excel sheet but i am unable to get all records that are displayed in ALV report.
    I am getting only 73 records if i have only 180
    Any inputs please for correctine the error
    Regards
    Rasheed.

    hi
    you can follow these stapes and get ur work done
    go to List > select Export  > Spreadsheet or just click the excel icon from the tool bar.This would download the data to excel.
    hope this helps
    regards
    Aakash Banga

  • Downloads from ALV GRID-Text conversion to dates in EXCEL

    When downloading table displays of data from ALV-GRID for excel spreadsheet, we end of with files that have a header and various line ifnromation.  IF we manually clear up the display, then we can have the individicual column headers used and force them to text but if we just call the file up as an EXCEL spreadsheet, some part numbers such 12-3465 appear in Excel as Dec-65.
    The following is an example of the record (but it is word wrapped within this display limit).  In actuality, the verbage enclosed with the <b> represent the start of the  lines that have actual display data running out about 90 characters.
    Suggestions on how to make the download immediately correct in Excel direct from SAP ALV-GRID without cleaning out the heading lines and manually forcing the affected columns to TEXT format?
    thanks
    <b>03/02/2007</b>                                                                    Dynamic List Display                                                                                1
    <b>Materials-Inforecord Details Report</b>
    <b>Purchasing Org: ILMO</b>
                        <b>Report Run Date:03/02/2007</b>                    <b>Report Time:14:31:16</b>
         <b>Plnt     Mat Grp     Vendor     Name 1     Material     Material</b> description     Vendor Cat     Mfr     MPN     PC     Item Chg.     OUn      Eq to     BUn     Net price     Per     OPUn     Inforecord     PGr     Mv Avg        per     ValCl
         <b>0042     04     106070     BURROWS COMPANY</b>     184110     Glv Exam Ltx Non Ster     02-5001     TILLOTSON     02-5001               CA     2,000     EA        93.40      1     CA     5300006999     999     93.40     2,000     6438

    there are different options to export to excel which all behave differently, if you go for the menu ->export it differs from the export button from the alv buttonbar.
    try the different export to excel options perhaps there is one that behaves the way you want
    kind regards
    arthur de smidt

  • Excel fiel from ALV report

    Hi Gurus,
        is der any way to download data from ALV report to excel sheet depending on  layout set dyanmically.
      I mean to say that if I choose a layout then data has to transfer to excel sheet according to layout fields automaticaly.

    I think this can be done by oops ALV , are u using reusealv F.M to call output in ALV ?
    Try the below kind of ALV
    IN PBO -
    >
    SET PF-STATUS 'PROJREP'.
    SET TITLEBAR text-046.
    DATA: g_container TYPE scrfname VALUE 'ALV',
          g_grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    IF g_custom_container IS INITIAL.
        CREATE OBJECT g_custom_container
               EXPORTING container_name = g_container.  (Name of the container )
    CREATE OBJECT g_grid1
               EXPORTING i_parent = g_custom_container.
    PERFORM create_field_catalog_ce
    CALL METHOD g_grid1->set_frontend_fieldcatalog
          EXPORTING
            it_fieldcatalog = t_fcat_ce.
    ALL METHOD g_grid1->set_table_for_first_display
          EXPORTING
            i_structure_name = 'ST_DISPLAY'
          CHANGING
            it_outtab        = t_display_io
            it_fieldcatalog  = t_fcat_ce.
    ->Create Object to receive events and link them to handler methods.
    When the ALV Control raises the event for the specified instance
    the corresponding method is automatically called.
        CREATE OBJECT g_event_receiver.
        SET HANDLER g_event_receiver->handle_double_click FOR g_grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = g_grid1.
    IN PAI -->
    CALL METHOD cl_gui_cfw=>dispatch.

  • Get Selections From ALV on Multiple Selection Mode

    Hi,
    How can i get values of selected rows from ALV that has selection '0..n' (multiple selection) ?
    Can somebody help me pls?
    Thanks.

    Hi Nurullah,
    Steps to make multiple rows selectable in ALV:
    1) Create the selection property of the node that you are binding to the DATA node as o..n
    2) Un-check the, "Initialization Lead Selection" checkbox for the node which you are using to bind to the DATA node
    3) In the WDDOINIT method specify the ALV's selection mode as MULTI_NO_LEAD. It is important that you set the selection mode to MULTI_NO_LEAD or else in the end you would be capturing 1 row lesser than the total number of rows the user has selected. This is because 1 of the rows would have the LeadSelection property & our logic wouldnt be reading the data for that row. Check the example code fragment as shown below:
    DATA lo_value TYPE REF TO cl_salv_wd_config_table.
      lo_value = lo_interfacecontroller->get_model( ).
      CALL METHOD lo_value->if_salv_wd_table_settings~set_selection_mode
        EXPORTING
          value = cl_wd_table=>e_selection_mode-MULTI_NO_LEAD.
    Steps to get the multiple rows selected by the user
    In order to get the multiple rows which were selected by the user you will just have to call the get_selected_elements method of if_wd_context_node. So as you can see its no different from how you would get the multiple rows selected by the user in a table ui element. First get the reference of the node which you have used to bind to the ALV & then call this method on it. Check the example code fragment below:
    METHOD get_selected_rows .
      DATA: temp TYPE string.
      DATA: lr_node TYPE REF TO if_wd_context_node,
                wa_temp  TYPE REF TO if_wd_context_element,
                ls_node1 TYPE wd_this->element_node_flighttab,
                lt_node1 TYPE wd_this->elements_node_flighttab.
      lr_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' ).
    " This would now contain the references of all the selected rows
      lt_temp = lr_node->get_selected_elements( ).
        LOOP AT lt_temp INTO wa_temp.
    " Use the references to get the exact row data
          CALL METHOD wa_temp->get_static_attributes
            IMPORTING
              static_attributes = ls_node1.
          APPEND ls_node1 TO lt_node1.
          CLEAR ls_node1.
        ENDLOOP.
    ENDMETHOD.
    Hope this helps resolve your problem.
    Regards,
    Uday

  • Capturing data from ALV grid

    Dear experts.
    Can anyone help me to capture data from ALV grid to pass to a BAPI FM.
    My ALV grid has the check box as first column and I want to capture only the rows in the grid with these checkboxes checked. I would prefer to do it without OO.
    Regards
    Sathar

    Loop at the table used for ALV data where <checkbox-field> = 'X'.
    Best,
    Jim

  • Saving Data from ALV.

    hi all.
    I have an issue regarding saving data from alv to data base table.
    The problem is like this. I have an internal table consist of 10 column from three diferent tables.one primary key is there.
    now i have displayed it in alv grid. there is a column of quantity. i made some changes in quantity of some rows. now i want to save it into the database table from which that quantity field fetched.
    i used first check_changed_data method. if the flag is set it means data is changed.
    wat shud i do to save that quantity column into data base.
    Thanks In advance.
    varu

    Hi,
    <b>To modify database or ztable from the ALV grid,you need to do the following:</b>
    ---You have to modify the field Catalog fields (fields that you want to make editable).Set the field <b>EDIT as 'X'</b>.For example if you want to make the field below editable:
    ls_fcat-fieldname = 'CARRID'.
    ls_fcat-edit = 'X'.
    APPEND ls_fcat TO pt_fieldcat.
    ---Call the method below before you call the set_table_for_first_display.
    CALL METHOD ALV_GRID_INSTANCE-><b>set_ready_for_input</b>
    EXPORTING
    i_ready_for_input = 0. ( For Display ) and ('1' for Edit )
    After this put the set_table_for_first_display.
    <b>Now if the ALV data has changed,and you want to change the database or ztable,then in your pf status give a function code for SAVE button in the GUI.
    In the PAI of the screen,in user command module write the following:</b>
    WHEN 'SAVE'.
    <b>call method gr_alvgrid->check_changed_data</b>
    importing e_valid = l_valid.
    if l_valid = 'X'.
    <b>MODIFY spfli FROM TABLE itab_spfli.</b>
    endif.
    <b>(l_valid is a flag.</b>
    DATA:l_valid type c.
    If you want to check if the user has entered any value on the grid, use the Method : CALL METHOD gr_alvgrid->check_changed_data.
    This method returns a flag l_valid which can be checked to see if the data on the ALV grid has been changed or not.)
    Regards,
    Beejal
    **Reward if this helps

  • Exclude buttons from ALV

    Hi All,
      I want to exclude pushbuttons from ALV. Can any body suggest me how to do this. I am using classes to display ALV.
    Regards,
    Venkat.

    in the pbo of your screen, before displaying your alv grid write in the following way:-
    data: g_alv_grid          type ref to cl_gui_alv_grid,
             g_exclude          type ui_func,
             g_t_tlbr_excl       type ui_functions.
    *PBO if used container or screen ,
    start of selection - if working with selection screen but before displaying alv.
    Exclude ICONS
        perform form_exculde_icons.
        call method g_alv_grid->set_table_for_first_display
          EXPORTING
            is_variant           = VARIANT
            is_layout            = LAYOUT
            is_print             =  PRINT
            it_toolbar_excluding = g_t_tlbr_excl
          CHANGING
            it_outtab            = ITAB
            it_fieldcatalog      = FIELDCATALOG[]
        if sy-subrc <> 0.
          write: 'Method call ''Set_table_for_first_display'' failed.'.
          exit.
        endif.
    form form_exculde_icons .
    Exclude alv sum button
      g_exclude = cl_gui_alv_grid=>mc_fc_sum.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv count button
      g_exclude = cl_gui_alv_grid=>mc_fc_count.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv average button
      g_exclude = cl_gui_alv_grid=>mc_fc_average.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv maximum button
      g_exclude = cl_gui_alv_grid=>mc_fc_maximum.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv manimum button
      g_exclude = cl_gui_alv_grid=>mc_fc_minimum.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv subtotal button
      g_exclude = cl_gui_alv_grid=>mc_fc_subtot.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv auf button
      g_exclude = cl_gui_alv_grid=>mc_fc_auf.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv locpaste button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv new_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv mb_view button
      g_exclude = cl_gui_alv_grid=>mc_mb_view.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_view button
      g_exclude = cl_gui_alv_grid=>mc_fc_views.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv print_prev button
      g_exclude = cl_gui_alv_grid=>mc_fc_print_prev.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv viewgrid button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_grid.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv view_excel button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_excel.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv view_crystal button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_crystal.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv view_lotus button
      g_exclude = cl_gui_alv_grid=>mc_fc_view_lotus.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv send button
      g_exclude = cl_gui_alv_grid=>mc_fc_send.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_abc button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_abc.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_xint button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_xint.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_expcrdesig button
      g_exclude = cl_gui_alv_grid=>mc_fc_expcrdesig.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_expcrtempl button
      g_exclude = cl_gui_alv_grid=>mc_fc_expcrtempl.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv mb_paste button
      g_exclude = cl_gui_alv_grid=>mc_mb_paste.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv load_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_load_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv current_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_current_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv maintain_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_maintain_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv save_variant button
      g_exclude = cl_gui_alv_grid=>mc_fc_save_variant.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv select_all button
      g_exclude = cl_gui_alv_grid=>mc_fc_select_all.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv deselect_all button
      g_exclude = cl_gui_alv_grid=>mc_fc_deselect_all.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv graph button
      g_exclude = cl_gui_alv_grid=>mc_fc_graph.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv info button
      g_exclude = cl_gui_alv_grid=>mc_fc_info.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv f4 button
      g_exclude = cl_gui_alv_grid=>mc_fc_f4.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_report button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_report.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_check button
      g_exclude = cl_gui_alv_grid=>mc_fc_check.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv fc_refresh button
      g_exclude = cl_gui_alv_grid=>mc_fc_refresh.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv loc_cut button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv loc_copy button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv loc_undo button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv append_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv insert_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv delete_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv copy_row button
      g_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv reprep button
      g_exclude = cl_gui_alv_grid=>mc_fc_reprep.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_chain button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_chain.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_more button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_more.
      append g_exclude to g_t_tlbr_excl.
    Exclude alv call_master_data button
      g_exclude = cl_gui_alv_grid=>mc_fc_call_master_data.
      append g_exclude to g_t_tlbr_excl.
    endform.

  • Exporting data from ALV Report...

    Dear All,
    While I am exporting data from ALV report to any other Format (Excel, Txt, HTML) it only export the data of last column, but the heading is comming properly and also the column heading is displaying properly.
    So how to rectify it. (the report is Object Oriented).
    Regards,
    Dahrmesh

    Hi Davabap,
    Refer this sample program "BCALV_GRID_VERIFY" . I hope it is problem with structure mismatching.
    Otherwise can you paste your code ?
    Regards,
    Vicky
    PS: Award points if helpful

  • Call transaction from alv

    i am calling a transaction from alv i want to select the check boxes on th called transaction and go to the next screen how do i do that

    Hello Chandan
    You have to handle the DOUBLE_CLICK event either in your callback form routine (FM-based ALV) or event handler method for event USER_COMMAND (ABAP-OO based ALV).
    If you call the transaction directly you will not have the authority check for this transaction. If you need this, you can use function module <b>ABAP4_CALL_TRANSACTION</b> instead.
    If you want to open the transaction in a new window you can use the static method <b>CL_RECA_GUI_SERVICES=>CALL_TRANSACTION</b> (no authority check!).
    Regards
    Uwe

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

  • Jump from alv report to qa03 screen based on PRUEFLOS field

    Hi experts,
    I developed one alv report ,in that one field name is PRUEFLOS (inspection lot number).I want to jump from alv report
    to QA03 screen based on PRUEFLOS field.I wrote in this way but i didn't get.
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
      CASE SELFIELD-FIELDNAME.
        WHEN 'PRUEFLOS'.
          READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
          SET PARAMETER ID  'QLS' FIELD T_FINAL-PRUEFLOS.
          CALL TRANSACTION 'QA03'   AND SKIP FIRST SCREEN.
      ENDCASE.
    ENDFORM.
    what is the problem ?pls help me in this.

    Hi Ram,
    Recheck:
    1) You have passed 'FORM USER_COMMAND' in 'I_CALLBACK_USER_COMMAND' while calling f.m. for ALV displa, and
    2) You have checked the value of user command, i.e.
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
    CASE SY-UCOMM.
    WHEN '&IC1'.
    CASE SELFIELD-FIELDNAME.
    WHEN 'PRUEFLOS'.
    READ TABLE T_FINAL INDEX SELFIELD-TABINDEX.
    SET PARAMETER ID 'QLS' FIELD T_FINAL-PRUEFLOS.
    CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
    ENDCASE.
    ENDCASE.
    ENDFORM.
    Regards,
    Birendra

Maybe you are looking for