Vous êtes sur la page 1sur 9

Configuration Steps to Upload of Photo of Employee master

Create Number Range


A number range must be created for SAP Archive Link.
Transaction code: OANR
For this process, additional authorisation is required for S_NUMBER = 03 ARCHIVELNK.
In Intervals, create number range 01 from 0000000001 to 9999999999 without the external number flag. This is
likely to already exist.

Assign Documents Class


Document type HRICOLFOTO must exist with document class JPG.
Transaction code: OAC2
Table: TOAVE

Document type settings


Document type HRICOLFOTO must be linked to object type PREL and Infotype 0002.
Transaction code: SM31
Table: V_T585O (View)
Set all three columns here to minuses and don't put a flag in the check box.

Content Repository
Create a content repository with storage type FILE archive.
Transaction code: OAC0
or follow IMG path:
Basis Components

Basis Services

SAP Archive Link

Basic Settings

Maintain content repositories

Swap from display to amend. Select a current entry and copy or just hit create. Then select .
Then fill in the details as below:
Choose a two character name can use Zx (where x is a number) only 2 Character should be maintained if you wish
to use the customer namespace
Choose the relevant description
Set DocArea to be Archive Link
Storage type set to R/3 Database
Protocol leave blank
Choose Version no. 0046 (or the latest one that is available)
Contents table set this to SDOKCONT1
Basic Path c:\ (this should be set to where the photos are all held)

Archive Path c:\ (this is the area from where the photos are retrieved)
Output Device can leave blank
Enter the path name where the photos are to be loaded from. Note this is for loading only. When the photos are
linked into the sap system (see later), actually, SAP takes a copy and stores it elsewhere. The path may only need
to be entered to Arch.path, but entering to all three doesnt seem to hurt.

Maintain the required Basis Service


Transaction code: SICF
Here you activate the Content Server Interface.
First you need to create a user profile with sufficient authorizations to carry out the processes which are done by
the system in the background. Ideally this should be a background user for a notional/dummy user. You can use your
own user ID after which SAP will warn you that this is a dialogue user account. If you do use your own user ID,
change it as soon as you have tested the config. Once you have finished the project, the chances are that your user
account will be deleted from the system which will subsequently stop this service from working.
Double-click on content server in the left hand tree structure. You can find it under default host > sap > bc > content
server
Once you have done this, click on the refresh icon and make sure that the service is activated. If it is activated, the
writing should be in bold (as opposed to greyed out)

Check which content repository (Archive) is linked to document type HRICOLFOTO in object
type PREL
Transaction code: OAC3
Table: TOAOM_C
Set the Content Repository field to the one you set up in the step above.
Note the Ret.per. field is the retention period for the photo in MONTHS. (so the default is 833 years and 3 months!)

Link photo to personnel number


Transaction code: OAAD
Click on the Create Store and Assign button. Enter Business Object PREL and Document Type HRICOLFOTO.
Click on create(F8).
Enter the Personnel Number of the employee you want to link the photo to. Choose also the infotype that you wish
the photo to be displayed on (not sure how relevant this is. It works if you use 0002 but should also work if left blank.
Suspect is only relevant if you wanted to store different photos for different infotypes)
Click on Continue.
Enter the path and filename of the photo. The dropdown will allow you to navigate to the appropriate directory.
SAP will notify you that the Stored document is created successfully and you end up with something like:
If you get an error 401 to do with missing authorizations, then try and redo the above step. It often only happens the
first time you try and load the photo.

Displaying Photos
You can display your linked photos straight away if you want, from any Infotype, by selecting the employee in Display
or Maintain Data and selecting Menu item Extras, display all facsimiles:
However, this will open a new application (e.g. Paint) and load the picture into it. This is a bit cumbersome. Its much
more likely that you really want the picture to appear nicely in the header of the appropriate infotype.

Amend Infotype Headers to display photo correctly


Transaction code: SM31
Table: T588J
or follow IMG path:
Personnel Management

Personnel Administration

Customising User Interfaces

Change Screen Header

If youre following the IMG path, you must now choose activity Infotype Header Definition
Note, Header structure per infotype and Header modifier activities describe which header is to be shown at the top of
each infotype. The enticing Passport photo option determines whether HRICOLFOTO or HRIEMPFOTO is used.
Choosing either option is fine as long as all your other settings relate to that entry as well.
In the example below, the picture has been placed in header modifier 91, which corresponds to screen header 91,
which is linked to Infotype 0002.
All you need to do is add an entry for PERNR with Field Type PIC. Column 75 puts the picture on the right hand
side. The IT column is used to decide where to take the Field Name value from. For PERNR, all infotypes have this
field.
Dont forget to GENERATE the screen header again.
When you see the resultant Infotype display you can double click on the picture will bring up a large version of it.

Other Useful Hints

You can add more than one photo to the same employee !
If you do this, both photos are stored (with stored dates). The latest one will be displayed on the infotype header.
Selecting menu bar Extra --> Display all facsimiles will give you a list of all the photos for the employee. To look at
one, select it and choose something like Display from content server. (some of the normal display buttons dont
actually display the photo, just details about it!).
You can find details of, and delete photos.
This can be done from transaction OAAD by choosing Find rather than Create.
Make sure you choose the right Find. Photos are Documents.
Select Business Object as PREL and document type as HRICOLFOTO or HRIEMPFOTO depending on which
one you have used.
You may be further asked for a Personnel number. If you blank this out, youll get all the entries in your
Archive.
To delete a photo, select the entry and hit the dustbin (or Delete). After a number of are you sure messages, and a
display of the doomed photo (probably in a separate window which will need closing again), the photo will be deleted.
Note, the deleted entry will NOT vanish from the currently displayed list. You will need to back arrow out of the list
and re-execute the archive display to see the changes.
Displaying a photo can slow down the server during the transaction, since the photo has to be loaded from the
archive (this is especially the case if you choose to display the photo on the master data / applicant data entry
screen.)

BDC for Mass Upload:


To Upload in Mass:
REPORT ZHR_BDC_UPLOADPIC NO STANDARD PAGE HEADING LINE-SIZE 255.

INCLUDE
INCLUDE BDCRECX1.

INTERNALTABLES
DATA : BEGIN OF IT_DATA OCCURS 0, RP50G-PERNR(8), " LIKE RP50G-PERNR,
RLGRAP-FILENAME(128),
END OF IT_DATA.

START-OF-SELECTION
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.

Vous aimerez peut-être aussi