Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP 7.40 Syntax Question

jdloranger
Participant
0 Likes
2,424


I have been reading through and digesting the new ABAP features in Horst Keller's post   Great stuff.  However I see at different places, particularly in the constructor expressions the use of the pipe "|" .  I am not clear of the use of these.  Are they for separating elements?

An example from Horst's Blog on Constructor Operator VALUE



Other expressions in VALUE operator

Of course, the arguments of VALUE can be expressions or function calls:

TYPES t_date_tab TYPE TABLE OF string  WITH EMPTY KEY.

DATA(date_tab) = VALUE t_date_tab(
  ( |{ CONV d( sy-datlo - 1 ) DATE = ENVIRONMENT }| )
  ( |{         sy-datlo       DATE = ENVIRONMENT }| )
  ( |{ CONV d( sy-datlo + 1 ) DATE = ENVIRONMENT }| ) ).

Any clarification on that would be helpful.  Thank you in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,332

Hi Justin,

Recently we had some sessions on ABAP 7.4 release.

The I operator is used for creating new character strings out of literals and embedded expressions.

Like in our ABAP releases we use Write to statement same can be replaced by Pipe which is called as string template.It works for all the cases except for  text elements.

Regards,

Kannan


I have been reading through and digesting the new ABAP features in Horst Keller's post   Great stuff.  However I see at different places, particularly in the constructor expressions the use of the pipe "|" .  I am not clear of the use of these.  Are they for separating elements?

An example from Horst's Blog on Constructor Operator VALUE



Other expressions in VALUE operator

Of course, the arguments of VALUE can be expressions or function calls:

TYPES t_date_tab TYPE TABLE OF string  WITH EMPTY KEY.

DATA(date_tab) = VALUE t_date_tab(
  ( |{ CONV d( sy-datlo - 1 ) DATE = ENVIRONMENT }| )
  ( |{         sy-datlo       DATE = ENVIRONMENT }| )
  ( |{ CONV d( sy-datlo + 1 ) DATE = ENVIRONMENT }| ) ).

Any clarification on that would be helpful.  Thank you in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
1,333

Hi Justin,

Recently we had some sessions on ABAP 7.4 release.

The I operator is used for creating new character strings out of literals and embedded expressions.

Like in our ABAP releases we use Write to statement same can be replaced by Pipe which is called as string template.It works for all the cases except for  text elements.

Regards,

Kannan

Read only

matt
Active Contributor
0 Likes
1,332

Pipes are delimiters of non-translatable text.

I.e. if you've got some text that you don't want to be translated, and never should be translated, instead of surrounding it with ' surround it with |

This is not a 7.4 feature. I'm in 7.3 and using it.

Read only

Private_Member_7726
Active Contributor
0 Likes
1,332

Hi,

Those are used for designating string templates (unfortunately help.sap.com ABAP docu is still down for me so linking to a blog and). The result of template has type string.

I don't know if there are other uses for pipes, but I loooove string templates - no more CONCATENATE, no more temp variable when you need to pass something of type C to a method parameter of type string Works on 702 as well.

cheers

Jānis

Read only

0 Likes
1,332

Janis,   thank you for the link.  Yet another post with lots of good stuff.

Justin

Read only

jdloranger
Participant
0 Likes
1,332

Thank you all.  Every day, it seems, I learn something new that can be put into practice.

KInd Regards,

Justin