cancel
Showing results for 
Search instead for 
Did you mean: 

Fill Transformation from field not in transformation

Former Member
0 Kudos

Hi SAP Guru's

Please assist or advise me on the following issue.

I have a Cube that has to be filled using a DSO which is filled from the 0EC_PCA_1 extractor. Not all of the fields between the DSO and the Cube align but after investigating I have found that the there are fields which can be used to derive the values of other fields by means of a Master Data Read in my Transformation. However I am having trouble to do the following:

For example

In the DSO I have 0ACCOUNT which is mapped to 0ACCOUNT in the Cube. I have 0GL_ACCOUNT in the cube but NOT in the DSO.

I have another field in the Cube that is characteristic of 0GL_ACCOUNT which I want to populate for each 0ACCOUNT.

Thus what I want to do is read from 0GL_ACCOUNT via 0ACCOUNT to get the field in the cube.

Please advise if this is possible and how this can be done? I have a couple of fields that I want to map in this way.

Restraints:

I may not change the existing Cube or DSO.

Thanks in advance!

Accepted Solutions (1)

Accepted Solutions (1)

former_member183519
Contributor
0 Kudos

Hello ,

you can write code at end routine.

Select GL_ACCOUNT from ACCOUNT_MD_TAB into table IT_ACC_MD_TAB

FOR ALL ENTRIES IN RESULT_PACKAGE

where ACCOUNT=RESULT_PACKAGE-ACCOUNT.

SORT IT_ACC_MD_TAB BY GL_ACCOUNT.

DELETE ADJUCENT DUPLICATES FROM IT_ACC_MD_TAB BY GL_ACCOUNT.


LOOP AT RESULT_PACKAGE assigning <result_fields>.

Read table IT_ACC_MD_TAB INTO WA_ACC

                 WITH KEY Account = <result_fields>-account.

IF sy-subrc = 0.

RESULT = wa_acc-gl_account.

Endif.

ENDLOOP.

** for performance perspective,  instead of field routine go for end routine.

Regards,

Hitesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I hope I understand your question: -

* If you are using info source(inbound) you can add those fields as dummy fields which you can populate in start routine.

* If not, you can still add those fields in the DSO ( dummy will be blank) and use them in the transformation.

Thanks,

-J

Former Member
0 Kudos

Hi Alexander,

you can write a routine (field\end routine) in cube to get the data from 0account which is in DSO.


also you can map both fields on-to-one if your DSO which has 0account and cube which has 0glaccount have transformations.

marco_simon2
Participant
0 Kudos

Hi Alexander,

I'm absolutely not sure if I understood your problem correctly, but I'll give it a try:

What I guess is: You wanna fill a target-characteristic with the value of an attribute (=master data record field) of a source-characteristic.

In your case (if I got it right)

Source                                                  Target           

0ACCOUNT      --->                               0ACCOUNT  (direct rule)

0ACCOUNT__0GL_ACCOUNT --->     0_GL_ACCOUNT (indirect rule)

Since (i think) 7.1 there should be an own transformation-type "master data" for such cases.
But you can do that manually as well by simply reading the needed md-value in the routine.

So the idea is, to write some code in the routine like:

Select single GL_ACCOUNT from ACCOUNT_MD_TABLE into wa where ACCOUNT=[SOURCE_FIELD-ACCOUNT]

if sy-subrc = 0.

RESULT = wa-gl_account.

endif.

Since it isn't very performant to call a SELECT for each and every record passing your routine it might make more sense to cache the MD-table in the starting-routine and read read from the caching-table in the rule-routine.

Hope that addresses your case in any kind.

Best regards,

  Marco