on 2014 May 27 11:57 AM
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
Request clarification before answering.
Hi Soumya.
Create 12 Rule Groups in transformations.In the standard group map 0calmonth and 0calyear = 1, 2014 and in others have it like 2 , 3, 4 ...12.
Hope this helps instead of coding.
Regards,
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Soumya,
Declare ITAB_SOURCE as internal table instead of work area.
DATA: ITAB_SOURCE TYPE STANDARD TABLE OF _ty_t_SC_1,
WA_SOURCE TYPE _ty_s_SC_1,
TMP_COUNTER TYPE I VALUE 1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it's already defined as a table, hence the update of 12 records
the note (1258089) is really straight forward... not sure what I could add to make it more clear to you? you're obviously in scenario 1... instead of "changing" the value of WA_SOURCE-CALMONTH2 you'll also have to "update" the value of WA_SOURCE-RECORD
your initial records have values 1 (for employee 9000125) and 2 (for employee 9001673) for RECORD
since you don't correctly update the values for RECORD, they're just being overwritten in your second loop
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.