2008 Dec 16 10:13 AM
Hi Experts,
Select-options : so_budat like mseg-budat.
I need to loop that select-options.
How this can be done any idea.
This is due i need to loop at the select-options and read a internal table with that date.
Thank you.
2008 Dec 16 10:20 AM
Hi,
You can apply loop on select-optoins table as follows:
loop at so_budat.
if so_budat-(low/High/sign/option) = <value>.
<process as per ur need>
endif.
endloop.
Hope this will help.
Regards,
Nitin.
2008 Dec 16 10:20 AM
Hi
Its simple
Loop at so_budat.
endloop.
You can access data inside loop as
so_budat-low
so_budat-high
so_budat-sign
so_budat-option.
Regards
Aditya
2008 Dec 16 10:20 AM
Hi,
You can apply loop on select-optoins table as follows:
loop at so_budat.
if so_budat-(low/High/sign/option) = <value>.
<process as per ur need>
endif.
endloop.
Hope this will help.
Regards,
Nitin.
2008 Dec 16 10:21 AM
Hi Sarvanannan,
Can you let us know what exactly you require. do you want to display the current date of the system or what.
Because if you use loop then there will be no execution of the report.
2008 Dec 16 10:21 AM
Hello,
Can you plz elaborate a bit on your requirement?
From initial reading i understand that its not necessary to LOOP at Select-Options.
You can use this code.
LOOP AT ITAB WHERE BUDAT IN SO_BUDAT.
* Your Logic.
ENDLOOP.
Hope this is clear.
BR,
Suhas
2008 Dec 16 11:34 AM
Hi,
It is diffcult to loop at select-options unless you restrict the intervals and extensions. Remember that the user has a wide choice on the select option to choose The OPTION as CP, NE, NP, GE, LE etc.
He/she can enter ranges which you will have to determine programmitically.
However in addition to what Suhas suggested, you can alternatively check the date inside the loop if you want :
Loop at itab into wa
if wa-budat in so_budat.
Endloop.
Rather best would be to put this in the where condition when you are selecting the data from the database itself.
Select * from dbtable
where budat in so_budat.
regards,
Advait
2008 Dec 16 10:50 AM
hi ,
report dummy.
tables: mara.
select-options: matnr for mara-matnr.
start-of-selection.
loop at matnr.
write: / matnr-sign,
matnr-option,
matnr-low,
matnr-high.
endloop.
regards
chinnaiya
2008 Dec 16 11:15 AM
Hi.
i hope, this will work for your requirement.
*To write the data in the output screen given by the user on the selection screen.
DATA: lv_variant TYPE raldb-variant.
lv_variant = sy-slset.
types: TYPES: BEGIN OF gt_selections,
selections TYPE c LENGTH 100,
END OF gt_selections.
data: gi_selections TYPE STANDARD TABLE OF gt_selections
CALL FUNCTION 'PRINT_SELECTIONS'
EXPORTING
mode = '1'
rname = sy-cprog
rvariante = lv_variant
TABLES
infotab = gi_selections
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 0.
LOOP AT gi_selections INTO gwa_selections.
WRITE / gwa_selections-selections.
ENDLOOP.
ENDIF.
2009 Jan 06 3:57 AM