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: 

Access field value in ALV

Former Member
0 Kudos

Hello experts,

I have created an simple ALV Grid report, in that I have implemented double click event n I want to create a new ALV grid with new data to be displayed. So I want to access field value ie using SLIS_SELFIELD or anything. Could anyone please guide me how can I access a field value using slis though SLIS_SELFIELD has methods like SEL_TAB_FIELD... I wan to access something like SEL_FIELD_VALUE but its not available in the class.

Thanks in advance...

Regards,

Viral Patel

4 REPLIES 4

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Viral,

SLIS_SELFIELD is not a class. It is infact a flat structure defined in the type-pool SLIS.

You can access the value in the field value. Check in SE11 for the other fields in SLIS_SELFIELD.

BR,

Suhas

Former Member
0 Kudos

Hi Suhas,

Thanks for the quick responce.

How do I access selected field's value using SLIS_SELFIELD? Is there any attribute for that like SEL_TAB_FIELD, SEL_TABNAME, etc..?

Thanks..

Regards,

Viral Patel

Edited by: Viral Patel on Nov 30, 2009 11:20 AM

0 Kudos

Read the documentation for the param I_CALLBACK_USER_COMMAND of the FM: REUSE_ALV_GRID_DISPLAY.

Here you will get the details.

BR,

Suhas

Former Member
0 Kudos

Hi Viral,

SLIS_SELFIELD has an attribute named VALUE which holds the value you selected row & TBAINDEX holds the row number.

Refer below code snippet :-

FORM user_command
          USING s_ucomm LIKE sy-ucomm
          s_selfield TYPE slis_selfield.                    "#EC CALLED

  CASE s_ucomm.
    WHEN '&IC1'.
      CLEAR wa_podat2.
      READ TABLE itab_podat2 INTO wa_podat2 INDEX s_selfield-tabindex.

      CHECK sy-subrc = 0.

      IF wa_podat2-ebeln = s_selfield-value.
        SET PARAMETER ID 'BES' FIELD wa_podat2-ebeln.
        IF wa_podat2-ebeln IS NOT INITIAL.
          CALL TRANSACTION c_tcode.
        ENDIF.

For above event to happen, you have to use parameter I_CALLBACK_USER_COMMAND of REUSE_ALV_GRID_DISPLAY as below :-

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program      = l_repid
      i_callback_user_command = 'USER_COMMAND'
      it_fieldcat             = itab_fieldcat
      it_events               = itab_events
    TABLES
      t_outtab                = itab_podat2[].

Regards

Abhii

Edited by: Abhii on Nov 30, 2009 11:25 AM