我有来自HTEXT的“Müşterisiparişindenmüşterisiparişinenakilkaydı”文字。
HTEXT是一个25个字符的字段,你知道。但是当我使用
时“WRITE”命令。它写道“Müşterisiparişindenmüşterisiparişinenakilkaydı”
但我更改了ALV的代码。然后它在ALV中显示为“Müşterisiparişindenmüş”。
“Müşterisiparişindenmüş”文字有25个字符,如你所见。
如何更改屏幕上显示的数据长度?
我是ABAP的新人。我搜索我的问题,但我无法集成自己的代码。我的代码如下。 <<<<<<>>>>>>>>>>>>>>>
TABLES : mseg, mkpf, zrapor_mseg_mkpf_alv .
CONSTANTS : gc_alv_item_table TYPE slis_tabname VALUE 'GT_ALV' , "ALV itab name
gc_program_name LIKE sy-repid VALUE 'ZRAPOR_MSEG_MKPF_ALV' , "Program name
gc_structure_name LIKE dd02l-tabname VALUE 'ZRAPOR_MSEG_MKPF_ALV' . "Structure name
DATA : gt_alv TYPE TABLE OF zrapor_mseg_mkpf_alv WITH HEADER LINE .
DATA : gt_flcat TYPE slis_t_fieldcat_alv . "Field Catalog is defined
DATA : gwa_flcat LIKE LINE OF gt_flcat . "Field catalog's work area
DATA : gwa_flcat2 LIKE LINE OF gt_flcat .
DATA : gs_alv LIKE LINE OF gt_alv .
<<<<<<<<<<<>>>>>>>>
FORM make_field_catalog .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = gc_program_name
i_internal_tabname = gc_alv_item_table
i_structure_name = gc_structure_name
CHANGING
ct_fieldcat = gt_flcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
DELETE gt_flcat WHERE fieldname = 'SOBKZ' .
ENDFORM .
答案 0 :(得分:1)
data wa_fieldcat like line of gt_flcat. " The fieldcat line to append
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-ref_fieldname = 'MATNR'.
wa_fieldcat-ref_tabname = 'MARA'.
wa_fieldcat-outputlen = 10. " Specify the length
wa_fieldcat-col_pos = cont.
append wa_fieldcat to gt_flcat.
clear wa_fieldcat.
add 1 to cont.
...
或许您在ALV结构中使用的变量长度为25。检查或发布您的代码,看看会发生什么。