on 10-16-2007 10:34 AM
Hi all,
Can you please guide me how to upload photo of employee from infotype 0002.
I can upload it through ooad or oaoh, how can we upload photo through 0002
please help
Regards,
Aman
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aman,
You cannot upload the photos from infotype 2.
You have to use a BDC program for mass upload or upload individually through OAAD.
Use the FM ARCHIV_CREATE_DIALOG_META for upload of Photo, Since the recording of OAAD will pop-up a dialog window.
chk this source code.
*Table for filling screen
DATA: BEGIN OF t_record OCCURS 0,
pernr(12) TYPE c, "Employee Number
path(255) TYPE c, "photo path
END OF t_record.
LOOP AT t_record.
Since the employee photo is always stored in 0002 infotype, we need to
concatenate the employee id with preceeding zeros and pad "0002" in
right into the pernr field which will be passed to object_id
Any unwanted leading zeros deleted
SHIFT t_record-pernr LEFT DELETING LEADING '0'.
Any leading space is removed
CONDENSE t_record-pernr.
0002 is concatenated to the emp id
CONCATENATE t_record-pernr '0002' INTO t_record-pernr.
Push the contents of pernr into pernr_zero since its a NUMC type field
and hence zeros will be padded automatically by the system
w_pernr_zero = t_record-pernr.
Now pernr will be having zero padding
CLEAR w_pernr_pass.
w_pernr_pass = w_pernr_zero.
from "ARCHIV_CREATE_DIALOG_META"
CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'
EXPORTING
archiv_id = 'A1'
ar_object = 'HRICOLFOTO'
object_id = w_pernr_pass
sap_object = 'PREL'
file = t_record-path.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
Hope this helps you.
Regards,
Subbu.
Message was edited by:
Subramanian Padmanaaban
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.