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

How does QUANT field display conversion work with no conversion exit?

Former Member
0 Likes
1,155

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
950

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

6 REPLIES 6
Read only

anversha_s
Active Contributor
0 Likes
950

Hi anthony,

i think it might be in the screen layout.

kindly check there.

Rgds

anver

Read only

0 Likes
950

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.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
950

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

Read only

0 Likes
950

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.

Read only

Former Member
0 Likes
951

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

Read only

0 Likes
950

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.