Skip to Content
Author's profile photo Grigoriy Babitskiy

Derivation type: Enchancement

Deriation type “Enchancement” is usefull when all other derivation types are not able to cope with a derivation-task. With ABAP code you can get any data you need.

Scenario: we will take as example scenario from Derivation type: Table lookup.

In Analyzer we use some characteristics. One of them is WYQ14S “Country”. We need it to set as “Country of Organization’s Registered Office” of Business partner while Automatic integration TRM and Analyzers.

IMG -> Financial Supply Chain Management -> Treasury and Risk Management -> Basic Analyzer Settings -> Automatic Integration of Financial Objects in Transaction Master Data -> Money Market -> Define Derivation Strategy (tr. AFO_FOI_DER_MONEY)

/wp-content/uploads/2014/10/1_559271.jpg

In general screen of derivation press “Create step” /wp-content/uploads/2014/10/9_559281.jpgbutton or F5.

/wp-content/uploads/2014/10/2_559272.jpg

Select “Enchancement” step.

/wp-content/uploads/2014/10/3_559273.jpg

Pay attention to Ehchancement ID – RMDRM001 – we will need it later.

Press “Project management” button.

/wp-content/uploads/2014/10/4_559275.jpg

Enter Project Id – “ZDERIVAT” and press “Create” button

/wp-content/uploads/2014/10/5_559276.jpg

Enter project short text and press “Enchancement assighnments”.

/wp-content/uploads/2014/10/6_559289.jpg

Enter Enchancement ID (from the first screen of newly created derivation step), save and press “Components” button.

/wp-content/uploads/2014/10/7_559290.jpg

Activate project and make a double click on Function exit.

/wp-content/uploads/2014/10/8_559291.jpg

Here you can find Function EXIT_SAPLCFADMM_001declaration – we will use it.

/wp-content/uploads/2014/10/19_559324.jpg

I_DATASTR – Analysis Structure id.

I_STEP_ID – derivation step id.

I_DATA – date of execution.

/wp-content/uploads/2014/10/16_559311.jpg

This is our Source field declaration. We use them in our select as they have values we need to get data for Target fields.

/wp-content/uploads/2014/10/17_559312.jpg

This is Target field declaration. You have to put values that you will get through ABAP code into this fields.

/wp-content/uploads/2014/10/18_559322.jpg

E_EXIT_IS_ACTIVE – always set this field as “X” in order to pass data from variable to target fields in derivation.

E_FAILED – if you failed to obtain data – set this field as “X”.

/wp-content/uploads/2014/10/20_559332.jpg

Make a double click on include ZXRMDMMU01. The system will ask you if you want to create new include.

/wp-content/uploads/2014/10/9_559281.jpg

Create include and enter type of programm – “I Include programm”.

/wp-content/uploads/2014/10/11_559293.jpg

Enter ABAP code into include.


SELECT SINGLE CNTRY_COMP
    FROM BP001
    INTO E_RM_CHAR
    WHERE PARTNER = I_MONEY_MARKET-KONTRH.
   IF sy-subrc <> 0.
     E_FAILED = 'X'.
   ELSEIF
     E_EXIT_IS_ACTIVE = 'X'.
   ENDIF.

After all you have to activate newly created data.

/wp-content/uploads/2014/10/10_559294.jpg

Activation our include.

/wp-content/uploads/2014/10/13_559295.jpg

Don’t forget to activate project by pressing /wp-content/uploads/2014/10/15_559310.jpg and then activation button, then get back to initial screen.

/wp-content/uploads/2014/10/14_559296.jpg

Enter Source field and Target field.

Derivation step is ready.

For other Derivation topics reffer toTRM Derivation (index)

Assigned Tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Gustavo Vazquez
      Gustavo Vazquez

      Hi Grigoriy,

      I'm trying to derive characteristics with your blog and worked for MM and Securities ( RMDRM001 & RMDRP001 ) but when i try for TRL or Security transactions I get an enhacement spot in red.

      trx: AFO_FOI_DER_TRL

      I couldn't make it work. The enhacement is enabled but not active.

      How can l enable it ?

      Kind Regards

       

      Author's profile photo Grigoriy Babitskiy
      Grigoriy Babitskiy
      Blog Post Author

      Hello Gustavo,

      In your case you need to use badi: tr. SE18 -> Enhancement Spot "ES_TAN_TRL_DERIVATION_ENH" -> Enchancement Implementation.

      Author's profile photo Gustavo Vazquez
      Gustavo Vazquez

      Hi Grigoriy,

      thanks for the answer. I 've created the BADI and its active. Have i done something wrong ?

       

      Kind Regards

      Author's profile photo Grigoriy Babitskiy
      Grigoriy Babitskiy
      Blog Post Author

      You have to check:

      1. Enchancement implementation has to be active.

      1. And the method of badi also has to be active - this is usual problem with not activation methods.

      Author's profile photo Gustavo Vazquez
      Gustavo Vazquez

      Both are active.

      Should I open an OSS message ?

       

      Author's profile photo Grigoriy Babitskiy
      Grigoriy Babitskiy
      Blog Post Author

      Did you try to enter into your badi code by running an application ?

      Some times when to enchance you derivation and use badi - red sign doesn't mean anything. If your code is not working - that's the problem.

      Author's profile photo Gustavo Vazquez
      Gustavo Vazquez

      Thanks Grigoriy !!!!

      There was a problem in the code.

      Kind Regards

      Author's profile photo Grigoriy Babitskiy
      Grigoriy Babitskiy
      Blog Post Author

      Not at all !

      Author's profile photo Guillermo ACCFIG
      Guillermo ACCFIG

      Hello Grigoriy,

      I’m trying to cutomize the “Derivation of Additional Account Assignments” but I cannot find the user exit to place my code. I’ve also tried to use badi BADI_TPM_ENHANCE_ACCFIG_TRAC but when I run transaction TBB1 it does not enter this badi.

      Could you please help me?

      Regards

       

       

      Author's profile photo Grigoriy Babitskiy
      Grigoriy Babitskiy
      Blog Post Author

      Hello Guillermo! Check TPM_POS_IND_TRAC badi.