‎2008 Feb 20 6:50 AM
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
‎2008 Feb 20 6:55 AM
Hi,
You need to use append before endloop.
Try this.
Append OUTPUT.
ENDLOOP.
Edited by: Niyaz Ahamed on Feb 20, 2008 12:28 PM
‎2008 Feb 20 6:55 AM
‎2008 Feb 20 6:57 AM
‎2008 Feb 20 7:17 AM
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.
‎2008 Feb 20 7:29 AM
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
‎2008 Feb 20 8:33 AM
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.