larshp / local-to-global Goto Github PK
View Code? Open in Web Editor NEWTool for converting local ABAP classes to global
License: MIT License
Tool for converting local ABAP classes to global
License: MIT License
todo
move to CLASS line
REPORT zwbcrossgt.
START-OF-SELECTION.
PERFORM run.
FORM run.
DATA: lt_cross TYPE wbcrossgtt.
SELECT * FROM wbcrossgt INTO TABLE lt_cross
WHERE include LIKE 'ZCL_ABAPGIT_%'
AND name LIKE 'Z%'.
SELECT * FROM tadir INTO TABLE @DATA(lt_tadir)
WHERE devclass = '$AGLOBAL'.
LOOP AT lt_tadir INTO DATA(ls_tadir) WHERE object = 'CLAS'.
DATA(lt_includes) = cl_oo_classname_service=>get_all_class_includes(
CONV #( ls_tadir-obj_name ) ).
LOOP AT lt_includes INTO DATA(lv_include).
LOOP AT lt_cross ASSIGNING FIELD-SYMBOL(<ls_cross>) WHERE include = lv_include.
<ls_cross>-include = ls_tadir-obj_name.
ENDLOOP.
ENDLOOP.
ENDLOOP.
LOOP AT lt_cross ASSIGNING <ls_cross>.
DATA(lv_index) = sy-tabix.
IF <ls_cross>-name CA '\'.
SPLIT <ls_cross>-name AT '\' INTO <ls_cross>-name DATA(lv_foo).
ENDIF.
IF <ls_cross>-name = <ls_cross>-include.
DELETE lt_cross INDEX lv_index.
ENDIF.
ENDLOOP.
SORT lt_cross BY name ASCENDING include ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_cross COMPARING name include.
WRITE: / lines( lt_cross ).
PERFORM result USING lt_cross.
ENDFORM.
FORM result USING pt_cross TYPE wbcrossgtt.
DATA: lt_result TYPE STANDARD TABLE OF text200 WITH DEFAULT KEY,
lv_rc LIKE sy-subrc.
LOOP AT pt_cross INTO DATA(ls_cross).
APPEND |{ ls_cross-include } -> { ls_cross-name }| TO lt_result.
ENDLOOP.
cl_gui_frontend_services=>clipboard_export(
IMPORTING
data = lt_result
CHANGING
rc = lv_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
no_authority = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
WRITE: / 'error', sy-subrc.
ENDIF.
WRITE: / lv_rc.
ENDFORM.
todo
1: extract classes definition + implementation
2: rename class
3: add "PUBLIC"
4: rename usages, heuristic?
5: comments?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.