cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

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

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.

Please help

0 Likes
View Entire Topic
RafkeMagic
Active Contributor
0 Likes

if you add entries to a data package, you need to correctly fill the "RECORD" field according to the "design" rules

see OSS note 1258089 for the design rules for start routines

(there are similar notes for end routines and expert routines, resp. 1223532 and 1227667)

Former Member
0 Likes

Hi Raf,

Thanks for the pointer.

I am pretty new to ABAP and learning on my own. Can you please elaborate a little. I checked out the OSS notes but its not very clear to me. Please help me understanf the concept.