‎2007 Jan 18 5:51 AM
Hi,
I want to dispaly search help on a field from a internal table have multiple key fields i.e combination of fld1 + fld2 +fld3 makes one single row. Therfore can any one tell me how to return that single row , because if I am using function F4IF_INT_TABLE_VALUE_REQUEST I get only one return field that I select by which I can't get the actual line that I have selected as there may be more that one line for that field.
please suggest any way through programming not by creating any search help through se11.
thanks
‎2007 Jan 18 6:08 AM
Hi,
Use select query to select the fields & display them.
In the following code i've selected only a single field in select query but u can do it for more than 1 & proceed similarly.i've tried it before using this code.
SELECT WERKS
NAME1
FROM T001W
INTO TABLE ITEMP
WHERE IWERK = 'M011'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'WERKS'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = ITEMP
FIELD_TAB =
RETURN_TAB = T_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.
S_WERK-LOW = T_RETURN-FIELDVAL.
Hope this helps.
Reward if helpful.
Regards,
Sipra
‎2007 Jan 18 5:57 AM
Hi,
use the FM <b>POPUP_WITH_TABLE_DISPLAY</b>
U can get the single row.... which is selected......
-
santhosh
‎2007 Jan 18 6:07 AM
hi,
Just check this code it might help you
tables TCURT.
DATA: RTAB TYPE TABLE OF DDSHRETVAL WITH HEADER LINE.
DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency
P_LTEXT LIKE TCURT-LTEXT. "Long Text
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.
CLEAR: DYFIELDS[], DYFIELDS.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'TCURT'
fieldname = 'WAERS'
SEARCHHELP = ' '
SHLPPARAM = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
VALUE = ' '
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
SUPPRESS_RECORDLIST = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
RETURN_TAB = RTAB[]
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE RTAB INDEX SY-TABIX.
P_WAERS = RTAB-FIELDVAL.
SELECT SINGLE LTEXT FROM TCURT
INTO DYFIELDS-FIELDVALUE
WHERE SPRAS = SY-LANGU
AND WAERS = P_WAERS.
IF SY-SUBRC <> 0.
CLEAR DYFIELDS-FIELDVALUE.
ENDIF.
*--- update another field
DYFIELDS-FIELDNAME = 'P_LTEXT'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
tables
dynpfields = DYFIELDS .
Hope your query will be solved...
‎2007 Jan 18 6:03 AM
Hi,
You can use the same FM itself.
You may have one field in the internal table which will have the combination of ur fld1,fld2 and fld3. lets assume the combined fld name is COMBINATION.
Now,
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'COMBINATION'
dynpprog = repid
dynpnr = '1000'
value_org = 'S'
value = fldval
TABLES
value_tab = it_ff4tab
value_tab = it_f4tab
field_tab = it_f4field
return_tab = it_f4ret
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.
p_fld1 = it_f4ret-fieldval+0(10).
p_fld2 = it_f4ret-fieldval+10(5).
p_fld3 = it_f4ret-fieldval+15(10).
P_fld1, p_fld2 and p_fld3 are the selection-screen parameters.
Regards
Subramanian
‎2007 Jan 18 6:08 AM
Hi,
Use select query to select the fields & display them.
In the following code i've selected only a single field in select query but u can do it for more than 1 & proceed similarly.i've tried it before using this code.
SELECT WERKS
NAME1
FROM T001W
INTO TABLE ITEMP
WHERE IWERK = 'M011'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'WERKS'
PVALKEY = ' '
DYNPPROG = ' '
DYNPNR = ' '
DYNPROFIELD = ' '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
TABLES
VALUE_TAB = ITEMP
FIELD_TAB =
RETURN_TAB = T_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.
S_WERK-LOW = T_RETURN-FIELDVAL.
Hope this helps.
Reward if helpful.
Regards,
Sipra