‎2009 Apr 27 10:58 AM
Hallo
TYPES: BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln,
END OF ty_vbak.
DATA: tes(15) TYPE c,
lt_vbak TYPE TABLE OF ty_vbak,
wa_vbak LIKE LINE OF lt_vbak.
LOOP AT lt_vbak INTO wa_vbak.
wa_vbak-vbeln = 100 + 1.
IF wa_vbak-vbeln = 1000.
EXIT.
ENDIF.
ENDLOOP.
In the above code the program dont enter in loop. can somebody tell where is my mistake.
thanks.
‎2009 Apr 27 11:00 AM
hi,
in order to get in to the loop, check whether the internal table is intial or not.
If internal table has records, only then it will get into the loop..
hope it is clear..
Rgds.,
subash
‎2009 Apr 27 11:00 AM
HI ahmed,
I dont' see any select statement from u r code.
Check u r internla table has records or is it empty.
IF it is empty it wont get into loop.
Thanks
‎2009 Apr 27 11:01 AM
hI
Is there any data in internal table lt_vbak ? There is no SELECT statement .
Regards
‎2009 Apr 27 11:01 AM
‎2009 Apr 27 11:02 AM
hi
There is no data lt_vbak table to loop.SO append some values to the table and try again then it will defnetly enter into the loop.
regards
Jyotheswar.
‎2009 Apr 27 11:02 AM
Hello,
As there is no data in the Internal Table " lt_vbak" it will not get in to the Loop
regards
Suresh
‎2009 Apr 27 11:02 AM
Hi Waseem,
First check whether ur internal table lt_vbak is having any data or not. Bcoz in the code that u hv posted I do not see any select query populating the internal table.
Regards,
Arnab
‎2009 Apr 27 11:02 AM
Have you populated the table lt_vbak ?
Check the data in lt_vbak by debugging.
Regards,
Nitin.
‎2009 Apr 27 11:03 AM
‎2009 Apr 27 11:06 AM
hi,
this is yuor code.
> TYPES: BEGIN OF ty_vbak,
> vbeln TYPE vbak-vbeln,
> END OF ty_vbak.
>
> DATA: tes(15) TYPE c,
> lt_vbak TYPE TABLE OF ty_vbak,
> wa_vbak LIKE LINE OF lt_vbak.
> LOOP AT lt_vbak INTO wa_vbak.
> wa_vbak-vbeln = 100 + 1.
> IF wa_vbak-vbeln = 1000.
> EXIT.
> ENDIF.
> ENDLOOP.
write it like this.
TYPES: BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln,
END OF ty_vbak.
DATA: tes(15) TYPE c,
lt_vbak TYPE STANDARD TABLE OF ty_vbak,
wa_vbak type ty_vbak.
LOOP AT lt_vbak INTO wa_vbak.
wa_vbak-vbeln = 100 + 1.
IF wa_vbak-vbeln = 1000.
EXIT.
ENDIF.
ENDLOOP.
hope this helps
Regards
Ritesh Jha