Skip to content

Commit

Permalink
Merge pull request #81 from Bechtle-AG/master
Browse files Browse the repository at this point in the history
feat: updated searchhelps
  • Loading branch information
miggi92 authored Apr 24, 2024
2 parents 2f7fcef + f3fe7c8 commit 3463ddd
Show file tree
Hide file tree
Showing 17 changed files with 1,071 additions and 488 deletions.
2 changes: 1 addition & 1 deletion .abapgit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<item>/overrides</item>
<item>/.github</item>
<item>/.vscode</item>
<item>/requirements.txt</item>
<item>/requirements.txt</item>
</IGNORE>
<VERSION_CONSTANT>zif_odata_constants=&gt;gc_version</VERSION_CONSTANT>
</DATA>
Expand Down
5 changes: 5 additions & 0 deletions src/z_odata.msag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@
<MSGNR>008</MSGNR>
<TEXT>Action &amp; isn&apos;t implemented yet.</TEXT>
</item>
<item>
<SPRSL>E</SPRSL>
<MSGNR>009</MSGNR>
<TEXT>Column &amp; not found in table &amp;. (Search help generation)</TEXT>
</item>
</T100_TEXTS>
</asx:values>
</asx:abap>
Expand Down
51 changes: 51 additions & 0 deletions src/z_odata_annotations/zcl_odata_annotaion_sap.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"! <p class="shorttext synchronized">SAP Annotation namespace</p>
CLASS zcl_odata_annotaion_sap DEFINITION
PUBLIC
CREATE PRIVATE.

PUBLIC SECTION.
"! <p class="shorttext synchronized">Get annotation object</p>
"!
"! @parameter ro_annotation | <p class="shorttext synchronized">Annotation object</p>
METHODS get_annotation_object
RETURNING VALUE(ro_annotation) TYPE REF TO /iwbep/if_mgw_odata_annotation.

"! <p class="shorttext synchronized">Add date only annotation</p>
"! With this annotation the date property will only show a date and not also a time (EDM has no date only type)
"!
METHODS add_date_only_annotation.

"! <p class="shorttext synchronized">Create from property</p>
"!
"! @parameter io_property | <p class="shorttext synchronized">Property</p>
"! @parameter ro_sap_annotation | <p class="shorttext synchronized">SAP annotation instance</p>
"!
"! @raising /iwbep/cx_mgw_med_exception | <p class="shorttext synchronized">Annotation couldn't be initialized</p>
CLASS-METHODS create_from_property
IMPORTING io_property TYPE REF TO /iwbep/if_mgw_odata_property
RETURNING VALUE(ro_sap_annotation) TYPE REF TO zcl_odata_annotaion_sap
RAISING /iwbep/cx_mgw_med_exception.

PROTECTED SECTION.

PRIVATE SECTION.
DATA mo_annotation TYPE REF TO /iwbep/if_mgw_odata_annotation.

ENDCLASS.


CLASS zcl_odata_annotaion_sap IMPLEMENTATION.
METHOD get_annotation_object.
ro_annotation = mo_annotation.
ENDMETHOD.

METHOD add_date_only_annotation.
mo_annotation->add( iv_key = 'display-format'
iv_value = 'Date' ).
ENDMETHOD.

METHOD create_from_property.
ro_sap_annotation = NEW #( ).
ro_sap_annotation->mo_annotation = io_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' ).
ENDMETHOD.
ENDCLASS.
59 changes: 59 additions & 0 deletions src/z_odata_annotations/zcl_odata_annotaion_sap.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?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_ODATA_ANNOTAION_SAP</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>SAP Annotation namespace</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
<DESCRIPTIONS>
<SEOCOMPOTX>
<CMPNAME>ADD_DATE_ONLY_ANNOTATION</CMPNAME>
<LANGU>E</LANGU>
<DESCRIPT>Add date only annotation</DESCRIPT>
</SEOCOMPOTX>
<SEOCOMPOTX>
<CMPNAME>CREATE_FROM_PROPERTY</CMPNAME>
<LANGU>E</LANGU>
<DESCRIPT>Create from property</DESCRIPT>
</SEOCOMPOTX>
<SEOCOMPOTX>
<CMPNAME>GET_ANNOTATION_OBJECT</CMPNAME>
<LANGU>E</LANGU>
<DESCRIPT>Get annotation object</DESCRIPT>
</SEOCOMPOTX>
</DESCRIPTIONS>
<DESCRIPTIONS_SUB>
<SEOSUBCOTX>
<CMPNAME>CREATE_FROM_PROPERTY</CMPNAME>
<SCONAME>/IWBEP/CX_MGW_MED_EXCEPTION</SCONAME>
<LANGU>E</LANGU>
<DESCRIPT>Annotation couldn&apos;t be initialized</DESCRIPT>
</SEOSUBCOTX>
<SEOSUBCOTX>
<CMPNAME>CREATE_FROM_PROPERTY</CMPNAME>
<SCONAME>IO_PROPERTY</SCONAME>
<LANGU>E</LANGU>
<DESCRIPT>Property</DESCRIPT>
</SEOSUBCOTX>
<SEOSUBCOTX>
<CMPNAME>CREATE_FROM_PROPERTY</CMPNAME>
<SCONAME>RO_SAP_ANNOTATION</SCONAME>
<LANGU>E</LANGU>
<DESCRIPT>SAP annotation instance</DESCRIPT>
</SEOSUBCOTX>
<SEOSUBCOTX>
<CMPNAME>GET_ANNOTATION_OBJECT</CMPNAME>
<SCONAME>RO_ANNOTATION</SCONAME>
<LANGU>E</LANGU>
<DESCRIPT>Annotation object</DESCRIPT>
</SEOSUBCOTX>
</DESCRIPTIONS_SUB>
</asx:values>
</asx:abap>
</abapGit>
2 changes: 1 addition & 1 deletion src/z_odata_annotations/zcl_odata_annotation_shlp.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_ODATA_ANNOTATION_SHLP</CLSNAME>
<LANGU>E</LANGU>
<LANGU>D</LANGU>
<DESCRIPT>Searchhelp annotation</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
Expand Down
2 changes: 1 addition & 1 deletion src/z_odata_bo/zcl_odata_bo_user.clas.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_ODATA_BO_USER</CLSNAME>
<LANGU>E</LANGU>
<LANGU>D</LANGU>
<DESCRIPT>OData User</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
Expand Down
Loading

0 comments on commit 3463ddd

Please sign in to comment.