Application Development 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: 

employee photo - send to external system

Former Member
0 Kudos
437

Hi,

There is requirement that need to send employee photo from sap to the external system. How can I do this? Any function or sample code for this?

3 REPLIES 3

Former Member
0 Kudos
109

HI,

write a RFC which uses

'HR_IMAGE_EXISTS' to get the image document id and then use 'ALINK_RFC_TABLE_GET' to image in JPG format convert the returned RAW table to xstring format using SCMS_BINARY_TO_XSTRING pass the resulting xstring as the export parameter of this RFC .

portal application can now use this xsring to render the image.

Thanks

Virkatnh

Former Member
0 Kudos
109

Hi,

Please check this link

Thanks

Vikranth

Former Member
0 Kudos
109

REPORT ZHR_BDC_UPLOADPIC NO STANDARD PAGE HEADING LINE-SIZE 255.

INCLUDE

INCLUDE BDCRECX1.

I N T E R N A L T A B L E S

DATA : BEGIN OF IT_DATA OCCURS 0, RP50G-PERNR(8), " LIKE RP50G-PERNR,

RLGRAP-FILENAME(128),

END OF IT_DATA.

S T A R T - O F - S E L E C T I O N

START-OF-SELECTION.PERFORM OPEN_GROUP.

CALL FUNCTION 'UPLOAD'

EXPORTING

FILENAME = 'C:\PICTURE.TXT'

FILETYPE = 'DAT'

TABLES

DATA_TAB = IT_DATA

EXCEPTIONS

CONVERSION_ERROR = 1

INVALID_TABLE_WIDTH = 2

INVALID_TYPE = 3

NO_BATCH = 4

UNKNOWN_ERROR = 5

GUI_REFUSE_FILETRANSFER = 6

OTHERS = 7.

IF SY-SUBRC NE 0.

WRITE : / 'Unable to upload data'.

STOP.

ENDIF.

LOOP AT IT_DATA.

PERFORM BDC_DYNPRO USING 'OANEWCON' '0100'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'TOAOM-AR_OBJECT'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=NEW'.

PERFORM BDC_FIELD USING 'TOAOM-SAP_OBJECT'

'PREL'.

PERFORM BDC_FIELD USING 'TOAOM-AR_OBJECT'

'HRICOLFOTO'.

PERFORM BDC_DYNPRO USING 'SAPLSJ01' '0200'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'FIELD_VALUES-INPUT(02)'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=OK'.

PERFORM BDC_FIELD USING 'FIELD_VALUES-INPUT(01)'

IT_DATA-RP50G-PERNR. "'10002'.

PERFORM BDC_FIELD USING 'FIELD_VALUES-INPUT(02)'

'0002'.

PERFORM BDC_DYNPRO USING 'SAPLOPTM' '0105'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'SAPB-SAPPOOLINF'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=OKAY'.

PERFORM BDC_FIELD USING 'SAPB-SAPPOOLINF'

IT_DATA-RLGRAP-FILENAME. "JPG'.

PERFORM BDC_TRANSACTION USING 'OAOH'.

clear IT_DATA-RLGRAP-FILENAME.

ENDLOOP.

PERFORM CLOSE_GROUP.