‎2009 Jul 27 2:44 AM
I have some research in this forum before posting this
I have a table contains multiple key fields, I am using this table in function module F4IF_INT_TABLE_VALUE_REQUEST
But my problem is its not returning all the key field back in RETURN table. or RETURN table not returning the index which row selected.
How to get all multiple key fields from this function module or do we any other function moudule that returns the all the key fields
or any search help function module that returns the selected row index ?
a®
‎2009 Jul 27 2:22 PM
Hi,
Refer below code of FM 'F4IF_INT_TABLE_VALUE_REQUEST',it will useful to you.
DATA: IL_RETURN TYPE TABLE OF DDSHRETVAL,
WAL_RETURN TYPE DDSHRETVAL,
IL_FIELDS TYPE TABLE OF DFIES ,
WAL_FIELDS TYPE DFIES,
VL_RETFIELD LIKE DFIES-FIELDNAME.
CLEAR IL_FIELDS.
REFRESH IL_FIELDS.
LOOP AT FIELDS.
WAL_FIELDS-FIELDNAME = FIELDS-FIELDNAME .
WAL_FIELDS-TABNAME = FIELDS-TABNAME.
WAL_FIELDS-KEYFLAG = FIELDS-SELECTFLAG.
APPEND WAL_FIELDS TO IL_FIELDS.
ENDLOOP.
VL_RETFIELD = 'TABNAME'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ''
RETFIELD = VL_RETFIELD
VALUE_ORG = ''
TABLES
VALUE_TAB = VALUES
FIELD_TAB = IL_FIELDS
RETURN_TAB = IL_RETURN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
READ TABLE IL_RETURN INTO WAL_RETURN WITH KEY FIELDNAME = VL_RETFIELD.
IF SY-SUBRC EQ 0.
VIEWNAME = WAL_RETURN-FIELDVAL.
ENDIF.
Best regards,
Syf
‎2009 Jul 27 2:33 PM
Hi,
Try like this.
1. first declare a internal table with your required fields for f4 help.
2. select data from table into internal table based on some condition.
3. use Fm as
ALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = '' "Give standard field here for ref.
RETFIELD = VL_RETFIELD
VALUE_ORG = ''
TABLES
VALUE_TAB = VALUES
FIELD_TAB = IL_FIELDS
RETURN_TAB = IL_RETURN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
Regards,
Vijay
‎2009 Jul 27 2:46 PM
Hi
I think it returns the number of the selected records, not the number of the record selected, so if you can choise only one record it will always be 1.
Max
‎2009 Jul 27 2:54 PM
Max,
The return table conains the following fields
SHLPNAME
FIELDNAME
RECORDPOS
FIELDVAL
RETFIELD
But it is NOT return complete key from the table , say for example
I am sending MATNR, MATNR1 and MATNR2 (These are key of the table) After selecting the function returns with
MATNR value and not MATNR1 and MATNR2 values
In this case how can i validate with table ?
a®
‎2009 Jul 27 2:57 PM
Hi
Yes it returns only one field value, try to use REUSE_ALV_POPUP_TO_SELECT, it returns the index of selected record.
Max
‎2009 Jul 27 3:06 PM
Hi,
Thats right it is only going to have the value of the field that has been clicked on if you want to get the exact record you ahve to use 'RECORDPOS' as returned which should be the position of the line in the displayed table.
Regards,
Himanshu Verma