I want to define an object for BAdI implementation that will not initialize the BAdI by its name in declaration.
Example of what I don't want:
DATA l_split_badi TYPE REF TO fieb_get_bank_stmts_x.
Question 1 : I want something like:
DATA l_split_badi TYPE REF TO object.
lv_class_name = 'fieb_get_bank_stmts_x'.
create object l_split_badi type (lv_class_name).
If I declare like above, I get the following syntax error:
"L_SPLIT_BADI" is not a valid BAdI handle here.
The reason why I need to perform such implementation is, while importing the Change request to a system which has an older SAP version, the import fails because of BAdI declaration with TYPE REF TO
(because that BAdI doesn't exist in the system).
My idea is with dynamic declaration to avoid the pre-check on importing the Change request.
Any idea is welcome ! Thanks to all !
EDIT Question 2 : after solution proposed by Sandra Rossi to use DATA l_split_badi TYPE REF TO cl_badi_base
and GET BADI l_split_badi TYPE ('FIEB_GET_BANK_STMTS_X')
, I get the same syntax error at line CALL BADI l_split_badi->split
below:
CALL BADI l_split_badi->split
EXPORTING
i_string = lv_cont
IMPORTING
et_string = lt_xml_string
EXCEPTIONS
split_not_possible = 1
wrong_format = 2.