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

Negative Values in textboxes

Former Member
0 Likes
1,598

Greetings,

I am trying to display a textbox in a Dynpro, the value to be displayed is of type Currency but only allows me to enter/display positive numbers (ends with a dump when the associated variable has a negative number), it is associated . If I draw a box making reference to a dictionary field, It works fine displaying and receiving negative values. Is there a flag or a property to set in the screen painter to allow negative values?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,192

The field I am referring to is declared in the DATA section of my program and referes to a data dictionary structure using the LIKE sentence. However, it doesn't work with negative values, the only working possibility is displaying a work area defined in the TABLES section but this is not practical for me since what I want to display is the result of calculations made internally and not intended for storage in the database.

10 REPLIES 10
Read only

former_member186741
Active Contributor
0 Likes
1,192

the field you are referring to must have an underlying data dictionary 'domain' which has the 'sign' checkbox ticked.

Read only

0 Likes
1,192

Hi,

Adding to what Neil already mentioned, You can only set the sign flag (checkbox) for data types DEC, FLTP, QUAN and CURR.

Regards,

Suresh Datti

Read only

Former Member
0 Likes
1,193

The field I am referring to is declared in the DATA section of my program and referes to a data dictionary structure using the LIKE sentence. However, it doesn't work with negative values, the only working possibility is displaying a work area defined in the TABLES section but this is not practical for me since what I want to display is the result of calculations made internally and not intended for storage in the database.

Read only

0 Likes
1,192

Hi Sergio,

In your data declaration ,declare this field with a Domain where the field <b>Sign</b> is checked.If it is checked,then it will carry take the sign & displays also.

For example you can consider dataelement MENG8,whose Domain is also MENG8.

Read only

0 Likes
1,192

I am declaring my field with a LIKE sentence referring to a transparent table where the components are of type NETWR, the domain it referres to has the Sign flag already checked.


tables: zsourcetable.

data: 
 reg1 like zsourcetable,
 reg2 like zsourcetable.

start-of-selection.
 select single *
 from zsourcetable
 into reg1.

 reg2-value = reg1 * -1.

 call screen 100.

zsourcetable is of type NETWR, the domain it uses has the sign flag checked.

If i put on the dynpro 100 the field reg2-value, when it has a negative value, the program exits with a dump. If I use the field zsourcetable-value, it works fine. Anyway it is not the solution since I need to display simultaneously several records on screen with the results of calculations.

Read only

0 Likes
1,192

Don't mind the syntax errors in the last post. You get the idea.

Read only

0 Likes
1,192

In the screen painter field attributes....compare the field "Text" in both cases...link to program field and link to data dict. field...

There should be "V" at the beginning for the Data Dict case...where as it will not be present in the other case...

if you want to make use of the program field and want -ve sign....copy the content of "Text" for the data dict. case and paste it in with the Program field...

see if this helps...

Thanks,

Renjith.

Read only

0 Likes
1,192

Sorry, I don't seem to find what you say, in the field Text of the field properties window in the screen painter I get "___________________" for both cases there is no "V" in either.

Read only

0 Likes
1,192

I believe the field you are using or displaying -ve values has a placeholder for the -ve sign.

Go to DYNPRO - Click on Dictionary / Program fields button.

Give the field name for eg VBAP-NETWR and click on 'Get from Program'. You need to declare this field in the program.

Select the same and drag to the screen. Place wherever you required to be.

Test this once you activate code.

Read only

0 Likes
1,192

Once you select the field from dictionary, place it and activate the screen, you should see the V for a -ve supported field..(it is at the end in the TEXT field)..

Anyways rather than looking for this...choose the field you want to show -ve sign and put in "___.___.___.___,__V" instead of "___________________" in the text of the screen field attributes..and it should not dump on -ve values anymore...

i assume your field is 14 place 2 decimals...

Thanks,

Renjith.