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: 

Column Values getting truncated when executing ABAP report in background using FM: REUSE_ALV_GRID_DISPLAY

former_member311223
Participant
0 Kudos

Hi Experts,

I am facing a strange issue, one of the Column Values getting truncated when executing report in background. The column filed output length is 10 characters and the field "Chain ID" is of type KUNNR. But when we execute it in background and check the value in the spool we only see first 7 characters only. Plz find the screen shot below. The column name is Chain ID. Here only 7 characters are getting displayed, but it should display 10 characters.

In foreground the report is working fine.

I am using FM: REUSE_ALV_GRID_DISPLAY to display the output.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

   EXPORTING

    i_callback_program                = lv_repid

    i_grid_settings                       = lk_grid

    is_layout                               = lwa_layout

    it_fieldcat                              = i_fieldcat

I am passing the below data along with the internal table values to prevent this issue. But of no help.

DATA: lk_grid       TYPE lvc_s_glay, " Grid settings

           lwa_layout TYPE slis_layout_alv.

  lk_grid-no_colwopt = c_true.

  lwa_layout-colwidth_optimize = c_true.

In the field catalog I am passing the following data for this "Chain ID" Column .

k_fieldcat-fieldname    = xv_fldname.

k_fieldcat-tabname      = 'I_FINAL'.

k_fieldcat-seltext_l      = xv_desc.

k_fieldcat-seltext_m    = xv_desc.

k_fieldcat-seltext_s     = xv_desc.

k_fieldcat-no_convext  = xv_desc.

k_fieldcat-outputlen     = '00015'.

Still Unable to solve the issue. Kindly provide me some solution for the same.

Regards

Gopa

5 REPLIES 5

Former Member
0 Kudos

Pass values to the fields reference field name and reference table in the fieldcat.

V.

0 Kudos

Hi Vikram,

Thanks for the update.. but the issue is still not solved... getting the same error..

0 Kudos

Hi

In your code -

 

  lk_grid-no_colwopt = c_true.

  lwa_layout-colwidth_optimize = c_true.


Can you try with un-checking / checking with these two parameters.

0 Kudos

Hi Atul Sir,

Thanks for the update. I un-checked the code "lk_grid-no_colwopt = c_true.".

And also deleted and re-created the Layout Variants and the issue got solved.

Regards

Gopa

Former Member
0 Kudos

hi,

u can use auto-width optimize in layout .........