2008 Apr 14 3:50 PM
Hi,
How does at end works with the below code>
LOOP AT i_crhd into x_crhd.
at new arbpl.
v_resource = x_crhd-arbpl.
LOOP AT i_afko into x_afko.
at new plnbez.
v_matcode = x-afko-plnbez.
READ TABLE i_mseg into x_mseg with key x_afko-aufnr.
IF sy-subrc eq 0.
IF x_mseg-bwart eq '101'.
v_menge_101 = v_menge_101 + x_mseg-menge.
ELSEIF i_mseg-bwart = '102'.
v_menge_102 = v_menge_102 + i_mseg-menge.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
Thanks a lot!
Hi,
How does at end works with the below code>
LOOP AT i_crhd into x_crhd.
at new arbpl.
v_resource = x_crhd-arbpl.
LOOP AT i_afko into x_afko.
at new plnbez.
v_matcode = x-afko-plnbez.
READ TABLE i_mseg into x_mseg with key x_afko-aufnr.
IF sy-subrc eq 0.
IF x_mseg-bwart eq '101'.
v_menge_101 = v_menge_101 + x_mseg-menge.
ELSEIF i_mseg-bwart = '102'.
v_menge_102 = v_menge_102 + i_mseg-menge.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
Thanks a lot!
2008 Apr 14 3:59 PM
Hi,
At end will appera for inner loop first and then outer loop.
Please note that At end will appear inside respective loops.
Regards,
Siddhesh S.Tawate
2008 Apr 14 3:59 PM
at end of <field>.
this means when table is sorted by a (key) field, that when looping over internal table and the last record from this particular field is reached, than it will go into AT END OF section.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |