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

reg: display initial value as blank

Former Member
0 Likes
1,876

Hi all,

I have a table with four columns . One column is of data type NUMC and has an initial value set in the standard table.

I need to display the table with values, and the initial values should be displayed as blank.

Thanks

Priya

9 REPLIES 9
Read only

GauthamV
Active Contributor
0 Likes
1,363

loop at itab.

if itab-value is initial.

itab-value = ' '.

endif.
endloop.
Read only

Former Member
0 Likes
1,363

Great!!

@Priya:It depends how you are showing your values?ALV?Classical? or what?

Read only

Former Member
0 Likes
1,363

Hi,

You can try this code to write blank ---

DATA : W_N TYPE N .
WRITE W_N NO-ZERO.

Regards

Pinaki

Read only

Former Member
0 Likes
1,363

Hi,

If u want to show that blank.

Replace the value with space.

Regrds

Read only

Former Member
0 Likes
1,363

hi all,

I m working with table control.

the column displays initial value 0 , if no value exists .

Read only

0 Likes
1,363

HI

For NUMC fileds by defalut it will take '0'

Do one thing use the following .

if <UR filed name> = '0' .

replace '0' by space.

endif.

Read only

Former Member
0 Likes
1,363

Hi,

Move it to the variable of char type and chk if it is 0, display space.

As shown in the below eg.

data: i type n,

c type c.

c = i.

if c = 0.

c = ' '.

endif.

write c.

Read only

Former Member
0 Likes
1,363

Eg. With internal Table

DATA:BEGIN OF itab OCCURS 0,

id type n,

name type char10 ,

END OF itab.

data: l_id(8) type c.

*itab-id = 1.

itab-name = 'aa'.

append itab.

itab-id = 2.

itab-name = 'bb'.

append itab.

loop at itab.

l_id = itab-id.

if l_id = 0.

l_id = ''.

endif.

write:/ l_id, itab-name.

endloop.

Read only

Former Member
0 Likes
1,363

i have solve the issue

i assigned the numc field to character field

Thanks all