Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Jan 07, 2015 at 11:14 AM

    Hello Sreenivas,

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

    It suppresses the Leading Zeros.

    Hope this helps,

    Anup D.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 07, 2015 at 10:20 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 05:45 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 06:11 AM

    Hi Sreenivas,

    You can use this function module to avoid leading zeros.

    CONVERSION_EXIT_MATN1_OUTPUT

    With Regards

    Arun VS

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 07:00 AM

    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

    Add comment
    10|10000 characters needed characters exceeded