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

reg loop stmt..

Former Member
0 Likes
544

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
Read only

Former Member
0 Likes
512

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

Read only

Former Member
0 Likes
512

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

Read only

Former Member
0 Likes
512

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

Read only

sharadendu_agrawal
Active Participant
0 Likes
512

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