‎2008 Mar 03 12:37 PM
loop at itab8 where MANDT eq '' and zwerks eq ''.
MOVE ITAB7-MANDT TO ITAB8-MANDT.
MOVE ITAB7-ZWERKS TO ITAB8-ZWERKS.
MOVE ITAB7-ZLDAT TO ITAB8-ZLDAT.
MOVE ITAB7-ZBLDAT TO ITAB8-ZBLDAT.
APPEND ITAB8.
endloop.
IN THE ABOVE CODE, DATA IS GOING INTO ITAB8 BUT IT IS ADDING IN THE ITAB TABLE INSTEAD OF GOING INTO THE RECORDS OF ITAB8.
CAN ANY ONE SUGGEST HOW TO PASS ITAB7 DATA INTO THE RECORDS OF ITAB8 IN THE ABOVE CODE.
ACTUALLY IT HAS 4 FIELDS AND ALL FOUR FIELD DATA IS REPEATED IN ALL RECORDS, I HAVE TO JUST PASS THIS DATA INTO EXISTING BLANK FIELDS OF ITAB8.
THANX
ROCKY
‎2008 Mar 03 12:43 PM
Hi,
Change ur code like below...
MOVE ITAB7-MANDT TO ITAB8-MANDT.
MOVE ITAB7-ZWERKS TO ITAB8-ZWERKS.
MOVE ITAB7-ZLDAT TO ITAB8-ZLDAT.
MOVE ITAB7-ZBLDAT TO ITAB8-ZBLDAT.
MODIFY itab8 TRANSPORTING MANDT ZWERKS ZLDAT ZBLDAT where MANDT = ' ' and ZWERKS = ' '.
Cheers,
jose.
‎2008 Mar 03 12:39 PM
‎2008 Mar 03 12:43 PM
Hi,
Change ur code like below...
MOVE ITAB7-MANDT TO ITAB8-MANDT.
MOVE ITAB7-ZWERKS TO ITAB8-ZWERKS.
MOVE ITAB7-ZLDAT TO ITAB8-ZLDAT.
MOVE ITAB7-ZBLDAT TO ITAB8-ZBLDAT.
MODIFY itab8 TRANSPORTING MANDT ZWERKS ZLDAT ZBLDAT where MANDT = ' ' and ZWERKS = ' '.
Cheers,
jose.
‎2008 Mar 03 12:48 PM
Hi Rocky,
Take another table, say ITAB8_1 with the same structure of ITAB8 and try using the following code,
loop at itab8 where MANDT eq '' and zwerks eq ''.
MOVE ITAB7-MANDT TO ITAB8_1-MANDT.
MOVE ITAB7-ZWERKS TO ITAB8_1-ZWERKS.
MOVE ITAB7-ZLDAT TO ITAB8_1-ZLDAT.
MOVE ITAB7-ZBLDAT TO ITAB8_1-ZBLDAT.
APPEND ITAB8_1.
endloop.
clear ITAB8.
MOVE ITAB8_1 to ITAB8.
please award points if helpful.
‎2008 Mar 03 12:51 PM
can u clearly ask whats the problem..
what exactly expecting from the program..
‎2008 Mar 03 12:55 PM
loop at itab8 where MANDT eq '' and zwerks eq ''.
MOVE ITAB7-MANDT TO ITAB8-MANDT.
MOVE ITAB7-ZWERKS TO ITAB8-ZWERKS.
MOVE ITAB7-ZLDAT TO ITAB8-ZLDAT.
MOVE ITAB7-ZBLDAT TO ITAB8-ZBLDAT.
modify ITAB8.
endloop.
You have to use modify instead of Append.
‎2008 Mar 03 1:26 PM
instaed of appned use modify statment.
modify itab8 transporting fileds mandt zwerks zldat zbldat.
this will modify the exsting intrenal table records.