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

alv grid thousand separator

MariaJooRocha
Contributor
0 Likes
4,678

Hi SDN,

How can I format a field type float and display in alv grid, using the thousand separator?

Thanks.

Best regards,

Maria João Rocha

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
2,785

use a conversion exit, you will have to write one.

Regards,

Clemens

Hi SDN,

How can I format a field type float and display in alv grid, using the thousand separator?

Thanks.

Best regards,

Maria João Rocha

14 REPLIES 14
Read only

former_member156446
Active Contributor
0 Likes
2,785

need to move the floating value to numeric type and display..

Read only

Clemenss
Active Contributor
0 Likes
2,786

use a conversion exit, you will have to write one.

Regards,

Clemens

Read only

naimesh_patel
Active Contributor
0 Likes
2,785

You can set the Edit Mask and Conversion Exit to convert the Float to Quantity.


  ls_fcat-edit_mask   = '==FLTQU'.
  ls_fcat-convexit    = 'FLTQU'.

Regards,

Naimesh Patel

Read only

MariaJooRocha
Contributor
0 Likes
2,785

Thanks for the replies.

Do you know any conversion exit foi a float bu with 2 decimals places?

The CONVERSION_EXIT_FLTQU_OUTPUT has 3 places for the decimals.

Best regards,

Maria João Rocha

Read only

0 Likes
2,785

Hi maria,

Try this way:-

DATA : v1 TYPE p DECIMALS 4 VALUE '12345.6789',
       v2 TYPE p DECIMALS 2.
 
v2 = v1.
WRITE v2.

" ouptut : 12,345.68

Read only

MariaJooRocha
Contributor
0 Likes
2,785

Thanks Kumar ,

but i'm using alv grid, and the internal table to pass to the method grid_100->set_table_for_first_display, has many float fields.

Best regards,

Maria João Rocha

Read only

0 Likes
2,785

Hi,

Exit PROZA used in Domain IMA_PROZ used by data element IMA_PROZ_ALL has 2 decimals. But this exit is not correct because it does not use WRITE TO and thus does not create the right format. Look at this code to get a sample of how-not-to-create a conversion exit.

FUNCTION CONVERSION_EXIT_PROZA_OUTPUT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       IMPORTING
*"             VALUE(INPUT)
*"       EXPORTING
*"             VALUE(OUTPUT)
*"----------------------------------------------------------------------
  DATA: L_OUTPUT13_2(8) TYPE P DECIMALS 2,
        L_LEN TYPE I, L_BEGIN TYPE I.

  L_OUTPUT13_2 = INPUT.
  OUTPUT = L_OUTPUT13_2.
  CONDENSE OUTPUT.
  L_LEN = STRLEN( OUTPUT ).
  IF  L_LEN < 6.
    CLEAR OUTPUT.
    L_BEGIN = 6 - L_LEN.
    OUTPUT+L_BEGIN(L_LEN) = L_OUTPUT13_2.
  ENDIF.
ENDFUNCTION.

Regards,

Clemens

Read only

MariaJooRocha
Contributor
0 Likes
2,785

An example for what i need:

2.4356510000000000E+06 -> 243.651,00

Best regards,

Maria João Rocha

Read only

0 Likes
2,785

Hi Maria,

Try this

in Fieldcat:


W_FIELDCAT-outputlen = 20.
W_FIELDCAT-decimals_out = 2.

This should solve your issue.

Nag

Read only

MariaJooRocha
Contributor
0 Likes
2,785

Hi Naga Mohan Kummara

That way thousand separator is missing.

Best regards,

Maria João Rocha

Read only

0 Likes
2,785

Hi ,

Just have a look at following field catalog.

FS_FIELDCAT-FIELDNAME = 'TEST'.

FS_FIELDCAT-COL_POS = WC_COLUMN.

FS_FIELDCAT-OUTPUTLEN = 20.

FS_FIELDCAT-DECIMALS_OUT = 2.

FS_FIELDCAT-edit_mask = '==FLTQU'.

FS_FIELDCAT-TABNAME = 'INT_OUTPUT'.

Thousand separtor displaying correctly.. Give a try..

Nag

Read only

MariaJooRocha
Contributor
0 Likes
2,785

Hi Naga Mohan Kummara,

edit_mask = '==FLTQU', the data element OIO_QUANTITY in the conversion exit , has domain 'MENGE' with 3 decimals, i need the output with 2 decimals.

Best regards,

Maria João Rocha

Read only

0 Likes
2,785

Hi ,

Give a try with this

'==VAL02'

Nag

Read only

MariaJooRocha
Contributor
0 Likes
2,785

Hi,

it works with fieldcat-edit_mask = '==DEC2'

Best regards,

Maria João Rocha