-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apress
committed
Oct 18, 2016
0 parents
commit bfd45f1
Showing
129 changed files
with
13,524 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH03_01_HELLO_WORLD | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
REPORT YCL_CH04_01_HELLO_WORLD. | ||
|
||
*********************************** | ||
* Hello World ! - Use Text Symbol * | ||
*********************************** | ||
|
||
WRITE /5 TEXT-001. " / - start output on new line. 5 - start output | ||
" from 5th column. | ||
" text symbols are addressed with pre-fix TEXT, | ||
" followed by the text symbol three character | ||
" identification |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_02_LIST_SYS_FIELDS | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
|
||
REPORT YCL_CH04_02_LIST_SYS_FIELDS. | ||
|
||
************************** | ||
* Output System Fields ** | ||
************************** | ||
|
||
WRITE:/5 'SY-ABCDE', SY-ABCDE, " / start output on new line | ||
/5 'SY-DATUM', SY-DATUM, " 5 start the output from 5th column | ||
/5 'SY-DBSYS', SY-DBSYS, " : & , are for chaining i.e. avoiding | ||
" repetition of the key word WRITE | ||
/5 'SY-HOST ', SY-HOST, " text literals enclosed in single quote | ||
/5 'SY-LANGU', SY-LANGU, | ||
/5 'SY-MANDT', SY-MANDT, | ||
/5 'SY-OPSYS', SY-OPSYS, | ||
/5 'SY-REPID', SY-REPID, | ||
/5 'SY-SAPRL', SY-SAPRL, | ||
/5 'SY-SYSID', SY-SYSID, | ||
/5 'SY-TCODE', SY-TCODE, | ||
/5 'SY-UNAME', SY-UNAME, | ||
/5 'SY-UZEIT', SY-UZEIT. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_03_ELEM_DATA_OBJECTS | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
REPORT YCL_CH04_03_ELEM_DATA_OBJECTS. | ||
|
||
******************************************************************* | ||
* declare elementary DATA objects, assign values with declaration * | ||
* output data objects * | ||
******************************************************************* | ||
*********************************************************************** | ||
* key word DATA used to declare data (variables) ** | ||
* ** | ||
* : & , used for chaining i.e. avoid repetition of key word DATA. ** | ||
* ** | ||
* variable TYPE is specified with the key word TYPE followed by ** | ||
* C/D/F/I/N/P/T/X/STRING/XSTRING. if TYPE not specified, assumes ** | ||
* default TYPE as C. ** | ||
* ** | ||
* length to be specified for TYPES C,N,P,X in parenthesis. length ** | ||
* is in bytes for P & X. if length not specified for TYPES C,N,P,X ** | ||
* it assumes the default length.(see table 4.1) lengths of TYPES ** | ||
* D,F,I,T is fixed. TYPES STRING, XSTRING length varies at run time ** | ||
* ** | ||
* the VALUE clause is to assign a starting value. it is optional. ** | ||
* ** | ||
* decimals for TYPE F,P are specified with key word DECIMALS ** | ||
* followed by the number of decimals ** | ||
* ** | ||
* if single quote required as part of literal string,single quote ** | ||
* should be entered twice like 'ABC''' is for string ABC' ** | ||
*********************************************************************** | ||
|
||
DATA: CNAME(25) TYPE C | ||
VALUE 'MPHASIS - an H.P. Company', " length in parenthesis | ||
" VALUE is optional | ||
|
||
TODAY TYPE D | ||
VALUE '20130101', " numeric literals not containing any sign | ||
" & decimal can be enclosed in single quotes | ||
" numeric literals containing sign or decimal | ||
" should be enclosed in single quotes | ||
|
||
|
||
FNUM TYPE F VALUE '12345.6789', | ||
COUNT TYPE I VALUE 987654321, | ||
ECODE(7) TYPE N VALUE 2191778, | ||
BASIC_SAL(4) TYPE P DECIMALS 2 VALUE 20000, | ||
NOW TYPE T VALUE '094500', "give value in quotes | ||
HEXA(8) TYPE X VALUE '0123456789ABCDEF', | ||
STRNG TYPE STRING VALUE 'MORGAN''S GATE', "single quote | ||
"as part of string | ||
|
||
XSTRNG TYPE XSTRING." XSTRING does not take VALUE addition | ||
*********************************************************************** | ||
WRITE:/5 'TYPE C :', CNAME, | ||
/5 'TYPE D :', TODAY, | ||
/5 'TYPE F :', FNUM, | ||
/5 'TYPE I :', COUNT, | ||
/5 'TYPE N :', ECODE, | ||
/5 'TYPE P :', BASIC_SAL, | ||
/5 'TYPE T :', NOW, | ||
/5 'TYPE X :', HEXA, | ||
/5 'TYPE STRING :', STRNG. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_04_CONSTANTS | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
|
||
REPORT YCL_CH04_04_CONSTANTS. | ||
********************************************************************* | ||
* declare Constant data objects, assign values (which is mandatory) * | ||
* declarative statement CONSTANTS . * | ||
* output constant data objects * | ||
********************************************************************* | ||
*********************************************************************** | ||
* key word CONSTANTS used to declare constants ** | ||
* ** | ||
* the VALUE clause is to assign a starting value. it is mandatory ** | ||
* ** | ||
*********************************************************************** | ||
|
||
CONSTANTS: INDIAN_REPUBLIC_DAY TYPE D VALUE '19500126', | ||
AMERICAN_INDE_DAY TYPE D VALUE '17760704', | ||
ZERO TYPE I VALUE IS INITIAL. | ||
|
||
WRITE:/5 'INDIAN_REPUBLIC_DAY', INDIAN_REPUBLIC_DAY, | ||
/5 'AMERICAN_INDE_DAY ', AMERICAN_INDE_DAY. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_05_TRANSF_DATE_MOVE | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
|
||
REPORT YCL_CH04_05_TRANSF_DATE_MOVE. | ||
|
||
************************************************** | ||
* Date Transformation with MOVE Offset & Length ** | ||
* convert YYYYMMDD to MM-DD-YYYY ** | ||
************************************************** | ||
********************************************* | ||
* Source-Offsets Destination-Offsets * | ||
* 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 8 9 * | ||
* ----------------- --------------------- * | ||
* |Y|Y|Y|Y|M|M|D|D| |M|M|-|D|D|-|Y|Y|Y|Y| * | ||
* ----------------- --------------------- * | ||
********************************************* | ||
|
||
DATA: SOURCE TYPE D VALUE '20130116', | ||
DESTIN(10) TYPE C. | ||
***************************************** | ||
MOVE SOURCE+4(2) TO DESTIN+0. "MOVE MM to DESTIN | ||
MOVE '-' TO DESTIN+2. "MOVE '-' TO DESTIN | ||
|
||
MOVE SOURCE+6(2) TO DESTIN+3. "MOVE DD to DESTIN | ||
MOVE '-' TO DESTIN+5. "MOVE '-' TO DESTIN | ||
|
||
MOVE SOURCE+0(4) TO DESTIN+6. "MOVE YYYY to DESTIN | ||
|
||
WRITE:/5 'SOURCE-DEFAULT OUTPUT (DDMMYYYY) :', SOURCE, | ||
/5 'DESTIN-TRANSFORMED OUTUT (MM/DD/YYYY) :', DESTIN. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_06_STRU_DATE_OBJ | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
|
||
REPORT YCL_CH04_06_STRU_DATA_OBJ. | ||
|
||
****************************************************** | ||
* Structured Data Objects: Access Individual Fields ** | ||
****************************************************** | ||
|
||
************************************************** | ||
* declare structured data object. Assign ** | ||
* starting values to fields in the structured ** | ||
* data object. output these fields by accessing ** | ||
* the individual fields. ** | ||
************************************************** | ||
|
||
DATA: BEGIN OF CONTACT_MODES," CONTACT_MODES-name of struc data object | ||
|
||
NAME(25) TYPE C VALUE 'SURAJ NAIR', | ||
LAND_LINE(12) TYPE N VALUE '009126960021', | ||
CELL_NO(14) TYPE N VALUE '00919502102377', | ||
EMAIL TYPE STRING VALUE '[email protected]', | ||
|
||
END OF CONTACT_MODES. | ||
|
||
WRITE :/5 'Name :', CONTACT_MODES-NAME, | ||
/5 'Land Line No. :', CONTACT_MODES-LAND_LINE, | ||
/5 'Cell No. :', CONTACT_MODES-CELL_NO, | ||
/5 'Email Address :', CONTACT_MODES-EMAIL. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_07_STRU_DATA_TYP_OBJ1 | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
|
||
REPORT YCL_CH04_07_STRU_DATA_TYP_OBJ1. | ||
|
||
************************************************************ | ||
* User Defined TYPE, Reference to Structured Data Object ** | ||
************************************************************ | ||
|
||
****************************************************** | ||
* declare user defined structured TYPE with TYPES ** | ||
* statement. declare two structured data objects ** | ||
* (source, destination) by referring to this user ** | ||
* defined structured TYPE ** | ||
* assign values to individual fields of source ** | ||
* use MOVE statement to transfer entire data of ** | ||
* source to destination. output from destination ** | ||
****************************************************** | ||
|
||
TYPES: BEGIN OF CONTACT_MODES_TYPE, "user defined structured TYPE | ||
|
||
NAME(25) TYPE C, | ||
LAND_LINE(12) TYPE N, | ||
CELL_NO(14) TYPE N, | ||
EMAIL TYPE STRING, | ||
|
||
END OF CONTACT_MODES_TYPE. | ||
|
||
DATA: CONTACT_MODES_SRCE TYPE CONTACT_MODES_TYPE, | ||
CONTACT_MODES_DEST TYPE CONTACT_MODES_TYPE. | ||
|
||
CONTACT_MODES_SRCE-NAME = 'ATUL VASAN'. | ||
CONTACT_MODES_SRCE-LAND_LINE = '00912696008'. | ||
CONTACT_MODES_SRCE-CELL_NO = '00919502102355'. | ||
CONTACT_MODES_SRCE-EMAIL = '[email protected]'. | ||
|
||
MOVE CONTACT_MODES_SRCE TO CONTACT_MODES_DEST. "MOVE stru to stru | ||
|
||
WRITE: /5 'Name :', CONTACT_MODES_DEST-NAME, | ||
/5 'Land Line No. :', CONTACT_MODES_DEST-LAND_LINE, | ||
/5 'Cell No. :', CONTACT_MODES_DEST-CELL_NO, | ||
/5 'Email Address :', CONTACT_MODES_DEST-EMAIL. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_08_STRU_DATA_TYP_OBJ2 | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
|
||
REPORT YCL_CH04_08_STRU_DATA_TYP_OBJ2. | ||
|
||
******************************************************************* | ||
* User Defined TYPE in DDIC, Reference to Structured Data Object ** | ||
******************************************************************* | ||
|
||
****************************************************** | ||
* declare two structured data objects ** | ||
* (source, destination) by referring to structured ** | ||
* TYPE defined in DDIC Type Group ** | ||
* assign values to individual fields of source ** | ||
* use MOVE statement to transfer entire data of ** | ||
* source to destination. output from destination ** | ||
****************************************************** | ||
TYPE-POOLS YCLG1. "list Type Group you are using in this program | ||
|
||
DATA: CONTACT_MODES_SRCE TYPE YCLG1_CONTACT_MODES_TYPE, | ||
CONTACT_MODES_DEST TYPE YCLG1_CONTACT_MODES_TYPE. | ||
|
||
CONTACT_MODES_SRCE-NAME = 'AGHA SHEIK'. | ||
CONTACT_MODES_SRCE-LAND_LINE = '00912696010'. | ||
CONTACT_MODES_SRCE-CELL_NO = '00919502102350'. | ||
CONTACT_MODES_SRCE-EMAIL = '[email protected]'. | ||
|
||
MOVE CONTACT_MODES_SRCE TO CONTACT_MODES_DEST. "MOVE stru to stru | ||
|
||
WRITE: /5 'Name :', CONTACT_MODES_DEST-NAME, | ||
/5 'Land Line No. :', CONTACT_MODES_DEST-LAND_LINE, | ||
/5 'Cell No. :', CONTACT_MODES_DEST-CELL_NO, | ||
/5 'Email Address :', CONTACT_MODES_DEST-EMAIL. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
*&---------------------------------------------------------------------* | ||
*& Report YCL_CH04_09_STRU_MOVE_CORR | ||
*& | ||
*&---------------------------------------------------------------------* | ||
*& | ||
*& | ||
*&---------------------------------------------------------------------* | ||
|
||
REPORT YCL_CH04_09_STRU_MOVE_CORR. | ||
|
||
************************************************* | ||
* Structured Data Objects - MOVE-CORRESPONDING ** | ||
************************************************* | ||
|
||
******************************************************* | ||
* declare two structured data objects with one field ** | ||
* name differing in source & destination ** | ||
* ** | ||
* assign values to individual fields of source and ** | ||
* destination ** | ||
* ** | ||
* use MOVE-CORRESPONDING statement to transfer from ** | ||
* source to destination. output from destination ** | ||
******************************************************* | ||
|
||
DATA: BEGIN OF CONTACT_MODES_SRCE, | ||
NAME(25) TYPE C VALUE 'GURU DAS', | ||
LAND_LINE(12) TYPE N VALUE '00912696113', | ||
CELL_NO(14) TYPE N VALUE '00919592302444', | ||
EMAIL TYPE STRING VALUE '[email protected]', | ||
END OF CONTACT_MODES_SRCE, | ||
|
||
BEGIN OF CONTACT_MODES_DEST, | ||
NAME(25) TYPE C VALUE 'ZZZZZZZZ', | ||
LAND_LINE_NO(12) TYPE N VALUE '999999999999', | ||
CELL_NO(12) TYPE N VALUE '999999999999', " length differs from source | ||
EMAIL TYPE STRING VALUE 'ZZZZZZZZZZZZZZZZ', | ||
END OF CONTACT_MODES_DEST. | ||
|
||
MOVE-CORRESPONDING CONTACT_MODES_SRCE TO CONTACT_MODES_DEST. | ||
|
||
WRITE: /5 'Name :', CONTACT_MODES_DEST-NAME, | ||
/5 'Land Line No. :', CONTACT_MODES_DEST-LAND_LINE_NO, | ||
/5 'Cell No. :', CONTACT_MODES_DEST-CELL_NO, | ||
/5 'Email Address :', CONTACT_MODES_DEST-EMAIL. |
Oops, something went wrong.