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 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.

        DATATYPE STRING VALUE 'AJAY BABU   VARIKALLU'.
        WRITE ' BEFORE CONDENSE: ',S.
        CONDENSE S.
        WRITE ' AFTER CONDENSE: ',S.

    OUTPUT
                             

    3. Concatenate two strings

            * Used to combine two strings.
        Syntax
                   Concatenate <string1> <string2> into <string_final> separated by <space>.
        Code
                    REPORT zajay_practice.
        DATAstr1 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


4. Find length of string
        * Used to find string length
    Syntax
                strlen( variable ).
    Code
                REPORT zajay_practice.
        DATAstr1 type string VALUE 'ajay',
              len type i.
        len strlenstr1 ).
        write'String length :',len.
     
Output
                

5. Translate to uppercase or lowercase.
        
        * Used to convert lowercase or uppercase.
    Syntax
    Code
    Output


Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).