Skip to Content

FM 'F4IF_INT_TABLE_VALUE_REQUEST return splitting one field into 2

Hi ,
I am using FM F4IF_INT_TABLE_VALUE_REQUEST to return 2 fields, however instead f returning 2 fields it is splitting 1 field into 2. I am trying to return an Error Code and Text and it is actually splitting the text into the error code and text fields. I imagine there is a probleem with my Field tab but not sure what. I have searched the forums but have not seen this issue discussed. Thanks for any assistance.

Jim

Here are the 2 Fields I want returned in the F4 help Error Type and Description

Here is how the F4 FM is returning it

Here is the code

MODULE sub_populate_dropdown_val_cls INPUT.

TABLES: zca_error_typ_br.


TYPES: BEGIN OF ty_ertyp,
error_type TYPE z_er_type,
description(40) TYPE c,
END OF ty_ertyp.

*F4 Multi Line Return declarations
DATA: lwa_ertyp TYPE ty_ertyp,
lt_ertyp TYPE STANDARD TABLE OF ty_ertyp INITIAL SIZE 0,
lt_f4_ret LIKE ddshretval OCCURS 0 WITH HEADER LINE,
lwa_field_tab LIKE dfies,
lt_field_tab LIKE dfies OCCURS 0 WITH HEADER LINE,
lt_dselc LIKE dselc OCCURS 0 WITH HEADER LINE.

SELECT error_type description
FROM zca_error_typ_br
INTO TABLE lt_ertyp.
SORT lt_ertyp BY error_type.

clear: lwa_field_tab.
refresh: lt_field_tab, lt_dselc.

PERFORM fieldinfo_get USING 'ZCA_ERROR_TYP_BR' 'ERROR_TYPE'
CHANGING lwa_field_tab.
APPEND lwa_field_tab TO lt_field_tab.

PERFORM fieldinfo_get USING 'ZCA_ERROR_TYP_BR' 'DESCRIPTION'
CHANGING lwa_field_tab.
APPEND lwa_field_tab TO lt_field_tab.

* LOOP AT lt_ertyp INTO lwa_ertyp.
lt_dselc-fldname = 'ERROR_TYPE'.
lt_dselc-dyfldname = 'LWA_ERR_LOG-ERROR_TYPE'.
* lt_dselc-dyfldname = lwa_ertyp-error_type.
APPEND lt_dselc.
lt_dselc-fldname = 'DESCRIPTION'.
lt_dselc-dyfldname = 'LWA_ERR_LOG-DESCRIPTION'.

* lt_dselc-dyfldname = lwa_ertyp-description.
APPEND lt_dselc.
* ENDLOOP.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* ddic_structure = 'ZCA_ERROR_TYP_BR' "lt_ertyp
retfield = 'ERROR_TYPE'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'LWA_ERR_LOG-ERROR_TYPE'
value_org = 'S'
TABLES
value_tab = lt_ertyp
field_tab = lt_field_tab
dynpfld_mapping = lt_dselc.
* return_tab = lt_f4_ret.

IF sy-subrc = 0.
* lwa_err_log-error_type = lt_f4_ret-fieldval.
ENDIF.

* sy-ucomm = 'PICK'.
* SUPPRESS DIALOG.



ENDMODULE. " SUB_POPULATE_DROPDOWN_VAL_CLS INPUT

FORM fieldinfo_get USING p_tabname
p_error_type
CHANGING p_lt_field_tab.

CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = p_tabname
fieldname = p_error_type
lfieldname = p_error_type
IMPORTING
dfies_wa = p_lt_field_tab
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

ENDFORM. " FIELDINFO_GET

capture.jpg (46.2 kB)
capture.jpg (30.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 17, 2016 at 08:53 PM

    I have found the issue in table lt_dselc only the field that is used in the F4IF_INT_TABLE_VALUE_REQUEST-retfield should be in this table. I had both fields that I wanted returned.in the table.

    Add comment
    10|10000 characters needed characters exceeded