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

variable update using string concatenation itself. Is this a bug ?

PRAGSMATIC
Participant
0 Likes
1,192

As in the screenshot, at line 5, it gives me the expected output,

but I was expecting the same at line 6. Why iv_text updates itself in mid way of right expressing. In my opinion, it should evaluate the right expression completely and then update the variable itself.

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
1,054

replace this line

data(lv_text) = `Z_CLAIM_500_EMAIL`

' --> Char

`--> string

3 REPLIES 3
Read only

FredericGirod
Active Contributor
1,055

replace this line

data(lv_text) = `Z_CLAIM_500_EMAIL`

' --> Char

`--> string

Read only

1,054

anurag.gupta.home24 When you write this inline declaration:

data(lv_text) = 'Z_CLAIM_500_EMAIL'.

the ABAP compiler declares LV_TEXT as a variable of type C and length 17 (because there are 17 characters in the right-hand side).

It means that LV_TEXT can never have more than 17 characters at runtime, any longer text assigned to it will be truncated.

Solution: do as Frederic said.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,054

Please post the code as text instead of image, so that one can easily answer by testing your code.