Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Loop Statement?

Former Member
0 Likes
538

Hi all,

I have written a loop statement as below.

SORT PXXXX ENDDA BY DESCENDING.

LOOP AT PXXX WHERE BEGDA LE PN-ENDDA

                                    and endda GT pn-begda

                                    an aewrc in s_aewrc.

exit.

endloop.

if sy-subrc = 0.

----

---

endif.

I have two records in the mention period, but in the loop it's not populating the latest values. It's populating the old one.

please suggest on this.

Moderator Message - Un-marked as question.

Message was edited by: Suhas Saha

2 REPLIES 2
Read only

Former Member
0 Likes
501

why can't you go for provide and endprovide as this is related to infotype internal tables data ?

Hope it helps to you?

Read only

former_member225631
Active Contributor
0 Likes
501

Hi, apart from endda, you have given two more conditions in loop. If the latest data is not populated means, the latest record doesn't satisfy these conditions.