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 problem with zeros

Former Member
0 Likes
945

Hi guys,

I have a problem in ALV. There is character field which is company code , whenever the value is '000'or 010' it is displaying as '0' or '10'. can you please help me on this. here is the field catelog for this... it is really urgent.

CLEAR e_fieldcat.

ADD 1 TO w_col_pos.

e_fieldcat-fieldname = 'AUFNR'.

e_fieldcat-seltext_m = 'Company Code'.

e_fieldcat-col_pos = w_col_pos.

e_fieldcat-no_zero = space.

e_fieldcat-lzero = 'X'.

e_fieldcat-edit_mask = '==ALPHA'.

APPEND e_fieldcat TO t_fieldcat.

thanks.

1 ACCEPTED SOLUTION
Read only

amit_khare
Active Contributor
0 Likes
909

If its a character field why are you pasing followng values -

<b>

e_fieldcat-no_zero = space.

e_fieldcat-lzero = 'X'.

e_fieldcat-edit_mask = '==ALPHA'.

</b>

add this one.

<b>e_fieldcat-datatype = 'CHAR'.</b>

try the display by removing them.

also AUFNR is the order number of CHAR 12 not the company code as far as I remember.

Regards,

Amit

Reward all helpful replies.

Please close the thread.

Thanks,

Amit

Message was edited by:

Amit Khare

If its a character field why are you pasing followng values -

<b>

e_fieldcat-no_zero = space.

e_fieldcat-lzero = 'X'.

e_fieldcat-edit_mask = '==ALPHA'.

</b>

add this one.

<b>e_fieldcat-datatype = 'CHAR'.</b>

try the display by removing them.

also AUFNR is the order number of CHAR 12 not the company code as far as I remember.

Regards,

Amit

Reward all helpful replies.

Please close the thread.

Thanks,

Amit

Message was edited by:

Amit Khare

8 REPLIES 8
Read only

amit_khare
Active Contributor
0 Likes
910

If its a character field why are you pasing followng values -

<b>

e_fieldcat-no_zero = space.

e_fieldcat-lzero = 'X'.

e_fieldcat-edit_mask = '==ALPHA'.

</b>

add this one.

<b>e_fieldcat-datatype = 'CHAR'.</b>

try the display by removing them.

also AUFNR is the order number of CHAR 12 not the company code as far as I remember.

Regards,

Amit

Reward all helpful replies.

Please close the thread.

Thanks,

Amit

Message was edited by:

Amit Khare

Read only

0 Likes
909

Yes you are right. but here I am displaying the company code from order number. Well it is a different req,. I have tried all the options but no use...Thanks for the quick reply...

lakshmi

Read only

0 Likes
909

I got the result thanks

Read only

Former Member
0 Likes
909

Hi,

How did you fix it..

THanks,

Naren

Read only

0 Likes
909

I have declared another field which is also charecter and moved the contents of order number to that field and displayed it in ALV

Thanks.

Read only

Former Member
0 Likes
909

Hi Lakshmi ,

wa_fieldcat-edit_mask = '==ALPHA'.

wa_fieldcat-edit_lzero = 'X'.

If this doesnt work.

<b>

Declare the field as type MARA-MATNR.

</b>

BCOZ conv routine for MATNR IS MATN1.

Usually, if all is well, this will be handled automatically, for example, if on a dynpro, all you need to do is set the conversion routine value to ALPHA, then the conversion will be automatic, nothing to code. If in a list display, the field should be TYPE MARA-MATNR, then the conversion will be automatic on the list display, as well as the ALV grid.

Reward points if helpful

Regards

Naresh

Read only

Former Member
0 Likes
909

Thanks for the help

Read only

Former Member
0 Likes
909

Hi

Reward points for helpful entries.

Regards

Naresh