‎2006 Feb 28 1:11 AM
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?
‎2006 Feb 28 2:34 PM
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.
‎2006 Feb 28 1:43 AM
the field you are referring to must have an underlying data dictionary 'domain' which has the 'sign' checkbox ticked.
‎2006 Feb 28 2:12 AM
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
‎2006 Feb 28 2:34 PM
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.
‎2006 Feb 28 2:42 PM
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.
‎2006 Feb 28 3:05 PM
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.
‎2006 Feb 28 3:07 PM
Don't mind the syntax errors in the last post. You get the idea.
‎2006 Feb 28 3:44 PM
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.
‎2006 Feb 28 8:07 PM
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.
‎2006 Feb 28 8:28 PM
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.
‎2006 Feb 28 8:53 PM
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.