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

Problem with screen field conversion

Former Member
0 Likes
833

Hi,

I have a screen with a field of type NUMC that refers to a global variable (declared in my top include) of type QUAN size 13 decimals 3.

When I enter the value 1 in the screen field, it saves in the database field 0.001. If I enter, for example, 2100, it puts 2.100.

Of course, the problem occurs in the transparent conversion between the screen field and my variable that will be saved in database.

Somebody realize how can I solve this?

Please, help ASAP.

Regards,

Charles

9 REPLIES 9
Read only

Former Member
0 Likes
802

hi,

you have said the the field in the screen is refering to global variable which has decimals 3. so you are getting 21 if u give 21,000.

if u want 21,000 to be updated in database the declare a variable quan with decimals 0.

hope it is useful.

regards,

sreelakshmi.

Read only

Former Member
0 Likes
802

Dear,

Try this, yr prob may be solved :-

You can change the screen field to Quan of same size (just greater than 2 like for eg . in this case type quan size 15 decimal 3 ) Also u have to give reference field (for eg give mara-meins)

Otherwise, u have to change the decimal places in yr top include to 0.

Best Regards,

P Singh

Read only

0 Likes
802

Hi P Singh,

My variable is of the same type of table column (that is QUAN 13 decimals 3). So I think I can't change that.

I tried change the screen field type to QUAN, but occurs a error on activation because I have to give a reference to a unit and I don't know how to do that (what unit is).

If you have another sugestions, or correction to what I say above, please tell me.

Thanks,

Charles

Read only

0 Likes
802

Try to multiply the value by 1000 when saving to the database.

Read only

0 Likes
802

I think do that, it work but isn't the best solution.

Thanks

Read only

0 Likes
802

Give reference of BSEG-MEINS to your quantity field....

it should solve the problem..

Read only

Former Member
0 Likes
802

I solved my problem by relating the screen field to the database table field.

That isn't the solution that I want (because the screen field should be NUMC), but work.

If no more solutions I'll leave that.

Thanks.

Read only

Former Member
0 Likes
802

Hello Charles,

Is it possible for you to give the way the global variable is declared in your program. This would be helpful in looking in a different perspective.

Regards,

Pavan

Read only

0 Likes
802

Hi Pavan,

gv_field TYPE ddic_table-field.

I my screen I have a field of type NUMC that refers to this gv_field.