on 02-01-2019 9:01 AM
Hi Team,
I have created AMDP class for one of my custom planning function requirement. Need some clarification in proceeding further.
1. I have created class by implementing the interfaces IF_AMDP_MARKER_HDB, IF_RSPLFA_SRVTYPE_IMP_EXEC and IF_RSPLFA_SRVTYPE_TREX_EXEC. Now my question is :
1. Is it mandatory to implement all the methods of these interfaces. If yes, what code needs to be written in these methods.
2. What is the difference between IF_RSPLFA_SRVTYPE_IMP_EXEC and IF_RSPLFA_SRVTYPE_TREX_EXEC interfaces ?
what is the difference between writing my script procedure in execute methods of the above 2 interfaces.
3. I want to explore more about the above interfaces and its methods and the execution cycle.
Please help.
Regards,
Shreyanssh.
Hi Praveen,
I think this topic is quite well covered already in how-to guides.
Here is a general list of how-to guides:
and the topics you are interested in can be found here:
https://archive.sap.com/documents/docs/DOC-53800
and
Regards,
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor,
Thanks for the reply, i have followed one document in the above link.
1. I have created Class, Custom Planing function type, Planning function and Planning sequence.
class ZCL_CPY_PFTY_01 definition
public
final
create public .
public section.
interfaces IF_AMDP_MARKER_HDB.
interfaces IF_RSPLFA_SRVTYPE_IMP_EXEC.
interfaces IF_RSPLFA_SRVTYPE_TREX_EXEC.
TYPES : BEGIN OF TY_AQPL,
CALMONTH2 TYPE CHAR2 ,
CALYEAR TYPE CHAR4 ,
Z_PROD TYPE CHAR20 ,
ZRC_AMT TYPE INTEGER ,
ZRC_QTY TYPE INTEGER ,
END OF TY_AQPL.
TYPES : TT_AQPL TYPE STANDARD table of TY_AQPL.
CLASS-METHODS MY_HANA_PROCEDURE
IMPORTING VALUE(LT_AGG) TYPE TT_AQPL
EXPORTING VALUE(LT_AG1) TYPE TT_AQPL .
protected section.
private section.
ENDCLASS.
CLASS ZCL_CPY_PFTY_01 IMPLEMENTATION.
METHOD IF_RSPLFA_SRVTYPE_IMP_EXEC~init_execution.
EXIT.
endmethod.
METHOD IF_RSPLFA_SRVTYPE_IMP_EXEC~finish_execution.
EXIT.
ENDMETHOD.
METHOD IF_RSPLFA_SRVTYPE_IMP_EXEC~EXECUTE.
EXIT.
endmethod.
METHOD if_rsplfa_srvtype_trex_exec~init_and_check.
" e_trex_supported = rs_c_true.
exit.
ENDMETHOD.
METHOD IF_RSPLFA_SRVTYPE_TREX_EXEC~trex_execute.
DATA: l_r_sql_script TYPE REF TO if_rspls_sql_script,
l_procedure_name TYPE string,
l_t_iobj_param TYPE if_rsr_pe_adapter=>tn_t_iobj_param.
l_r_sql_script = cl_rspls_session_store_manager=>get_sql_script_instance( i_r_store = i_r_store ).
l_r_sql_script->get_parameter_values(
EXPORTING
i_r_param_set = i_r_param_set
i_para_name_for_procedure = 'HANA_PROCEDURE_NAME'
IMPORTING
e_procedure_name = l_procedure_name
e_t_iobj_param = l_t_iobj_param ).
l_procedure_name = 'ZCL_CPY_PFTY_01=>MY_HANA_PROCEDURE'.
r_s_view-view = l_r_sql_script->execute_sql_script(
i_view = i_view
i_t_iobj_param = l_t_iobj_param
i_proc_name = l_procedure_name
* i_sql_script_returns_ai = abap_true
i_r_msg = i_r_msg ).
ENDMETHOD.
METHOD MY_HANA_PROCEDURE BY DATABASE procedure for hdb language SQLSCRIPT.
LT_AG1 = SELECT CALMONTH2 ,
'2020' AS CALYEAR ,
Z_PROD ,
ZRC_AMT ,
ZRC_QTY
FROM :LT_AGG;
ENDMETHOD.
ENDCLASS.
. When executing the planning sequence, I am getting the below dump.
I have done the following analysis.
1. When commenting the e_trex_supported = rs_c_true statement in init_and_check method of IF_RSPLFA_SRVTYPE_TREX_EXEC interface. the execution is happening in the application layer and since the execute method of IF_RSPLFA_SRVTYPE_IMP_EXEC is blank, I am getting 0 records output.
User | Count |
---|---|
15 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.