In this blog I am going to discuss about the Customer exit variable implementation using BADI.
The scenario is We need to consider(extract) the snapshot data of the 1st day of every month over a 1 year period back starting from current data.
In the next blog step by step I will discuss about the PYMTD, YTD, YMTD based on a range or input date.
To implement the customer exit, we need to implement the Interface abstract method of the enhancement spot RSROA_VARIABLES_EXIT and definition RSROA_VARIABLES_EXIT_BADI in user customized BADI class.
The implementation flow will look like below -
Step by Steps :
1. Create a customer exit variable ZVK_LST_YEAR of type Range and remove check from the checkbox input "Input-Ready" -
2. Go to SE18 and check the RSROA_VARIABLES_EXIT to check the interface and method definition. It will help us to implement the method of interface exists in the RSROA_VARIABLES_EXIT definition using SE19 in the next steps.
3. Go to Se19. Create a Custom BADI inside the enhancement Spot RSROA_VARIABLES_EXIT.
With the below name.-
Customized BADI Name - ZZSD_VARIABLES_EXIT_BADI
Implemented class Name - ZCL_ZZSD_VARIABLES_EXIT_BADI.
4. Put the filter in the created implementation as below -
5. Go inside the class to crate your code -
6. The code to implement the scenario of the customer exit is given below-
DATA: WA1 like LINE OF C_T_RANGE,
ZINITIALDT TYPE SY-DATUM,
ZENDDT TYPE SY-DATUM,
ZNMONTH TYPE N LENGTH 2,
ZDAYS_LV TYPE N LENGTH 2,
ZYAR_LV TYPE N LENGTH 4,
var type N LENGTH 8.