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

Need sample interactive ALV(At line selection event...)

aris_hidalgo
Contributor
0 Likes
1,051

Hello Experts,

I have a requirement that when I show the results, there will be 3 hotspots for

the sales order, delivery order and invoice number. So for example I click on

the sales order it will open a pop up window that will show additional information, etc.

So when the user clicks all 3 hotspots it will show 3 popup windows.

How do I do this guys? simple examples will be highly appreciated.Thank you guys and take care!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
726

Hi Viraylab,

Use User_command event of ALV.

Refer this code :

form BUILD_EVENTCAT using p_i_eventcat TYPE SLIS_T_EVENT.

DATA: I_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = P_I_EVENTCAT

  • 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.

clear I_event.

read table p_i_eventcat with key name = slis_ev_user_command into I_event.

if sy-subrc = 0.

move 'USER_COMMAND' to I_event-form.

append I_event to p_i_eventcat.

endif.

FORM Z8_USER_COMMAND USING P_UCOMM TYPE SY-UCOMM

P_SELFIELD TYPE SLIS_SELFIELD.

CASE P_UCOMM.

WHEN '&IC1'.

if p_selfield-name = i_tab-vbeln.(sales order)

write :/p_selfield-value.

elseif p_selfield-name = i_tab-vbeln(invoice)

write :/p_selfield-value.

elseif p_selfield-name = i_tab-vbeln(delivery)

write :/p_selfield-value.

endif.

endcase.

Reward points if helpful.

Regards,

Hemant

Hello Experts,

I have a requirement that when I show the results, there will be 3 hotspots for

the sales order, delivery order and invoice number. So for example I click on

the sales order it will open a pop up window that will show additional information, etc.

So when the user clicks all 3 hotspots it will show 3 popup windows.

How do I do this guys? simple examples will be highly appreciated.Thank you guys and take care!

6 REPLIES 6
Read only

Former Member
0 Likes
726
Read only

Former Member
0 Likes
726

hi,

Check this thread.. hope it helps

Cheers

Vj

Read only

p291102
Active Contributor
0 Likes
726

Hi,

This is the sample report for INTERACTIVE REPORT.

REPORT YMS_INTERACTIVETEST LINE-SIZE 50 NO STANDARD PAGE HEADING.

TABLES: VBAP,KNA1,VBAK.

SELECT-OPTIONS: CUST FOR KNA1-KUNNR.

DATA: BEGIN OF ITAB OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

VBELN LIKE VBAK-VBELN,

AUDAT LIKE VBAK-AUDAT,

AUART LIKE VBAK-AUART,

POSNR LIKE VBAP-POSNR,

POSAR LIKE VBAP-POSAR,

END OF ITAB.

DATA: ITAB1 LIKE ITAB OCCURS 0 WITH HEADER LINE.

INITIALIZATION.

START-OF-SELECTION.

SELECT KNA1KUNNR KNA1NAME1 INTO CORRESPONDING FIELDS OF TABLE ITAB1

FROM KNA1 WHERE KNA1~KUNNR IN CUST.

LOOP AT ITAB1.

WRITE:/10 ITAB1-KUNNR HOTSPOT, 30 ITAB1-NAME1.

HIDE: ITAB1-KUNNR.

ENDLOOP.

AT LINE-SELECTION.

CASE SY-LSIND.

WHEN '1'.

SELECT KNA1KUNNR VBAKVBELN VBAKAUDAT VBAKERDAT INTO CORRESPONDING FIELDS OF TABLE ITAB1

FROM KNA1 INNER JOIN VBAK ON KNA1KUNNR = VBAKKUNNR.

LOOP AT ITAB1.

WRITE:/ ITAB1-VBELN HOTSPOT, ITAB1-AUDAT, ITAB1-AUART.

HIDE: ITAB1-VBELN, ITAB1-AUDAT, ITAB1-AUART.

ENDLOOP.

WHEN '2'.

SELECT VBAKVBELN VBAPPOSNR VBAP~POSAR

INTO CORRESPONDING FIELDS OF TABLE ITAB1 FROM VBAK INNER JOIN VBAP ON VBAKVBELN = VBAPVBELN.

LOOP AT ITAB1.

WRITE:/ ITAB1-POSNR, ITAB1-POSAR.

ENDLOOP.

ENDCASE.

TOP-OF-PAGE.

WRITE:/ SY-VLINE,TEXT-001 COLOR COL_NEGATIVE.

ULINE.

Thanks,

Sankar M

Read only

Former Member
0 Likes
727

Hi Viraylab,

Use User_command event of ALV.

Refer this code :

form BUILD_EVENTCAT using p_i_eventcat TYPE SLIS_T_EVENT.

DATA: I_EVENT TYPE SLIS_ALV_EVENT.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = P_I_EVENTCAT

  • 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.

clear I_event.

read table p_i_eventcat with key name = slis_ev_user_command into I_event.

if sy-subrc = 0.

move 'USER_COMMAND' to I_event-form.

append I_event to p_i_eventcat.

endif.

FORM Z8_USER_COMMAND USING P_UCOMM TYPE SY-UCOMM

P_SELFIELD TYPE SLIS_SELFIELD.

CASE P_UCOMM.

WHEN '&IC1'.

if p_selfield-name = i_tab-vbeln.(sales order)

write :/p_selfield-value.

elseif p_selfield-name = i_tab-vbeln(invoice)

write :/p_selfield-value.

elseif p_selfield-name = i_tab-vbeln(delivery)

write :/p_selfield-value.

endif.

endcase.

Reward points if helpful.

Regards,

Hemant

Read only

Former Member
0 Likes
726
Read only

VijayasekarK
Active Participant
0 Likes
726

Hi ,

Goto SE38>Environment>Examples.....

you will find a programs in all categories.....

Hope it helps....

Regards,

Vijay