10-16-2008 1:55 PM
Hi friends,
i am restricting the f4 help through this function. I have taken two fields Btrtl and Abkrs. now when i select the f4 help it selects abkrs instead of btrtl . my requirement is that when i select f4 it shows two field which is showing but when i select any of that field it should show me BTRTL. Below i am sendin my code.
DATA: BEGIN OF IHELP OCCURS 0,
FIELD(10),
FTEXT(50),
END OF IHELP,
DEPT_H(20).
DATA: BEGIN OF IT_HELP OCCURS 0,
BTRTL LIKE PA0001-BTRTL,
ABKRS LIKE PA0001-ABKRS,
END OF IT_HELP.
DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE,
L_RETFIELD TYPE DFIES-FIELDNAME.
PARAMETERS :DEPT1 TYPE PA0001-BTRTL .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DEPT1.
SELECT BTRTL ABKRS FROM PA0001 INTO table IT_HELP where ABKRS = 'LT'.
SORT IT_HELP BY BTRTL ASCENDING ABKRS DESCENDING.
DELETE ADJACENT DUPLICATES FROM IT_HELP COMPARING BTRTL.
L_RETFIELD = 'BTRTL'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'L_RETFIELD'
DYNPPROG = SY-REPID
DYNPNR = '1000'
DYNPROFIELD = 'DEPT1'
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
TABLES
VALUE_TAB = IT_HELP
RETURN_TAB = T_RETURN
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
Regards,
Himanshu
10-16-2008 1:57 PM
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = L_RETFIELD "<---remove the quotes and see
10-16-2008 1:57 PM
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = L_RETFIELD "<---remove the quotes and see
10-16-2008 2:07 PM
Hi Friend,
I have removed that field but nothing happened. it select abkrs field only.
Regards,
Himanshu
10-16-2008 2:16 PM
it works well in my system
REPORT ztest_f4.
DATA: BEGIN OF ihelp OCCURS 0,
field(10),
ftext(50),
END OF ihelp,
dept_h(20).
DATA: BEGIN OF it_help OCCURS 0,
btrtl LIKE pa0001-btrtl,
abkrs LIKE pa0001-abkrs,
END OF it_help.
DATA : t_return TYPE STANDARD TABLE OF ddshretval WITH HEADER LINE,
l_retfield TYPE dfies-fieldname.
PARAMETERS :dept1 TYPE pa0001-btrtl .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR dept1.
SELECT btrtl abkrs FROM pa0001 INTO TABLE it_help WHERE abkrs = 'D2'.
SORT it_help BY btrtl ASCENDING abkrs DESCENDING.
DELETE ADJACENT DUPLICATES FROM it_help COMPARING btrtl.
l_retfield = 'BTRTL'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = l_retfield
dynpprog = sy-repid
dynpnr = '1000'
dynprofield = 'DEPT1'
value_org = 'S'
multiple_choice = ' '
TABLES
value_tab = it_help
return_tab = t_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
I am not sure what is the problem with it. just check it once.
10-16-2008 3:40 PM
HI FRIEND,
I ALREADY GET MY ANSWER. I AM NOT GETTING RIGHT VALUE BECAUSE OF SINGLE QUOTE USED IN l_retfield.
BUT ANYWAY THANKS FOR REPLY
10-16-2008 3:42 PM
>
> Hi Friend,
> I have removed that field but nothing happened. it select abkrs field only.
>
>
> Regards,
> Himanshu
but you said , even after removing you are not getting the result.