Permalink
Browse files

Code inspector fixes (#1997)

* pretty print

* definitions to top of routine

* space before .

* omit parameter names where possible

* double space after if

* remove pseudo comments where possible
  • Loading branch information...
larshp committed Oct 12, 2018
1 parent ef2b90c commit fa39fcd43f3f08a3087dc19b33067b29fcbf9de6
@@ -160,7 +160,7 @@ ENDCLASS.
CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
CLASS ZCL_ABAPGIT_GIT_PORCELAIN IMPLEMENTATION.
METHOD build_trees.
@@ -389,7 +389,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
READ TABLE it_objects INTO ls_object
WITH KEY type COMPONENTS
type = zif_abapgit_definitions=>c_type-commit
sha1 = iv_branch .
sha1 = iv_branch.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'commit not found' ).
ENDIF.
@@ -28,7 +28,7 @@ ENDCLASS.
CLASS zcl_abapgit_ecatt_sp_upload IMPLEMENTATION.
CLASS ZCL_ABAPGIT_ECATT_SP_UPLOAD IMPLEMENTATION.
METHOD get_ecatt_sp.
@@ -107,14 +107,13 @@ CLASS zcl_abapgit_ecatt_sp_upload IMPLEMENTATION.
TO <lv_d_akh>. " doesn't exist in 702
ASSIGN COMPONENT 'I_AKH' OF STRUCTURE ch_object
TO <lv_i_akh>. " doesn't exist in 702
IF <lv_d_akh> IS ASSIGNED
AND <lv_i_akh> IS ASSIGNED.
IF <lv_d_akh> IS ASSIGNED AND <lv_i_akh> IS ASSIGNED.
<lv_i_akh> = <lv_d_akh>.
ENDIF.
super->upload(
CHANGING
ch_object = ch_object ).
ch_object = ch_object ).
upload_data_from_stream( ch_object-filename ).
@@ -36,7 +36,7 @@ ENDCLASS.
CLASS zcl_abapgit_ecatt_val_obj_upl IMPLEMENTATION.
CLASS ZCL_ABAPGIT_ECATT_VAL_OBJ_UPL IMPLEMENTATION.
METHOD get_business_msgs_from_dom.
@@ -232,14 +232,13 @@ CLASS zcl_abapgit_ecatt_val_obj_upl IMPLEMENTATION.
TO <lv_d_akh>. " doesn't exist in 702
ASSIGN COMPONENT 'I_AKH' OF STRUCTURE ch_object
TO <lv_i_akh>. " doesn't exist in 702
IF <lv_d_akh> IS ASSIGNED
AND <lv_i_akh> IS ASSIGNED.
IF <lv_d_akh> IS ASSIGNED AND <lv_i_akh> IS ASSIGNED.
<lv_i_akh> = <lv_d_akh>.
ENDIF.
super->upload(
CHANGING
ch_object = ch_object ).
ch_object = ch_object ).
upload_data_from_stream( ch_object-filename ).
CATCH cx_ecatt_apl INTO lx_ex.
@@ -879,7 +879,7 @@ CLASS ZCL_ABAPGIT_OBJECT_FUGR IMPLEMENTATION.
io_xml->read( EXPORTING iv_name = 'DYNPROS'
CHANGING cg_data = lt_dynpros ).
deserialize_dynpros( it_dynpros = lt_dynpros ).
deserialize_dynpros( lt_dynpros ).
io_xml->read( EXPORTING iv_name = 'CUA'
CHANGING cg_data = ls_cua ).
@@ -44,7 +44,64 @@ ENDCLASS.
CLASS zcl_abapgit_object_msag IMPLEMENTATION.
CLASS ZCL_ABAPGIT_OBJECT_MSAG IMPLEMENTATION.
METHOD delete_documentation.
DATA: lv_key_s TYPE dokhl-object.
CLEAR lv_key_s.
CALL FUNCTION 'DOCU_OBJECT_NAME_CONCATENATE'
EXPORTING
docu_id = 'NA'
element = iv_message_id
addition = ' '
IMPORTING
object = lv_key_s
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'DOKU_DELETE_ALL'
EXPORTING
doku_id = 'NA'
doku_object = lv_key_s
generic_use = 'X'
suppress_authority = space
suppress_enqueue = space
suppress_transport = space
EXCEPTIONS
header_without_text = 01
index_without_header = 02
no_authority_for_devclass_xxxx = 03
no_docu_found = 04
object_is_already_enqueued = 05
object_is_enqueued_by_corr = 06
user_break = 07.
ENDMETHOD.
METHOD delete_msgid.
delete_documentation( iv_message_id ).
DELETE FROM t100a WHERE arbgb = iv_message_id.
IF sy-subrc = 0 OR sy-subrc = 4.
CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT'
EXPORTING
object = iv_message_id
operation = 'DELETE'
program = space
type = 'CN'.
DELETE FROM t100o WHERE arbgb = iv_message_id.
DELETE FROM t100t WHERE arbgb = iv_message_id. "#EC CI_NOFIRST
DELETE FROM t100u WHERE arbgb = iv_message_id.
DELETE FROM t100x WHERE arbgb = iv_message_id.
DELETE FROM t100 WHERE arbgb = iv_message_id.
ENDIF.
ENDMETHOD.
METHOD deserialize_texts.
@@ -79,7 +136,7 @@ CLASS zcl_abapgit_object_msag IMPLEMENTATION.
MOVE-CORRESPONDING <ls_t100_text> TO ls_t100.
ls_t100-arbgb = lv_msg_id.
MODIFY t100 FROM ls_t100. "#EC CI_SUBRC
MODIFY t100 FROM ls_t100.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
@@ -88,6 +145,15 @@ CLASS zcl_abapgit_object_msag IMPLEMENTATION.
ENDMETHOD.
METHOD free_access_permission.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
mode = 'FREE'
object = i_message_id
object_class = 'T100'.
ENDMETHOD.
METHOD serialize_longtexts_msag.
DATA: lv_object TYPE dokhl-object,
@@ -285,7 +351,7 @@ CLASS zcl_abapgit_object_msag IMPLEMENTATION.
LOOP AT lt_t100 ASSIGNING <ls_t100>.
DELETE lt_before WHERE msgnr = <ls_t100>-msgnr.
MODIFY t100 FROM <ls_t100>. "#EC CI_SUBRC
MODIFY t100 FROM <ls_t100>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
@@ -294,7 +360,7 @@ CLASS zcl_abapgit_object_msag IMPLEMENTATION.
ls_t100u-name = sy-uname.
ls_t100u-datum = sy-datum.
ls_t100u-selfdef = '3'.
MODIFY t100u FROM ls_t100u. "#EC CI_SUBRC
MODIFY t100u FROM ls_t100u.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100U modify failed' ).
ENDIF.
@@ -305,15 +371,15 @@ CLASS zcl_abapgit_object_msag IMPLEMENTATION.
ls_t100a-respuser = sy-uname.
ls_t100a-ldate = sy-datum.
ls_t100a-ltime = sy-uzeit.
MODIFY t100a FROM ls_t100a. "#EC CI_SUBRC
MODIFY t100a FROM ls_t100a.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100A modify failed' ).
ENDIF.
ls_t100t-sprsl = mv_language.
ls_t100t-arbgb = ls_t100a-arbgb.
ls_t100t-stext = ls_t100a-stext.
MODIFY t100t FROM ls_t100t. "#EC CI_SUBRC
MODIFY t100t FROM ls_t100t.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100T modify failed' ).
ENDIF.
@@ -328,7 +394,7 @@ CLASS zcl_abapgit_object_msag IMPLEMENTATION.
deserialize_longtexts( io_xml ).
deserialize_texts( io_xml = io_xml ).
deserialize_texts( io_xml ).
ENDMETHOD.
@@ -417,70 +483,4 @@ CLASS zcl_abapgit_object_msag IMPLEMENTATION.
serialize_texts( io_xml ).
ENDMETHOD.
METHOD delete_msgid.
delete_documentation( iv_message_id ).
DELETE FROM t100a WHERE arbgb = iv_message_id.
IF sy-subrc = 0 OR sy-subrc = 4.
CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT'
EXPORTING
object = iv_message_id
operation = 'DELETE'
program = space
type = 'CN'.
DELETE FROM t100o WHERE arbgb = iv_message_id.
DELETE FROM t100t WHERE arbgb = iv_message_id. "#EC CI_NOFIRST
DELETE FROM t100u WHERE arbgb = iv_message_id.
DELETE FROM t100x WHERE arbgb = iv_message_id.
DELETE FROM t100 WHERE arbgb = iv_message_id.
ENDIF.
ENDMETHOD.
METHOD free_access_permission.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
mode = 'FREE'
object = i_message_id
object_class = 'T100'.
ENDMETHOD.
METHOD delete_documentation.
DATA: lv_key_s TYPE dokhl-object.
CLEAR lv_key_s.
CALL FUNCTION 'DOCU_OBJECT_NAME_CONCATENATE'
EXPORTING
docu_id = 'NA'
element = iv_message_id
addition = ' '
IMPORTING
object = lv_key_s
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'DOKU_DELETE_ALL'
EXPORTING
doku_id = 'NA'
doku_object = lv_key_s
generic_use = 'X'
suppress_authority = space
suppress_enqueue = space
suppress_transport = space
EXCEPTIONS
header_without_text = 01
index_without_header = 02
no_authority_for_devclass_xxxx = 03
no_docu_found = 04
object_is_already_enqueued = 05
object_is_enqueued_by_corr = 06
user_break = 07.
ENDMETHOD.
ENDCLASS.
@@ -243,16 +243,16 @@ CLASS ZCL_ABAPGIT_OBJECT_UDMO IMPLEMENTATION.
METHOD deserialize_long_texts.
TYPES BEGIN OF language_type.
TYPES language TYPE dm40t-sprache.
TYPES END OF language_type.
DATA BEGIN OF ls_udmo_long_text.
DATA language TYPE dm40t-sprache.
DATA header TYPE thead.
DATA content TYPE xstring.
DATA END OF ls_udmo_long_text.
TYPES BEGIN OF language_type.
TYPES language TYPE dm40t-sprache.
TYPES END OF language_type.
DATA lt_udmo_long_texts LIKE STANDARD TABLE OF ls_udmo_long_text.
DATA lt_udmo_languages TYPE STANDARD TABLE OF language_type.
DATA ls_header TYPE thead.
@@ -421,7 +421,7 @@ CLASS ZCL_ABAPGIT_OBJECT_UDMO IMPLEMENTATION.
AND as4local EQ me->mv_activation_state.
LOOP AT lt_udmo_entities ASSIGNING <udmo_entity> .
LOOP AT lt_udmo_entities ASSIGNING <udmo_entity>.
" You are reminded that administrative information, such as last changed by user, date, time is not serialised.
CLEAR <udmo_entity>-lstuser.
@@ -440,8 +440,6 @@ CLASS ZCL_ABAPGIT_OBJECT_UDMO IMPLEMENTATION.
ig_data = lt_udmo_entities ).
ENDIF.
ENDMETHOD.
@@ -452,30 +450,29 @@ CLASS ZCL_ABAPGIT_OBJECT_UDMO IMPLEMENTATION.
" The model has a long description also in a master language, with other long descriptions
" maintained as translations using SE63 Translation Editor. All of these long texts are held in DOK*
TYPES BEGIN OF ls_language_type.
TYPES language TYPE dm40t-sprache.
TYPES END OF ls_language_type.
DATA BEGIN OF ls_udmo_long_text.
DATA language TYPE dm40t-sprache.
DATA header TYPE thead.
DATA content TYPE xstring.
DATA END OF ls_udmo_long_text.
TYPES BEGIN OF ls_language_type.
TYPES language TYPE dm40t-sprache.
TYPES END OF ls_language_type.
DATA lt_udmo_long_texts LIKE STANDARD TABLE OF ls_udmo_long_text.
DATA lt_udmo_languages TYPE STANDARD TABLE OF ls_language_type.
DATA ls_udmo_language LIKE LINE OF lt_udmo_languages.
DATA: lv_error_status TYPE lxestatprc .
DATA: lv_error_status TYPE lxestatprc.
" In which languages are the short texts are maintained.
SELECT sprache AS language
FROM dm40t
INTO TABLE lt_udmo_languages
WHERE dmoid EQ me->mv_data_model
AND as4local EQ me->mv_activation_state
ORDER BY sprache ASCENDING. "#EC CI_NOFIRST
FROM dm40t
INTO TABLE lt_udmo_languages
WHERE dmoid EQ me->mv_data_model
AND as4local EQ me->mv_activation_state
ORDER BY sprache ASCENDING. "#EC CI_NOFIRST
" For every language for which a short text is maintained,
LOOP AT lt_udmo_languages INTO ls_udmo_language.
Oops, something went wrong.

0 comments on commit fa39fcd

Please sign in to comment.