Hi all,
i have already searched about it on SCN but not get any thread where i can resolve my problem so here i am posting it, i have created a screen in which i have provided F4 help, in this F4 help i am showing name and associated number of employeees, when ever user picks any values from F4 help i wants to capture the associated number from the screen, for this what i have done till now is.
I have created a F4 help and when user enters the values, i have used a PAI event to capture the corresponding values by using translation like shown below. Here ztable-rm_name is the screen field for which F4 help has been provided, and emp_code is the value i have to capture.
MODULE NUMBER INPUT.
IF ZTABLE-RM_NAME IS NOT INITIAL.
IF IT_ZINCEN IS NOT INITIAL.
SORT IT_ZINCEN BY RM_NAME.
LOOP AT it_zincen INTO wa_zincen.
TRANSLATE wa_zincen-RM_NAME TO UPPER CASE.
wa_zincen1-rm_name = wa_zincen-rm_name.
wa_zincen1-emp_code = wa_zincen-emp_code.
APPEND wa_zincen1 TO it_zincen1.
ENDLOOP.
READ TABLE it_zincen1 INTO wa_zincen1 WITH KEY RM_NAME = ZSDPROJECT1-RM_NAME.
IF SY-SUBRC = 0.
EMP_CODE5 = WA_ZINCEN1-EMP_CODE.
ENDIF.
As you can see that i am fetching the emp_code through it_zincen1 which i have already got through the database and it contains the list of all employees
and its associated numbers, the problem which i am getting is that , while fetching the data by passing rm_name it will provide the emp_code of first matching rm_name, so it will give an ambiguity in result , if there will be more than one employee in the database.
So, i am looking for any other approach, that will give consistent result , i have done it through DYNP_VALUES_READ also, but not getting proper result, please if someone has the idea about how to achieve it, please tell me the solution.
Thanks in advance.