11-27-2020 3:39 AM
Hi I'm looping through the internal table it is not working it is getting exit.after at new
loop at lt_invoice_data into data(ls_invoice).
at new ls_invoice-innumber.
lv_flag = 'X'.
endloop.
11-27-2020 5:26 AM
11-27-2020 7:19 AM
If you can share a bit more of your code, we can help you.
If your code looks like this below, exiting after the 1st INNUMBER is the correct behaviour
loop at lt_invoice_data into data(ls_invoice).
at new ls_invoice-innumber.
lv_flag = 'X'.
endat.
if lv_flag = 'X'.
exit.
endif.
endloop.
11-27-2020 5:30 PM
Just indicate the component name:
loop at lt_invoice_data into data(ls_invoice).
at new innumber.
...
endat.
endloop.
11-29-2020 8:55 AM
lakshmi.chinta,
Before you check the issue recommend you to have the below understanding.
1) When you apply AT NEW on a field system checks and compares all the fields before it to be Same. AT NEW is triggered only when there is a difference in all the fields before during the iteration.
2) We need to align all the fields we need to compare to be the frontline fields of the internal table. This Helps us in applying the control break statements better.
3) The LINK can you help you understand the concept better.
If you can help us with the code we can provide better solutions. Also I expect all the lines of the internal table to hold the same number in the field INNUMBER. Kindly share the code to take this further.
Regards!