‎2008 Apr 30 5:11 AM
Hi all....
Iam having one internal table with five fields and 10 records...
Now iam going to add one more record to that internal table in my program by using append statement...
itab-f1 = ' '.
itab-f2 = ' '.
itab-f3 = ' '.
itab-f4 = 'india '.
itab-f5 = ' '.
append itab.clear itab.
with above syntax i have to get four spaces and one entry....
but i am getting 0 for the last field, which is the numeric field...
how to avoid that zero...
there is no chanse to change numeric as char or others....because it is database table field using in some other reports and in other conditions in this reoprt also....
and
one more thing is iam dispalying this internal table by using table control, not with normal reporting!!!!
thank you,
naveen.
‎2008 Apr 30 5:36 AM
Hi Naveen,
Assign the value to a field-symbol as following:
data: num type n.
num = itab-f5.
field-symbols: <fs> type any.
assign num to <fs> casting type c.
if <fs> is assigned.
clear <fs>.
write:/ <fs>.
endif.
Copy paste the program in a test program and check the output. Also check the value of <fs> after getting assigned and then after clearing it.
Thank you.
Reward points if found useful
‎2008 Apr 30 5:13 AM
Please try this....
itab-f1 = ' '.
itab-f2 = ' '.
itab-f3 = ' '.
itab-f4 = 'india '.
append itab.clear itab.
‎2008 Apr 30 5:27 AM
Hi...
Then it was going to disply previous value of the f5 field....
Thank you,
Naveen
‎2008 Apr 30 5:21 AM
What you can do to avoid displaying the zero is write like below
Write: / ITAB-F5 no zero.
reward if helpful
‎2008 Apr 30 5:25 AM
Hi... Iam not displaying using write statement...with table control iam doing this....ok!!
Thank you, naveen
‎2008 Apr 30 5:40 AM
The only way I know of to make the field not show as "0" is to have it as type CHAR. Unless I'm missing something, this is how it is in SAP. You can get around this if you are willing to do some extra coding, moving the values from CHAR CURR and handling the negative sign.
regards,
Ashish
‎2008 Apr 30 5:36 AM
Hi Naveen,
Assign the value to a field-symbol as following:
data: num type n.
num = itab-f5.
field-symbols: <fs> type any.
assign num to <fs> casting type c.
if <fs> is assigned.
clear <fs>.
write:/ <fs>.
endif.
Copy paste the program in a test program and check the output. Also check the value of <fs> after getting assigned and then after clearing it.
Thank you.
Reward points if found useful
‎2008 Apr 30 6:22 AM
Hi,
I tested as you specified but no zero displaying for me in the table control.
And also try to change the type in the screen painter for that last field in the table control (like NUMC).
Regards,
Raghu