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

problem with reports...

Former Member
0 Likes
603

Hi all,

1) How to handle double click event in interactive report ?

and when we double click on field which event will call?

and we have emp id in basic list then how to pass that into secondary list?

Thanks in advance..

sudharsan.

1 ACCEPTED SOLUTION
Read only

former_member187255
Active Contributor
0 Likes
578

check this....

<a href="http://www.sapgenie.com/abap/ireports.htm">http://www.sapgenie.com/abap/ireports.htm</a>

You can try this sample program copied from forum...

report ztest.

TYPES : BEGIN OF ty_test,

code TYPE i,

name(10) TYPE c,

amount TYPE p DECIMALS 2,

END OF ty_test.

DATA : it_test TYPE STANDARD TABLE OF ty_test WITH HEADER LINE INITIAL

SIZE 10.

DATA : wa TYPE ty_test,

chk1 TYPE c,

fldname(30), fldval(50).

*set pf-status 'PF01'.

*set titlebar 'PF01'.

*

INITIALIZATION.

it_test-code = 300.

it_test-name = 'Ramesh'.

it_test-amount = 5500.

APPEND it_test.

wa-code = 207.

wa-name = 'Prem'.

wa-amount = 5000.

APPEND wa TO it_test.

it_test-code = 117.

it_test-name = 'James Bond'.

it_test-amount = 9900.

INSERT it_test INDEX 3.

it_test-code = 217.

it_test-name = 'Sivaraman'.

it_test-amount = 9900.

INSERT it_test INDEX 3.

it_test-code = 201.

it_test-name = 'Saravanan'.

it_test-amount = 1000.

APPEND it_test.

it_test-code = 210.

it_test-name = 'Shanmugam'.

it_test-amount = 6000.

APPEND it_test.

WRITE : / 'Loop Display ( Appended rows ) :-'.

LOOP AT it_test.

WRITE : / chk1 AS CHECKBOX,

sy-tabix, sy-vline, it_test-code, it_test-name, it_test-amount.

HIDE : it_test-code, it_test-name.

ENDLOOP.

SKIP.

END-OF-SELECTION.

CLEAR : it_test-code, it_test-name.

WRITE : / 'this from end of selection'.

&----


*& Form DISP1

&----


  • text

----


FORM disp1.

WINDOW STARTING AT 15 10

ENDING AT 80 15.

DO.

CLEAR chk1.

READ LINE sy-index FIELD VALUE chk1.

IF sy-subrc NE 0.

EXIT.

ELSE.

CHECK chk1 NE space.

WRITE : / it_test-code, it_test-name.

MODIFY CURRENT LINE :

FIELD VALUE chk1 FROM ' '

FIELD FORMAT chk1 INPUT OFF.

ENDIF.

ENDDO.

ENDFORM. "DISP1

***line double click ****

AT LINE-SELECTION.

CHECK sy-lsind = 1.

WINDOW STARTING AT 5 4

ENDING AT 85 20.

WRITE: / 'THE USER DOUBLE-CLICKED A LINE IN THE REPORT'.

WRITE: / sy-lisel.

WRITE : / 'Sometime ',it_test-name, ' is good '.

WRITE : / 'Sometime ',it_test-name, ' is bad '.

WRITE : / 'Sometime ',it_test-name, ' is rich '.

WRITE : / 'Sometime ',it_test-name, ' is poor '.

WRITE : / 'Who knows, who is ',it_test-name, ' ? '.

WRITE : /, / 'we can also use this in SELECT statement'.

CLEAR : it_test-code, it_test-name.

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

ULINE.

SKIP.

SKIP.

WRITE : / 'Below from Get Cursor Field...'.

GET CURSOR FIELD fldname VALUE fldval.

CONDENSE fldname.

CONDENSE fldval.

WRITE : / 'You have clicked ', fldname, ' & its value is ', fldval.

***function key press F6 ****

AT PF06.

PERFORM disp1.

*AT USER-COMMAND.

  • CASE SY-UCOMM.

  • WHEN 'STOP' OR 'CANCEL'.

  • LEAVE TO SCREEN 0.

  • WHEN 'TESTME'.

  • PERFORM DISP1.

  • ENDCASE.

Message was edited by:

rCm

5 REPLIES 5
Read only

former_member187255
Active Contributor
0 Likes
579

check this....

<a href="http://www.sapgenie.com/abap/ireports.htm">http://www.sapgenie.com/abap/ireports.htm</a>

You can try this sample program copied from forum...

report ztest.

TYPES : BEGIN OF ty_test,

code TYPE i,

name(10) TYPE c,

amount TYPE p DECIMALS 2,

END OF ty_test.

DATA : it_test TYPE STANDARD TABLE OF ty_test WITH HEADER LINE INITIAL

SIZE 10.

DATA : wa TYPE ty_test,

chk1 TYPE c,

fldname(30), fldval(50).

*set pf-status 'PF01'.

*set titlebar 'PF01'.

*

INITIALIZATION.

it_test-code = 300.

it_test-name = 'Ramesh'.

it_test-amount = 5500.

APPEND it_test.

wa-code = 207.

wa-name = 'Prem'.

wa-amount = 5000.

APPEND wa TO it_test.

it_test-code = 117.

it_test-name = 'James Bond'.

it_test-amount = 9900.

INSERT it_test INDEX 3.

it_test-code = 217.

it_test-name = 'Sivaraman'.

it_test-amount = 9900.

INSERT it_test INDEX 3.

it_test-code = 201.

it_test-name = 'Saravanan'.

it_test-amount = 1000.

APPEND it_test.

it_test-code = 210.

it_test-name = 'Shanmugam'.

it_test-amount = 6000.

APPEND it_test.

WRITE : / 'Loop Display ( Appended rows ) :-'.

LOOP AT it_test.

WRITE : / chk1 AS CHECKBOX,

sy-tabix, sy-vline, it_test-code, it_test-name, it_test-amount.

HIDE : it_test-code, it_test-name.

ENDLOOP.

SKIP.

END-OF-SELECTION.

CLEAR : it_test-code, it_test-name.

WRITE : / 'this from end of selection'.

&----


*& Form DISP1

&----


  • text

----


FORM disp1.

WINDOW STARTING AT 15 10

ENDING AT 80 15.

DO.

CLEAR chk1.

READ LINE sy-index FIELD VALUE chk1.

IF sy-subrc NE 0.

EXIT.

ELSE.

CHECK chk1 NE space.

WRITE : / it_test-code, it_test-name.

MODIFY CURRENT LINE :

FIELD VALUE chk1 FROM ' '

FIELD FORMAT chk1 INPUT OFF.

ENDIF.

ENDDO.

ENDFORM. "DISP1

***line double click ****

AT LINE-SELECTION.

CHECK sy-lsind = 1.

WINDOW STARTING AT 5 4

ENDING AT 85 20.

WRITE: / 'THE USER DOUBLE-CLICKED A LINE IN THE REPORT'.

WRITE: / sy-lisel.

WRITE : / 'Sometime ',it_test-name, ' is good '.

WRITE : / 'Sometime ',it_test-name, ' is bad '.

WRITE : / 'Sometime ',it_test-name, ' is rich '.

WRITE : / 'Sometime ',it_test-name, ' is poor '.

WRITE : / 'Who knows, who is ',it_test-name, ' ? '.

WRITE : /, / 'we can also use this in SELECT statement'.

CLEAR : it_test-code, it_test-name.

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

ULINE.

SKIP.

SKIP.

WRITE : / 'Below from Get Cursor Field...'.

GET CURSOR FIELD fldname VALUE fldval.

CONDENSE fldname.

CONDENSE fldval.

WRITE : / 'You have clicked ', fldname, ' & its value is ', fldval.

***function key press F6 ****

AT PF06.

PERFORM disp1.

*AT USER-COMMAND.

  • CASE SY-UCOMM.

  • WHEN 'STOP' OR 'CANCEL'.

  • LEAVE TO SCREEN 0.

  • WHEN 'TESTME'.

  • PERFORM DISP1.

  • ENDCASE.

Message was edited by:

rCm

Read only

Former Member
0 Likes
578

check one interactive report for double click

http://www.sap-img.com/abap/an-interactive-alv-report.htm

Read only

Former Member
0 Likes
578

Refer the sample report.

demo_list_at_line_selection

and this program to transfer the fields in the basic list to the secondary lis: demo_list_hide

Regards,

Ravi

Read only

SantoshKallem
Active Contributor
0 Likes
578

when double click on field, AT LINE SELECTION event will fire.

and sy-lsind will change from 0 to 1.

here check if sy-lsind = 1

write first secondary list.

regards.

santhosh

Read only

Former Member
0 Likes
578

Hi sudarshan,

1) when you double click on a list <b>AT LINE SELECTION event</b> is fired. and the list index system variable <b>SY-LSIND</b> is incremented by 1.

f<b>or basic list SY-LSIND is 0</b> and then it gets incresed by 1 for each secondary list.

to chek with the emp. number of the basic list in secondary list, when u write the emp.number on basic list...after writing use statement...

<b>HIDE : <empnumber field name></b>

this statement lets u access this field in secondary list and then...

<b>AT LINE SELECTION.

case sy-lsind.

when '1'.

select f1 f2 f3 from dbtable into itab where empnumber = <empnumberfield name used with HIDE statement>.

***then Display the secondary list.

endcase.</b>

Reward useful answers with points..

Regards,

Tejas