Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Reporting

Former Member
0 Kudos
356

Dear All,

I have wrote a report  where datas will be fetched from ekko and ekpo , first it will fetch datas from ekpo then after dbl clk it will produce another secondary list which will show up the data from ekko , this similar coding is working for mara and makt but the similar coding isnt working for ekko and ekpo table ,

and it is producing  an error field symbol has not yet been assigned .


Regards,

Rohan.

16 REPLIES 16

Ashg1402
Contributor
0 Kudos
330

Hi,

are you using field symbol in event handling part.?

Can you post your code.? only the event handling part.

Regards

Ashish

PeterJonker
Active Contributor
0 Kudos
330

Did you check the sourcecode where the field symbol is queried (in debug).

The error message is pretty clear of what has happened.  Can you share some of your code ? Which ALV functionality are you using OO (which one) or Function modules ? Did you debug your code ?

former_member197132
Participant
0 Kudos
330

your code please.

Former Member
0 Kudos
330

Hi all, the code -

TYPE-POOLS: slis.

TYPES: BEGIN OF ty_ekpo,

        ebeln TYPE ebeln,

        ebelp TYPE ebelp,

        werks TYPE werks,

        lgort TYPE lgort,

        END OF ty_ekpo.

TYPES: BEGIN OF ty_ekko,

        ebeln type ebeln ,

        bukrs TYPE bukrs,

        bstyp TYPE bstyp,

*        spras TYPE spras,

        END OF ty_ekko.

DATA: it_ekpo TYPE TABLE OF ty_ekpo,

      wa_ekpo TYPE ty_ekpo.

DATA: it_ekko TYPE TABLE OF ty_ekko,

      wa_ekko TYPE ty_ekko.

DATA: it_fcat TYPE slis_t_fieldcat_alv,

      wa_fcat TYPE slis_fieldcat_alv.

DATA: it_fcat1 TYPE slis_t_fieldcat_alv,

      wa_fcat1 TYPE slis_fieldcat_alv.

DATA:v_ebeln TYPE ekpo-ebeln.

SELECT-OPTIONS: s_ebeln FOR  v_ebeln.

START-OF-SELECTION.

  PERFORM get_data.

  PERFORM fieldcat.

  PERFORM display.

*&---------------------------------------------------------------------*

*&      Form  get_data

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM get_data .

  SELECT * FROM ekpo INTO CORRESPONDING FIELDS OF TABLE it_ekpo

  WHERE ebeln IN s_ebeln.

ENDFORM.                    " get_data

*&---------------------------------------------------------------------*

*&      Form  fieldcat

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM fieldcat .

  wa_fcat-col_pos = '1'.

  wa_fcat-fieldname = 'ebeln'.

  wa_fcat-tabname = 'IT_ekpo'.

  wa_fcat-seltext_m = 'Doc No.'.

  APPEND wa_fcat TO it_fcat.

  wa_fcat-col_pos = '2'.

  wa_fcat-fieldname = 'ebelp'.

  wa_fcat-tabname = 'IT_ekpo'.

  wa_fcat-seltext_m = 'Item No'.

  APPEND wa_fcat TO it_fcat.

  wa_fcat-col_pos = '3'.

  wa_fcat-fieldname = 'werks'.

  wa_fcat-tabname = 'IT_ekpo'.

  wa_fcat-seltext_m = 'plant'.

  APPEND wa_fcat TO it_fcat.

  wa_fcat-col_pos = '4'.

  wa_fcat-fieldname = 'lgort'.

  wa_fcat-tabname = 'IT_ekpo'.

  wa_fcat-seltext_m = 'storage'.

  wa_fcat-ref_tabname = 'ekpo'.

  APPEND wa_fcat TO it_fcat.

ENDFORM.                    " fieldcat

*&---------------------------------------------------------------------*

*&      Form  display

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM display .

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

   EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

     i_callback_program                = sy-repid

*   I_CALLBACK_PF_STATUS_SET          = ' '

     i_callback_user_command           = 'USER_COMMAND'

*   I_CALLBACK_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_GRID_SETTINGS                   =

*   IS_LAYOUT                         =

     it_fieldcat                       = it_fcat

*   IT_EXCLUDING                      =

*

*   ES_EXIT_CAUSED_BY_USER            =

    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.                    " display

*&--------------------------------------------------------------------*

*&      Form  USER_COMMAND

*&--------------------------------------------------------------------*

*       text

*---------------------------------------------------------------------*

*      -->R_UCOMM    text

*      -->RS_SELFIELDtext

*---------------------------------------------------------------------*

FORM user_command USING r_ucomm LIKE sy-ucomm

                        rs_selfield TYPE slis_selfield.

  CASE r_ucomm.

    WHEN '&IC1'.

      READ TABLE it_ekpo INTO wa_ekpo INDEX rs_selfield-tabindex.

      IF sy-subrc = 0.

*        SET PARAMETER ID 'MAT' FIELD wa_mara-matnr.

*

*

*CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

        PERFORM get_data1.

        PERFORM fieldcat1.

        PERFORM display1.

      ENDIF.

  ENDCASE.

ENDFORM.                    "USER_COMMAND

*&---------------------------------------------------------------------*

*&      Form  get_data1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM get_data1 .

  SELECT * FROM ekko INTO CORRESPONDING FIELDS OF TABLE it_ekko WHERE

  ebeln = wa_ekpo-ebeln

  AND spras = 'EN'.

ENDFORM.                                                    " get_data1

*&---------------------------------------------------------------------*

*&      Form  fieldcat1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM fieldcat1 .

  wa_fcat1-col_pos = '1'.

  wa_fcat1-fieldname = 'ebeln'.

  wa_fcat1-tabname = 'IT_ekko'.

  wa_fcat1-seltext_m = 'Purchs Doc No'.

  APPEND wa_fcat1 TO it_fcat1.

  wa_fcat1-col_pos = '2'.

  wa_fcat1-fieldname = 'bukrs'.

  wa_fcat1-tabname = 'IT_ekko'.

  wa_fcat1-seltext_m = 'compnay code'.

  APPEND wa_fcat1 TO it_fcat1.

   wa_fcat1-col_pos = '3'.

  wa_fcat1-fieldname = 'bstyp'.

  wa_fcat1-tabname = 'IT_ekko'.

  wa_fcat1-seltext_m = 'Purchasing Doc Cat.'.

  APPEND wa_fcat1 TO it_fcat1.

ENDFORM.                                                    " fieldcat1

*&---------------------------------------------------------------------*

*&      Form  display1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM display1 .

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

   EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

   I_CALLBACK_PROGRAM                = SY-REPID

     i_callback_pf_status_set          = 'SET_PF_STATUS'

     i_callback_user_command           = 'USER_COMMAND1'

*   I_CALLBACK_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_GRID_SETTINGS                   =

*   IS_LAYOUT                         =

     it_fieldcat                       = it_fcat1

*   IT_EXCLUDING                      =

*   IT_SPECIAL_GROUPS                 =

*   IT_SORT                           =

*   IT_FILTER                         =

*   IS_SEL_HIDE                       =

*   I_DEFAULT                         = 'X'

*   I_SAVE                            = ' '

*   IS_VARIANT                        =

*   IT_EVENTS                         =

*   IT_EVENT_EXIT                     =

*   IS_PRINT                          =

*   IS_REPREP_ID                      =

*   I_SCREEN_START_COLUMN             = 0

*   I_SCREEN_START_LINE               = 0

*   I_SCREEN_END_COLUMN               = 0

*   I_SCREEN_END_LINE                 = 0

*   IT_ALV_GRAPHICS                   =

*   IT_HYPERLINK                      =

*   IT_ADD_FIELDCAT                   =

*   IT_EXCEPT_QINFO                   =

*   I_HTML_HEIGHT_TOP                 =

*   I_HTML_HEIGHT_END                 =

* IMPORTING

*   E_EXIT_CAUSED_BY_CALLER           =

*   ES_EXIT_CAUSED_BY_USER            =

    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.                                                    " display1

FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.

  SET PF-STATUS 'ZSTATUS1'.

ENDFORM.                    "SET_PF_STATUS

*&--------------------------------------------------------------------*

*&      Form  USER_COMMAND1

*&--------------------------------------------------------------------*

*       text

*---------------------------------------------------------------------*

*      -->R_UCOMM    text

*      -->RS_SELFIELDtext

*---------------------------------------------------------------------*

FORM user_command1 USING r_ucomm LIKE sy-ucomm

                        rs_selfield TYPE slis_selfield.

  CASE r_ucomm.

    WHEN 'DISPLAY'.

      CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

      WHEN 'BACK'.

      LEAVE TO SCREEN 0.

      WHEN 'EXIT'.

      LEAVE PROGRAM.

      WHEN 'DOWNLOAD'.

      CALL FUNCTION 'GUI_DOWNLOAD'

        EXPORTING

*         BIN_FILESIZE                  =

          filename                      =  'F:\New Text Document.txt'

         FILETYPE                      = 'ASC'

*         APPEND                        = ' '

         WRITE_FIELD_SEPARATOR         = 'X'

*         HEADER                        = '00'

*         TRUNC_TRAILING_BLANKS         = ' '

*         WRITE_LF                      = 'X'

*         COL_SELECT                    = ' '

*         COL_SELECT_MASK               = ' '

*         DAT_MODE                      = ' '

*       IMPORTING

*         FILELENGTH                    =

        tables

          data_tab                      = IT_ekpo

*       EXCEPTIONS

*         FILE_WRITE_ERROR              = 1

*         NO_BATCH                      = 2

*         GUI_REFUSE_FILETRANSFER       = 3

*         INVALID_TYPE                  = 4

*         NO_AUTHORITY                  = 5

*         UNKNOWN_ERROR                 = 6

*         HEADER_NOT_ALLOWED            = 7

*         SEPARATOR_NOT_ALLOWED         = 8

*         FILESIZE_NOT_ALLOWED          = 9

*         HEADER_TOO_LONG               = 10

*         DP_ERROR_CREATE               = 11

*         DP_ERROR_SEND                 = 12

*         DP_ERROR_WRITE                = 13

*         UNKNOWN_DP_ERROR              = 14

*         ACCESS_DENIED                 = 15

*         DP_OUT_OF_MEMORY              = 16

*         DISK_FULL                     = 17

*         DP_TIMEOUT                    = 18

*         FILE_NOT_FOUND                = 19

*         DATAPROVIDER_EXCEPTION        = 20

*         CONTROL_FLUSH_ERROR           = 21

*         OTHERS                        = 22

                .

      IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

  ENDCASE.

ENDFORM.                    "USER_COMMAND1

0 Kudos
330

Hi,

There are two issues-

1. change this :

    werks TYPE werks TO werks type ewerk,

     lgort TYPE lgort,  TO lgort type lgort_d.

2. In all the field catalogs, like - wa_fcat1-fieldname = 'bstyp',  Provide  the name in uppercase i.e. wa_fcat1-fieldname = 'BSTYP'.

Make the changes and it will work.

Regards

Ashish

0 Kudos
330

And also change fieldcatalog's tabname & ref_tabname to uppercase.

  wa_fcat-tabname = 'IT_EKPO'.

  wa_fcat-ref_tabname = 'EKPO'.

sanjaybit
Explorer
0 Kudos
330

Dear Rohan,

As a thumb rule, while creating the field catalogue where ever you are giving any field/table name within ' ' use uppercase.

Thanks,

Sanjay

Former Member
0 Kudos
330

Thank you all ,

for replies

Former Member
0 Kudos
330

Hi,

now its showing an error as wa_fcat cannot be converted to it_fcat ?? gone through some link but isnt helpful

0 Kudos
330

What change did you do.?

Can you post.?

Try this code . I checked it's working-

TYPE-POOLS: slis.

TYPES: BEGIN OF ty_ekpo,

         ebeln TYPE ebeln,

         ebelp TYPE ebelp,

         werks TYPE ewerk,

         lgort TYPE lgort_d,

         END OF ty_ekpo.

TYPES: BEGIN OF ty_ekko,

         ebeln type ebeln ,

         bukrs TYPE bukrs,

         bstyp TYPE bstyp,

*        spras TYPE spras,

         END OF ty_ekko.

DATA: it_ekpo TYPE TABLE OF ty_ekpo,

       wa_ekpo TYPE ty_ekpo.

DATA: it_ekko TYPE TABLE OF ty_ekko,

       wa_ekko TYPE ty_ekko.

DATA: it_fcat TYPE slis_t_fieldcat_alv,

       wa_fcat TYPE slis_fieldcat_alv.

DATA: it_fcat1 TYPE slis_t_fieldcat_alv,

       wa_fcat1 TYPE slis_fieldcat_alv.

DATA:v_ebeln TYPE ekpo-ebeln.

SELECT-OPTIONS: s_ebeln FOR  v_ebeln.

START-OF-SELECTION.

   PERFORM get_data.

   PERFORM fieldcat.

   PERFORM display.

*&---------------------------------------------------------------------*

*&      Form  get_data

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM get_data .

   SELECT * FROM ekpo INTO CORRESPONDING FIELDS OF TABLE it_ekpo

   WHERE ebeln IN s_ebeln.

ENDFORM.                    " get_data

*&---------------------------------------------------------------------*

*&      Form  fieldcat

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM fieldcat .

   wa_fcat-col_pos = '1'.

   wa_fcat-fieldname = 'EBELN'.

   wa_fcat-tabname = 'IT_ekpo'.

   wa_fcat-seltext_m = 'Doc No.'.

   APPEND wa_fcat TO it_fcat.

   wa_fcat-col_pos = '2'.

   wa_fcat-fieldname = 'EBELP'.

   wa_fcat-tabname = 'IT_ekpo'.

   wa_fcat-seltext_m = 'Item No'.

   APPEND wa_fcat TO it_fcat.

   wa_fcat-col_pos = '3'.

   wa_fcat-fieldname = 'WERKS'.

   wa_fcat-tabname = 'IT_ekpo'.

   wa_fcat-seltext_m = 'plant'.

   APPEND wa_fcat TO it_fcat.

   wa_fcat-col_pos = '4'.

   wa_fcat-fieldname = 'LGORT'.

   wa_fcat-tabname = 'IT_ekpo'.

   wa_fcat-seltext_m = 'storage'.

   wa_fcat-ref_tabname = 'ekpo'.

   APPEND wa_fcat TO it_fcat.

ENDFORM.                    " fieldcat

*&---------------------------------------------------------------------*

*&      Form  display

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM display .

   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

      i_callback_program                = sy-repid

*   I_CALLBACK_PF_STATUS_SET          = ' '

      i_callback_user_command           = 'USER_COMMAND'

*   I_CALLBACK_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_GRID_SETTINGS                   =

*   IS_LAYOUT                         =

      it_fieldcat                       = it_fcat

*   IT_EXCLUDING                      =

*

*   ES_EXIT_CAUSED_BY_USER            =

     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.                    " display

*&--------------------------------------------------------------------*

*&      Form  USER_COMMAND

*&--------------------------------------------------------------------*

*       text

*---------------------------------------------------------------------*

*      -->R_UCOMM    text

*      -->RS_SELFIELDtext

*---------------------------------------------------------------------*

FORM user_command USING r_ucomm LIKE sy-ucomm

                         rs_selfield TYPE slis_selfield.

   CASE r_ucomm.

     WHEN '&IC1'.

       READ TABLE it_ekpo INTO wa_ekpo INDEX rs_selfield-tabindex.

       IF sy-subrc = 0.

*        SET PARAMETER ID 'MAT' FIELD wa_mara-matnr.

*

*

*CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

         PERFORM get_data1.

         PERFORM fieldcat1.

         PERFORM display1.

       ENDIF.

   ENDCASE.

ENDFORM.                    "USER_COMMAND

*&---------------------------------------------------------------------*

*&      Form  get_data1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM get_data1 .

   SELECT * FROM ekko INTO CORRESPONDING FIELDS OF TABLE it_ekko WHERE

   ebeln = wa_ekpo-ebeln

   AND spras = 'EN'.

ENDFORM.                                                    " get_data1

*&---------------------------------------------------------------------*

*&      Form  fieldcat1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM fieldcat1 .

   wa_fcat1-col_pos = '1'.

   wa_fcat1-fieldname = 'EBELN'.

   wa_fcat1-tabname = 'IT_ekko'.

   wa_fcat1-seltext_m = 'Purchs Doc No'.

   APPEND wa_fcat1 TO it_fcat1.

   wa_fcat1-col_pos = '2'.

   wa_fcat1-fieldname = 'BUKRS'.

   wa_fcat1-tabname = 'IT_ekko'.

   wa_fcat1-seltext_m = 'compnay code'.

   APPEND wa_fcat1 TO it_fcat1.

    wa_fcat1-col_pos = '3'.

   wa_fcat1-fieldname = 'BSTYP'.

   wa_fcat1-tabname = 'IT_ekko'.

   wa_fcat1-seltext_m = 'Purchasing Doc Cat.'.

   APPEND wa_fcat1 TO it_fcat1.

ENDFORM.                                                    " fieldcat1

*&---------------------------------------------------------------------*

*&      Form  display1

*&---------------------------------------------------------------------*

*       text

*----------------------------------------------------------------------*

*  -->  p1        text

*  <--  p2        text

*----------------------------------------------------------------------*

FORM display1 .

   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

    I_CALLBACK_PROGRAM                = SY-REPID

      i_callback_pf_status_set          = 'SET_PF_STATUS'

      i_callback_user_command           = 'USER_COMMAND1'

*   I_CALLBACK_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_GRID_SETTINGS                   =

*   IS_LAYOUT                         =

      it_fieldcat                       = it_fcat1

*   IT_EXCLUDING                      =

*   IT_SPECIAL_GROUPS                 =

*   IT_SORT                           =

*   IT_FILTER                         =

*   IS_SEL_HIDE                       =

*   I_DEFAULT                         = 'X'

*   I_SAVE                            = ' '

*   IS_VARIANT                        =

*   IT_EVENTS                         =

*   IT_EVENT_EXIT                     =

*   IS_PRINT                          =

*   IS_REPREP_ID                      =

*   I_SCREEN_START_COLUMN             = 0

*   I_SCREEN_START_LINE               = 0

*   I_SCREEN_END_COLUMN               = 0

*   I_SCREEN_END_LINE                 = 0

*   IT_ALV_GRAPHICS                   =

*   IT_HYPERLINK                      =

*   IT_ADD_FIELDCAT                   =

*   IT_EXCEPT_QINFO                   =

*   I_HTML_HEIGHT_TOP                 =

*   I_HTML_HEIGHT_END                 =

* IMPORTING

*   E_EXIT_CAUSED_BY_CALLER           =

*   ES_EXIT_CAUSED_BY_USER            =

     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.                                                    " display1

FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.

   SET PF-STATUS 'ZSTATUS1'.

ENDFORM.                    "SET_PF_STATUS

*&--------------------------------------------------------------------*

*&      Form  USER_COMMAND1

*&--------------------------------------------------------------------*

*       text

*---------------------------------------------------------------------*

*      -->R_UCOMM    text

*      -->RS_SELFIELDtext

*---------------------------------------------------------------------*

FORM user_command1 USING r_ucomm LIKE sy-ucomm

                         rs_selfield TYPE slis_selfield.

   CASE r_ucomm.

     WHEN 'DISPLAY'.

       CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

       WHEN 'BACK'.

       LEAVE TO SCREEN 0.

       WHEN 'EXIT'.

       LEAVE PROGRAM.

       WHEN 'DOWNLOAD'.

       CALL FUNCTION 'GUI_DOWNLOAD'

         EXPORTING

*         BIN_FILESIZE                  =

           filename                      'F:\New Text Document.txt'

          FILETYPE                      = 'ASC'

*         APPEND                        = ' '

          WRITE_FIELD_SEPARATOR         = 'X'

*         HEADER                        = '00'

*         TRUNC_TRAILING_BLANKS         = ' '

*         WRITE_LF                      = 'X'

*         COL_SELECT                    = ' '

*         COL_SELECT_MASK               = ' '

*         DAT_MODE                      = ' '

*       IMPORTING

*         FILELENGTH                    =

         tables

           data_tab                      = IT_ekpo

*       EXCEPTIONS

*         FILE_WRITE_ERROR              = 1

*         NO_BATCH                      = 2

*         GUI_REFUSE_FILETRANSFER       = 3

*         INVALID_TYPE                  = 4

*         NO_AUTHORITY                  = 5

*         UNKNOWN_ERROR                 = 6

*         HEADER_NOT_ALLOWED            = 7

*         SEPARATOR_NOT_ALLOWED         = 8

*         FILESIZE_NOT_ALLOWED          = 9

*         HEADER_TOO_LONG               = 10

*         DP_ERROR_CREATE               = 11

*         DP_ERROR_SEND                 = 12

*         DP_ERROR_WRITE                = 13

*         UNKNOWN_DP_ERROR              = 14

*         ACCESS_DENIED                 = 15

*         DP_OUT_OF_MEMORY              = 16

*         DISK_FULL                     = 17

*         DP_TIMEOUT                    = 18

*         FILE_NOT_FOUND                = 19

*         DATAPROVIDER_EXCEPTION        = 20

*         CONTROL_FLUSH_ERROR           = 21

*         OTHERS                        = 22

                 .

       IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

       ENDIF.

   ENDCASE.

ENDFORM.                    "USER_COMMAND1

Former Member
0 Kudos
330

Thanks asish Gupta it is working .

0 Kudos
330

Nice..

former_member182550
Active Contributor
0 Kudos
330

An exercise for you....

Rather than using double click to trigger your display,  use the movement of the cursor from one row to another......

Rich

0 Kudos
330

Hi richard if any links to the regarded exercise will be given it will be really helpful , this exercise is for hotspot right , hope u u understand .

Regards ,

Rohan

Former Member
0 Kudos
330

Thnks Richard for the exercise , would do and reply back to you.

Regards ,

Rohan

0 Kudos
330

Hi Rohan,

No,  it's not for a hotspot.

There are some events that handle the change in selection for a row or a cell.  These are pr4efixed with the word 'DELAYED'.

This is not a link following task - nor one where I will tell you the answers - it's an exercise on using documentation and research of your own.

Once you have some working code,  I will tell you how to make the process smoother for the end user.

Rich