Skip to Content
0
Former Member
Jun 08, 2010 at 12:47 PM

Write new line in Data Package fails

17 Views

Hi all,

I'm trying to assign Cost Distribution Codes from my Start Routine into a BW cube.

The start routine derives the Cost Center from a Masterdata table in where the HR Position, Cost Centerand FTE % are held.

Eg. I'm pulling an employee record from datasource 0HR_PA_0; this employee record is assigned to a Position which is split into 2 Cost Centers.

Datasource 0HR_PA_0 only has one record per month, but I'd like the cube to be uploaded with 2 records; one for each Cost Center Distribution Code and FTE %, but how would I do that?

I created a Start Routine in where I specified to find the Coste Center from the Masterdata object (zposcost) and if it finds more than 1 to write an extra line. This doesn't work; it still only writes only one line to the cube.

Please help!

This is part oif the code:

DATA: 
gd_/bic/mzposcost   LIKE /bic/mzposcost,
gd_/bi0/mcostcenter LIKE /bi0/mcostcenter,
gl_data_package     TYPE _ty_s_sc_1.

*IF MORE THAN 1 FOR THE DATE RANGE WRITE A NEW LINE IN THE DATA PACKAGE
              MOVE-CORRESPONDING <source_fields> TO gl_data_package.

              MOVE gd_/bic/mzposcost-as_prcnt TO
              gl_data_package-/bic/zhr_pcnt3.

              MOVE gd_/bic/mzposcost-costcenter TO
              gl_data_package-costcenter.

LOOP AT il_data_package INTO gl_data_package.

      MOVE-CORRESPONDING gl_data_package TO <source_fields>.
      APPEND <source_fields> TO SOURCE_PACKAGE.
    ENDLOOP.

Edited by: Markus de Graaff on Jun 8, 2010 2:37 PM