2010 Mar 01 3:51 AM
I am having some trouble converting some data from type P to type C. I am only new to abap so please bear with me
I have two variables
DATA gv_shifttime TYPE p.
DATA lv_shifttime type c.
I do some calculations and put the result in gv_shifttime.
When I run the code
lv_shifttime = gv_shifttime.
all I get in lv_shifttime is *
2010 Mar 01 3:56 AM
I am having some trouble converting some data from type P to type C. I am only new to abap so please bear with me
I have two variables
DATA gv_shifttime TYPE p.
DATA lv_shifttime type c.
I do some calculations and put the result in gv_shifttime.
When I run the code
lv_shifttime = gv_shifttime.
all I get in lv_shifttime is *
2010 Mar 01 3:56 AM
2010 Mar 01 4:01 AM
I am trying to build the Commentary for my ALV tree so that I can include the input values when it is printed. I want to include this value in the Commentary
2010 Mar 01 4:09 AM
Hi,
So why do you want to convert a packed type into character type? Can't you display directly, i mean to say, can't you directly add it to commentery directly?
Or is there any necessicity that you need to convert it in character format?
Also, when you define character type variable you need to spcify length, otherwise it takes default length which is 1 in this case.
You need to define your variable as
DATA lv_shifttime type char10.It defines variable lv_shifttime with length 10.
Thanks,
Archana
2010 Mar 01 4:25 AM
I see what the problem was now. When I was adding it directly I could see no value in the print preview or when I paused the program and looked at the variable, this was because the commentary info field is 60 characters long.
I was converting it to a character format so I could try different things to get it working.
But your advice has solved my problem, thankyou.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |