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: 

reg loop stmt..

former_member198892
Participant
0 Kudos

Hi All,

I have used loop statement..

loop at it_date.

loop at itmat. "where budat = it_date-date.

if itmat-budat = <b>it_date-date</b>.

PERFORM opbal_data.

PERFORM all_data.

PERFORM mat_data.

endloop.

endloop.

it_date-date contains from 01.05.2007 to 30.05.2007.

first time its executed correctly, 2nd time it_date-date ll not be increment in this loop like 02-05-2007.3rd time only its increment as a 03-05-2007.

please suggest me. How to use..

4 REPLIES 4

Former Member
0 Kudos

Hi TT ,

here u have to get internal table like

1/10/07

2/10/07

etc .

for this u have to use FM CSCP_PARA1_GET_PERIODS

which will return DATES.

regards

Peram

Former Member
0 Kudos

Here is your code ....

SORT  it_date  BY  date.
SORT  itmat  BY  budat .
[code]loop at it_date.
*loop at itmat. "where budat = it_date-date.
Read table  itmat  with key  budat = it_date-date.
*if itmat-budat = it_date-date.
if  sy-subrc = 0 .
PERFORM opbal_data.
PERFORM all_data.
PERFORM mat_data.
endif.
*endloop.
endloop.

if this is not working place your full code .....

reward points if it is usefull ...

Girish

Former Member
0 Kudos

Hi,

This might work

loop at it_date.

loop at itmat. where budat IN it_date-date.

PERFORM opbal_data.

PERFORM all_data.

PERFORM mat_data.

endloop.

endloop.

Regards,

Shruthi R

sharadendu_agrawal
Active Participant
0 Kudos

Use the following logic...

loop at itmat.

read table it_date with key date = itmat-budat.

if sy-subrc = 0.

PERFORM opbal_data.

PERFORM all_data.

PERFORM mat_data.

endif.

endloop.

This will help u..

reward if helpful..

Cheers,

Sharadendu