cancel
Showing results for 
Search instead for 
Did you mean: 

Batch uploading of employee photo using T-code OAAD

Former Member
0 Kudos

Hi All,

When uploading employee photos with OAAD, I can not use SHDB to record the bdc actions because there is a popup function(to specify uploading JPG file) which can NOT be recorded by BDC.

So anybody got some suggestions?

Thanks in adv.

Br,Kee

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use this code this will work.

This is a code workaround instead of BDC from SHDB.

START-OF-SELECTION.

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.

  • Call this function module for storing the photos.

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.

Former Member
0 Kudos

Hit the point. Thanks a lot.

Answers (0)