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

interactive report query

Former Member
0 Likes
823

good day experts...

please help me on this...

i have an interactive report... during at line selection it will display the details on the other screen.

my problem is everytime i trigger at line select it always display the last page so i have to scroll up

again to see the details. another problem in my report is the more i trigger the at line select when i need to go

to the main page is the number of time i have to click BACK command just to go back to the main page.

here is the sample code of my at line selection:

AT LINE-SELECTION.

CLEAR: LV_TEXT1.

READ CURRENT LINE FIELD VALUE CTRL_SUM1-TEXT INTO LV_TEXT1.

IF NOT LV_TEXT1 IS INITIAL.

PERFORM DISPLAY_PREV USING LV_TEXT1.

SCROLL LIST INDEX 1 TO: PAGE SY-CPAGE LINE SY-STARO,

COLUMN SY-STACO .

ENDIF.

*----


Form DISPLAY_PREV:

*----


SORT TAB_ABKRS BY ABKRS.

SORT CTRL_DET1 BY ABKRS STAT2 PERSG PERSK ENAME.

LOOP AT TAB_ABKRS.

CLEAR: LV_CTR1, LV_TOTAL1.

WRITE: /1 'Previous Period Mancount'.

SORT CTRL_SUM1 BY ABKRS STAT2 PERSG PERSK.

LOOP AT CTRL_SUM1 WHERE ABKRS = TAB_ABKRS-ABKRS.

IF SY-SUBRC EQ 0.

IF CTRL_SUM1-TEXT = P_LV_TEXT1.

WRITE: /3 CTRL_SUM1-TEXT COLOR COL_HEADING.

HIDE_ABKRS = TAB_ABKRS-ABKRS.

HIDE HIDE_ABKRS.

FORMAT COLOR COL_NORMAL.

PERFORM EXPAND_PREVIOUS.

FORMAT COLOR OFF.

WRITE: /71 CTRL_SUM1-CTR COLOR COL_TOTAL,

82 CTRL_SUM1-BETRG COLOR COL_TOTAL.

CLEAR: HIDE_ABKRS.

ELSE.

WRITE: /3 CTRL_SUM1-TEXT, 71 CTRL_SUM1-CTR, 82 CTRL_SUM1-BETRG.

HIDE_ABKRS = TAB_ABKRS-ABKRS.

HIDE HIDE_ABKRS.

CLEAR: HIDE_ABKRS.

ENDIF.

ENDIF.

LV_CTR1 = LV_CTR1 + CTRL_SUM1-CTR.

LV_TOTAL1 = LV_TOTAL1 + CTRL_SUM1-BETRG.

MODIFY CTRL_SUM1 TRANSPORTING TEXT.

ENDLOOP.

ULINE.

WRITE: /3 'Total:', 71 LV_CTR1, 82 LV_TOTAL1.

ENDLOOP.

ULINE.

please help...

thank you...

6 REPLIES 6
Read only

Former Member
0 Likes
790

Hi,

How are you calling the other screen by Leave to screen or call screen that imp. also when you are going back what statment are u using leave to screen 0 or again set screen.

In my view to call screen and at the time of back leave screen to 0.

Atul

Read only

former_member194669
Active Contributor
0 Likes
790

In you Form "DISPLAY_PREV" you need to reset sy-lsind = 0 to resolve your BACK problem

(Please check my reply in this thread)

and scrolling you need to use SET CURSOR syntax in the secondary list displayed

a®

Read only

0 Likes
790

good day!

i reset my sy-lsind to 0, but when i click the BACK command button it display my selection screen not my main page

display...

Read only

0 Likes
790

Please check demo program

DEMO_LIST_INTERACTIVE_2

a®

Read only

venkat_o
Active Contributor
0 Likes
790

Hi, <li>To place your cursor at the start of the secondary report. You have to write below statement under AT LINE-SELECTION.

SET CURSOR LINE 1.
<li>To go to main report from interactive after clicking BACK Button, you need to create your own pf-status after START-OF-SELECTION and have to try the below way.
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'BACK'.
      sy-lsind = 0.
  ENDCASE.
Thanks Venkat.O

Read only

Former Member
0 Likes
790

solved