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

initialize value

Former Member
0 Likes
1,123

I want to display value of quantity field as blank if it contains vaue as 0.00

This is the query which i hav written.

select * from resb into corresponding fields of resb_itab_wa

where aufnr = itab_wa-aufnr AND WERKS = ITAB_WA-DWERK.

IF RESB_ITAB_WA-ENMNG = 0.

RESB_ITAB_WA-ENMNG = ' '.

ENDIF.

i.e. if the value of resb_itab_wa is 0.00 then it should display blank

So i wrote the above query. But there is no change . 0.00 is yet being displayed.

Do i hav to write something else since it is a quantity field.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
830

WHERE do you have your problem?

in SMARTFORMS? in SAP-Script? in a write statement?

in SMARTFORMS and in SAP-Script the solution is quite easy.

at your output variable in your form just add (I).

Example: &EKPO-NETWR(I)&

if EKPO-NETWR is initial (would be 0.00), then it wiont get printed.

if it differs from initial state, then it will be printed.

if you have that problem in a write statement, you should swap that value through a char field, and print (write) that char field.

Swap the value ONLY if your value is not initial.

4 REPLIES 4
Read only

Former Member
0 Likes
830

Hi Priti,

The default value depends on the data type of the variable.

If the RESB_ITAB_WA-ENMNG is QUAN, then it would display only 0.00. You cannot change it to BLANK.

To give BLANK (" ") as default value, the data type should be one that would accept CHAR values.

Allot points if answer was useful.

Best Regards,

Ram.

Read only

Former Member
0 Likes
831

WHERE do you have your problem?

in SMARTFORMS? in SAP-Script? in a write statement?

in SMARTFORMS and in SAP-Script the solution is quite easy.

at your output variable in your form just add (I).

Example: &EKPO-NETWR(I)&

if EKPO-NETWR is initial (would be 0.00), then it wiont get printed.

if it differs from initial state, then it will be printed.

if you have that problem in a write statement, you should swap that value through a char field, and print (write) that char field.

Swap the value ONLY if your value is not initial.

Read only

0 Likes
830

THANK YOU SO MUCH

Read only

Former Member
0 Likes
830

Hi Preeti,

Its not your fault that the default value is being displayed.

What you can do is to have another column in your internal table of type c.

Whenever there is a value in rseb just transfer it to you column.

At the time of display hide the column with the actual values and display the type c column.

Regards,

Ravi