Quantcast
Channel: SCN : All Content - Data Warehousing
Viewing all articles
Browse latest Browse all 1423

How to split table records

$
0
0

Hi Gurus,

Need your help in this.

I am trying to split records in a table through ABAP routine. Following is the source table with 2 records

source.jpg

To split the record I wrote the following code in Start routine

DATA: ITAB_SOURCE TYPE _ty_t_SC_1,

       WA_SOURCE TYPE _ty_s_SC_1,

       TMP_COUNTER TYPE I VALUE 1.

LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS>.

   CLEAR WA_SOURCE.

   MOVE <SOURCE_FIELDS> TO WA_SOURCE.

   TMP_COUNTER = 1.

   DO 12 TIMES.

     WA_SOURCE-CALMONTH2 = TMP_COUNTER.

     APPEND WA_SOURCE TO ITAB_SOURCE.

     TMP_COUNTER = TMP_COUNTER + 1.

     ENDDO.

     "TMP_COUNTER = 1.

   ENDLOOP.

   "REFRESH SOURCE_PACKAGE.

   MOVE ITAB_SOURCE TO SOURCE_PACKAGE


However I could see only 1 record being split. Kindly point out the flaw in my routine.Following is the result for the routine.

result.jpg

Please help


Viewing all articles
Browse latest Browse all 1423

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>