Skip to Content

Expert-Routine: No transformation

Hi experts,

when defining 'normal' transformations, you've got the possiblity to define which fields of the target-structure shall be modifed or stay untoched (by using the option "No transformation"). This allows for example to load master-data attributes from several sources, while every source only needs to provide a subset of all target-fields.

I'm looking for something similar in conclusion with the expert-routine.

Is there a way to write an expert routine which only updates e.g. target-field 1,2,3,7 while 4,5,6 are not modified at all?

Please note that writing a _SPACE_ to any of the not wanted target-fields will erase the already existing value in the master-data-tables.

Hence transfering _SPACE_ into this fields is certainly not solution I'm looking for.

In other words: Is it possible to reduce the target-structure in an expert-routine without changing the target itself?

Thanks for your hints,

best regards,

Marco

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 13, 2012 at 05:11 PM

    Hi Marco,

    My first answer is: Don't use expert routines. They are almost never required.

    However, assuming that you have a good reason to use expert routines (I'd like to know what it is, out of curiosity), the answer is that unfortunately you are out of luck. All fields will be updated and BW doesn't provide any tools to help you. One option is going to be to do a forward-lookup on your data target (you can find it dynamically from the DTP l_r_request object, which I think is available in the expert routine context) and populate the fields that you want to populate from the target from there.

    Another option is to do your expert routine between the source and an InfoSource, and then have an normal transformation from the InfoSource to the target where you only map the fields you want to update. Come to think of it, this is probably the more elegant solution.

    Regards,

    Ethan

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Marco,

      Thanks for the explanation. Column-to-row transposition is exactly one of the scenarios where I would usually want to use an expert routine as well. So good to know that this is a scenario where there isn't really another option.

      I'm a little confused about why you're trying to avoid InfoSources. I find them one of the most useful constructs in BW 7.x. They serve quite a different and more general purpose than in 3.x. They can actually behave basically like a write-optimized DSO without persistence, which can be very useful for making transformation logic reusable. You might want to give them a chance.

      In any case, it sounds like you've got some ideas now. Good luck with addressing the problem. If you come up with other approaches, I'd be very interested to know what they are as well.

      Cheers,

      Ethan

  • avatar image
    Former Member
    Dec 12, 2012 at 01:39 PM

    Hi Marco,

    It's very well possible in expert routines too.

    We are using expert routines, in which the transformation mappings are maintained in a table.

    This table entry contains mappings which needs to be mapped and we refer this table for mappings for every transformation for the source/target.

    Br,

    H

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Marco Simon

      As Ethan said I agree with the use of expert routine only when the scenario is complex for example if you doing a cost allocation or PA kind of scenario in BW.

      I have a suggestion here just to innovate(might not be the best approach but gets the work done).

      As you not updating created on it makes sense that system assumes it has null value for a new record coming in and during the change run it overwrites the previous value stored assuming its changed to null.

      So now the solution:

      Read the master data table(0material-attr.-table (for a particular material):) in the code and update the created on with the value found with material as key

      So you have a new record with existing date and not null as previous.

      Hope this helps

      Cheers!

  • avatar image
    Former Member
    Nov 28, 2013 at 04:07 PM

    Marco,

    Just create an 7.0 infosource between the datasource and your expert routine and then a normal transformation (just mapping what you need to update) from the infosource to the infoobject.

    Please assign points if useful.

    Add comment
    10|10000 characters needed characters exceeded