REPLACE in sap ABAP

 Replace

        * Replace command replace only 1st occurrence in String.

Replace all occurrences of

       * Used to replace all the occurrences in the given string.

 

Report for replace

          REPORT zab_rp_replace.

        PARAMETERS: p_name TYPE string.

        WRITE: 'Before replacing: ', p_name.
        REPLACE 'A' WITH 'B' INTO p_name.
        WRITE: / 'After replacing: ', p_name.

Input



Output



 

Report for replace all occurrences of

 

REPORT zab_rp_replace.

PARAMETERS: p_name TYPE string.
WRITE: 'Before replacing: ', p_name.
REPLACE ALL OCCURRENCES OF 'A' IN p_name WITH 'B'.
WRITE: / 'After replacing: ', p_name.

 

Input



 

Output




****************************Thank You*************************

 


Comments

Popular posts from this blog

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

Add custom tab to me51n at item level in ABAP

Pf status and user command in factory method - OOPS ALV in ABAP