2023 Nov 18 3:16 AM
Dear All,
I am having Truncation of text in print preview ALV Grid after 30 Characters. The text and header appears properly in ALV GRID.
The header is truncated as well.
The details are as below:
*********Declaration in table
DATA: BEGIN OF it_workflow_output OCCURS 0,
work_item_date(10) TYPE c ," LIKE "swfawrkitm-wi_cd,
work_item_time(10) TYPE c ," LIKE swfawrkitm-wi_ct,
approval_status(20) TYPE c, " LIKE zwfstatus-zwf_status,
work_item_text(99) TYPE c, " LIKE swwwihead-wi_rhtext,
agent_id(20) TYPE c, " LIKE zwfstatus-zwf_approver,
quote_number LIKE zwfstatus-zwf_quote,
quote_creator(20) TYPE c, " LIKE zwfstatus-zquote_ernam,
sales_document LIKE vbak-vbeln,
document_creator(20) TYPE c, " LIKE zwfstatus-zorder_ernam,
customer_sold_to(20) TYPE c, " LIKE vbak-kunnr,
account_manager(20) TYPE c, " LIKE zwfstatus-zf_am_number,
am_name(20) TYPE c, " LIKE zwfstatus-zwf_am_name,
customer_fab(20) TYPE c, " LIKE zwfstatus-zwf_custfab_no,
customer_fab_name LIKE zwfstatus-zwf_cust_fab,
division(8) TYPE c, "vbap-spart,
END OF it_workflow_output.
**********Field Catalog
WHEN 'CUSTOMER_FAB_NAME'.
<fs_fieldcat>-outputlen = '100'.
<fs_fieldcat>-ddictxt = 'L'.
<fs_fieldcat>-no_convext = 'X'.
<fs_fieldcat>-no_out = space.
<fs_fieldcat>-seltext_l
= ' Customer Fab Account Description '.
<fs_fieldcat>-seltext_m
= ' Customer Fab Account Description '.
<fs_fieldcat>-seltext_s
= ' Customer Fab Account Description '.
<fs_fieldcat>-ref_tabname = 'KNA1'.
<fs_fieldcat>-ref_fieldname = 'NAME1'.
<fs_fieldcat>-outputlen = '225'.
*****************Other coding
DATA : iprint TYPE slis_print_alv.
iprint-no_change_print_params = 'X'.
gs_settings-no_colwopt = 'X'.
gs_layout-colwidth_optimize = 'X'.
***********Func module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
i_bypassing_buffer = c_xflag_alv_flg
* I_BUFFER_ACTIVE = ' '
i_callback_program = gs_repid
* I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = c_user_command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
i_grid_title = gc_title
i_grid_settings = gs_settings
is_layout = gs_layout
it_fieldcat = gt_fieldcat
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = gt_sort
* IT_FILTER =
* IS_SEL_HIDE =
i_default = c_xflag_alv_flg
i_save = c_xflag_alv_flg
is_variant = gc_variant
it_events = gt_events
* IT_EVENT_EXIT =
is_print = iprint "SDESHPAN
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_workflow_output.
I will be really thankful for kindly helping.
Regards.
2023 Nov 18 12:45 PM
Could you please share a screenshot of debugger concerning the value of field catalog for this field?
Did you run the ALV SOS consistency check?
2023 Nov 20 10:21 AM
You wrote
WHEN 'CUSTOMER_FAB_NAME'.
<fs_fieldcat>-outputlen = '100'.
" ...
<fs_fieldcat>-ref_tabname = 'KNA1'.
<fs_fieldcat>-ref_fieldname = 'NAME1'.
<fs_fieldcat>-outputlen = '225'.
Reference fields or value 35 should be enough, which value is actually used by ALV Grid (use Consistency check to display field catalog current values)
(Also consider using a recent alv class such as CL_SALV_TABLE an not an outdated FM)
2023 Nov 20 11:19 AM
Dear Sandra,
Thanks for ALV &SOS suggestion. I will be thankful for kindly helping further.
I checked &SOS it showed a below for column concerned, it shows OUTPUTLEN = 28 (5th row below screen shot)instead of 35 or 225 passed in program code while passing to REUSE_ALV_GRID_DSIPLAY, and the text is truncated:
&SOS:
Field catalog passed to REUSE_ALV_GRID_DISPLAY
Regards,
SD
2023 Nov 20 11:52 AM
Why indicating 225 if the maximum is 35?
What happens if you indicate 35?
Did you check the SAP notes?