‎2007 Jun 05 9:36 AM
hi guys,
need a bit of help.
say i have two fields on my selection screen --
dept. number
name of employee
now my requirement is such that if i give the <b>dept. number</b> and press F4 on the <b>name of employee</b> field, then all employee names corresponding to the <b>dept. numbere</b> ,that i have entered, should be displayed.
like for example : i enter dept. numbere as 10.
then the name of employees working in dept. Number 10 should be displayed in the F4 help.
please reply as soon as possible. and if possible please send me the exact coding.
‎2007 Jun 05 9:56 AM
Hi,
To get the value of Dept no ,Dont forget to use the function module 'DYNP_VALUES_READ' .
At selection-screen on value-request for pname.
DATA :it_dynpread LIKE dynpread OCCURS 1 WITH HEADER LINE.
REFRESH it_dynpread .
it_dynpread -fieldname = 'PNAME'.
append it_dynpread .
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = it_dynpread
exceptions
others.
‎2007 Jun 05 9:40 AM
Hi,
What you can do is using the select statement fetch all the desired records into an internal table i.e. Emplyee name and Deptt.
Now, using function F4IF_FIELD_VALUE_REQUEST you can assign this Internal table as a serach help to your field on the selection screen.
Regards,
Himanshu
‎2007 Jun 05 9:40 AM
hi
use the fiollowing FM
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
<b> retfield = 'EBELP'</b><b>/ <dept no></b>
PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'DYNPFD'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
<b>value_tab = it_line_items</b>/<b><containig dept no and name of emp></b>
FIELD_TAB =
RETURN_TAB =
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
ravish
<b>plz dont forget to reward points if helpful</b>
‎2007 Jun 05 9:43 AM
Hi,
Write select query for selecting the name of the employees corresponding to that Department.For that write select query as
SELECT NAME FROM <table> INTO TABLE <itab> WHERE DEPT = <deptno>.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'NAME'
TABLES
VALUE_TAB = <itab>
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
Regards,
Padmam.
‎2007 Jun 05 9:44 AM
HI,
data:
begin of t_values occurs 2,
value like kna1-begru,
end of t_values,
t_return like ddshretval occurs 0 with header line.
t_values = 'PAR*'.
append t_values.
t_values = 'UGG'.
append t_values.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'BEGRU'
value_org = 'S'
tables
value_tab = t_values
return_tab = t_return
exceptions
parameter_error = 1
no_values_found = 2
others = 3.
Regards
Sudheer
‎2007 Jun 05 9:44 AM
Hi,
At selectiom-screen on value request for p_name.
SELECT DISTINCT
EMP_NAME
FROM Employee INTO CORRESPONDING FIELDS OF TABLE
ITAB WHERE
DEPT = P_DEPT.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'EMP_NAME'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_NAME'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB.
Here itab is the internal table with fiel EMP_NAME.
P_NAME is the selection screen parameter for employee nbame.
Reward points if it is helpfl.
‎2007 Jun 05 9:47 AM
‎2007 Jun 05 9:56 AM
Hi,
To get the value of Dept no ,Dont forget to use the function module 'DYNP_VALUES_READ' .
At selection-screen on value-request for pname.
DATA :it_dynpread LIKE dynpread OCCURS 1 WITH HEADER LINE.
REFRESH it_dynpread .
it_dynpread -fieldname = 'PNAME'.
append it_dynpread .
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-repid
dynumb = sy-dynnr
tables
dynpfields = it_dynpread
exceptions
others.
‎2007 Jun 05 12:01 PM
hi ,
how can we read the value entered in the dept. number field i'm not getting that please help.
‎2007 Jun 05 12:14 PM
Hi,
You got to read it_dynpread internal table and then move it to p_dept field.
Check out hte following Eg:
PARAMETERS: p_dept(5) TYPE c,
p_ename(40) TYPE c.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ename.
DATA :it_dynpread LIKE dynpread OCCURS 1 WITH HEADER LINE.
REFRESH it_dynpread .
it_dynpread-fieldname = 'P_DEPT'.
APPEND it_dynpread .
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
TABLES
dynpfields = it_dynpread
EXCEPTIONS
OTHERS.
<b>READ TABLE it_dynpread INDEX 1.
p_dept = it_dynpread-fieldvalue</b>.
SELECT DISTINCT
emp_name
FROM employee INTO CORRESPONDING FIELDS OF TABLE
itab WHERE
dept = p_dept.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'EMP_NAME'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_ENAME'
value_org = 'S'
TABLES
value_tab = itab.
‎2007 Jun 05 12:19 PM
hi,
check this
go to transaction abapdocu
abapdocu->screens->processing screens->F4 help from screens
i think this will help u better