Skip to content

Commit

Permalink
Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
mbtools committed Apr 7, 2024
1 parent faaa28c commit 757fd94
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 81 deletions.
67 changes: 37 additions & 30 deletions src/sap/#mbtools#cl_sap.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ CLASS /mbtools/cl_sap DEFINITION
************************************************************************
PUBLIC SECTION.

CONSTANTS:
BEGIN OF c_pgmid,
head TYPE pgmid VALUE 'HEAD',
r3tr TYPE pgmid VALUE 'R3TR',
limu TYPE pgmid VALUE 'LIMU',
basis TYPE pgmid VALUE 'ZZ01',
END OF c_pgmid.

TYPES:
BEGIN OF ty_domain_value,
domvalue_l TYPE domvalue_l,
Expand Down Expand Up @@ -102,7 +110,7 @@ CLASS /mbtools/cl_sap DEFINITION

CLASS-METHODS show_object
IMPORTING
!iv_pgmid TYPE csequence DEFAULT 'R3TR'
!iv_pgmid TYPE csequence DEFAULT c_pgmid-r3tr
!iv_object TYPE csequence
!iv_obj_name TYPE csequence
!iv_line_number TYPE i OPTIONAL
Expand All @@ -121,7 +129,6 @@ CLASS /mbtools/cl_sap DEFINITION
!iv_program TYPE csequence
RETURNING
VALUE(rv_exit) TYPE abap_bool.

PROTECTED SECTION.

PRIVATE SECTION.
Expand All @@ -134,7 +141,7 @@ CLASS /mbtools/cl_sap DEFINITION

CLASS-METHODS _map_object
IMPORTING
!iv_pgmid TYPE csequence DEFAULT 'R3TR'
!iv_pgmid TYPE csequence DEFAULT c_pgmid-r3tr
!iv_object TYPE csequence
!iv_obj_name TYPE csequence
EXPORTING
Expand All @@ -144,7 +151,7 @@ CLASS /mbtools/cl_sap DEFINITION

CLASS-METHODS _jump_basis
IMPORTING
!iv_pgmid TYPE csequence DEFAULT 'R3TR'
!iv_pgmid TYPE csequence DEFAULT c_pgmid-basis

Check failure on line 154 in src/sap/#mbtools#cl_sap.clas.abap

View check run for this annotation

abaplint / abaplint

Variable "iv_pgmid" not used

https://rules.abaplint.org/unused_variables
!iv_object TYPE csequence
!iv_obj_name TYPE csequence.

Expand All @@ -166,11 +173,11 @@ CLASS /mbtools/cl_sap IMPLEMENTATION.
wt_object_text = gt_object_texts.

" Add texts for non-transportable objects (or from previous releases)
ls_object_text-pgmid = 'HEAD'.
ls_object_text-pgmid = c_pgmid-head.
ls_object_text-object = 'SYST'.
ls_object_text-text = 'System Head'(107).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-pgmid = 'R3TR'.
ls_object_text-pgmid = c_pgmid-r3tr.
ls_object_text-object = 'LSYS'.
ls_object_text-text = 'Source System'(100).
COLLECT ls_object_text INTO gt_object_texts.
Expand All @@ -197,38 +204,38 @@ CLASS /mbtools/cl_sap IMPLEMENTATION.
COLLECT ls_object_text INTO gt_object_texts.

" Add Basis Objects
ls_object_text-pgmid = 'ZZZZ'.
ls_object_text-object = 'ZACT'.
ls_object_text-pgmid = c_pgmid-basis.
ls_object_text-object = /mbtools/if_objects=>c_basis-activity.
ls_object_text-text = 'Activity'(110).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZCLI'.
ls_object_text-object = /mbtools/if_objects=>c_basis-client.
ls_object_text-text = 'Client'(111).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZPCK'.
ls_object_text-object = /mbtools/if_objects=>c_basis-devclass.
ls_object_text-text = 'Package'(112).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZOWN'.
ls_object_text-object = /mbtools/if_objects=>c_basis-owner.
ls_object_text-text = 'Owner'(113).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZPRJ'.
ls_object_text-object = /mbtools/if_objects=>c_basis-project.
ls_object_text-text = 'Project'(114).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZREQ'.
ls_object_text-object = /mbtools/if_objects=>c_basis-request.
ls_object_text-text = 'Transport Request'(115).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZSYS'.
ls_object_text-object = /mbtools/if_objects=>c_basis-system.
ls_object_text-text = 'System'(116).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZGRP'.
ls_object_text-object = /mbtools/if_objects=>c_basis-target_group.
ls_object_text-text = 'Target Group'(117).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZLAY'.
ls_object_text-object = /mbtools/if_objects=>c_basis-translayer.
ls_object_text-text = 'Transport Layer'(118).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZTGT'.
ls_object_text-object = /mbtools/if_objects=>c_basis-transport_target.
ls_object_text-text = 'Transport Target'(119).
COLLECT ls_object_text INTO gt_object_texts.
ls_object_text-object = 'ZUSR'.
ls_object_text-object = /mbtools/if_objects=>c_basis-user.
ls_object_text-text = 'User'(120).
COLLECT ls_object_text INTO gt_object_texts.

Expand Down Expand Up @@ -675,16 +682,16 @@ CLASS /mbtools/cl_sap IMPLEMENTATION.
lv_pgmid = iv_pgmid.
ELSE.
READ TABLE gt_object_texts TRANSPORTING NO FIELDS
WITH KEY pgmid = 'LIMU' object = iv_object.
WITH KEY pgmid = c_pgmid-limu object = iv_object.
IF sy-subrc = 0.
lv_pgmid = 'LIMU'.
lv_pgmid = c_pgmid-limu.
ELSE.
RETURN.
ENDIF.
ENDIF.

" Basis objects
IF iv_pgmid = 'ZZZZ'.
IF iv_pgmid = c_pgmid-basis.
_jump_basis(
iv_pgmid = iv_pgmid
iv_object = iv_object
Expand Down Expand Up @@ -770,64 +777,64 @@ CLASS /mbtools/cl_sap IMPLEMENTATION.
lv_username TYPE xubname.

CASE iv_object.
WHEN /mbtools/if_command_field=>c_objects_basis-activity.
WHEN /mbtools/if_objects=>c_basis-activity.
lv_activity = iv_obj_name.

CALL FUNCTION 'TR_SHOW_ACTIVITY'
EXPORTING
iv_activity = lv_activity.

WHEN /mbtools/if_command_field=>c_objects_basis-client.
WHEN /mbtools/if_objects=>c_basis-client.
lv_client = iv_obj_name.

CALL FUNCTION 'TR_SHOW_CLIENT'
EXPORTING
iv_client = lv_client.

WHEN /mbtools/if_command_field=>c_objects_basis-devclass.
WHEN /mbtools/if_objects=>c_basis-devclass.
lv_devclass = iv_obj_name.

CALL FUNCTION 'TR_SHOW_DEVCLASS'
EXPORTING
iv_devclass = lv_devclass.

WHEN /mbtools/if_command_field=>c_objects_basis-owner.
WHEN /mbtools/if_objects=>c_basis-owner.
lv_trkorr = iv_obj_name.

CALL FUNCTION 'TR_SHOW_OWNER'
EXPORTING
iv_trkorr = lv_trkorr.

WHEN /mbtools/if_command_field=>c_objects_basis-project.
WHEN /mbtools/if_objects=>c_basis-project.
lv_project = iv_obj_name.

CALL FUNCTION 'TR_SHOW_PROJECT'
EXPORTING
iv_project = lv_project.

WHEN /mbtools/if_command_field=>c_objects_basis-request.
WHEN /mbtools/if_objects=>c_basis-request.
lv_trkorr = iv_obj_name.

CALL FUNCTION 'TR_SHOW_REQUEST'
EXPORTING
iv_trkorr = lv_trkorr
iv_popup = abap_true.

WHEN /mbtools/if_command_field=>c_objects_basis-system.
WHEN /mbtools/if_objects=>c_basis-system.
lv_system = iv_obj_name.

CALL FUNCTION 'TR_SHOW_SYSTEM'
EXPORTING
iv_system = lv_system.

WHEN /mbtools/if_command_field=>c_objects_basis-translayer.
WHEN /mbtools/if_objects=>c_basis-translayer.
lv_translayer = iv_obj_name.

CALL FUNCTION 'TR_SHOW_TRANSLAYER'
EXPORTING
iv_translayer = lv_translayer.

WHEN /mbtools/if_command_field=>c_objects_basis-user.
WHEN /mbtools/if_objects=>c_basis-user.
lv_username = iv_obj_name.

CALL FUNCTION 'TR_SHOW_USER'
Expand Down
128 changes: 77 additions & 51 deletions src/sap/#mbtools#if_objects.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -10,59 +10,85 @@ INTERFACE /mbtools/if_objects

* Note: All constants must by unique and some constants don't exist in lower releases
* BW-WHM
CONSTANTS c_multiprov TYPE lvc_fname VALUE rs_c_tlogo-multiprovider ##NO_TEXT.
CONSTANTS c_infocube TYPE lvc_fname VALUE rs_c_tlogo-infocube ##NO_TEXT.
CONSTANTS c_ods TYPE lvc_fname VALUE rs_c_tlogo-ods_object ##NO_TEXT.
CONSTANTS c_infoset TYPE lvc_fname VALUE rs_c_tlogo-infoset ##NO_TEXT.
CONSTANTS c_infoobject TYPE lvc_fname VALUE rs_c_tlogo-infoobject ##NO_TEXT.
CONSTANTS c_hierarchy TYPE lvc_fname VALUE 'HIER' ##NO_TEXT. "rs_c_tlogo-hierarchy,
CONSTANTS c_dimension TYPE lvc_fname VALUE 'DIME' ##NO_TEXT.
CONSTANTS c_hybridprovider TYPE lvc_fname VALUE 'HYPR' ##NO_TEXT. "rs_c_tlogo-hybridprovider,
CONSTANTS c_lpo TYPE lvc_fname VALUE 'LPOA' ##NO_TEXT. "rs_c_tlogo-log_partitioned_obj,
CONSTANTS c_ctrt TYPE lvc_fname VALUE rs_c_tlogo-cur_trans_type ##NO_TEXT.
CONSTANTS c_uomt TYPE lvc_fname VALUE rs_c_tlogo-uom_trans_type ##NO_TEXT.
CONSTANTS c_thjt TYPE lvc_fname VALUE rs_c_tlogo-tmphierjoin_type ##NO_TEXT.
CONSTANTS:
c_multiprov TYPE lvc_fname VALUE rs_c_tlogo-multiprovider,
c_infocube TYPE lvc_fname VALUE rs_c_tlogo-infocube,
c_ods TYPE lvc_fname VALUE rs_c_tlogo-ods_object,
c_infoset TYPE lvc_fname VALUE rs_c_tlogo-infoset,
c_infoobject TYPE lvc_fname VALUE rs_c_tlogo-infoobject,
c_hierarchy TYPE lvc_fname VALUE 'HIER', "rs_c_tlogo-hierarchy,
c_dimension TYPE lvc_fname VALUE 'DIME',
c_hybridprovider TYPE lvc_fname VALUE 'HYPR', "rs_c_tlogo-hybridprovider,
c_lpo TYPE lvc_fname VALUE 'LPOA', "rs_c_tlogo-log_partitioned_obj,
c_ctrt TYPE lvc_fname VALUE rs_c_tlogo-cur_trans_type,
c_uomt TYPE lvc_fname VALUE rs_c_tlogo-uom_trans_type,
c_thjt TYPE lvc_fname VALUE rs_c_tlogo-tmphierjoin_type.

* BW-BEX
CONSTANTS c_element TYPE lvc_fname VALUE rs_c_tlogo-element ##NO_TEXT.
CONSTANTS c_query TYPE lvc_fname VALUE rzd1_c_deftp-report ##NO_TEXT.
CONSTANTS c_variable TYPE lvc_fname VALUE rzd1_c_deftp-variable ##NO_TEXT.
CONSTANTS c_sel_object TYPE lvc_fname VALUE rzd1_c_deftp-sel_object ##NO_TEXT.
CONSTANTS:
c_element TYPE lvc_fname VALUE rs_c_tlogo-element,
c_query TYPE lvc_fname VALUE rzd1_c_deftp-report,
c_variable TYPE lvc_fname VALUE rzd1_c_deftp-variable,
c_sel_object TYPE lvc_fname VALUE rzd1_c_deftp-sel_object.

* BW-PLA-IP
CONSTANTS c_plan_provider TYPE lvc_fname VALUE 'BASI' ##NO_TEXT. "rs_c_tlogo-basic_infocube,
CONSTANTS c_char_relationship TYPE lvc_fname VALUE rs_c_tlogo-characteristic_relationship ##NO_TEXT.
CONSTANTS c_data_slice TYPE lvc_fname VALUE rs_c_tlogo-data_slices ##NO_TEXT.
CONSTANTS c_aggrlevel TYPE lvc_fname VALUE rs_c_tlogo-aggrlevel ##NO_TEXT.
CONSTANTS c_plan_service_type TYPE lvc_fname VALUE rs_c_tlogo-planning_service_type ##NO_TEXT.
CONSTANTS c_plan_service TYPE lvc_fname VALUE rs_c_tlogo-planning_service ##NO_TEXT.
CONSTANTS c_plan_sequence TYPE lvc_fname VALUE rs_c_tlogo-planning_sequence ##NO_TEXT.
CONSTANTS:
c_plan_provider TYPE lvc_fname VALUE 'BASI', "rs_c_tlogo-basic_infocube,
c_char_relationship TYPE lvc_fname VALUE rs_c_tlogo-characteristic_relationship,
c_data_slice TYPE lvc_fname VALUE rs_c_tlogo-data_slices,
c_aggrlevel TYPE lvc_fname VALUE rs_c_tlogo-aggrlevel,
c_plan_service_type TYPE lvc_fname VALUE rs_c_tlogo-planning_service_type,
c_plan_service TYPE lvc_fname VALUE rs_c_tlogo-planning_service,
c_plan_sequence TYPE lvc_fname VALUE rs_c_tlogo-planning_sequence.

* BW-PLA-BPS
CONSTANTS c_bps_profile TYPE lvc_fname VALUE 'BPS_PROFILE' ##NO_TEXT.
CONSTANTS c_bps_area TYPE lvc_fname VALUE 'BPS_AREA' ##NO_TEXT.
CONSTANTS c_bps_level TYPE lvc_fname VALUE 'BPS_LEVEL' ##NO_TEXT.
CONSTANTS c_bps_package TYPE lvc_fname VALUE 'BPS_PACKAGE' ##NO_TEXT.
CONSTANTS c_bps_method TYPE lvc_fname VALUE 'BPS_METHOD' ##NO_TEXT.
CONSTANTS c_bps_method_mp TYPE lvc_fname VALUE 'BPS_METHOD_MP' ##NO_TEXT.
CONSTANTS c_bps_method_doc TYPE lvc_fname VALUE 'BPS_METHOD_DOC' ##NO_TEXT.
CONSTANTS c_bps_method_bf TYPE lvc_fname VALUE 'BPS_METHOD_BF' ##NO_TEXT.
CONSTANTS c_bps_layout TYPE lvc_fname VALUE 'BPS_LAYOUT' ##NO_TEXT.
CONSTANTS c_bps_function TYPE lvc_fname VALUE 'BPS_FUNCTION' ##NO_TEXT.
CONSTANTS c_bps_param TYPE lvc_fname VALUE 'BPS_PARAM' ##NO_TEXT.
CONSTANTS c_bps_gps TYPE lvc_fname VALUE 'BPS_GPS' ##NO_TEXT.
CONSTANTS c_bps_web_interface TYPE lvc_fname VALUE 'BPS_WIF' ##NO_TEXT.
CONSTANTS c_bps_folder TYPE lvc_fname VALUE 'BPS_FOLDER' ##NO_TEXT.
CONSTANTS:
c_bps_profile TYPE lvc_fname VALUE 'BPS_PROFILE',
c_bps_area TYPE lvc_fname VALUE 'BPS_AREA',
c_bps_level TYPE lvc_fname VALUE 'BPS_LEVEL',
c_bps_package TYPE lvc_fname VALUE 'BPS_PACKAGE',
c_bps_method TYPE lvc_fname VALUE 'BPS_METHOD',
c_bps_method_mp TYPE lvc_fname VALUE 'BPS_METHOD_MP',
c_bps_method_doc TYPE lvc_fname VALUE 'BPS_METHOD_DOC',
c_bps_method_bf TYPE lvc_fname VALUE 'BPS_METHOD_BF',
c_bps_layout TYPE lvc_fname VALUE 'BPS_LAYOUT',
c_bps_function TYPE lvc_fname VALUE 'BPS_FUNCTION',
c_bps_param TYPE lvc_fname VALUE 'BPS_PARAM',
c_bps_gps TYPE lvc_fname VALUE 'BPS_GPS',
c_bps_web_interface TYPE lvc_fname VALUE 'BPS_WIF',
c_bps_folder TYPE lvc_fname VALUE 'BPS_FOLDER'.

* Basis
CONSTANTS:
BEGIN OF c_basis,
activity TYPE lvc_fname VALUE 'ZACT',
client TYPE lvc_fname VALUE 'ZCLI',
devclass TYPE lvc_fname VALUE 'ZPCK',
owner TYPE lvc_fname VALUE 'ZOWN',
project TYPE lvc_fname VALUE 'ZPRJ',
request TYPE lvc_fname VALUE 'ZREQ',
system TYPE lvc_fname VALUE 'ZSYS',
target_group TYPE lvc_fname VALUE 'ZGRP',
translayer TYPE lvc_fname VALUE 'ZLAY',
transport_target TYPE lvc_fname VALUE 'ZTGT',
user TYPE lvc_fname VALUE 'ZUSR',
END OF c_basis.

* Others
CONSTANTS c_user_id TYPE lvc_fname VALUE rs_c_tlogo-user ##NO_TEXT.
CONSTANTS c_role TYPE lvc_fname VALUE rs_c_tlogo-activity_group ##NO_TEXT.
CONSTANTS c_icon TYPE lvc_fname VALUE 'ICON' ##NO_TEXT.
CONSTANTS c_abap_function TYPE lvc_fname VALUE 'FUNC' ##NO_TEXT.
CONSTANTS c_abap_program TYPE lvc_fname VALUE 'PROG' ##NO_TEXT.
CONSTANTS c_abap_class TYPE lvc_fname VALUE 'CLAS' ##NO_TEXT.
CONSTANTS c_abap_interface TYPE lvc_fname VALUE 'INTF' ##NO_TEXT.
CONSTANTS c_data_element TYPE lvc_fname VALUE rs_c_obj_dtel ##NO_TEXT.
CONSTANTS c_table TYPE lvc_fname VALUE rs_c_obj_tabl ##NO_TEXT.
CONSTANTS c_number_range TYPE lvc_fname VALUE rs_c_obj_nrob ##NO_TEXT.
CONSTANTS c_enhancement TYPE lvc_fname VALUE 'SMOD' ##NO_TEXT.
CONSTANTS c_enhancement_proj TYPE lvc_fname VALUE 'CMOD' ##NO_TEXT.
CONSTANTS c_datasource TYPE lvc_fname VALUE 'OSOA' ##NO_TEXT.
CONSTANTS c_appl_comp_hier TYPE lvc_fname VALUE 'DSAA' ##NO_TEXT.
CONSTANTS:
c_user_id TYPE lvc_fname VALUE rs_c_tlogo-user,
c_role TYPE lvc_fname VALUE rs_c_tlogo-activity_group,
c_icon TYPE lvc_fname VALUE 'ICON',
c_abap_function TYPE lvc_fname VALUE 'FUNC',
c_abap_program TYPE lvc_fname VALUE 'PROG',
c_abap_class TYPE lvc_fname VALUE 'CLAS',
c_abap_interface TYPE lvc_fname VALUE 'INTF',
c_data_element TYPE lvc_fname VALUE rs_c_obj_dtel,
c_table TYPE lvc_fname VALUE rs_c_obj_tabl,
c_number_range TYPE lvc_fname VALUE rs_c_obj_nrob,
c_enhancement TYPE lvc_fname VALUE 'SMOD',
c_enhancement_proj TYPE lvc_fname VALUE 'CMOD',
c_datasource TYPE lvc_fname VALUE 'OSOA',
c_appl_comp_hier TYPE lvc_fname VALUE 'DSAA'.

ENDINTERFACE.

0 comments on commit 757fd94

Please sign in to comment.