2007 Jul 22 4:01 PM
Hi all,
I am getting two columns in my final internal table itab , Objectcode and ObjectNO. For one objectcode there are around eight to nine objectno product
So all was displaying in different line item , uptill know it's fine .
now I have to add two more fields to the itab, from some other Database table where there is Objectcode is there and the same line item for Qty, But no ObjectNo. now i have sorted itab and have to assign these Qty and slab to this sorted itab sequentially . pls help and provide your valuable suggestions.
thanks in advance,
Regards,
Vivek
2007 Jul 22 5:25 PM
ITAB1
objcode
objno
lineitem
New_Qty --->.
New_Slab--->.
.
ITAB2.
objcode
lineitem
Qty
slab
SELECT objcode
lineitem
Qty
Slap
FROM <Your table>
INTO TABLE ITAB2
FOR ALL ENTRIES IN ITAB1
WHERE objcode = ITAB1-objcode
AND lineitem = ITAB1-lineitem.
LOOP AT ITAB2.
READ TABLE ITAB1 WITH KEY objcode = ITAB1-objcode
lineitem = ITAB1-lineitem.
IF SY-SUBRC IS INITIAIL.
MOVE: ITAB2-QTY TO ITAB1-QTY,
ITAB2-SLAP ITAB1-SLAP.
MODIFY ITAB1 TRANSPORTING QTY slap INDEX sy-tabix.
ENDIF.
ENDLOOP.
Regards,
A.Singh
2007 Jul 22 5:25 PM
ITAB1
objcode
objno
lineitem
New_Qty --->.
New_Slab--->.
.
ITAB2.
objcode
lineitem
Qty
slab
SELECT objcode
lineitem
Qty
Slap
FROM <Your table>
INTO TABLE ITAB2
FOR ALL ENTRIES IN ITAB1
WHERE objcode = ITAB1-objcode
AND lineitem = ITAB1-lineitem.
LOOP AT ITAB2.
READ TABLE ITAB1 WITH KEY objcode = ITAB1-objcode
lineitem = ITAB1-lineitem.
IF SY-SUBRC IS INITIAIL.
MOVE: ITAB2-QTY TO ITAB1-QTY,
ITAB2-SLAP ITAB1-SLAP.
MODIFY ITAB1 TRANSPORTING QTY slap INDEX sy-tabix.
ENDIF.
ENDLOOP.
Regards,
A.Singh