Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ABAP_STANDARD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: ABAP_STANDARD

on:
push:
branches: [standard]


permissions:
contents: read

Expand Down
144 changes: 88 additions & 56 deletions src/z2ui5_cl_demo_app_067.clas.abap
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
CLASS z2ui5_cl_demo_app_067 DEFINITION PUBLIC.

PUBLIC SECTION.

INTERFACES z2ui5_if_app.

DATA amount TYPE p LENGTH 14 DECIMALS 3.
DATA currency TYPE string.
DATA amount TYPE p LENGTH 14 DECIMALS 3.
DATA currency TYPE string.
DATA numeric TYPE Z2UI5_NUMC12.

DATA check_initialized TYPE abap_bool.

PROTECTED SECTION.

PRIVATE SECTION.
ENDCLASS.



CLASS Z2UI5_CL_DEMO_APP_067 IMPLEMENTATION.

CLASS z2ui5_cl_demo_app_067 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

IF check_initialized = abap_false.
check_initialized = abap_true.

numeric = '000000000012'.
amount = '123456789.123'.
currency = `USD`.

Expand All @@ -33,56 +33,88 @@ CLASS Z2UI5_CL_DEMO_APP_067 IMPLEMENTATION.
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
ENDCASE.

client->view_display( z2ui5_cl_xml_view=>factory( )->shell(
)->page(
title = 'abap2UI5 - Currency Format'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->simple_form( title = 'Currency'
editable = abap_true
)->content( 'form'
)->title( 'Input'
)->label( 'Documentation'
)->link( text = 'https://sapui5.hana.ondemand.com/#/entity/sap.ui.model.type.Currency'
href = 'https://sapui5.hana.ondemand.com/#/entity/sap.ui.model.type.Currency'
)->label( 'One field'
)->input( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) && `'], type: 'sap.ui.model.type.Currency' }`
)->label( 'Two field'
)->input( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) && `'], type: 'sap.ui.model.type.Currency' , formatOptions: {showMeasure: false} }`
)->input( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) && `'], type: 'sap.ui.model.type.Currency' , formatOptions: {showNumber: false} }`
)->label( 'Default'
)->text( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) && `'], type: 'sap.ui.model.type.Currency' }`
)->label( 'preserveDecimals:false'
)->text( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) &&
`'], type: 'sap.ui.model.type.Currency' , formatOptions: { preserveDecimals : false } }`
)->label( 'currencyCode:false'
)->text( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) &&
`'], type: 'sap.ui.model.type.Currency' , formatOptions: { currencyCode : false } }`
)->label( `style:'short'`
)->text( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) && `'], type: 'sap.ui.model.type.Currency' , formatOptions: { style : 'short' } }`
)->label( `style:'long'`
)->text( `{ parts: [ '` && client->_bind_edit( val = amount
path = abap_true ) && `', '` && client->_bind_edit( val = currency
path = abap_true ) && `'], type: 'sap.ui.model.type.Currency' , formatOptions: { style : 'long' } }`
)->label( 'event'
)->button( text = 'send'
press = client->_event( 'BUTTON' )
)->stringify( ) ).

DATA(page) = z2ui5_cl_xml_view=>factory( )->shell(
)->page( title = 'abap2UI5 - Currency Format'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL ) ).

page->simple_form( title = 'Currency'
editable = abap_true
)->content( 'form'
)->title( 'Input'
)->label( 'Documentation'
)->link( text = 'https://sapui5.hana.ondemand.com/#/entity/sap.ui.model.type.Currency'
href = 'https://sapui5.hana.ondemand.com/#/entity/sap.ui.model.type.Currency'
)->label( 'One field'
)->input(
|\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '{ client->_bind_edit(
val = currency
path = abap_true ) }'], type: 'sap.ui.model.type.Currency' \}|
)->label( 'Two field'
)->input(
|\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '{ client->_bind_edit(
val = currency
path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{showMeasure: false\} \}|
)->input(
|\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '{ client->_bind_edit(
val = currency
path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{showNumber: false\} \}|
)->label( 'Default'
)->text(
|\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '{ client->_bind_edit(
val = currency
path = abap_true ) }'], type: 'sap.ui.model.type.Currency' \}|
)->label( 'preserveDecimals:false'
)->text( |\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '| && client->_bind_edit(
val = currency
path = abap_true ) &&
|'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ preserveDecimals : false \} \}|
)->label( 'currencyCode:false'
)->text( |\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '| && client->_bind_edit(
val = currency
path = abap_true ) &&
|'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ currencyCode : false \} \}|
)->label( `style:'short'`
)->text(
|\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '{ client->_bind_edit(
val = currency
path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ style : 'short' \} \}|
)->label( `style:'long'`
)->text(
|\{ parts: [ '{ client->_bind_edit( val = amount
path = abap_true ) }', '{ client->_bind_edit(
val = currency
path = abap_true ) }'], type: 'sap.ui.model.type.Currency' , formatOptions: \{ style : 'long' \} \}|
)->label( 'event'
)->button( text = 'send'
press = client->_event( 'BUTTON' ) ).

page->simple_form( title = 'No Zeros'
editable = abap_true
)->content( 'form'
)->title( 'Input'
)->label( 'Documentation'
)->link( text = 'https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.model.odata.type.String%23methods/formatValue'
href = 'https://sapui5.hana.ondemand.com/sdk/#/api/sap.ui.model.odata.type.String%23methods/formatValue'
)->label( 'Numeric'
)->input( value = client->_bind_edit( val = numeric )

)->label( `Without leading Zeros`

)->text(
text = |\{path : '{ client->_bind_edit(
val = numeric
path = abap_true ) }', type : 'sap.ui.model.odata.type.String', constraints : \{ isDigitSequence : true \} \}| ).

client->view_display( page->stringify( ) ).

ENDMETHOD.

ENDCLASS.
95 changes: 95 additions & 0 deletions src/z2ui5_cl_demo_app_326.clas.abap
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
CLASS z2ui5_cl_demo_app_326 DEFINITION PUBLIC CREATE PUBLIC.

PUBLIC SECTION.
INTERFACES z2ui5_if_app.

DATA unit TYPE meins.
DATA numc TYPE z2ui5_numc12.
DATA check_initialized TYPE abap_bool.

PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.

METHODS z2ui5_set_data.

METHODS display_view
IMPORTING
!client TYPE REF TO z2ui5_if_client.

METHODS on_event
IMPORTING
!client TYPE REF TO z2ui5_if_client.

PRIVATE SECTION.
ENDCLASS.


CLASS z2ui5_cl_demo_app_326 IMPLEMENTATION.

METHOD z2ui5_if_app~main.

me->client = client.

IF check_initialized = abap_false.
check_initialized = abap_true.
display_view( client ).
z2ui5_set_data( ).
ENDIF.

on_event( client ).

ENDMETHOD.

METHOD display_view.

DATA(view) = z2ui5_cl_xml_view=>factory( ).

client->view_display( val = view->shell(
)->page( title = 'abap2UI5 - Conversion Exit'
navbuttonpress = client->_event( 'BACK' )
shownavbutton = xsdbool( client->get( )-s_draft-id_prev_app_stack IS NOT INITIAL )
)->simple_form( title = 'Form Title'
editable = abap_true
)->content( 'form'
)->title( 'Conversion'
)->label( 'Numeric'
)->input( value = client->_bind_edit( numc )
enabled = abap_false
)->label( `Unit`
)->input( value = client->_bind_edit( unit )
enabled = abap_false
)->stringify( ) ).

ENDMETHOD.

METHOD on_event.

CASE client->get( )-event.
WHEN 'BACK'.
client->nav_app_leave( ).
ENDCASE.

ENDMETHOD.

METHOD z2ui5_set_data.

unit = 'ST'. " internal ST -> external PC (if logged in in english)
numc = 10. " internal 0000000010 -> external 10

TRY.
CALL FUNCTION `CONVERSION_EXIT_CUNIT_OUTPUT`
EXPORTING input = unit
IMPORTING output = unit
EXCEPTIONS OTHERS = 99.

CALL FUNCTION `CONVERSION_EXIT_ALPHA_OUTPUT`
EXPORTING input = numc
IMPORTING output = numc
EXCEPTIONS OTHERS = 99.

CATCH cx_root.
ENDTRY.

ENDMETHOD.

ENDCLASS.
16 changes: 16 additions & 0 deletions src/z2ui5_cl_demo_app_326.clas.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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>Z2UI5_CL_DEMO_APP_326</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>Conversion Exits</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>
16 changes: 16 additions & 0 deletions src/z2ui5_numc12.doma.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DOMA" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<DD01V>
<DOMNAME>Z2UI5_NUMC12</DOMNAME>
<DDLANGUAGE>E</DDLANGUAGE>
<DATATYPE>NUMC</DATATYPE>
<LENG>000012</LENG>
<OUTPUTLEN>000012</OUTPUTLEN>
<CONVEXIT>ALPHA</CONVEXIT>
<DDTEXT>Numc12</DDTEXT>
</DD01V>
</asx:values>
</asx:abap>
</abapGit>
23 changes: 23 additions & 0 deletions src/z2ui5_numc12.dtel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DTEL" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<DD04V>
<ROLLNAME>Z2UI5_NUMC12</ROLLNAME>
<DDLANGUAGE>E</DDLANGUAGE>
<DOMNAME>Z2UI5_NUMC12</DOMNAME>
<HEADLEN>07</HEADLEN>
<SCRLEN1>07</SCRLEN1>
<SCRLEN2>07</SCRLEN2>
<SCRLEN3>07</SCRLEN3>
<DDTEXT>Numeric 12</DDTEXT>
<REPTEXT>Numc 12</REPTEXT>
<SCRTEXT_S>Numc 12</SCRTEXT_S>
<SCRTEXT_M>Numc 12</SCRTEXT_M>
<SCRTEXT_L>Numc 12</SCRTEXT_L>
<DTELMASTER>E</DTELMASTER>
<REFKIND>D</REFKIND>
</DD04V>
</asx:values>
</asx:abap>
</abapGit>