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

suppress Zero's in module pool .

Former Member
0 Likes
1,427

i have used a field in module pool.the data type of that field is type p dcimals 2.

it is showing 0.00 when nil at the begning of program.

i want it no to display anything till its value is zero or nil.

it want these fields blank not even 0 should be displayed.

plz suggest some solution.

i have used a field in module pool.the data type of that field is type p dcimals 2.

it is showing 0.00 when nil at the begning of program.

i want it no to display anything till its value is zero or nil.

it want these fields blank not even 0 should be displayed.

plz suggest some solution.

2 REPLIES 2
Read only

schneidertho
Product and Topic Expert
Product and Topic Expert
0 Likes
848

Hi Abhishek,

I don't think that you are able to differentiate between null and "0.00" here.

Null values can be recognized on database level (they could e.g. arise for existing records when you create an additional column in a database table). In ABAP itself (leaving aside SELECT) you can only check for initial values (but not for null). The initial value for P is "0". Therefore the dynpro displays "0.00" in your case.

Some thoughts. I cannot say more without knowing the exact use-case:

1) if you have a read-only field, you could create an additional CHAR field on the screen. Then you could get empty columns for initial values / "0" values (that only partly solves the topic for you). Example

  • field1 type p (hidden on screen)
  • field2 type c (visible)
  • logic: if field1 is not initial... write field1 to field2... format options...

2) if you want to differentiate between "user has entered 0.00" and "user has not entered anything", you need to somehow memorize that the user has entered something (and you might have to be able to recover this from the database, if your program has a persistence).

Best regards

Thorsten

Read only

Former Member
0 Likes
848

Hi Abhi,

    i have a doubt is the " Con SCM/Ton "  a field present in the table you used in the module pool program.

     if it is so just try to change the data type of the data element you used for that field .

make it as Data Type         : QUAN

                 No. of cahr        : 4.

                decimal Places  : 2.

use this field.

Thank You

Ron