‎2007 Feb 13 5:05 AM
Hi ,
Tell me for each statement how does the Following Code Work ....
That too Loop at ***** Into ***** i need explanation ( What it will pass into other )
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT
WHERE FIELDNM = 'ERSDA'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_ERSDA.
APPEND L_R_ERSDA.
ENDLOOP.
‎2007 Feb 13 5:18 AM
Hi,
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT.<b>This loop will select t_select from the s_s_if table into the workarea l_s_select where the condition statisfies.</b>
WHERE FIELDNM = 'ERSDA'.MOVE-CORRESPONDING L_S_SELECT TO L_R_ERSDA.
<b>Move the entries in the l_s_select into a table with the same field.</b>
APPEND L_R_ERSDA.<b>Appending the entries into the table.</b>
ENDLOOP.Can u give the declaration for l_s_select and s_s_if.
‎2007 Feb 13 5:10 AM
Hello Kumar ,
The loop at into where , this will loop at all those records where the feildnm =ERSDA , for all other records the loop does iterate.
Move corresponding , moves the value from feilds of L_S_SELECT to the corresponding feilds of L_R_ERSDA , so in this the structures must hev feils with same name.
append appends the value of the header into the internal table.
Regards
Arun
‎2007 Feb 13 5:13 AM
hi,
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT
WHERE FIELDNM = 'ERSDA'.
MOVE-CORRESPONDING L_S_SELECT TO L_R_ERSDA.
APPEND L_R_ERSDA.
ENDLOOP.1. fetch the records satsfying the condition 'ERSDA' and will place it in the work area L_S_SELECT.
2. Move-Corresponding will move the ciorresponding field name from L_S_SELECT TO L_R_ERSDA(this is header line).
3. that header line is appended into the itab L_R_ERSDA
Regards
Anver
‎2007 Feb 13 5:14 AM
Hi ,
So it Loops based on Field name 'ERSDA' and select the Fields and Appends those Records to Body ...Right ?
‎2007 Feb 13 5:18 AM
hi,
ya it will move the record based on Field name 'ERSDA' into the work area .
Regards
Anver
‎2007 Feb 13 5:15 AM
Hi,
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT
WHERE FIELDNM = 'ERSDA' ......
This will copy the content of ur internal table S_S_IF-T_SELECT to work area L_S_SELECT line by line,where WHERE FIELDNM = 'ERSDA'
MOVE-CORRESPONDING L_S_SELECT TO L_R_ERSDA
Once the record is found in internal table satisfying above 'Where' condition..it will copy the content from work area L_S_SELECT to internal table L_R_ERSDA's header.. (corresponding fields)
..
APPEND L_R_ERSDA.
This will append the record ( with corresponding field copied ) to internal table L_R_ERSDA
ENDLOOP.
‎2007 Feb 13 5:18 AM
Hi,
LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT.<b>This loop will select t_select from the s_s_if table into the workarea l_s_select where the condition statisfies.</b>
WHERE FIELDNM = 'ERSDA'.MOVE-CORRESPONDING L_S_SELECT TO L_R_ERSDA.
<b>Move the entries in the l_s_select into a table with the same field.</b>
APPEND L_R_ERSDA.<b>Appending the entries into the table.</b>
ENDLOOP.Can u give the declaration for l_s_select and s_s_if.
‎2007 Feb 13 5:18 AM
Hi,
S_S_IF is an internal table which in turn should contain an internal table called t_select.
Basically,the code is looping the internal table t_select if the field fieldnam = 'ERSDA'.
For each record satisfying the condition,it is placing the record in work area l_s_select.
And then inside the loop,it's moving the similar field of work area l_s_select to l_r_ersda.
After moving the correspodning values,it is appending the values to the internal table l_r_ersda from the work area l_r_ersda.