‎2006 Oct 29 8:42 AM
I have a screen that I am using with a database table field that is based on the quantity field BRGEW.
When the database table has a value '2,000' stored in the field, it is displayed as '2', which is fine.
I want to know how this conversion on the screen is happening. There is NO conversion exit routine behind the data element, and NO explicit use of a conversion routine associated with my screen element, and yet the conversion still happens.
Can anybody tell me how this is being done? I need to use the same functionality writing to a BDCDATA-FVAL field, making sure the BDCDATA-FVAL field has data input as displaued, not as stored in the database.
‎2006 Oct 29 11:05 AM
Hi Anthony
The conversion is automatically made using the measure unit.
U can use WRITE statament with option UNIT:
WRITE BRGEW UNIT <UNIT> TO BDCDATA-FVAL.
Max
‎2006 Oct 29 9:12 AM
Hi anthony,
i think it might be in the screen layout.
kindly check there.
Rgds
anver
‎2006 Oct 29 10:43 AM
Hi Anver,
No it isn't; I just explicitly stated that it is not in the screen settings for the field or in the data element itself.
BR,
Tony.
‎2006 Oct 29 10:51 AM
Hi Anthony, the formatting is happening automatically by the screen renderer. THe built in data types are formatted in a specific way when used in screens. Also for the BDC problem, You simply need to move to a smaller field, like 10 characters. Then use this field to build the BDCDATA-FVAL. No need for formatting.
data: bdc_qty(10) type c.
bdc_qty = mara-brgew.
perform bdcdata.......Regards,
Rich Heilman
‎2006 Oct 29 12:10 PM
Hii Rich,
Nope, that doesn't work either.
I have a quantity field zsp01-brgew type brgew (QUANT 13); it contains the value 2.000, representing the value 2. It appears on the screen as 2, not 2.000.
If I do this as suggested:
data: bdc_qty(10) type c.
bdc_qty = zsp01-brgew.I get the value 2.000 in the bdc_qty field, which is 2000 with the country settings I have to use (000's separator is a '.').
Currently I am having to do this:
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
FLOAT_IMP = ZSP01-BRGEW
FORMAT_IMP = 'P10_3'
LEFT_IMP = 'X'
ROUND_IMP = '+'
IMPORTING
CHAR_EXP = FVAL.
Which works, but I'm sure there must be an easier way.
BR,
Tony.
‎2006 Oct 29 11:05 AM
Hi Anthony
The conversion is automatically made using the measure unit.
U can use WRITE statament with option UNIT:
WRITE BRGEW UNIT <UNIT> TO BDCDATA-FVAL.
Max
‎2006 Oct 29 12:16 PM
Hi Max,
That's just about it thanks!
I had to remove leading spaces though:
WRITE ZSP01-BRGEW UNIT ZSP01-GEWEI TO FVAL.
SHIFT FVAL LEFT DELETING LEADING SPACE.
Thanks for helping!
BR,
Tony.