Application Development and Automation 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: 
Read only

typical interactive ALV

Former Member
0 Likes
767

hii all,

i m illustrating my problem through following example:

Suppose i m on the first page of an interactive report..that contains 4 rows and 3 columns..

and i have selected first row...

Now the problem is : when i click on 1 st column of selected row it should display some interactive report

but when i click on another column of the same selected row it should display SOME

OTHER ALV....what code should i write?????//

Can any1 help me ,plzzzz???

Regards,

Apoorv.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
743

Hi,

Actually i too faced the same issue try to do like this ur problem get resolved,

FORM USER_COMMAND USING U_UCOMM TYPE SY-UCOMM

US_SELF_FIELD TYPE SLIS_SELFIELD. "#EC CALLED

CASE U_UCOMM.

WHEN '&IC1'.

READ TABLE IT_OUTPUT INTO WA_OUTPUT INDEX US_SELF_FIELD-TABINDEX.

CASE US_SELF_FIELD-FIELDNAME.

WHEN 'CWEEK'.

IF US_SELF_FIELD-VALUE = 0.

MESSAGE E001(ZHR_KPI).

ENDIF.

IF US_SELF_FIELD-TABINDEX = 1.

Thanks and Regards,

Thirukumaran. R

8 REPLIES 8
Read only

Former Member
0 Likes
743

You are calling different screens, Based on the Alv row.

try with this

DATA: LINE_EVENT TYPE SLIS_ALV_EVENT.

  CLEAR LINE_EVENT.

  CLEAR LINE_EVENT.
  LINE_EVENT-NAME = 'USER_COMMAND'.
  LINE_EVENT-FORM = 'USER_COMMAND'.
  APPEND LINE_EVENT TO I_EVENTS.


  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                < all others paramets are as required
                 IT_EVENTS                = I_EVENTS
       TABLES
            T_OUTTAB                 = I_FINAL.


FORM USER_COMMAND USING WS_UCOMM LIKE SY-UCOMM
                          WS_SELFIELD TYPE SLIS_SELFIELD.
  CASE WS_UCOMM.

    WHEN '&IC1'.
       if WS_SELFIELD-TABINDEX =1  (1st row)
       elseif WS_SELFIELD-TABINDEX =2  (2nd row)
       elseif WS_SELFIELD-TABINDEX =3  (3rd row)
        and so on
       endif.

Regards

Sasi

ENDFORM.

Read only

0 Likes
743

hii sasi,

thanx for replying ..

can u help me once more?????/

can i write like this:

if ws_selfield-fieldname = 'Vendor_no'.

*some code that lead me to 2 nd ALV that contains VENDOR DETAILS.

elseif ws_selfield-fieldname = 'Mat_no'.

*some code that leads me to 3rd ALV that contains MATERIAL DETAILS.

endif.

plzz reply....

Regards,

Apoorv

Read only

Former Member
0 Likes
744

Hi,

Actually i too faced the same issue try to do like this ur problem get resolved,

FORM USER_COMMAND USING U_UCOMM TYPE SY-UCOMM

US_SELF_FIELD TYPE SLIS_SELFIELD. "#EC CALLED

CASE U_UCOMM.

WHEN '&IC1'.

READ TABLE IT_OUTPUT INTO WA_OUTPUT INDEX US_SELF_FIELD-TABINDEX.

CASE US_SELF_FIELD-FIELDNAME.

WHEN 'CWEEK'.

IF US_SELF_FIELD-VALUE = 0.

MESSAGE E001(ZHR_KPI).

ENDIF.

IF US_SELF_FIELD-TABINDEX = 1.

Thanks and Regards,

Thirukumaran. R

Read only

0 Likes
743

hii thirukumaran,

thanx for replying ..

can u help me once more?????/

can i write like this:

if ws_selfield-fieldname = 'Vendor_no'.

*some code that lead me to 2 nd ALV that contains VENDOR DETAILS.

elseif ws_selfield-fieldname = 'Mat_no'.

*some code that leads me to 3rd ALV that contains MATERIAL DETAILS.

endif.

plzz reply....

Regards,

Apoorv

Read only

0 Likes
743

Yes you can do that ws_selfield-fieldname contains the selected field name value, so based on that you can navigate to some other transactions

Regards

Sasi

Read only

0 Likes
743

Hi,

if ws_selfield-fieldname = 'Vendor_no'.

you can write the above statement but the field name should be in caps.

Regards,

Dev.

Read only

0 Likes
743

thank u so much..........god bless...

Read only

0 Likes
743

thanx dev....