20 May 2009

Templates for Start Routine

Following is the sample code for start routine in Transformation :

DATA: WA_TEMP TYPE DATA_PACKAGE_STRUCTURE, KEY1(255) TYPE C, KEY2(255)
TYPE C.
DATA: KEY3(255) TYPE C.
DATA: END_DATE LIKE DATA_PACKAGE-CALDAY.
DATA: START_DATE LIKE DATA_PACKAGE-CALDAY.

SORT DATA_PACKAGE BY
EMPLOYEE
CALDAY
REPTT
UNIT.

LOOP at DATA_PACKAGE INTO WA_TEMP.

CONCATENATE WA_TEMP-EMPLOYEE WA_TEMP-REPTT INTO KEY1.

IF KEY2 = KEY1.
END_DATE = WA_TEMP-CALDAY.
WA_TEMP-/BIC/ZDAY_TO = END_DATE.
WA_TEMP-/BIC/ZDAY_FROM = START_DATE.
ELSE.
START_DATE = WA_TEMP-CALDAY.
END_DATE = WA_TEMP-CALDAY.
WA_TEMP-/BIC/ZDAY_TO = END_DATE.
WA_TEMP-/BIC/ZDAY_FROM = START_DATE.

ENDIF.


KEY2 = KEY1.

MODIFY DATA_PACKAGE FROM WA_TEMP.

ENDLOOP.

3 comments:

Unknown said...

hai naresh can u plz send some routines with requiremnts.....????

Unknown said...

hai naresh can u pla send some routines with requirements???

ravikiran0004@gmail.com

desaisuri said...

Hai naresh can you please send me some routines with requirements...
desaisuri@gmail.com