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

LOOP AT SCREEN

Former Member
0 Likes
703

Hi,

i want to populate an itab with values entered thru the screen...

i am havng a selection screen with one parameter ... what event shld i use to loop at that screen until all data is enterd?

Can any one help me?

Arathy.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
663

Hi,

For selection screen u have to use at selection screen output event

and for loop screen use the structure - screen

6 REPLIES 6
Read only

Former Member
0 Likes
664

Hi,

For selection screen u have to use at selection screen output event

and for loop screen use the structure - screen

Read only

0 Likes
663

Whats wrong in this pgm segment...

I think after viewing this code segment u'll hav a better understanding of what I asked?

SELECTION-SCREEN BEGIN OF BLOCK SO .

parameters:num type i default 2.

SELECTION-SCREEN END OF BLOCK SO.

data:begin of itab occurs 0,

n type i,

end of itab,

wa like line of itab.

at selection-screen .

start-of-selection.

LOOP AT SCREEN.

if num eq 3.

leave screen.

else.

wa-n = num.

append itab.

endif.

ENDLOOP.

loop at itab.

write itab-n.

endloop.

Read only

0 Likes
663

Your loop at screen should be used in at selection screen event not in start of selection.

Thanks,

Read only

Former Member
0 Likes
663

Arathy,

Your best solution here is to call the screen and not use the selectoin screen.


  START-OF-SELECTION.

  CALL SCREEN 100.

Then do your processing in Screnn 100 through the PBO and PAI modules.

Read only

Former Member
0 Likes
663

Hi,

I modified your code little bit.

Do like this.

SELECTION-SCREEN BEGIN OF BLOCK SO .

parameters:num type i default 2.

SELECTION-SCREEN END OF BLOCK SO.

data:begin of itab occurs 0,

n type i,

end of itab,

wa like line of itab.

at selection-screen .

wa-n = num.

append wa to itab.

loop at itab.

write / itab-n.

endloop.

No need of "loop at screen" here.

Loop at screen will be used mainly in AT SELECTION-SCREEN OUTPUT event.

Regards

Sandeep Reddy.

Read only

0 Likes
663

Thnks for all who helped me in one way or other.I think I failed to convey my need to all.

I got a solution to my pblm thru select-options.

Below is the code segment.

DATA: BEGIN OF ITAB OCCURS 0,

MYCITY(20),

END OF ITAB.

DATA CITY(20).

SELECT-OPTIONS CTY FOR CITY .

LOOP AT CTY.

MOVE CTY-LOW TO ITAB-MYCITY.

APPEND ITAB.

ENDLOOP.

LOOP AT ITAB.

WRITE ITAB-MYCITY.

ENDLOOP.