2006 Feb 13 8:12 AM
Hi Experts,
I am having the following requirements.
1) I have design the selection screen by using Select-options statement. In that i have to initialize both low and high values. I don't know how to write and where to write the code for the same.
2) and another requirement as
field A contain values ( 0, 1, 1, 0, 1, 1, 1, 0)
Field B contain values (1, 0, 1, 1, 1, 1, 1, 1)
At new b.
write:/ b.
endat.
In the above case how many times At new statement calls.
3) How is EXIT differ to STOP and CONTINUE. Please give me the brief idea on this.
I hope i will get the accurate results for the above soon.
Regards
Prabhakar
2006 Feb 13 8:17 AM
hI
1) YOU HAVE WRITRE IT IN THE INITIALIZATION EVENT.
INITILIAZATION.
S_OPT-HIGH = <VALUE>.
S_OPT-LOW = <VALUE>.
2) AT NEW STATEMENT WILL TRIGGER WHENEVER THERE IS A CHANGE IN THAT FIELD AND THE FIELD BEFORE THAT FIELD. SO IN YOUR SCENARIO IT WILL TRIGGER 6 TIMES.
3)IN THE LOOP
WEHN YOU SAY CONTINUE IT WILL GO FOR THE NEXT ITERATION.
WHEN YOU SAY STOP IT WILL STOP THE ITERATION AND GO TO THE END STATEMENT.
WHEN YOU SAY EXIT IT EXITS THE LOOP.
<b>HI prabharakar
plz close the thread if your request is answered.</b>
REGARDS
KISHORE
Message was edited by: Harikishore Sreenivasulu
2006 Feb 13 8:18 AM
Hi
1) Use INITIALIZATION event
INITIALIZATION.
SO_A(3) = 'IBT'.
SO_A-LOW = 1.
SO_A-HIGH = 10.
APPEND SO_A.
SO_A-LOW = 20.
SO_A-HIGH = 30.
APPEND SO_A.
........
SO_A(3) = 'IBT'.
SO_A-LOW = 1.
SO_A-HIGH = 10.
APPEND SO_A.
SO_B-LOW = 20.
SO_B-HIGH = 30.
APPEND SO_B.
.........
2) The event AT NEW <FIELD> (or AT END) is triggered when the value of field <FIELD> or the value of a field at the left of <FIELD> is changing. So AT NEW B
A B
0 1 -> Here it's triggered
1 0 -> Here it's triggered
1 1 -> Here it's triggered
0 1 -> Here it's triggered (The value of A is changed)
1 1 -> Here it's triggered (The value of A is changed)
1 1
1 1
0 1 -> Here it's triggered (The value of A is changed)
3)
- CONTINUE: it is used in LOOP/ENDLOOP cycle and skip to next record;
- EXIT: it is used to exit from a cycle (DO/ENDDO, LOOP/ENDLOOP...) and routine (FORM)
- STOP: it is used to exit from event as START-OF-SELECTION, AT SELECTION-SCREEN...
Max
2006 Feb 13 8:21 AM
Hi Prabhakar,
For 1, use the initialization event and u can initialize like this
s_matnr- low = '001'.
S_matnr-high = '100'
append s_matnr.
For 2, general rule for control breaks is u have ur internal table columns sorted out. if is so, then ur at new b will triger for every new combi of a and b together, as A is ur first column in the internal table.
For 3,
Exit, get out of a current struct, whetehr it is if-endif or do-endo, continue, will just move to next loop pass skipping everything following its occuerence till the endloop statement. STOP takes you out of the program totally.
hope it helps
2006 Feb 13 8:23 AM
Hi,
1.
Select-options could be initialised with the command INITIALIZATION.
Ex :
tables : MARA.
select-options : s_matnr for mara-matnr.
Intialization.
move : '123456789' to s_matnr-low ,
'I' to s_matnr-sign ,
'EQ' to s_matnr-option.
append s_matnr.
I means Include, the other possible value is E for exclude.
EQ means EQual, could be BT BeTween ...
The structure of a select-options is : Sign, Option, Low and High. (Low and High is the two values you see in screen).
The commande Initialization could be place anywhere outside the start-of-selection ... end-of-selection.
2.
3 times .. but, depends where are the fields ..
4.
The command EXIT leave the current command. Command could be a PERFORM, a DO, a LOOP, a SELECT, ...
The command STOP go to the end-of-selection. If you put some code after the end-of-selection, the code will be processed.
Rgd
Frédéric
2006 Feb 13 8:47 AM
Hi Prabhakar,
1) this is a sample of how to initialize your fields.
select-options: la for mara-matnr.
initialization.
la-low = 'A00'.
la-high = 'A01'.
append la.
start-of-selection.
...
2) I assume that the values you are giving in fields A and B are the conternts of an internal table.
so the answer to your question about how many times the "at new b" statement is going to be called is : 6 because this is the number of changes of the pair of data in a and b fields is.
(0,1), (1,0), (1,1), (0,1), (1,1),(0,1).
3) EXIT exits the loop or the select and goes to the next statement
STOP stops whatever its doing and goes to end of selection
CONTINUE exits the specific processing step and continues to the next step loop.
so if you have the next code:
select * from mara where matnr in la.
if mara-matnr = 'A00'.
stop.
endif.
write : / mara-matnr.
endselect.
select * from marc where matnr in la.
endselect.
end of selection.
write : / 'END'.
stop will go to write : / 'END'.
EXIT will go to select * from marc
continue will stay in the same "select * from mara " and go to the next step.
Thanks
roxani