2008 Jan 08 3:13 PM
Hi Experts,
I have data declaration like this.
data :
char1(10) type c,
dat1 type dats,
num1 type numc.
Now i want to move spaces to all of them based on certain conditions. So i use
move : space to char1,
space to dat1,
space to num1.
for char1 it displays empty but for dat1 it shows - - or / /
and for num1 it shows 000 (depending on length of field).
Now how do i fully clear the char1 and num1 field as well?
thanks
Dany
Hi Experts,
I have data declaration like this.
data :
char1(10) type c,
dat1 type dats,
num1 type numc.
Now i want to move spaces to all of them based on certain conditions. So i use
move : space to char1,
space to dat1,
space to num1.
for char1 it displays empty but for dat1 it shows - - or / /
and for num1 it shows 000 (depending on length of field).
Now how do i fully clear the char1 and num1 field as well?
thanks
Dany
2008 Jan 08 3:21 PM
"check values while displaying
IF dat1 IS INITIAL.
WRITE space.
ENDIF.
IF num1 IS INITIAL.
WRITE space.
ENDIF.
2008 Jan 08 3:27 PM
Hi Perez C,
Its not even touching the IF cond as i see that dat1 & num1 have space(nit intial) in debug mode.
well, actually i need to pass these values to display them in ALV.
Any more suggestions?
2008 Jan 08 3:30 PM
report zars no standard page heading
line-size 170
line-count 65(4).
data : zdate like sy-datum.
data : zdatechar(10) type c.
move space to zdate.
write zdate using edit mask '__ __ ____' to zdatechar.
write zdatechar.
2008 Jan 08 4:15 PM
Hi a®s ,
Now can you give an idea as how can i pass these fields (say zdatechar) into an itab meant for ALV display?
thanks
Dany
2008 Jan 08 4:20 PM
Dan,
For ALV , why we need to go for roundway solution. Please check the following parameters in the field catalog
ie
NO_SIGN = 'X'
NO_ZERO = 'X'
system will take care the rest.
In your first post you have not mentioned anything about displaying the values in ALV
a®
2008 Jan 08 4:50 PM
Hi a®s ,
Oh! you are right.
But i am getting / / for the dates field here still. I tried to set my own data in user profile..but no use.
Any suggestions?
2008 Jan 08 4:58 PM
2008 Jan 08 5:01 PM
2008 Jan 08 6:42 PM
Hi a®s,
I am able to see (in ebug mode) that the date fields are holding spaces but after geting displayed in ALV they are shown as / / ..etc like wise.
I cannot set edit mask in field catalog as this becoems generic.
I am converting the values of fields to spaces only based on certain conditions (liekif there are duplicate invoiceno rows..etc)
Please suggest.
2008 Jan 08 9:23 PM
Define the date column as char 12. WRITE the date value to that field when you want the value to display. Don't use the WRITE statement when you want to keep the field blank.
Only issue will be when a user sorts by the date column, the sorting will be goofy.
2008 Jan 08 3:31 PM
Yes it is displaying the Default values in the respective format.
To Consider them as space u can do as follows;
Take variables for each dats and numc of their size and of character type.
WHen u r checking the conditions and moving space to Dats and Numc variables move space to these character variables also.
SO that u can use them if required again.
awrd points if useful
Bhupal
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |