Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

selection-screen

Former Member
0 Likes
869

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.

1 ACCEPTED SOLUTION
Read only

former_member491305
Active Contributor
0 Likes
846

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.

10 REPLIES 10
Read only

Former Member
0 Likes
846

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

Read only

Former Member
0 Likes
846

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>

Read only

Former Member
0 Likes
846

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.

Read only

Former Member
0 Likes
846

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

Read only

Former Member
0 Likes
846

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.

Read only

Former Member
0 Likes
846
Read only

former_member491305
Active Contributor
0 Likes
847

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.

Read only

0 Likes
846

hi ,

how can we read the value entered in the dept. number field i'm not getting that please help.

Read only

0 Likes
846

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.

Read only

0 Likes
846

hi,

check this

go to transaction abapdocu

abapdocu->screens->processing screens->F4 help from screens

i think this will help u better