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: 

SAP note to suppress leading zeros for character fields in REUSE_ALV_GRID_DISPLAY output in ECC

Former Member
0 Kudos

Hi Experts,

Iam working on Upgrade from 4.6C to ECC 6.0.

There are some Z-programs which are using the Function Module "REUSE_ALV_GRID_DISPLAY".

Iam facing issue with Leading zeros.

I have debugged the program in both the versions,

Data in the Internal Table which we are passing to the

function module REUSE_ALV_GRID_DISPLAY is same in both the versions.

But I dont know why it is displaying differently in the 2 versions.

Leading Zeros are Prefixed if the data type is Char  in ECC.

Example:

For MATNR - Data type is CHAR and Length is 18.

So the output of the ALV is showing as "000000000000000012"  in ECC 6.0. But in 4.6c it si showing as "12".

Simillary for LIFNR field also we are facing this issue.

Till now we identified two fileds.

So my requirement is leading zeros should not appear in ECC 6.0 for Z-programs.

EX: MATNR  should be ‘12’ instead of "000000000000000012".

I too have a option of using the conversion exits, but it is not easy to use this conversion exit logic in all the Z programs(say there are 100 programs).

Is there any SNOTE for the same to implement.

Please help.

Thanks in Advance.

9 REPLIES 9

raymond_giuseppi
Active Contributor
0 Kudos

Don't call some hard-coded conversion-exit in your z-report, but improve quality of field catalog, seems the field catalog does not contain enough information for ECC to identify domain and so conversion-exit, becae less tolerant than old versions...)

Hint : try The Consistency Check to indentify missing informations, also read The Field Catalog, Generating the Field Catalog

Regards,

Raymond

0 Kudos

I have tried by passing reference field name to filed catalog but it is not working. Can you please provide more clarity on your solution

0 Kudos

Did you check actual values in the field catalog thru consistency check, look for ref ddic fields and domain value ?

anup_deshmukh4
Active Contributor
0 Kudos

Hello Sreenivas,

I Suppose you should try setting LZERO Field of the Field Catlog ,

It suppresses the Leading Zeros.

Hope this helps,

Anup D.

0 Kudos

LZERO is relevant only for NUMC data type but here MATNR is of type character. so not working this solution

0 Kudos

Hi

You should post the definition of your internal table printed by REUSE_ALV_GRID_DISPLAY and how the catalog is filled

Max

kabil_g
Active Participant
0 Kudos

This message was moderated.

venuarun
Active Participant
0 Kudos

Hi Sreenivas,

You can use this function module to avoid leading zeros.

CONVERSION_EXIT_MATN1_OUTPUT

With Regards

Arun VS

rajkumarnarasimman
Active Contributor
0 Kudos

Hi.


sreenivas reddy wrote:

So my requirement is leading zeros should not appear in ECC 6.0 for Z-programs.

EX: MATNR  should be ‘12’ instead of "000000000000000012".

I too have a option of using the conversion exits, but it is not easy to use this conversion exit logic in all the Z programs(say there are 100 programs).

Is there any SNOTE for the same to implement.


We have one more option to do, It is nothing but a suggestion, the decision is up-to you. But I am also expecting standards from SCN'ers, whether it is recommendable or not.

Since there are multiple Z-Programs, it is better to write the code inside the BADI/Implicit Enhancement in REUSE_ALV_GRID_DISPLAY instead of writing the code in every program.

Create a Z-table which contains the following Fields
  • T-code
  • Program Name
  • Field Name


Add the records into Z-table as per the structure.


Modify the Final internal table inside BADI/Implicit Enhancement using FM CONVERSTION_EXIT_MATN1_OUTPUT based on Z-table program name and field name.


I found implicit enhancement inside REUSE_ALV_GRID_DISPLAY as shown below.

If Exit is triggering, try the same.

If I am wrong, kindly correct me. 

Regards

Rajkumar Narasimman