07-28-2015 1:44 PM
Hi ,
I am trying to run a report in background, In spool I dont have leading zeros of material
When I run report in foreground I am getting leading zeros in my alv report.
Could you Please help me out.
Thank in advance
07-29-2015 4:53 AM
Hi,
do the changes
1. for the field values truncated
wa_fieldcat-no_convext = 'X'.
2.in
i_grid_settings = lwa_grid
is_layout = lwa_layout
*Optimize column width in the layout
lwa_layout-colwidth_optimize = 'X'.
*Do not optimize column width for printing
lwa_grid-no_colwopt = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_grid_settings = lwa_grid
is_layout = lwa_layout
it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
07-28-2015 2:01 PM
Hi,
When you display the ALV the material no. is automatically converted to external form due to the conversion routines applied. When you run the alv in background the material no. is in internal format.
Regards-
Vishal
07-28-2015 2:38 PM
Thanks for ur reply
I knew it,Spool is in internal format.
How can we get leading zeros now
07-28-2015 3:54 PM
Pass the reference field name and reference table name to the fieldcat as MATNR and MARA respectively.
The fields in the fieldcat are ref_fieldname and ref_tabname.
V.
07-28-2015 5:08 PM
Hi,
One way to do this is to take another field of char 20-18 in your final internal which you are using in ALV and assign the MATNR to this field so the conversion routine will not be applies to this. Then you can pass
Regards-
Vishal
07-29-2015 4:53 AM
Hi,
do the changes
1. for the field values truncated
wa_fieldcat-no_convext = 'X'.
2.in
i_grid_settings = lwa_grid
is_layout = lwa_layout
*Optimize column width in the layout
lwa_layout-colwidth_optimize = 'X'.
*Do not optimize column width for printing
lwa_grid-no_colwopt = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_grid_settings = lwa_grid
is_layout = lwa_layout
it_fieldcat = gt_fieldcat
TABLES
t_outtab = gt_out
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
07-29-2015 5:32 AM
Hi,
Try the options Leading Zeros or Supres Zero's in Field Catalog.
07-29-2015 5:50 AM
Hi,
Try to set this flag in the fieldcat:
no_zero = 'X'.
Or try to assign value to ref_fieldname and ref_tabname in the fieldcat.
Hope this helps.