Skip to end of metadata
Go to start of metadata

* Please note, these instructions were given to me so am now giving them to the community. I do hope they help someone. Kudos to the orginal author! someone on sapfans.com

1. Create a number range for SAP Archive Link :
IMG>Basis Components>Basis Services>SAP Archive Link>Basic Settings>Maintain number ranges.
Tcode: OANR
 Create range 01 from 0000000001 to 9999999999 without the external number flag.

2. Document type HRICOLFOTO must exist with document class JPG.
IMG>Basis Components>Basis Services>SAP Archive Link>System Settings>Maintain document types.
Table: TOAVE
Tcode: OAC2

3. Document type HRICOLFOTO must be linked to object type PREL and IT0002.
IMG>Personnel Management>Personnel Administration>Tools>Optical Archiving>Set up Optical Archiving in HR.
View: V_T585O,
 In all three columns there are minuses, don't put a flag in the check box.

4. Check which content repository (Archive) is linked to document type HRICOLFOTO and object type PREL.
IMG>Basis Components>Basis Services>SAP Archive Link>Basic Settings>Maintain Links.
Table: TOAOM_C,
Tcode: OAC3

5. Create this content repository with storage type FILE archive.
IMG>Basis Components>Basis Services>SAP Archive Link>Basic Settings>Maintain content repositories.
Tcode: OAC0

Storage type FILE archive can be attained by clicking on the field Storage type and clicking somewhere else in the screen with the right mouse button. Choose Possible entries and only then you get a list of all values. FILE Archive is entry number 08. Choose Version no. 0031 and Archive path something (e.g. C(smile) .

6. Link photo to personnel number.
Menu>Tools>Business Documents>Miscellaneous>Stored Documents.
Tcode: OAAD

Click on the Create button. Business object PREL and Docyment type HRICOLFOTO. Click on create (fill in the right personnel number in the pop up and click Continue). Choose the photo (as a JPG file) from the place where it is saved (e.g. hard disk). SAP will notify that the Stored Document was created succesfully. Photo is visible via PA10, PA20, PA30, PA40. Double-click to magnify photo.

To delete archived document :
Tcode: OAAD
 
click Find. In docyment type field select HRICOLFOTO and after execute you get a list of all documents. Select appropriate document and click on delete icon.

4.7 Version
 1).Use SICF Tcode: that displays lot of services. Under sap --> bc there is a service called content server interface. Activate this service.

2).Now Create the A2 repository with Tcode: OAC0.

3).While creating the repository, keep the Document Area blank, Storage type as R/3 database, Rep. Sub-type will appear as Normal by default, Version No. as 0046 and in Contents table put 'SDOKCONT1' as the table name.

4).Now upload the picture using Tcode: OAAD
 

To Upload in Mass:

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.
 

3 Comments

  1. Former Member

    No matter what I do, I can't get the document type FILE to appear in transaction OAC0.  We are on version 4.6c

  2. Unknown User (mcsiife)

    Mass upload program ZHR_BDC_UPLOADPIC requires input every file path for photos in dialog window.

    I have improved this process:

    1. Made a copy of program OANEWCON (program in transaction OAOH)  *ZOANEWCON* (hung on new transaction ZOAOH)

    inserted two lines  allow to pass a path as a parameter to this program:

    PROGRAM ZOANEWCO MESSAGE-ID OA.

    TABLES: TOAV0, TOAOM, TWFDB, TOAPA.
    DATA: KEY LIKE OJINT-KEY.
    DATA: OBJECT LIKE OJINT-NAME.
    DATA: OBJECT_ID LIKE TOAV0-OBJECT_ID.
    DATA: ARCHIV_ID LIKE TOAV0-ARCHIV_ID.
    DATA: ARC_DOC_ID LIKE TOAV0-ARC_DOC_ID.
    DATA: ABLAGEDATUM LIKE SAPB-SAPABLDATE.
    DATA: AR_DATE LIKE TOAV0-AR_DATE.
    DATA: DEL_DATE LIKE TOAV0-DEL_DATE.
    DATA: SAP_OBJECT LIKE TOAOM-SAP_OBJECT.
    DATA: AR_OBJECT LIKE TOAOM-AR_OBJECT.
    DATA: EXPIRY_TIM LIKE TOAOM-EXPIRY_TIM.

    DATA: METHOD LIKE OJINT-METHOD.
    DATA: RETURN LIKE OJINT-RETURN.
    DATA: PARAMETER LIKE OJINT-PARAMETER.

    DATA: BEGIN OF I_TOAV0 OCCURS 1.
            INCLUDE STRUCTURE TOAV0.
    DATA: END OF I_TOAV0.
    DATA: BEGIN OF I_TOAOM OCCURS 1.
            INCLUDE STRUCTURE TOAOM.
    DATA: END OF I_TOAOM.
    DATA: BEGIN OF FIELDS OCCURS 1.
            INCLUDE STRUCTURE OJFIELDS.
    DATA: END OF FIELDS.
    DATA: OK_CODE(4)         TYPE C,
          OK_CODE_SAVE(4)    TYPE C.

    DATA: CREATE(2) VALUE '01'.
    DATA: infile(70).
    *---------------------------------------------------------------------*
    *       MODULE INIT0100 OUTPUT                                        *
    *---------------------------------------------------------------------*
    *       ........                                                      *
    *---------------------------------------------------------------------*
    MODULE INIT0100 OUTPUT.
      SET TITLEBAR '000'.
      CLEAR: OBJECT, AR_OBJECT.
      SET PF-STATUS 'POPU100'.
    ENDMODULE.

    *---------------------------------------------------------------------*
    *       MODULE EXIT_BEARBEITEN INPUT                                  *
    *---------------------------------------------------------------------*
    *       ........                                                      *
    *---------------------------------------------------------------------*
    MODULE EXIT_BEARBEITEN INPUT.
      OK_CODE_SAVE = OK_CODE.
      CLEAR OK_CODE.
      CASE OK_CODE_SAVE.
        WHEN 'ESC'.
          SET SCREEN 0.
          LEAVE SCREEN.
        WHEN 'BACK'.
          SET SCREEN 0.
          LEAVE SCREEN.
        WHEN 'CANC'.
          SET SCREEN 0.
          LEAVE SCREEN.
      ENDCASE.
    ENDMODULE.

    *---------------------------------------------------------------------*
    *       MODULE READ0100 INPUT                                         *
    *---------------------------------------------------------------------*
    *       ........                                                      *
    *---------------------------------------------------------------------*
    MODULE READ0100 INPUT.
      OK_CODE_SAVE = OK_CODE.
      CLEAR OK_CODE.
      CLEAR KEY.
      CASE OK_CODE_SAVE.
        WHEN 'NEW'.
          OBJECT = TOAOM-SAP_OBJECT.
          AR_OBJECT = TOAOM-AR_OBJECT.
          SELECT * FROM TOAOM WHERE AR_OBJECT = AR_OBJECT
          AND SAP_OBJECT = OBJECT.
          ENDSELECT.
          IF SY-SUBRC <> 0.
            MESSAGE W251 WITH AR_OBJECT OBJECT.
            "MESSAGE: NO NCI-DOCTYPE with this Objecttyp
          ELSE.
    * Corr. 3.0. Begin

    * Authority check with Archive id

            ARCHIV_ID = TOAOM-ARCHIV_ID.

            PERFORM AUTHORITY_CHECK_CREATE(OAALL)
               USING ARCHIV_ID OBJECT SPACE AR_OBJECT SPACE
               CHANGING SY-SUBRC.
            IF SY-SUBRC NE 0.
              MESSAGE ID SY-MSGID TYPE 'E' NUMBER SY-MSGNO
                      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ELSE.
    * Corr. 3.0 End.

    *** Change 5.0 for BOR Objecttypes with GUID vok
    *          METHOD = 'EDIT'.
    *     Eingabe der Object_Id
    *          CALL FUNCTION 'OJ_KEY_FIELDS'
    *               EXPORTING
    *                    KEY                  = KEY
    *                    METHOD               = METHOD
    *                    OBJECT               = OBJECT
    *                    TITLE_DIALOG         = TEXT-001
    *               IMPORTING
    *                    KEY                  = KEY
    *               TABLES
    *                    FIELDS               = FIELDS
    *               EXCEPTIONS
    *                    EXC_OBJECT_NOT_FOUND = 01.

              CALL FUNCTION 'ARCHIV_POPUP_OBJECT_KEY'
                  EXPORTING
    *             DISPLAY               = ' '
                    OBJTYPE               = OBJECT
                    TITLE                 = TEXT-001
    *             OBJKEY                = ' '
    *             LASTTYPE              = ' '
    *             LASTKEY               = ' '
                    CHECKEXISTENCE        = 'X'
    *             GENERIC               = ' '
    *             EDIT                  = ' '
                 IMPORTING
    *             CHANGED               =
    *             RETURN                =
                    OBJKEY                = KEY
    *             USE_LAST              =
                  EXCEPTIONS
                    ERROR_PARAMETER       = 1
                    USER_CANCEL           = 2
                    OTHERS                = 3
                          .
    *** End of change 5.0 for BOR Objecttypes with GUID vok

              IF SY-SUBRC <> 0.
                MESSAGE ID SY-MSGID TYPE 'W'      NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                CLEAR TOAV0.
              ELSE.
                TOAV0-OBJECT_ID = KEY.
                IF KEY EQ SPACE.
                  MESSAGE W252.
                  CLEAR TOAV0.
    *      'Kein SAP-Beleg vorhanden.'.
                ELSE." create archiveobject versus dialog
                  PERFORM CREATE_ARCHIVE_OBJECT.
                ENDIF.
              ENDIF.
            ENDIF.
          ENDIF.
      ENDCASE.
    ENDMODULE.
    *---------------------------------------------------------------------*
    *       FORM CREATE_ARCHIVE_OBJECT                                    *
    *---------------------------------------------------------------------*
    *       ........                                                      *
    *---------------------------------------------------------------------*
    FORM CREATE_ARCHIVE_OBJECT.            "Create an archiveobject
      CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'
           EXPORTING
                AR_OBJECT                = TOAOM-AR_OBJECT
                OBJECT_ID                = TOAV0-OBJECT_ID
                SAP_OBJECT               = TOAOM-SAP_OBJECT
                FILE                          = infile
           IMPORTING
                ARCHIV                   = TOAV0-ARCHIV_ID
                ARCHIV_DOC_ID            = TOAV0-ARC_DOC_ID
                DOCUMENTCLASS            = TOAOM-DOC_TYPE
           EXCEPTIONS
                ERROR_ARCHIV             = 01
                ERROR_COMMUNICATIONTABLE = 02
                ERROR_CONNECTIONTABLE    = 03
                ERROR_KERNEL             = 04
                ERROR_PARAMETER          = 05
                ERROR_SCANQUEUE          = 06
                others                   = 7.

      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE 'W'      NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        CLEAR TOAV0.
      ELSE.
        MOVE TOAOM-DOC_TYPE TO TOAV0-RESERVE.
        TOAV0-SAP_OBJECT = TOAOM-SAP_OBJECT.
        TOAV0-AR_OBJECT = TOAOM-AR_OBJECT.
        COMMIT WORK.
        MESSAGE I044.
      ENDIF.
    ENDFORM.


    2. in program ZHR_BDC_UPLOADPIC calling transaction ZOAOH
    added parameters for data file, for a photo ID in archive, and add date of a photo into the data file

    e.g.: 0000000527.09.2004C:\Photos\5.jpg

    REPORT ZHR_BDC_UPLOADPIC NO STANDARD PAGE HEADING LINE-SIZE 255.

    DATA : BEGIN OF IT_DATA OCCURS 0,
             PERNR(8), " LIKE RP50G-PERNR,
             DATUM(10), "date of the photo
             FILENAME(128),
           END OF IT_DATA.
    DATA:  T1(80),
                 file_path(132).

    SELECTION-SCREEN: BEGIN OF BLOCK sp WITH FRAME TITLE text-f01
      NO INTERVALS.
      SELECTION-SCREEN BEGIN OF LINE.
        SELECTION-SCREEN COMMENT 5(4) A1 .
      SELECTION-SCREEN   END OF LINE.
    SELECTION-SCREEN: END   OF BLOCK sp.

       INCLUDE BDCRECX1.

    SELECTION-SCREEN SKIP 2.

    SELECTION-SCREEN: BEGIN OF BLOCK vst WITH FRAME TITLE text-f02.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(25) TEXT-S11 FOR FIELD IDOBJ.
      selection-screen position 45.
      PARAMETERS POPFILE(128)  VISIBLE LENGTH 50
        DEFAULT 'C:\PICTURE.TXT'.  "input data file
    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(25) TEXT-S12 FOR FIELD IDOBJ.
      selection-screen position 45.
      PARAMETERS IDOBJ(2) DEFAULT '01'.  "id object
    SELECTION-SCREEN END OF LINE.

    SELECTION-SCREEN: END   OF BLOCK vst.

    at selection-screen on value-request for POPFILE.

      call function 'F4_FILENAME'
             exporting
                 field_name = file_path
             importing
                 file_name = POPFILE.
    *        exception
    *             others    = 1.

    START-OF-SELECTION.

      PERFORM OPEN_GROUP.
      CALL FUNCTION 'WS_UPLOAD'
        EXPORTING
          FILENAME = POPFILE
          FILETYPE = 'ASC'
        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 : / 'No to able read input file'.
        STOP.
      ELSE.
        WRITE : / 'Data processing ...'.
        T1 = 'Data processing ...'.
        MESSAGE T1 Type 'S'.
      ENDIF.

      LOOP AT IT_DATA.
        PERFORM BDC_DYNPRO USING  'ZOANEWCON'         '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_FIELD  USING  'INFILE'           IT_DATA-FILENAME."JPG

        PERFORM BDC_DYNPRO USING  'SAPLOA12'         '0200'.
        PERFORM BDC_FIELD  USING  'BDC_CURSOR'       'OBJID-VALUE(03)'.
        PERFORM BDC_FIELD  USING  'BDC_OKCODE'       '=OK'.
        PERFORM BDC_FIELD  USING  'OBJID-VALUE(01)'  IT_DATA-PERNR.
        PERFORM BDC_FIELD  USING  'OBJID-VALUE(02)'  '0002'.
        PERFORM BDC_FIELD  USING  'OBJID-VALUE(04)'  IDOBJ.
        PERFORM BDC_FIELD  USING  'OBJID-VALUE(05)'  IT_DATA-DATUM.

        PERFORM BDC_TRANSACTION USING 'ZOAOH'.
        clear IT_DATA-FILENAME.
      ENDLOOP.
      PERFORM CLOSE_GROUP.

  3. Unknown User (quyxue4)

    How can I upload a JPG file into a separate server (not R/3) and view it through PA30?

    Regards