‎2006 Dec 12 3:56 PM
Hi,
by using the function module f4if_int_table_value_request, the table return_tab is returning only one field.But i need the the other fields populated to field_tab also.
The field value_org should be C .Can anyone help me in this.
DATA: BEGIN OF lt_values OCCURS 100,
line(18),
END OF lt_values.
DATA: LT_FIELD LIKE DFIES OCCURS 0 WITH HEADER LINE.
REFRESH lt_field.
CLEAR lt_field.
lt_field-tabname = 'RESB'.
lt_field-fieldname = 'WERKS'.
APPEND lt_field.
CLEAR lt_field.
lt_field-tabname = 'RESB'.
lt_field-fieldname = 'LGORT'.
APPEND lt_field.
CLEAR lt_field.
lt_field-tabname = 'RESB'.
lt_field-fieldname = 'CHARG'.
APPEND lt_field.
CLEAR lt_field.
lt_field-tabname = 'MCHB'.
lt_field-fieldname = 'CLABS'.
APPEND lt_field.
LOOP AT lt_charg_tab.
MOVE lt_charg_tab-werks TO lt_values-line.
APPEND lt_values.
MOVE lt_charg_tab-lgort TO lt_values-line.
APPEND lt_values.
MOVE lt_charg_tab-charg TO lt_values-line.
APPEND lt_values.
MOVE lt_charg_tab-clabs TO lt_values-line.
IF NOT l_komma IS INITIAL.
TRANSLATE lt_values-line USING '.,'.
ENDIF.
APPEND lt_values.
ENDLOOP.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'LGORT'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE = lv_title
VALUE = ' '
VALUE_ORG = 'C'
MULTIPLE_CHOICE = ' '
DISPLAY = lv_display
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = lt_values
FIELD_TAB = lt_field
RETURN_TAB = lt_return
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 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.
Regards,
keerthi
‎2006 Dec 12 4:06 PM
<b>HI
Check the sample code
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_kschl-low.
DATA: BEGIN OF li_kschl OCCURS 0,
kschl LIKE nast-kschl,
vtext LIKE t685t-vtext,
END OF li_kschl.
*
DATA: lt_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE.
RANGES : zdecp FOR t685t-kschl OCCURS 1." WITH HEADERLINE.
zdecp-sign = 'I'.
zdecp-option = 'CP'.
zdecp-low = 'Z*'.
APPEND zdecp.
SELECT kschl vtext INTO TABLE li_kschl FROM
t685t WHERE spras = sy-langu
AND kschl IN zdecp.
AND KSCHL CP 'Z'.
SORT li_kschl BY kschl.
DELETE ADJACENT DUPLICATES FROM li_kschl COMPARING kschl .
IF so_kschl-low IS INITIAL.
so_kschl-low = 'z*'.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'KSCHL'
dynpnr = sy-dynnr
dynpprog = sy-repid
dynprofield = 'z*'
value_org = 'S'
TABLES
value_tab = li_kschl
return_tab = li_ret_tab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Regs
Manas Ranjan Panda</b>
‎2006 Dec 12 4:24 PM
Hi,
If the declaration of lt_values is an internal table with the fields refering to dictionary structures, i can retrieve the values of the other fields from lt_values based on retfield value. But lt_values has a string declared in it.
Any help in this regard?????????????
keerthi
‎2006 Dec 12 4:20 PM
RETURN_TAB-RECORDPOS wont help, try setting MULTIPLE_CHOICE = 'X'.
Regards
Sridhar
Message was edited by:
Sridhar K
‎2006 Dec 12 4:32 PM
Hi,
This sample prg will help you to analyze the issue.
REPORT Z_HELP .
PARAMETER P_CONNID LIKE SPFLI-CONNID.
TYPES: BEGIN OF VALUES,
CARRID TYPE SPFLI-CARRID,
ZCONNID TYPE SPFLI-CONNID,
END OF VALUES.
DATA: VALUES_TAB TYPE TABLE OF VALUES.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CONNID.
CLEAR VALUES_TAB.
SELECT CARRID CONNID
FROM SPFLI
APPENDING CORRESPONDING FIELDS OF TABLE VALUES_TAB
WHERE CARRID ='AA'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'ZCONNID'
DYNPPROG = 'Z_HELP'
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_CONNID'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = VALUES_TAB.RT
Message was edited by:
Raja T