cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a character in front of a table record in runtime

Hi experts,

I have build up a report in alv. I want to add a character infront of a table record in runtime for only display purpose not to save that in database table. How to do that?

Table record is - R36.

I want to add 'OE' in front of R 36.

It will be "OER36".

Thanks in advance.

VXLozano
Active Contributor

frdric.girod how many times must I ask you to convert your comments to answers?

Yours is the neatest, efficientest, nicest way, so it deserves to be an answer, a green colored one, by any means.

VXLozano
Active Contributor

(I forgot to add)

just add the concatenation options preventing the case the OP's system is not new enough.

FredericGirod
Active Contributor

vicen.lozano honestly I never do it, just read the doc and suppose it could work. I have not enough time to test like sandra.rossi do it.

And I don't like down votation, so I prefer to comment when I am not sure or I do not propose a full answer 😉

Accepted Solutions (1)

Accepted Solutions (1)

Afsal
Advisor
Advisor
0 Kudos

Hi Subir,
You can concatenate multiple fields and strings with the pipe symbol (|)
eg.

DATA(concaticated_str) = |{ lv_var1 }somestring{ lv_var2 }|.
In your case, it would be something like,
DATA(r36_val) = 'R36'.
DATA(final_string) = |OE{ r36_val}|.

Hope this helps.

Cheers.
Afsal

0 Kudos

Thanks faisal love u bro...can you share your contact number?

Sandra_Rossi
Active Contributor
0 Kudos

If you people want to share your contact info, please update your SAP profile, don't paste them in the forum. Thank you. (as per Rules of Engagement)

Answers (1)

Answers (1)

FredericGirod
Active Contributor

Did you try inside the SELECT statement ? I think it could works

SELECT ('R36' && table-my_field) as my_field
       INTO ...
       FROM ..