24-String Operations and Field Symbols
24-String Operations and Field Symbols
ASSIGNED.
ENDIF.
ENDLOOP.
Check weather the field symbol is assigned or not before processing field symbol, it is very
important to check field symbol, if it is not assigned it will get a run-time error, use the
blow syntax to check field symbol assignment.
IF <FS_MARA> IS
ASSIGNED.
GET TIME STAMP FIELD LV_TIME_END. "get time at the end of loop
LV_TIME_TAKEN = LV_TIME_END - LV_TIME_START. "time taken
WRITE:/ 'Time taken: ', LV_TIME_TAKEN. "display time taken
Program2
REPORT ZSAPN_FIELDSYMBOLS2.
DATA : IT_MARA TYPE TABLE OF MARA. "internal table
DATA : WA_MARA TYPE MARA. "work area
DATA : LV_TIME_START TYPE TIMESTAMPL. "time at start of loop
DATA : LV_TIME_END TYPE TIMESTAMPL. "time at the end of loop
DATA LV_TIME_TAKEN TYPE P DECIMALS 8. "time difference
GET TIME STAMP FIELD LV_TIME_END. "get time at the end of loop
LV_TIME_TAKEN = LV_TIME_END - LV_TIME_START. "time taken
WRITE:/ 'Time taken: ', LV_TIME_TAKEN. "display time taken
ZSAPN_STRING.
ZSAPN_STRING.
STR(25) TYPE C,
END OF TY_STRING.
DATA IT_STRING TYPE TABLE OF TY_STRING.
DATA WA_STRING TYPE TY_STRING .
LV_STRING = 'SPLIT ME AT SPACE'.
SPLIT LV_STRING AT ' ' INTO TABLE IT_STRING .
WRITE :/ STRING .
*The out put will be 'ABC'
CONCATENATE STR1 STR2 STR3 INTO STRING SEPARATED BY ' '. "Concatenate into string
separated by space
WRITE :/ STRING .
*The out put will be 'THIS IS EXAMPLE OF CONCATENATE'