Skip to content

Commit

Permalink
A first minimal working scenario
Browse files Browse the repository at this point in the history
currently generates no interface, and just a single method.
  • Loading branch information
Peter Jaeckel committed Apr 28, 2018
1 parent 5baba58 commit 173ece6
Show file tree
Hide file tree
Showing 18 changed files with 868 additions and 141 deletions.
213 changes: 101 additions & 112 deletions zcl_flseoq_wrap.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CLASS zcl_flseoq_wrap DEFINITION
CREATE PUBLIC .

PUBLIC SECTION.
INTERFACES zif_flseoq.
CLASS-METHODS test
RETURNING
VALUE(r_rc) TYPE i.
Expand All @@ -16,18 +17,6 @@ CLASS zcl_flseoq_wrap DEFINITION
db_error
no_access
.
METHODS seo_class_create_complete
IMPORTING
devclass TYPE devclass
CHANGING
class TYPE vseoclass
EXCEPTIONS
existing
is_interface
db_error
component_error
no_access
other.
METHODS seo_class_existence_check
IMPORTING
clskey TYPE seoclskey
Expand All @@ -54,76 +43,7 @@ ENDCLASS.



CLASS zcl_flseoq_wrap IMPLEMENTATION.


METHOD seo_class_create_complete.
CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE'
EXPORTING
* corrnr = " Correction Number
devclass = devclass " Package
version = seoc_version_active " Active/Inactive
* genflag = SPACE " Generation Flag
* authority_check =
* overwrite =
* suppress_method_generation =
* suppress_refactoring_support =
* method_sources = " Table of Methodsources
* locals_def = " Sourcetext klassenlokaler Klassen (Definitionsteil)
* locals_imp = " Sourcetext klassenlokaler Klassen (Implementierungsteil)
* locals_mac = " ABAP-Source
* suppress_index_update =
* typesrc = " Updated type Source parameter to support more than 9999 char
* suppress_corr =
* suppress_dialog =
* lifecycle_manager = " Lifecycle manager
* locals_au = " Sourcecode for local testclasses
* lock_handle = " Lock Handle
* suppress_unlock =
* suppress_commit = " No DB_COMMIT will be executed
* generate_method_impls_wo_frame = " X -> METHOD_SOURCES have to contain METHOD and ENDMETHOD sta
* IMPORTING
* korrnr = " Request/Task
* TABLES
* class_descriptions = " Short description class/interface
* component_descriptions = " Short description class/interface component
* subcomponent_descriptions = " Class/interface subcomponent short description
CHANGING
class = class
* inheritance =
* redefinitions =
* implementings =
* impl_details =
* attributes =
* methods =
* events =
* types =
* type_source = " This parameter is deprecated. Please use typesrc.
* parameters =
* exceps =
* aliases =
* typepusages = " Type group application
* clsdeferrds =
* intdeferrds =
* friendships =
EXCEPTIONS
existing = 1
is_interface = 2
db_error = 3
component_error = 4
no_access = 5
other = 6
OTHERS = 7.
CASE sy-subrc.
WHEN 0. " do nothing
WHEN 1. RAISE existing.
WHEN 2. RAISE is_interface.
WHEN 3. RAISE db_error.
WHEN 4. RAISE component_error.
WHEN 5. RAISE no_access.
WHEN OTHERS. RAISE other.
ENDCASE.
ENDMETHOD.
CLASS ZCL_FLSEOQ_WRAP IMPLEMENTATION.


METHOD seo_class_delete_complete.
Expand Down Expand Up @@ -194,36 +114,36 @@ CLASS zcl_flseoq_wrap IMPLEMENTATION.
).


DATA(l_app) = NEW zcl_flseoq_wrap( ).
CALL METHOD l_app->seo_class_existence_check
EXPORTING
clskey = VALUE seoclskey( clsname = l_class-clsname )
IMPORTING
not_active = DATA(not_active)
EXCEPTIONS
not_specified = 1
not_existing = 2
is_interface = 3
no_text = 4
inconsistent = 5
other = 6
OTHERS = 7.
IF sy-subrc IS INITIAL.
l_app->seo_class_delete_complete(
EXPORTING
clskey = VALUE seoclskey( clsname = l_class-clsname )
EXCEPTIONS
not_existing = 1
is_interface = 2
db_error = 3
no_access = 4
OTHERS = 5
).
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
DATA(l_app) = CAST zif_flseoq( NEW zcl_flseoq_wrap( ) ).
* CALL METHOD l_app->seo_class_existence_check
* EXPORTING
* clskey = VALUE seoclskey( clsname = l_class-clsname )
* IMPORTING
* not_active = DATA(not_active)
* EXCEPTIONS
* not_specified = 1
* not_existing = 2
* is_interface = 3
* no_text = 4
* inconsistent = 5
* other = 6
* OTHERS = 7.
* IF sy-subrc IS INITIAL.
* l_app->seo_class_delete_complete(
* EXPORTING
* clskey = VALUE seoclskey( clsname = l_class-clsname )
* EXCEPTIONS
* not_existing = 1
* is_interface = 2
* db_error = 3
* no_access = 4
* OTHERS = 5
* ).
* IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
* ENDIF.
* ENDIF.

CALL METHOD l_app->seo_class_create_complete
EXPORTING
Expand All @@ -243,4 +163,73 @@ CLASS zcl_flseoq_wrap IMPLEMENTATION.
WITH sy-msgv1 sy-msgv2 sy-msgv4 sy-msgv4.

ENDMETHOD.


METHOD zif_flseoq~seo_class_create_complete.
CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE'
EXPORTING
* corrnr = " Correction Number
devclass = devclass " Package
version = seoc_version_active " Active/Inactive
* genflag = SPACE " Generation Flag
* authority_check =
overwrite = abap_true
suppress_method_generation = abap_false
* suppress_refactoring_support =
method_sources = method_sources " Table of Methodsources
* locals_def = " Sourcetext klassenlokaler Klassen (Definitionsteil)
* locals_imp = " Sourcetext klassenlokaler Klassen (Implementierungsteil)
* locals_mac = " ABAP-Source
* suppress_index_update =
* typesrc = " Updated type Source parameter to support more than 9999 char
* suppress_corr =
* suppress_dialog =
* lifecycle_manager = " Lifecycle manager
* locals_au = " Sourcecode for local testclasses
* lock_handle = " Lock Handle
* suppress_unlock =
* suppress_commit = " No DB_COMMIT will be executed
* generate_method_impls_wo_frame = " X -> METHOD_SOURCES have to contain METHOD and ENDMETHOD sta
* IMPORTING
* korrnr = " Request/Task
* TABLES
* class_descriptions = " Short description class/interface
* component_descriptions = " Short description class/interface component
* subcomponent_descriptions = " Class/interface subcomponent short description
CHANGING
class = class
* inheritance =
* redefinitions =
implementings = implementings
* impl_details =
* attributes =
methods = methods
* events =
types = types
* type_source = " This parameter is deprecated. Please use typesrc.
parameters = parameters
* exceps =
* aliases =
* typepusages = " Type group application
* clsdeferrds =
* intdeferrds =
* friendships =
EXCEPTIONS
existing = 1
is_interface = 2
db_error = 3
component_error = 4
no_access = 5
other = 6
OTHERS = 7.
CASE sy-subrc.
WHEN 0. " do nothing
WHEN 1. RAISE existing.
WHEN 2. RAISE is_interface.
WHEN 3. RAISE db_error.
WHEN 4. RAISE component_error.
WHEN 5. RAISE no_access.
WHEN OTHERS. RAISE other.
ENDCASE.
ENDMETHOD.
ENDCLASS.
1 change: 1 addition & 0 deletions zcl_flsuni_flwrap.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ENDCLASS.


CLASS zcl_flsuni_flwrap IMPLEMENTATION.

METHOD zif_flsuni~function_import_doku.
CALL FUNCTION 'FUNCTION_IMPORT_DOKU'
EXPORTING
Expand Down
74 changes: 74 additions & 0 deletions zcl_fmwp_builder.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
CLASS zcl_fmwp_builder DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .

PUBLIC SECTION.
INTERFACES zif_fmwp_builder.
METHODS constructor
IMPORTING
ir_gen TYPE REF TO zif_fmwp_gen
ir_seoq TYPE REF TO zif_flseoq.
PROTECTED SECTION.
PRIVATE SECTION.
DATA mr_gen TYPE REF TO zif_fmwp_gen.
DATA mr_seoq TYPE REF TO zif_flseoq.
ENDCLASS.



CLASS ZCL_FMWP_BUILDER IMPLEMENTATION.


METHOD constructor.

mr_gen = ir_gen.
mr_seoq = ir_seoq.

ENDMETHOD.


METHOD zif_fmwp_builder~generate.

DATA(l_cls) = NEW zcl_fmwp_clsinfo( ).
l_cls->class_set_def( i_name = |zcl_fl{ i_area }_gwrap| ).
CALL METHOD mr_gen->class_generate
EXPORTING
i_name = i_funcname
CHANGING
c_class = l_cls.

DATA(l_class) = l_cls->class_get_def( ).
DATA(lt_methods) = l_cls->method_get_all_methods( ).
DATA(lt_method_imps) = l_cls->method_get_all_impls( ).
DATA(lt_sources) = l_cls->method_get_all_sources( ).
DATA(lt_params) = l_cls->method_get_all_params( ).
DATA(lt_types) = l_cls->type_get_all( ).

CALL METHOD mr_seoq->seo_class_create_complete
EXPORTING
devclass = '$TMP'
method_sources = lt_sources
CHANGING
class = l_class
methods = lt_methods
implementings = lt_method_imps
parameters = lt_params
types = lt_types
EXCEPTIONS
existing = 1
is_interface = 2
db_error = 3
component_error = 4
no_access = 5
other = 6
OTHERS = 7.

IF sy-subrc IS NOT INITIAL.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv4 sy-msgv4.
ENDIF.


ENDMETHOD.
ENDCLASS.
19 changes: 19 additions & 0 deletions zcl_fmwp_builder.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_FMWP_BUILDER</CLSNAME>
<VERSION>1</VERSION>
<LANGU>E</LANGU>
<DESCRIPT>finally creating the class</DESCRIPT>
<EXPOSURE>2</EXPOSURE>
<STATE>1</STATE>
<CLSFINAL>X</CLSFINAL>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>
Loading

0 comments on commit 173ece6

Please sign in to comment.