Hello !
Topic:
Here is described how to create new conditons with the methods of BAdi SD_COND_SAVE_A.
Our goal was to create a new, further additional price conditon when certain conditions on saving of an new condition are met,
means additionally to the original condition we create a 2nd one .
This relates to BAdI SD_COND_SAVE_A (SE18) which uses Interface IF_EX_SD_COND_SAVE_A
See too BAdI -Documentation name SD_COND_SAVE_A if you are lucky to find it.
Starting from
function module RV_CONDITION_SAVE which is calling:
CALL FUNCTION 'SD_CONDITION_SAVE_EXIT'
The calling of the exit and subsequent posting is by SAP standard defined as follows in the
FM RV_CONDITION_SAVE:
IF DB_UPDATE = YES. "4.0
CALL FUNCTION 'SD_CONDITION_SAVE_EXIT' " <-- this will call our BAdI-Class
CALL FUNCTION 'RV_KONDITION_SICHERN_V13A' IN UPDATE TASK
In general, if you want to create new conditions this is recommended through using
< fill structures> ( see other places, where 'RV_CONDITION_COPY' is used )
CALL FUNCTION 'RV_CONDITION_RESET'.
CALL FUNCTION 'RV_CONDITION_COPY'
IF sy-subrc = 0.
CALL FUNCTION 'RV_CONDITION_SAVE'.
CALL FUNCTION 'RV_CONDITION_RESET'.
ENDIF.
Therefore, to avoid recursive call of 'RV_CONDITION_SAVE' :
( 'RV_CONDITION_SAVE' calls BAdI, which calls 'RV_CONDITION_SAVE' which calls BAdi,... )
use a new custom class attribute GD_UPD_COND_RUNS ( static , proteced , Type BOOLE_D ), see below.
Proceed as follows:
1) Create new impmentation of the BAdI.
Implement a new class:
2) ZCL_IM_SD_COND_SAVE_A
3) Implemenent new method IF_EX_SD_COND_SAVE_A~CONDITION_SAVE_EXIT.
Exemplaric coding for the method - See attachment "Method_IF_EX_SD_COND_SAVE_A~CONDITION_SAVE_EXIT.txt"
I hope there's someone finding it useful, as the BAdI is not documented !
Greetings, Markus Hapke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
3 | |
3 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |