物料编码用'CONVERSION_EXIT_MATN1_OUTPUT'
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING
INPUT = GS_ALV-SELMATNR
IMPORTING
OUTPUT = GS_ALV-SELMATNR.
其余都用'CONVERSION_EXIT_ALPHA_OUTPUT'
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = GS_ALV-AUFNR
IMPORTING
OUTPUT = GS_ALV-AUFNR.
GS_ALV-MATNR = GS_ALV-SELMATNR.
找函数名
双击数据元素
双击域
双击例程
因前导0导致查询不出来,可以先INPUT加上前导0,用完后再OUTPUT去掉前导0
LOOP AT s_selma.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = s_selma-low
IMPORTING
output = s_selma-low.
MODIFY s_selma.
CLEAR s_selma.
ENDLOOP.
"品牌
SELECT
mara~matnr,
mara~zbrand,
dd07t~ddtext "品牌
FROM mara INNER JOIN dd07t ON mara~zbrand = dd07t~domvalue_l
INTO TABLE @DATA(gt_ddtext2)
WHERE dd07t~domname = 'ZDBRAND'
AND dd07t~ddlanguage = @sy-langu
AND mara~matnr IN @s_selma .
SORT gt_ddtext2 BY matnr .
LOOP AT gt_alv INTO gs_alv.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = gs_alv-selmatnr
IMPORTING
output = gs_alv-selmatnr.
"品牌
READ TABLE gt_ddtext2 ASSIGNING FIELD-SYMBOL(<fs_ddtext2>) WITH KEY matnr = gs_alv-selmatnr
BINARY SEARCH.
IF sy-subrc = 0.
gs_alv-ddtext = <fs_ddtext2>-ddtext.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING
input = gs_alv-selmatnr
IMPORTING
output = gs_alv-selmatnr.
MODIFY gt_alv FROM gs_alv.
ENDLOOP.