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

string templates: why the double space?

abo
Active Contributor
0 Likes
2,069

Trying out an example from an old post I added a small twist, that is string templates.

The meshed approach:

WRITE: / |Jerry manager name: { line-name }, Salary: { line-salary } (MESH)|.

The non-mesh write is:

WRITE: / |Jerry manager name: { <manager>-name }, Salary:  { <manager>-salary } (OLD)|.

I noticed that to properly line up the two writes I had to add an extra blank space.

How so?

1 ACCEPTED SOLUTION
Read only

thalesvb
Active Contributor
1,962

That should be a bug on platform you ran it (ADT?).

Same code on 7.52 SAPGUI Java actually produces this. Extra space isn't needed.

Try storing string template from OLD into a new string first, without extra space, and writing that variable value (also checking debug value).

WRITE statement is old, String Template is new, sometimes shift happens (pun intended).

4 REPLIES 4
Read only

thalesvb
Active Contributor
1,963

That should be a bug on platform you ran it (ADT?).

Same code on 7.52 SAPGUI Java actually produces this. Extra space isn't needed.

Try storing string template from OLD into a new string first, without extra space, and writing that variable value (also checking debug value).

WRITE statement is old, String Template is new, sometimes shift happens (pun intended).

Read only

abo
Active Contributor
1,962

Wow, I am really surprised! I had thought of the weirdest possible explanations involving odd interactions between field symbols and templates, anything but a platform issue! You're correct, it is just as you say, also with the embedded Windows GUI in Eclipse.

It gets weirder, though, with double space:

WRITE: / |Jerry manager name: { line-name }, Salary: { line-salary } (MESH)|.
WRITE: / |Jerry manager name: { <manager>-name }, Salary:  { <manager>-salary } (OLD, ADT)|.

in ADT gives:

Jerry manager name: Jason, Salary: 3000 (MESH)<br>Jerry manager name: Jason, Salary: 3000 (OLD, ADT)

but using it twice:

WRITE: / |Jerry manager name: { line-name }, Salary: { line-salary } (MESH)|.
WRITE: / |Jerry manager name: { <manager>-name }, Salary:  { <manager>-salary } (OLD, ADT)|.
WRITE: / |Jerry manager name: { <manager>-name }, Salary: { <manager>-salary } (OLD, GUI)|.

gives different results within ADT:

Jerry manager name: Jason, Salary: 3000 (MESH)
Jerry manager name: Jason, Salary: 3000 (OLD, ADT)
Jerry manager name: Jason, Salary: 3000 (OLD, GUI)

Of course in this case the GUI is misaligned:

If anyone knows the proper place for reporting this issue, I'm down for filing a report.

The pun is equally appreciated, thanks: a funny correct answer wins over a boring correct answer 🙂

Read only

thalesvb
Active Contributor
1,962

I think only by Support Incident under BC-DWB-AIE component tree (got it from KBA 1856565 mentioned in ADT release cycle blog + other blogs mentioning to open file other ADT problems under that component root).

This deserves a question by itself (or a scavenger hunt through old questions, no ADT tag to help in that quest c5e08e0478aa4727abc4482f5be390b2).

Read only

abo
Active Contributor
1,962

Never mind: so far I could only reproduce this issue with ADT against my 7.52SP04 demo VM.

With both HANA on premise (S4CORE 104) and in cloud (Steampunk), the ADT output is consistent with the GUI and as expected. Weirdly amusing, but not worth the effort.