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: 

Reg:ALV, how to supress leading zeros

Former Member

Hi,

Presently I am doing a report with ALV,

Here I am getiing the ouput properly,that is i am able to display emlpoyee number correctly but with leading zero's.

I want to suppress this leading zero's as per the requirement.

How to solve the problem.

Thanks in Advance

Irfan Hussain

12 REPLIES 12

former_member181962
Active Contributor
0 Kudos

use shift with this syntax

SHIFT text LEFT DELETING leading space/<anything you don't want>.

Former Member
0 Kudos

WHY DONT YOU MODIFY THE INTERNAL TABLE VALUE ITSELF.

JUST

LOOP AT ITAB.

SHIFT ITAB-EMPNO LEFT DELETING LEADING '0'.

ENDLOOP.

NOW YOU PASS IT TO ALV.

CHEERS

former_member188685
Active Contributor
0 Kudos

Hi In fieldcat give LZERO = ' '.

this will work only the field is NUMC .

regards

vijay

Former Member
0 Kudos

HI irfan,

Go for Conversion exit.

Regards

Muthappan

Former Member
0 Kudos

Hi,

set <b>NO_ZERO</b> option in field catalog to 'X' for that employee number cloumn.

regards,

suresh

Former Member
0 Kudos

Hi Irfan,

just pass ls_fieldcat-NO_ZERO = 'X'.

<b> if ls_fieldcat-fieldname = 'PERNR'.

ls_fieldcat-NO_ZERO = 'X'.

endif.</b>

Thanks&Regards,

Siri.

Message was edited by: Srilatha T

0 Kudos

Hi,

This is my field catalog decleration.

Can just help me out with it.

Still the problem is persisiting.

DATA:RT_FCAT TYPE SLIS_T_FIELDCAT_ALV,

LS_FCAT TYPE SLIS_FIELDCAT_ALV,

POS TYPE I VALUE 1.

CLEAR LS_FCAT.

POS = POS + 1.

LS_FCAT-COL_POS = POS.

LS_FCAT-FIELDNAME = 'PERNR'.

LS_FCAT-TABNAME = 'PA0001'.

LS_FCAT-REF_FIELDNAME = 'IT_PA0001-PERNR'.

LS_FCAT-REF_TABNAME = 'IT_PA0001'.

LS_FCAT-SELTEXT_M = 'Emp. Number'.

APPEND LS_FCAT TO RT_FCAT.

Regards,

Irfan Hussain

0 Kudos

hi

Try with this.

CLEAR LS_FCAT.

POS = POS + 1.

LS_FCAT-COL_POS = POS.

LS_FCAT-FIELDNAME = 'PERNR'.

LS_FCAT-TABNAME = 'PA0001'.

LS_FCAT-REF_FIELDNAME = 'IT_PA0001-PERNR'.

LS_FCAT-REF_TABNAME = 'IT_PA0001'.

LS_FCAT-SELTEXT_M = 'Emp. Number'.

<b>LS_FCAT-NO_ZERO = 'X'.</b>

APPEND LS_FCAT TO RT_FCAT.

regards,

suresh

0 Kudos

Hi Suresh,

LS_FCAT-NO_ZERO = 'X'.

is not working,could you suggest some other method.

Regards,

Irfan

0 Kudos

hi,

otherwise try with this options

LS_FCAT-INTTYPE= 'N'.

LS_FCAT-DATATYPE = 'NUMC'.

LS_FCAT-NO_ZERO = 'X'.

regards,

suresh

Former Member

use

LS_FCAT-edit_mask = '==ALPHA'.

for that particular column

cheers

Message was edited by: Abhishek Suppal

Former Member
0 Kudos

Hi Irfan,

While populating the pernr values into your internal table use,

write pernr no-zero to internal table field...

if you are populating your internal table thru into table, loop at it and modify the pernr, so that leading zeros are omitted.

Regards,

Raj