SOME OF THE SHORTCUTS IN ABAP
1. Passing default value to select options
Syntax
select-options <id name> for <type> default <low value> to <high value>.
example
SELECT-OPTIONS S_ID FOR zajay_zstu-zst_id DEFAULT 1 to 10.
2.Remove leading spaces [ condense ]
* It is used to remove the leading and trailing spaces from a string.
Syntax
condense <VAR_NAME>
Example
REPORT zajay_practice.
DATA: S TYPE STRING VALUE 'AJAY BABU VARIKALLU'.WRITE : / ' BEFORE CONDENSE: ',S.
CONDENSE S.
WRITE : / ' AFTER CONDENSE: ',S.
3. Concatenate two strings
* Used to combine two strings.
Syntax
Concatenate <string1> <string2> into <string_final> separated by <space>.
Code
REPORT zajay_practice.
DATA: str1 type string VALUE 'ajay',str2 type string VALUE 'babu',
str_final type string.
write : 'before concatenate ',/ 'string1', str1,/'string2',str2.
CONCATENATE str1 str2 INTO str_final SEPARATED BY ' '.
write: / 'after concatenate :',str_final.
Output
* Used to find string length
Syntax
strlen( variable ).
Code
REPORT zajay_practice.
DATA: str1 type string VALUE 'ajay',len type i.
len = strlen( str1 ).
write: 'String length :',len.
Output
* Used to convert lowercase or uppercase.
Syntax
Code
Output
Comments
Post a Comment