Application Development 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: 

negative sign in alv grid

Former Member
0 Kudos

Hello friends,

I am using a grid alv to show some data, but when a column has negative number, they are shown without the sign (neither in the front, nor in the back), this is the code where I show the column

clear gt_fieldcat_data.

gt_fieldcat_data-fieldname = 'ZQTPRC'.

gt_fieldcat_data-seltext_m = 'QT disponible'.

gt_fieldcat_data-inttype = 'P'.

gt_fieldcat_data-outputlen = 18.

gt_fieldcat_data-decimals_out = '2'.

append gt_fieldcat_data.

what can I do so the negative number appear when it is negative. (it can be negative or positive)

Thanks for ur help !!!

Javier

7 REPLIES 7

Former Member
0 Kudos

Hi,

Are you sure that the data element of your data support negatives values ?

Have you checked in debug that your data are really regatives?

Mathieu

0 Kudos

yes, i checked in the bug, and the variable contains the negative number, for example 6-, but it shows 6.

Former Member
0 Kudos

if the internal table is filled with negative sign... try this way... create a variable as char and move the value to this char value and try displaying in ur alv output... it will display..

Former Member
0 Kudos

HI,

Change the Field to String or Charecter then it will display the Negative sign

Regards

Sudheer

Pawan_Kesari
Active Contributor
0 Kudos

from which table in dictionary data is coming... or can you find the similar field in data dictionary will corresponds to your data

try to fill these fields

gt_fieldcat_data-ref_fieldname

gt_fieldcat_data-ref_tabname

just for example if I am displayng material in ALV then I will fill

gt_fieldcat_data-ref_fieldname = 'MARA'

gt_fieldcat_data-ref_tabname = 'MATNR'

marcelo_ramos
Active Contributor
0 Kudos

Hi,

I think you must use a Character type to do this.

Try to move the value to this data and display it.

Regards.

Marcelo Ramos

Former Member
0 Kudos

hi,

pass "<b>-</b>________________" (thats 16 underscroes) to EDIT_MASK of field catalog for the required field.

Or

U can copy the fm CLOI_PUT_SIGN_IN_FRONT to CONVERSION_EXIT_SIGN_OUTPUT and activate it. Then in edit mask use this '==SIGN' or u can create one domain and refer the domain to that field. In that domain u set the convertion routine = SIGN

Thanks

Mahesh