cancel
Showing results for 
Search instead for 
Did you mean: 

transposing rows into columns(keyfigure)

Former Member
0 Kudos

Hi,

I need to transposing row into columns, means 1row into 20 column i created generic data source and WO DSO and map the field. for Key Figure i'm using the formula IF( /BIC/ZATNAM = 'Z_COB', /BIC/ZATF, 0 ).

formula works fine but transformation creates multiple records instead of 1 records.

Please help me to fix this problem.

Thanks,

Pria.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Pria,

Can you please elaborate? You have a datasource and you have one WO DSO.

You want 1 row into 20 columns? Do you mean Derive 20 Key figure values from 1 Characteristic value?

Also, WO DSO will have same number of records as in underlying datasource. (as Record number, Request number are keys). Maybe that is issue. Try Standard DSO.

Former Member
0 Kudos

Hi,

Thanks for your reply,

Here is the example;

Mat_Doc_num /BIC/ZATNAM /BIC/ZATF

0111 Z_COB 123

0111 Z_CAB 456

0111 Z_CAT 798

0111 Z-CAD 765

I need.

Mat_Doc_num Z_COB Z_CAB Z_CAT Z-CAD

0111 123 456 798 765

Please help me

Thanks

Former Member
0 Kudos

Hi,

Understood.

1. Use a standard DSO. With 'Mat_Doc_No' as key. So that you will have one line.

2. Merely writing if condition will suffice. This is peculiar case but we cant do NO UPDATE (RETURNCODE = 4) in the ABAP routine in BI 7.

whats happens, from source you get first record of Z_COB, you populate 123 while all others are blank.

in second record, Z_CAB will be populated but all other blank, even Z_COB will be overwritten.

So on.

Mat_Doc_num Z_COB Z_CAB Z_CAT Z-CAD

0111 # # # 765

Always last one will be loaded overwriting previous values.

So you will have to take all records in an internal table in Start Routine and read them in the update routine or end routine.

Also, if this is delta update, then you will have to append the previously loaded records for the Mat_Doc in DSO.

Former Member
0 Kudos

Hi Priya,

Since u r gonna transpose rows into coloumns..... try using an Expert outine instead of start and end routine. This will be much easier.

Regards,

Rahul

Former Member
0 Kudos

We had a similar requirement, but we used Rule Groups.. Its a good option, but needs some patience to work on creating mutliple rule groups for the same infoobject.. I'd would also suggest you to check use of ABAP for such backjobs, you can populate the feilds into an itab in an end-routine using the loop.... endloop statements & assign each element in column this to one particular tuple using append statement. Prior to this you must create a cube with fields >= # of rows for each line item

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Priya,

Will you please paste the logic or expert routine you had used for this requirement.

Former Member
0 Kudos

Simply use an end routine:


  LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
    COLLECT <RESULT_FIELDS> INTO l_t_result.
  ENDLOOP.
  RESULT_PACKAGE[] = l_t_result[].

Edit: An expert routine only is easier if you don't need to do any error handling.

Edited by: Dirk Herzog on May 24, 2011 10:01 AM

vishal_raina
Explorer
0 Kudos

good one