This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Declaring data elements --> | |
DATA(lv_text) = 'My Text'. | |
<!-- Return parameter of a function --> | |
DATA(lv_return) = zcl_my_class=>my_function( ). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mvc:View controllerName="SAPUI5_Demo.controller.MainView" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mvc="sap.ui.core.mvc" | |
displayBlock="true" xmlns="sap.m"> | |
<App> | |
<pages> | |
<Page title="Hello SAPUI5!"> | |
<content> | |
<Label text="This is my first application."/> | |
</content> | |
</Page> | |
</pages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
METHOD membersset_get_entityset. | |
SELECT partner, addrcomm, name_first, name_last, crdat FROM but000 | |
INTO TABLE @DATA(lt_but000) UP TO 100 ROWS | |
WHERE name_first NE @space | |
AND name_last NE @space. | |
IF lines( lt_but000 ) GT 0. | |
"et_entityset is our exporting table with data | |
APPEND LINES OF lt_but000 TO et_entityset. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before 7.40 | |
READ TABLE lt_itab INDEX lv_index INTO ls_itab. | |
// After 7.40 | |
DATA(ls_itab) = lt_itab[ lv_index ]. | |
// Before 7.40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lets say our import parameter needs a string but our variable's | |
// type is CHAR. | |
DATA lv_char TYPE CHAR30. | |
DATA(lv_result) = zcl_foo=>static_method( | |
iv_string = CONV string( lv_char ) ). | |
// we can convert it to string using CONV keyword with implicitly type | |
// we need. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before 7.40 | |
LOOP AT gt_vbak ASSIGNING FIELD-SYMBOL(<fs_vbak>). | |
// Transfer document numbers to another table | |
gv_vbeln = <fs_vbak>-vbeln. | |
APPEND gv_vbeln TO gt_vbeln. | |
CLEAR : gv_vbeln. | |
ENDLOOP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATA(lv_result_var) = SWITCH #( lv_case_value | |
WHEN 'CASE_1' THEN 'RESULT_1' | |
WHEN 'CASE_2' THEN 'RESULT_2' | |
ELSE 'DEFAULT' | |
). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATA : lv_num TYPE CHAR10 VALUE '0000000001'. | |
DATA(lv_without_zeros) = |{ lv_num ALPHA = OUT }| | |
// lv_without_zeros value is now '1'. | |
DATA(lv_with_zeros) = |{ lv_without_zeros ALPHA = IN }|. | |
// lv_with_zeros value is now '0000000001'. | |
DATA: lv_string TYPE string. | |
lv_string = |This is string.|. | |
DATA : lv_integer TYPE i VALUE 10. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@AbapCatalog.sqlViewName: 'ZDDLS_CDS_00' | |
@AbapCatalog.compiler.compareFilter: true | |
@AccessControl.authorizationCheck: #CHECK | |
@EndUserText.label: 'CDS Demo' | |
define view Zcds_Demo as select from but000 as but | |
left outer join adr6 as adr | |
on but.persnumber = adr.persnumber { | |
key but.partner as PARTNER, | |
but.name_first as NAME, | |
but.name_last as SURNAME, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mvc:View controllerName="SAPUI5_Demo.controller.MainView" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:l="sap.ui.layout" | |
xmlns:f="sap.ui.layout.form" xmlns:mvc="sap.ui.core.mvc" xmlns:core="sap.ui.core" xmlns="sap.m"> | |
<VBox class="sapUiSmallMargin"> | |
<f:SimpleForm id="SimpleFormToolbar" editable="true" layout="ResponsiveGridLayout" labelSpanXL="4" labelSpanL="3" labelSpanM="4" | |
labelSpanS="12" adjustLabelSpan="false" emptySpanXL="0" emptySpanL="4" emptySpanM="0" emptySpanS="0" columnsXL="2" columnsL="1" columnsM="1" | |
singleContainerFullSize="false"> | |
<f:toolbar> | |
<Toolbar id="TB1"> | |
<Title text="Personal Details" level="H4" titleStyle="H4"/> | |
</Toolbar> |
OlderNewer