Hi again,
In the ESS you evaluate the belonging employee record in HR via sy-unane and IT0105.
Problem now.
My user is connected to record number one. The user of a collegue two record number two.
We have created a iview with following RFC function.
We both start the iview with our own users. Be both recive the same values. But we are conected to different employee records and this records have different abcenses.
When we start the function in the backend everything is fine. Different output.
The function in a few words:
User (via sy-uname) checks in INTOTYPE 0105 subtype ESS which personnal number belongs to user.
With this personal number the function evaluates all abcenses and stores it in a table of the function.
This table should be shown in the Iview as output.
****************************
FUNCTION zp_get_absences_from_pernr_new.
*"----
-
""Local interface:
*" IMPORTING
*" VALUE(BEGDA) LIKE PRELP-BEGDA
*" VALUE(ENDDA) LIKE PRELP-BEGDA
*" TABLES
*" ABSENCES STRUCTURE ZPXX_ABSENCES OPTIONAL
*"----
-
DATA: lwa_2001 LIKE p2001,
lt_2001 LIKE TABLE OF lwa_2001.
TABLES : t554t.
DATA: p_usrid LIKE p0105-usrid,
p_usrty LIKE p0105-usrty,
usr_pernr LIKE p0105-pernr,
pernr TYPE prelp-pernr.
p_usrid = sy-uname.
p_usrty = 'ESS'.
TABLES : pa0105.
SELECT SINGLE * FROM pa0105
WHERE usrty = p_usrty
AND usrid EQ p_usrid
AND begda LE sy-datum
AND endda GE sy-datum.
IF sy-subrc = 0.
pernr = pa0105-pernr.
ELSE.
CLEAR pernr.
ENDIF.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
TCLAS = 'A'
pernr = pernr
infty = '2001'
begda = begda
endda = endda
TABLES
infty_tab = lt_2001
EXCEPTIONS
infty_not_found = 1
OTHERS = 2
.
IF sy-subrc = 0.
LOOP AT lt_2001 INTO lwa_2001.
absences-pernr = pernr.
absences-begda = lwa_2001-begda.
absences-endda = lwa_2001-endda.
absences-awart = lwa_2001-awart.
SELECT SINGLE * FROM t554t
WHERE sprsl = sy-langu
AND moabw = '01' " muß noch geändert werden.
AND awart = lwa_2001-awart.
absences-atext = t554t-atext.
APPEND absences.
ENDLOOP.
ENDIF.
ENDFUNCTION.
Add a comment