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

Diff b/w zero and blank

Former Member
0 Likes
1,131

hi all,

please solve this small problem for me.

i have some parameters on a report selection screen which are of type CURR...

PARAMETERS : i_cenvat LIKE j_1ipart2-exbed MODIF ID ch1,

i_ecess LIKE j_1ipart2-exbed MODIF ID ch2.

now my requirement is that if the value of these are left blank then some calculation has to happen and the result is to be stored in a variable. however, if the user decides to enter some value in it...no calculation is to take place..........no problems so far....

the problem however arises when the user enters a 0 value in these fields. being a curr type field, the default value of 0 is taken up even if the field is left blank.....and my requirement is to do the calculation if it is left blank and not if 0 is entered....

i tried using type p but it gives me the same problem......

currently i m using a workaround by using character type.....but m sure there has to be a better way.....

can anyone guide....???? Plzzzz......

_________________

regards,

PJ

1 ACCEPTED SOLUTION
Read only

christian_wohlfahrt
Active Contributor
0 Likes
1,046

Hi PJ,

I'm not sure, if there is a better way.

The initial value of a curr (or other number fields) is 0 and not blank - so there is no difference ... unless you switch to character: here initial value is blank -> you can determine a 0, which was entered.

Regards,

Christian

5 REPLIES 5
Read only

christian_wohlfahrt
Active Contributor
0 Likes
1,047

Hi PJ,

I'm not sure, if there is a better way.

The initial value of a curr (or other number fields) is 0 and not blank - so there is no difference ... unless you switch to character: here initial value is blank -> you can determine a 0, which was entered.

Regards,

Christian

Read only

Former Member
0 Likes
1,046

Hi,

TO make <b>field blank</b> during the display the type should be of <b>NUMC (N</b>), other than this it will shouw Zero during the display.

Try this one.

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,046

Hi,

As I know,What are you using is correct.We need to make it as character,then we have to use,since you are talking about selection screen.

But in dialog programming,we can handle this type of situation by

ON INPUT Process only on input

(where field contents are not initial)

ON CHAIN-INPUT Process only on input in a chain

ON REQUEST Process only on request (when

user enters a value on the screen)

ON CHAIN-REQUEST Process only on request in a chain

ON -INPUT Process only on '' input

- You can only use ON ... with field assignments.

Read only

athavanraja
Active Contributor
0 Likes
1,046

instead of changing your parameter filed to type c, try the following.

data: ctest(20) .

parameters : test type p decimals 2 .

write:/ test .

move: test to ctest.

if ctest is initial .

  • you can do your processing here as initial value for char is blank .

write: ctest .

endif .

Regards

Raja

Read only

0 Likes
1,046

well thanx guys...

so i see that what i am doing is the only way out...(or as far as we know)....

Raja....what u r saying is exactly i am doing right now...thanx buddy!!

regards,

PJ