Application Development 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: 

Loop Statement?

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Hope it helps to you?

former_member225631
Active Contributor
0 Kudos

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.