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

internal table loop help...

Former Member
0 Likes
660

Hello Friends,

My internal table looks like this:

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

Assume following records are one set and in the loop we need to read one set of records and create idoc.

I tried in this way, If T_ITAB_DATA+23(10) IS INITIAL. Then I am creating idoc. But it is not working when loop enter into 2nd st of records.

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

Please can you help me?

Thanks,

Shreekant

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
638

Hi Shreekanth,

Can you pl provide the second set of records for us to clearly understand your requirment?

Thanks

Shyam

6 REPLIES 6
Read only

Former Member
0 Likes
639

Hi Shreekanth,

Can you pl provide the second set of records for us to clearly understand your requirment?

Thanks

Shyam

Read only

0 Likes
638

Hi Shyam,

These are the internal table records:

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

I am treating this as one set, like this we have 3 sets u can see above.

10990191XSDSA0002099090

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

10990191XSDSA0002099090 TOTAL001 0098883330

Thanks for your reply,

Shreekant

Read only

0 Likes
638

Hi Shreekant,

loop at itab.

If condition.

idoc creation.clear itab.

else.

continue.

endif.

endloop.

try this...

Regards,

Kaveri

Read only

Former Member
0 Likes
638

Hi,

As you are doing with in the loop, try to clear the T_ITAB_DATA workarea every time before fetching the data from internal table.

Hope this will solve the problem.

Read only

RoySayak
Active Participant
0 Likes
638

Hi Shreekant,

I think at the time of execution of the program the HEADER of the internal table contains the previous value. Do one thing at the end of the loop clear the header data of internal table.

Syntax:

Clear <internal table name>.

********************************************************************reward points if it is useful***********************

THANKS,

Sayak...

Read only

Former Member
0 Likes
638

Hi,

You can try the following condition:

if T_ITAB_DATA+25(1) eq space.

Regards,

Shyam