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

append before endloop

Former Member
0 Likes
1,034

LOOP AT IT_PO WHERE CHECK = 'X'.

MOVE-CORRESPONDING IT_PO TO OUTPUT-MT_PURCHASE_DATA-HEADER.

MOVE 'R' TO OUTPUT-MT_PURCHASE_DATA-HEADER-FLAG.

MOVE-CORRESPONDING IT_PO TO L_ITEM.

L_ITEM-DMBTR = IT_PO-MENGE * IT_PO-NETPR.

INSERT L_ITEM INTO TABLE OUTPUT-MT_PURCHASE_DATA-ITEM.

ENDLOOP.

Do we need to add append before endloop ...If so ..How

6 REPLIES 6
Read only

Former Member
0 Likes
904

Hi,

You need to use append before endloop.

Try this.

Append OUTPUT.

ENDLOOP.

Edited by: Niyaz Ahamed on Feb 20, 2008 12:28 PM

Read only

Former Member
0 Likes
904

before endloop use append

append <workarea> to <itab>

Madhavi

Read only

Former Member
0 Likes
904

Hi

u need to append before endloop.

append itab.

Read only

Former Member
0 Likes
904
LOOP AT IT_PO WHERE CHECK = 'X'.

MOVE-CORRESPONDING IT_PO TO OUTPUT-MT_PURCHASE_DATA-HEADER.
MOVE 'R' TO OUTPUT-MT_PURCHASE_DATA-HEADER-FLAG.
MOVE-CORRESPONDING IT_PO TO L_ITEM.
L_ITEM-DMBTR = IT_PO-MENGE * IT_PO-NETPR.
INSERT L_ITEM INTO TABLE
                          OUTPUT-MT_PURCHASE_DATA-ITEM.

APPEND it_po.
         CLEAR     it_po.

ENDLOOP

.

If this doenot work can you revert back with the declaration for it_po, l_item and output structures.

Read only

0 Likes
904

Hmmmm sorry Judith,

IT_PO is the internal table he is looping, appending that again can get into a recursive loop. Append should be for MT_PURCHASE_DATA if it is internal table.

Regards

Eswar

Read only

Former Member
0 Likes
904

Hi Dear,

You need to append the contents to

internal table before endloop.

If you the append statement in loop it will append all

the records.

If you put it outside of the loop it will append the last

record to an internal table.

If it helps Reward me points.

Regards

Ashok.