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: 

secondary back to basic list logic

sap_cohort
Active Contributor
0 Kudos
103

Hi, I know it's been covered way too much, but I can't seem to make sense of it. I have a report list that opens up another list when a line is clicked. There is no initial selection screen. When a user selects exit on the 2nd list I want to return back to the basic list.

What's the easiest/best way to do this simple task?!


AT USER-COMMAND.
  CASE SY-UCOMM.
    WHEN 'SELALL'.
      DO.
        READ LINE SY-INDEX FIELD VALUE CHECK1.
        CHECK1 = 'X'.
        MODIFY LINE SY-INDEX FIELD VALUE CHECK1.
        IF SY-SUBRC <> 0.  EXIT.  ENDIF.
      ENDDO.
    WHEN 'REMALL'.
      DO.
        READ LINE SY-INDEX FIELD VALUE CHECK1.
        CHECK1 = SPACE.
        MODIFY LINE SY-INDEX FIELD VALUE CHECK1.
        IF SY-SUBRC <> 0.  EXIT.  ENDIF.
      ENDDO.
    WHEN 'EXIT'.
      SY-LSIND = 1.
  ENDCASE.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
62

Hi,

Try this..

write: / sy-lsind.

start-of-selection.

SET PF-STATUS 'TEST1'.

AT USER-COMMAND.

If sy-ucomm = 'DISPLAY'.

write: / sy-lsind.

endif.

<b>IF SY-UCOMM = 'EXIT'.

if sy-lsind > 1.

SY-LSIND = 0.

endif.

endif.</b>

Thanks,

Naren

3 REPLIES 3

Former Member
0 Kudos
63

Hi,

Try this..

write: / sy-lsind.

start-of-selection.

SET PF-STATUS 'TEST1'.

AT USER-COMMAND.

If sy-ucomm = 'DISPLAY'.

write: / sy-lsind.

endif.

<b>IF SY-UCOMM = 'EXIT'.

if sy-lsind > 1.

SY-LSIND = 0.

endif.

endif.</b>

Thanks,

Naren

sap_cohort
Active Contributor
0 Kudos
62

Found the answer here at the below url. Seems to me it should be easier than this.

Svetlin Rusev

Posts: 591

Questions: 11

Forum Points: 1,060

Registered: 3/22/05

Re: Basic List

Posted: Nov 8, 2005 9:32 AM Reply E-mail this post

Hi,

After pressing your button use FM 'SAPGUI_SET_FUNCTIONCODE' and set a new function code 'BACK'.

Svetlin

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
62

User must click the BACK button on the secondary list to return to the primary list.



report  zrich_0003.



start-of-selection.

  do 10 times.
    format hotspot on.
    write:/ sy-index.
    hide sy-index.
    format hotspot off.
  enddo.

at line-selection.

  write:/ sy-index.
    sy-lsind =   1.

Regards,

Rich Heilman