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)
In general screen of derivation press “Create step” button or F5.
Select “Enchancement” step.
Pay attention to Ehchancement ID – RMDRM001 – we will need it later.
Press “Project management” button.
Enter Project Id – “ZDERIVAT” and press “Create” button
Enter project short text and press “Enchancement assighnments”.
Enter Enchancement ID (from the first screen of newly created derivation step), save and press “Components” button.
Activate project and make a double click on Function exit.
Here you can find Function EXIT_SAPLCFADMM_001declaration – we will use it.
I_DATASTR – Analysis Structure id.
I_STEP_ID – derivation step id.
I_DATA – date of execution.
This is our Source field declaration. We use them in our select as they have values we need to get data for Target fields.
This is Target field declaration. You have to put values that you will get through ABAP code into this fields.
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”.
Make a double click on include ZXRMDMMU01. The system will ask you if you want to create new include.
Create include and enter type of programm – “I Include programm”.
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.
Activation our include.
Don’t forget to activate project by pressing and then activation button, then get back to initial screen.
Enter Source field and Target field.
Derivation step is ready.
For other Derivation topics reffer toTRM Derivation (index)
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
Hello Gustavo,
In your case you need to use badi: tr. SE18 -> Enhancement Spot "ES_TAN_TRL_DERIVATION_ENH" -> Enchancement Implementation.
Hi Grigoriy,
thanks for the answer. I 've created the BADI and its active. Have i done something wrong ?
Kind Regards
You have to check:
Both are active.
Should I open an OSS message ?
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.
Thanks Grigoriy !!!!
There was a problem in the code.
Kind Regards
Not at all !
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
Hello Guillermo! Check TPM_POS_IND_TRAC badi.