Working with String template ABAP 7.4


Using String template in ABAP 7.4, using methods in String template ABAP 7.4

A+ A-

Starting from NetWeaver 7.4, SAP introduced new concept called string template, this string template is enclosed by '|' and all variables, functions, data objects, method etc will be in { } inside '|'.

Prior to ABAP 7.4, we were below kind of logic to create a string text with variables in it.

DATA: LV_TEXT TYPE STRING VALUE 'SAPNUTS'.
DATA: LV_OUT TYPE STRING.

CONCATENATE 'Entered Text is:' lv_text INTO lv_out.

WRITE:/ lv_out.

Using string template ABAP7.4

DATA(lv_text) = 'SAPNUTS'.

DATA(lv_out) = | Entered Text id: { lv_text } |.
WRITE:/ lv_out.

Using Methods in String Template ABAP 7.4

Below is example using string template with method.

DATA(lv_out) = | Entered Text id: { ZCL_CHECK_BOOLEAN=>GET_TEXT( ) } |.
WRITE:/ lv_out.


Learner Questions

No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question


    Was this lesson helpful to you? Yes No 2 People out of 2 think this lesson helpful

    Lesson Navigation

    Conditional Statements ABAP 7.4← Previous Lesson
    Next Chapter →