*---------------------------------------------------------------------*
* CLASS lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script DEFINITION INHERITING FROM cl_tpda_script_class_super .
PUBLIC SECTION.
METHODS: prologue REDEFINITION,
init REDEFINITION,
script REDEFINITION,
end REDEFINITION.
INTERFACES: if_tpda_script_w_input.
PRIVATE SECTION.
DATA queryservicename TYPE string.
CONSTANTS querydefaultname TYPE string VALUE 'QUERY_SERVICE'.
ENDCLASS. "lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
* CLASS lcl_debugger_script IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script IMPLEMENTATION.
METHOD prologue.
*** generate abap_source (source handler for ABAP)
super->prologue( ).
ENDMETHOD. "prolog
METHOD init.
queryservicename = querydefaultname.
ENDMETHOD. "init
METHOD script.
TYPES:
BEGIN OF ty_selparam,
attrname TYPE string,
sign TYPE string,
option TYPE string,
low TYPE string,
high TYPE string,
END OF ty_selparam.
DATA lt_col_alv TYPE tpda_script_service_source_tab.
DATA ls_col_alv like LINE OF lt_col_alv.
DATA ls_selparam TYPE ty_selparam.
DATA lr_query_service TYPE tpda_quick_vars.
DATA lv_query_service_object_name TYPE tpda_var_name.
DATA lv_selparamcol_object_name TYPE tpda_var_name.
DATA lv_bo_object_name TYPE tpda_var_name.
DATA lv_number_of_selparam TYPE i.
DATA lt_attr TYPE tpda_script_object_attribut_it.
DATA ls_attr TYPE tpda_script_object_attributes.
DATA lt_selparam TYPE STANDARD TABLE OF ty_selparam.
DATA lr_attr TYPE REF TO cl_tpda_script_data_descr.
DATA lr_entity_list TYPE REF TO cl_tpda_script_tabledescr.
DATA lr_obj_descr TYPE REF TO cl_tpda_script_objectdescr.
REFRESH lt_selparam.
TRY.
lv_query_service_object_name = cl_tpda_script_data_descr=>get_variable_info( queryservicename )-varvalue.
lv_selparamcol_object_name = cl_tpda_script_data_descr=>get_variable_info( lv_query_service_object_name && '-SELECTION_PARAM_COL' )-varvalue.
lr_entity_list ?= cl_tpda_script_data_descr=>factory( lv_selparamcol_object_name && '-ENTITY_LIST' ).
lv_number_of_selparam = lr_entity_list->linecnt( ).
DO lv_number_of_selparam TIMES.
lv_bo_object_name = cl_tpda_script_data_descr=>get_variable_info( lv_selparamcol_object_name && '-ENTITY_LIST[' && sy-index && ']-BO')-varvalue.
ls_selparam-attrname = cl_tpda_script_data_descr=>get_simple_value( lv_bo_object_name && '-PARAMETER_DATA->ATTR_NAME' ).
ls_selparam-option = cl_tpda_script_data_descr=>get_simple_value( lv_bo_object_name && '-PARAMETER_DATA->SIGN' ).
ls_selparam-sign = cl_tpda_script_data_descr=>get_simple_value( lv_bo_object_name && '-PARAMETER_DATA->OPTION' ).
ls_selparam-low = cl_tpda_script_data_descr=>get_simple_value( lv_bo_object_name && '-PARAMETER_DATA->LOW' ).
ls_selparam-high = cl_tpda_script_data_descr=>get_simple_value( lv_bo_object_name && '-PARAMETER_DATA->HIGH' ).
APPEND ls_selparam TO lt_selparam.
ENDDO.
REFRESH lt_col_alv.
ls_col_alv-fieldname = ls_col_alv-content = 'ATTRNAME'.
APPEND ls_col_alv TO lt_col_alv.
ls_col_alv-fieldname = ls_col_alv-content = 'SIGN'.
APPEND ls_col_alv TO lt_col_alv.
ls_col_alv-fieldname = ls_col_alv-content = 'OPTION'.
APPEND ls_col_alv TO lt_col_alv.
ls_col_alv-fieldname = ls_col_alv-content = 'LOW'.
APPEND ls_col_alv TO lt_col_alv.
ls_col_alv-fieldname = ls_col_alv-content = 'HIGH'.
APPEND ls_col_alv TO lt_col_alv.
CALL METHOD cl_tpda_script_data_display=>data_display
EXPORTING
p_list_header = 'Query Selection Parameters'
p_column_it = lt_col_alv
p_popup = 'X'
CHANGING
p_data_it = lt_selparam.
CATCH cx_tpda_varname
cx_tpda_data_descr_invalidated
cx_sy_move_cast_error
cx_tpda_table_wrong_key
cx_tpda_script_no_simple_type
cx_tpda_table_wrong_table_type.
me->raise_error( ).
ENDTRY.
ENDMETHOD. "script
METHOD end.
*** insert your code which shall be executed at the end of the scripting (before trace is saved)
*** here
ENDMETHOD. "end
METHOD if_tpda_script_w_input~get_parameters.
DATA l_input TYPE tpda_transfer_struc.
IF p_parameters_it IS INITIAL.
l_input-id = 'Query Service Variable Name'.
l_input-value = querydefaultname.
APPEND l_input TO p_parameters_it.
ENDIF.
ENDMETHOD. "if_tpda_script_w_input~get_parameters
METHOD if_tpda_script_w_input~set_parameter_values.
DATA l_input TYPE tpda_transfer_struc.
READ TABLE p_parameter_values_it INTO l_input INDEX 1.
queryservicename = l_input-value.
ENDMETHOD. "if_tpda_script_w_input~set_parameter_values
ENDCLASS. "lcl_debugger_script IMPLEMENTATION
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |