on 02-12-2014 3:39 PM
Hi,
It's an automatic conversion by system based on data type. If you don't want to show decimal places, create a packed data element with no decimals and assign it to the attribute. Then in the program do the conversion to remove decimals and assign it to the attribute.
If it is of initial value( 000.00) you can set the formatting options. under properties of attribute in context change it to zeros as blanks.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Kiran,
When you say
If you don't want to show decimal places, create a packed data element with no decimals and assign it to the attribute.
Are you saying that I need to create a data dictionary element of type packed?
And then assign that in my context for the quantity attribute?
Couldn't I just use an existing one, or doesn't it exist?
Thanks again.
Hi Robert,
I suspect you are missing some thing and system will take care of decimals display based on unit automatically. We do not need to do any thing.
Please make sure that the below points are okay from your end.
- Let us say you have strcture ZST_EKPO with fields MENGE and MEINS
- You need to have reference to quantity fields as below ( i.e. referencing into same structure's unit )
Now, system auto converts decimals based on UNIT field
Example: if unit is of type NUMBER , quantity field may not have decimals
if uinit is of type quantity measuring weight.... it may have decimals based on unit
If you do not want to have decimals in any case, then as suggested, please use any suitable data element which doesn't have decimals
Example: refer where used list for domains like DEC13 or DEC_13
Hope this helps you.
Regards,
Rama
Hi,
Yes, I meant the same. Create a new data element ( say DEC 13) with no decimal places and assign it to the attribute in the context instead of the one which has decimal places.
Then in your program after fetching the data ( which has decimal places ) convert it to DEC 13 ( or type P no decimals ) with no decimals and then bind it to the context.
Regards,
Kiran
Hi Ramakrishnappa,
Thank you for the reply and i think you're idea is correct and I am getting the quanitity from EKPO but I'm having trouble doing what you say...
Originally I was just passing the EKPO value into my context attribute (which was also of type EKPO-MENGE) i.e.
webdynpro_menge = wa_ekpo-menge.
However if I change it to:
Write wa_ekpo-menge to webdynpro_menge unit 'CPY'.
this doesn't work either.
Do you know what I might be doing wrong?
Hi Robert,
Write statement with unit will not be retained while displaying data in WD, as its again converted by framework with reference to unit in the context attribute
I think your context node's data dictionary structure is not mapped properly
Please follow the below points to achieve your requirement
Hope this helps you.
Regards,
Rama
Hi Ramakrishnappa,
Oh right I hadn't done that - my context has a whole bunch of fields mixed in, some from EKPO some from Z tables...
I thertefore don't think I can do what you say...
Looks like I'll have to try your other suggestion of creatign a data element of type DEC13 and using that as a type for the quantity attribute in my context.
Thanks for your help.
Sorry one last question:
I simply pass the value from the quantity field (which has 3 decimal places) into the DEC13 field type and it seems to work:
data: output_menge type zrfq-dec13,
wa ekpo_menge type ekpo-menge.
output_menge = wa ekpo_menge.
Would anyone disagree or see anything wrong with this solution?
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.