‎2008 May 13 11:46 AM
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.
‎2008 May 13 11:51 AM
Hi,
For selection screen u have to use at selection screen output event
and for loop screen use the structure - screen
‎2008 May 13 11:51 AM
Hi,
For selection screen u have to use at selection screen output event
and for loop screen use the structure - screen
‎2008 May 13 11:56 AM
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.
‎2008 May 13 11:59 AM
Your loop at screen should be used in at selection screen event not in start of selection.
Thanks,
‎2008 May 13 12:23 PM
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.
‎2008 May 13 4:49 PM
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.
‎2008 May 14 8:04 AM
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.