2007 Aug 27 7:45 PM
I have a column in a report that needs to display both char values and type p decimals 3 (dataelemet labst) values.
What type should I define the field so it can hold both values ( 1.01 or PASS)
2007 Aug 27 8:21 PM
Rich
WRITE works to display it on the output. But i need to store it as a column for an ALV report and display it in ALV. It doesnt work there
Rich
WRITE works to display it on the output. But i need to store it as a column for an ALV report and display it in ALV. It doesnt work there
2007 Aug 27 7:48 PM
2007 Aug 27 7:53 PM
I tried to type it as char16. But then it does not display any values on the report. Just blanks and zeros.
wa_char_results-mean_value type labst
wa_zbdprt_alv-mean_value type char16
wa_zbdprt_alv-mean_value = wa_char_results-mean_value.
2007 Aug 27 7:58 PM
2007 Aug 27 7:59 PM
Before passing ,please condense the value and move it.
wa_char_results-mean_value type labst
wa_zbdprt_alv-mean_value type char16
Condese wa_char_results-mean_value.
wa_zbdprt_alv-mean_value = wa_char_results-mean_value.
Thanks
Seshu
2007 Aug 27 8:05 PM
write wa_char_results-mean_value to wa_zbdprt_alv-mean_value. does not work
When I CONDENSE, it works but it does not give me consistent number of decimal places. I need 3 decimal places. How to accomplish this.
2007 Aug 27 8:09 PM
2007 Aug 27 8:09 PM
Hi,
Try this.
data: lv_test(6) type p decimals 3,
lv_test2(10) type c.
lv_test = 900 / 27.
lv_test2 = lv_test.
condense lv_test2.
If you debug this code, you will see the exact solution i think.
Regards,
Reward points
2007 Aug 27 8:12 PM
For example this code works perfectly fine. No need to CONDENSE, just write the value to the field.
report zrich_0001 .
data:
wa_char_results-mean_value type labst value '123456123.789',
wa_zbdprt_alv-mean_value type char16.
write wa_char_results-mean_value to wa_zbdprt_alv-mean_value .
write:/ wa_zbdprt_alv-mean_value.
Regards,
RIch Heilman
2007 Aug 27 8:21 PM
Rich
WRITE works to display it on the output. But i need to store it as a column for an ALV report and display it in ALV. It doesnt work there
2007 Aug 27 8:25 PM
Oh boy, you didn't even try it did ya? the WRITE ... TO .... statement is used to write a value from one field to another and if required, apply formatting. So when you use the WRITE statement( the first one in my example above ) the system will write the value 123456123.789 to your character field like this. 123,456,123.789, now you can used this field(column) in your ALV, no problem, it will not write to the list display(the second WRITE in my examle above will, this was just for testing).
Regards,
Rich Heilman
2007 Aug 27 8:30 PM
Rich
That worked!!!
I had tried the WRITE after your first post and it gave me the blank output which I used to get. Perhaps the program wasnt activated. But yeah you are right, no need to CONDENSE.
Thanks
2007 Aug 27 8:31 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |