How to organize customer-specific customizing and maintenance objects


  • TVARVC
  • Seat leaf
  • How to display documentation?

There are a few options to struct and simplify the maintenance of customer-project-function-specific customizing. This own customizing can then be called from your custom programs, user-exits, and enhancement points. Managing these custom tables becomes increasingly difficult over time.  

Therefore, it should be a decision at the beginning of the project on how to struct and organize these data. 

Here is the list of possibilities we can apply in our developments: 
  1. Own customizing in SPRO - Document customizing 
    • Use T-code S_IMG_EXTENSION - IMG maintenance(note: when using the S_IMG_EXTENSION option SAP puts your entries aside and we can re-merge them after the upgrade)
    • Enhance structure> Create Enhancement ID, Enhance the structure
      • Add a note
      • Add an activity
        • Customizing activity ID
        • Assign the object using one of the allowed types: View cluster, Logical transport object, Table (with text table), Individual transaction object, View.
    • Add documentation.
  2. Maintain Area Menu ( master data ) - Group master data and transactions 
    • Use SE43: It allows us to group together menus that contain a set of functions intended to perform a particular task in a company.
  3. Create a process-guided transaction to manage interlinked customizing
    • A new program to maintain several customizing entries where the objects are interlinked. This should guarantee the consistency and traceability of the whole customizing setup.
    • Fiori app with process guide flow 
  4. Create a separate table to link and store activations and constants caused by change requests ( aggregation )
  5. Create a wiki with the link to custom objects and available documentation from the document management systems.
  6. BRF+ capabilities to store function-dependent variables ( customizing in the context )
  7. Constants can be kept in the declared interfaces (SE24), technical settings 
  8. Template, functional and technical documentation ( Word, and Presentation )
  9. Use of TVARVC or SETLEAF
  10. External service ( Business rule management )
If you know of any other useful tool, please, share it with a comment.


Instructions 

TVARVC or SETLEAF (04.06.2021)

TVARVC 
is standard table given by SAP to store the data under variants. we can put the values in TVARVC table to avoid hardcoding and/or creation of custom tables.

Transaction code: STVARV

There are two sections under STVARV to store parameters and Selection options.


SELECT SINGLE *
INTO ls_tvarvc
FROM tvarvc
WHERE name = 'Z_XYZ_Tolerance_Price'.


Please note: Creation and modification via STVARV don’t ask for Transport request unless we have not marked the checkbox “Include Changed entries in transport request”.


SETLEAF


SETLEAF is also a standard table in SAP like TVARVC where we can store the data in sets. Set is structure to store the values and values interval as well.

Advantage of sets over TVARVC is that It takes on the domain of the value we are storing, so it can be validated at input time to avoid any wrong entries. we can see the available entries over there.

Transaction code to create the Set: GS01
Transaction code to change the Set: GS02
Transaction code to display the Set: GS03

wa_setleaf type setleaf
SELECT SINGLE * FROM setleaf
into wa_setleaf
WHERE setclass = ‘0000’
AND subclass = space
AND setname = ‘Z_SALES_ORG’
AND valfrom = .vbak-vkorg.


How to display documentation?

Add events into the view

  • 13 HIDE_DOCUMENTATION_TAB
  • 19 SHOW_DOCUMENTATION_TAB

FORM show_documentation_tab. 

DATA: lv_tabclass TYPE tabclass,
lv_id TYPE doku_id.

IF sy-tcode EQ 'SPRO' OR sy-tcode EQ 'SM34'.
RETURN.
ENDIF.

SELECT SINGLE INTO LV_TABCLASS FROM DD02L
WHERE TABNAME = VIM_VIEW_NAME.

IF lv_tabclass = 'VIEW'.
lv_id = 'VW'.
ELSE.
lv_id = 'TB'.
ENDIF.

CALL METHOD zreuse_show_table_docu=>container_docu_show
EXPORTING
iv_table = vim_view_name
iv_id = lv_id.
ENDFORM.


FORM hide_documentation_tab.
CALL METHOD zreuse_show_table_docu=>container_docu_hide.
ENDFORM.


Z-servant class
  • GR_HTML Static Attribute Private Type Ref To CL_GUI_HTML_VIEWER
  • GR_DOCK Static Attribute Private Type Ref To CL_GUI_DOCKING_CONTAINER 
 Method CONTAINER_DOCU_HIDE
IF gr_html IS BOUND.
CALL METHOD gr_html->set_visible
EXPORTING
visible = space.
ENDIF.

IF gr_dock IS BOUND.
CALL METHOD gr_dock->set_visible
EXPORTING
visible = space.
ENDIF.


METHOD container_docu_show.

DATA lt_lines TYPE STANDARD TABLE OF tline.
DATA ls_header TYPE thead.
DATA lt_html TYPE STANDARD TABLE OF htmlline.
DATA lv_url TYPE c LENGTH 500.
DATA lv_spras TYPE sylangu.
DATA lt_conv_charformats TYPE TABLE OF tline.
DATA lt_conv_parformats TYPE TABLE OF tline.
STATICS sv_table TYPE doku_obj.


sv_table = iv_table.

CALL FUNCTION 'DOCU_GET'
EXPORTING
id = iv_id
langu = sy-langu
object = sv_table
IMPORTING
head = ls_header
TABLES
line = lt_lines
EXCEPTIONS
OTHERS = 5.
IF sy-subrc > 0.

CASE sy-langu.
WHEN 'D'.
lv_spras = 'E'.
WHEN 'E'.
lv_spras = 'D'.
WHEN 'F'.
lv_spras = 'E'.
ENDCASE.

CALL FUNCTION 'DOCU_GET'
EXPORTING
id = iv_id
langu = lv_spras
object = sv_table
IMPORTING
head = ls_header
TABLES
line = lt_lines
EXCEPTIONS
OTHERS = 5.
ENDIF.


IF lt_lines IS INITIAL AND iv_aldoc IS NOT INITIAL.

sv_table = iv_aldoc.
CALL FUNCTION 'DOCU_GET'
EXPORTING
id = 'DT'
langu = sy-langu
object = sv_table
IMPORTING
head = ls_header
TABLES
line = lt_lines
EXCEPTIONS
OTHERS = 5.
IF sy-subrc > 0.

CALL FUNCTION 'DOCU_GET'
EXPORTING
id = 'DT'
langu = lv_spras
object = sv_table
IMPORTING
head = ls_header
TABLES
line = lt_lines
EXCEPTIONS
OTHERS = 5.

ENDIF.
ENDIF.

IF gr_dock IS INITIAL.
CREATE OBJECT gr_dock
EXPORTING
side = cl_gui_docking_container=>dock_at_right
extension = 500
no_autodef_progid_dynnr = 'X'.
ENDIF.


IF lt_lines IS INITIAL.

IF gr_html IS BOUND.
CALL METHOD gr_html->set_visible
EXPORTING
visible = space.
ENDIF.

IF gr_dock IS BOUND.
CALL METHOD gr_dock->set_visible
EXPORTING
visible = space.
ENDIF.
ELSE.

IF gr_html IS BOUND.
CALL METHOD gr_html->set_visible
EXPORTING
visible = 'X'.
ENDIF.
IF gr_dock IS BOUND.
CALL METHOD gr_dock->set_visible
EXPORTING
visible = 'X'.
ENDIF.
ENDIF.


IF lt_lines IS NOT INITIAL.

IF gr_html IS INITIAL.

CREATE OBJECT gr_html
EXPORTING
parent = gr_dock.
ENDIF.

IF lt_conv_parformats IS INITIAL.
PERFORM build_mapping_tables IN PROGRAM rshtmimg_2
TABLES lt_conv_charformats
lt_conv_parformats.
ENDIF.

CALL FUNCTION 'CONVERT_ITF_TO_HTML'
EXPORTING
i_header = ls_header
TABLES
t_itf_text = lt_lines
t_html_text = lt_html
t_conv_charformats = lt_conv_charformats
t_conv_parformats = lt_conv_parformats
EXCEPTIONS
syntax_check = 1
replace = 2
illegal_header = 3
OTHERS = 4.
IF sy-subrc = 0.


PERFORM convert_tables IN PROGRAM rshtmimg_2 TABLES lt_html.

PERFORM set_colors IN PROGRAM rshtmimg_2 TABLES lt_html.

CALL METHOD gr_html->load_data
IMPORTING
assigned_url = lv_url
CHANGING
data_table = lt_html
EXCEPTIONS
OTHERS = 4.

IF sy-subrc = 0.

CALL METHOD gr_html->show_url
EXPORTING
url = lv_url.
ENDIF.
ENDIF.
ENDIF.

Comments