cancel
Showing results for 
Search instead for 
Did you mean: 

Split record into multiple lines in start routine

former_member327592
Participant
0 Kudos
255

Hi,

I need help.

I have a flat file that has a data in the below format.I would like to split this record into 3 records in the target DSO.

Required data in the target.

The code I have wrote in the start routine but this code is not giving me the required format.

The format I am getting with this logic is below.Can you please correct me where i am doing wrong here,

METHOD GLOBAL_START.

FIELD-SYMBOLS:

<SOURCE_FIELDS> TYPE _ty_s_SC_1.

DATA: MONITOR_REC TYPE rstmonitor.

DATA: ls_source_package type _ty_s_SC_1,

lt_source_package like table of ls_source_package.

loop at SOURCE_PACKAGE into ls_source_package

where

TCTIOBJNM eq '0COSTCENTER' or

TCTIOBJNM eq '0CO_AREA'.

lt_SOURCE_package = SOURCE_PACKAGE[].

case <SOURCE_FIELDS>-tctiobjnm.

when '0COSTCENTER'.

<SOURCE_FIELDS>-TCTIOBJNM = '0RESP_CCTR'.

append ls_source_package to lt_SOURCE_PACKAGE .

<SOURCE_FIELDS>-TCTIOBJNM = '0MAST_CCTR'.

append ls_SOURCE_PACKAGE TO lt_SOURCE_PACKAGE.

when '0CO_AREA'.

<SOURCE_FIELDS>-TCTIOBJNM = '0CO_MST_AR'.

append ls_SOURCE_PACKAGE TO lt_SOURCE_PACKAGE.

endcase.

endloop.

move lt_SOURCE_PACKAGE[] to SOURCE_PACKAGE[].

Accepted Solutions (0)

Answers (2)

Answers (2)

rathy_moorthy2
Active Contributor

you need to use a record key to keep track of the record number being updated.

Regards,

Rathy

appel_solar_dk
Active Participant
0 Kudos

Hi

I think you are looking for an ABAP course or look through some of your existing code and try hard to understand what it is doing. Alternatively ask an ABAP developer in your organisation typically they don't bite (their managers may).

Regards

Kristian