ARCHIV_CREATE_DIALOG_META

hi !!
when i use the function ' ARCHIV_CREATE_DIALOG_META' in online mode its ok,
but in batch mode i get the EXCEPTION : error_archiv = 1.
what can be the reason ?
CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'
EXPORTING
ARCHIV_ID = 'Z1'
ar_object = ez-ar_object
DEL_DATE = ''
NOTE = ' '
object_id = ez-object_id
sap_object = ez-sap_object
file = ez-file
COMMIT_FLAG = 'X'
IMPORTING
archiv_doc_id = l_docid
ARCHIV =
ARCHIV_DOC_ID =
DOCUMENTCLASS =
TABLES
OUTDOCTAB =
CHANGING
INFILETAB =
EXCEPTIONS
error_archiv = 1
error_communicationtable = 2
error_connectiontable = 3
error_kernel = 4
error_parameter = 5
error_scanqueue = 6
canceled_by_user = 7
OTHERS = 8.

hi !!
when i use the function ' ARCHIV_CREATE_DIALOG_META' in online mode its ok,
but in batch mode i get the EXCEPTION : error_archiv = 1.
what can be the reason ?
CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'
EXPORTING
ARCHIV_ID = 'Z1'
ar_object = ez-ar_object
DEL_DATE = ''
NOTE = ' '
object_id = ez-object_id
sap_object = ez-sap_object
file = ez-file
COMMIT_FLAG = 'X'
IMPORTING
archiv_doc_id = l_docid
ARCHIV =
ARCHIV_DOC_ID =
DOCUMENTCLASS =
TABLES
OUTDOCTAB =
CHANGING
INFILETAB =
EXCEPTIONS
error_archiv = 1
error_communicationtable = 2
error_connectiontable = 3
error_kernel = 4
error_parameter = 5
error_scanqueue = 6
canceled_by_user = 7
OTHERS = 8.

Similar Messages

  • Function: ARCHIV_CREATE_DIALOG_META

    When this function is called, another dialog screen opens and wants the file name. I want to give file name as a paramter to function. And this function has a file parameter which's length is 70. But in dialog screen length is not 70. Why this is so?

    hi,
    here's an ex. to scan documents - i don't fill the par. file:
      CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'                  
           EXPORTING                                             
                archiv_id                = toaar-archiv_id       
                ar_object                = twfdb-ncitype         
    *         DEL_DATE                 = ' '                     
    *          NOTE                     = ' '                    
                object_id                = objid                 
                sap_object               = twfdb-object          
    *         FILE                     = ' '                     
    *         COMMIT_FLAG              = ' '                     
           IMPORTING                                             
                archiv                   =  archiv               
                archiv_doc_id            =  docid                
                documentclass            =  class                
           EXCEPTIONS                                            
                error_archiv             = 1                     
                error_communicationtable = 2                     
                error_connectiontable    = 3                     
                error_kernel             = 4                     
                error_parameter          = 5                     
                error_scanqueue          = 6                     
                OTHERS                   = 7.                   

  • ARCHIV_CREATE_DIALOG_META FM not working from apllication server?

    Hi everyone,
    So, earlier I upload photos from my desktop and it worked. But now I have to upload photos from application server, so but ARCHIV_CREATE_DIALOG_META didn't upload the JPG file.
    file = ' /server/Photos/HRDEV/picture.jpg' .
    CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'
           EXPORTING
             ar_object                      = ar_object
             object_id                      = object_id
             sap_object                     = sap_object
             file                           = file
           IMPORTING
             archiv                         = archiv
             archiv_doc_id                  = archiv_doc_id
             documentclass                  = documentclass
           EXCEPTIONS
             error_archiv                   = 1
             error_communicationtable       = 2
             error_connectiontable          = 3
             error_kernel                   = 4
             error_parameter                = 5
             error_scanqueue                = 6
             canceled_by_user               = 7.
    After that sy-subrc is 1. And data not uploaded into toahr.
    Do you have any idea?
    Really Thank you.
    Mark

    There is no ARC_DOC_ID parameter for this function module.  It turns out that the problem was the file path.  The Content repository settings for the basic path had been set in mixed case which caused problems.  The path needs to match the parameter passed.  I recommend entering everything in upper case or lower case and then be consistent with the parameters you pass .. at least on a Windows system .. UNIX like systems need to be case sensitive.  Now that I've got that straight I'm getting an exception: SAP.Connector.RfcAbapException: ERROR_ARCHIV.  In stepping through the debugger it looks like it doesn't recognize the host which is odd since I can view documents in the repository on that host.

  • Employee Photo upload

    Hi Experts,
    I need to upload the photographs of employee to SAP.
    All the config required for photo upload is done
    These photograph path details and Emp Id will be available in a flat file.
    As BDC approach using OAAD is not able to workout (picking of text file is via a Operating system screen so we can’t record it in BDC) so we used below approach.
    Using GUI_UPLOAD and ARCHIV_CREATE_DIALOG_META .
    The above approach works FINE for foreground and presentation server upload.
    Now the requirement is:
    I have 2 questions.
    1. It is not working for background processing.
    2. The photo has to be called from app server (images available on App. Server (UNIX)). is it possible to get JPEG file from app server without using GUI_UPLOAD?
    If it is possible do guide me.
    Regards,
    Rahul

    I thought I'd share this with everyone.   We figured out how to load pictures in batch processing using pictures stored on a unix server.   The code below is what we are using.    For now, I'm using a driver file from the local drive to determine which picture goes with which associate, but we plan to automate this by storing the pictures with the associate number in the name.   We'll then read the directory each night and load any new pictures.    I thought I'd share what we discovered for now so you can build what you need for your side. 
    REPORT ZHR_EMPLOYEE_PICTURES_UPLOAD
    NO STANDARD PAGE HEADING LINE-SIZE 255.
    Program Title: Program to mass load employee pictures into HR module
    INCLUDE
    PARAMETERS:
      P_INFILE   LIKE RLGRAP-FILENAME
                 DEFAULT 'c:\PICTURE.TXT',
      P_UNXDIR   LIKE RLGRAP-FILENAME
                 DEFAULT '/usr/sap/data/WINDOWS_DFS/'.
    I N T E R N A L   T A B L E S
    DATA : BEGIN OF INFILE_DATA OCCURS 0,
           IN_LINE(80)   type c,
           END OF INFILE_DATA.
    DATA : begin of inrec,
           raw(1024) type x,
           end of inrec.
    DATA : begin of itab occurs 0,
           raw(1024) type x,
           end of itab.
    Data: WS_FILENAME   TYPE STRING,
          WS_OBJID      LIKE SAPB-SAPOBJID,
          WS_FILELENGTH TYPE I,
          WS_FLENGTH    LIKE SAPB-LENGTH.
    S T A R T - O F - S E L E C T I O N
    START-OF-SELECTION.
    Read input file that controls which picture goes with which associate.
      CALL FUNCTION 'WS_UPLOAD'
        EXPORTING
          FILENAME = P_INFILE
          FILETYPE = 'DAT'
        TABLES
          DATA_TAB = INFILE_DATA.
      IF SY-SUBRC NE 0.
        WRITE : / 'Unable to upload data'.
        STOP.
      ENDIF.
      LOOP AT INFILE_DATA.
      Determine file name and personnel ID from input file.
        concatenate P_UNXDIR INFILE_DATA-IN_lINE+9(71) into WS_FILENAME.
        WS_OBJID    = INFILE_DATA-IN_LINE+0(8).
      Clear table holding picture data.
        clear ITAB.
        refresh ITAB.
      Reset overall file length variable.
        ws_flength = 0.
      Open dataset to read in binary mode.
        open dataset WS_FILENAME for input in binary mode.
        do.
        Read file one record at a time in binary mode.
          clear inrec.
          read dataset WS_FILENAME into inrec
               maximum length 1024
               actual length ws_filelength.
        Determine accumulated file length as each record read in.
          ws_flength = ws_flength + ws_filelength.
        Last record of file will cause sy-subrc to not be 0 and will be
        less in length than record size.
          if ws_flength > 0.
            move inrec to itab.
            append itab.
          endif.
        end loop at end of file.
          if sy-subrc ne 0.
            exit.                    "end of file must have been reached
          endif.
        enddo.
        close dataset WS_FILENAME.
      Add picture file to content server for specific associate.
        CALL FUNCTION 'ARCHIV_CREATE_TABLE'
          EXPORTING
            ar_object       = 'HRICOLFOTO'
            object_id       = WS_OBJID
            sap_object      = 'PREL'
            flength         = WS_FLENGTH
          TABLES
            binarchivobject = ITAB.
        IF SY-SUBRC = 0.
          WRITE : / WS_OBJID+0(8), ' -- picture loaded: ', WS_FILENAME,
                                   ' -- length: ', WS_FLENGTH.
        else.
          WRITE : / WS_OBJID+0(8), ' -- Unable to load pic: ', WS_FILENAME,
                                   ' -- length: ', WS_FLENGTH.
        ENDIF.
        clear INFILE_DATA-IN_LINE.
      ENDLOOP.

  • Batch uploading of employee photo using T-code OAAD

    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

    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.

  • Massupload of Employee image

    Hi Guys,
                 I am able to upload employee images for single employee using 'OOAH'  and  'OOAD'  . My requirement is mass upload of images. I am unable to record shdb as these transaction contain browse option , i tried using "ARCHIV_CREATE_DIALOG_META "
    Import parameters               Value
    ARCHIV_ID                       A2
    AR_OBJECT                     HRICOLFOTO
    DEL_DATE
    NOTE
    OBJECT_ID                       102
    SAP_OBJECT                    PREL
    FILE                                   C:\11.JPG
    COMMIT_FLAG
                       ARC_DOC_ID                                                            CO                                                                DOC_CLASS
    DF7AA9E6FB1300F1A5D100215E270DFE                           A2                                                                               JPG
    But i am unable to see the picture , can you please suggest me bdc upload program or any changes if i have give to this function module .
    Thanks in advance .

    Try this.
    REPORT zhriphoto NO STANDARD PAGE HEADING LINE-SIZE 255
      MESSAGE-ID zdev .
    *I N T E R N A L T A B L E S
    DATA : BEGIN OF gt_photo OCCURS 0,
            pernr(8),
         END OF gt_photo.
    DATA: g_path LIKE draw-filep,
          g_sapobjid LIKE sapb-sapobjid,
          g_filename TYPE string,
          g_sappfad LIKE sapb-sappfad.
    PARAMETERS: p_file  LIKE rlgrap-filename OBLIGATORY.  " Document route
    *&  Initialization
    INITIALIZATION.
    CONCATENATE sy-uname sy-datum+4(4) INTO group.
                         START-OF-SELECTION
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR  p_file.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING  " DEF_FILENAME = ' '
          def_path         = 'C:\'
          mask             = ',Text Files,.txt;.prn,All Files,..'
          mode             = 'O'
          title            = 'Chose File'(100)
        IMPORTING
          filename         = p_file
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      IF sy-subrc <> 0 AND sy-subrc <> 3.
        MESSAGE e102(zdev) WITH 'Error Selecting File'(007).
      ENDIF.
                         START-OF-SELECTION
    START-OF-SELECTION.
      g_path = p_file.
      CALL FUNCTION 'CV120_SPLIT_PATH'
        EXPORTING
          pf_path  = g_path
        IMPORTING
          pfx_path = g_path.
      g_filename = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = g_filename
         FILETYPE                = 'ASC'
         has_field_separator     = 'X'
         dat_mode                = 'X'
        TABLES
          data_tab                = gt_photo
        EXCEPTIONS
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          OTHERS                  = 17.
      IF sy-subrc <> 0.
        MESSAGE s306 .
      ENDIF.
      LOOP AT gt_photo.
        CONCATENATE g_path gt_photo-pernr  '.JPG'  INTO g_sappfad.
        CONCATENATE gt_photo-pernr '0002' INTO g_sapobjid.
        CALL FUNCTION 'ARCHIV_CREATE_FILE'
          EXPORTING
            ar_object               = 'HRICOLFOTO'
            object_id               = g_sapobjid
            sap_object              = 'PREL'
            doc_type                = 'JPG'
            path                    = g_sappfad
          EXCEPTIONS
            error_conectiontable    = 1
            error_parameter         = 2
            error_archiv            = 3
            error_upload            = 4
            error_kernel            = 5
            no_entry_possible       = 6
            error_comunicationtable = 7
            OTHERS                  = 8.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ENDIF.
        CLEAR g_filename.
      ENDLOOP.
                         END-OF-SELECTION
    END-OF-SELECTION.
      WRITE / 'Done succesful!'.

  • Photo upload in infotype 2, or infotype header

    Can anyone tell me in detail how to upload photo of employee in infotype header and what all needs to be done in terms of basis also , archieve link or something.  I know oAAD but how does that linkage happen.

    Solution in https://wiki.sdn.sap.com/wiki/display/ERPHCM/Add%20Employee%20Photo%20on%20Infotype%200002?showChildren=false is very good.
    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.}

  • How to link bor object to Archive object

    I would like to convert normal file to Archive file using ARCHIV_CREATE_DIALOG_META it is giving
    error there is no link  between bor object and Archive object .

    Based on your other questions I assume you mean either in the workflow or in a method. First of all you should read the FAQ and the guidelines for the forums.
    Converting the object from a subtype to its parent type in a method is achievable by using some of the macros. You can even make a generic solution for this (e.g. a function module).
    Use SWC_GET_OBJECT_KEY to get the object key.
    The attribute OjectType of your object is itself an object. It has an attribute Parent which references another object. The key of this object is the name of the object type.
    Thus you have everything you need to create a new object reference with a type that is the parent object type of your current object; you have the key (which must be identical as this is a subtype) and the object type.

  • Upload image using webdynpro abap

    Gudday,
    I have a requirement to provide three functionalities like
    1)browse 2)upload 3)review the image using webdynpro ABAP.
    I tried with functionn module 'ARCHIV_CREATE_DIALOG_META'  which uploads images..but if i try to use the samething using service call in webdynpro ..it is throwing a dump..saying...'ARCHIV ID OF CLASS BASED NOT OCCURRED'
    Please suggest me how to proceed further ....its high priority....
    Awaiting your reply.
    Thanks,
    Deepthi.

    Hello Martina,
    Could you solve this problem?
    I need to upload documents in PA30 from Web Dynpro ABAP but the called funtions are not working. Could you please explain me how you resolved this?
    Thanks you very mutch!
    Regards
    Belé

  • Massive photo upload

    Hi Guys,
    I found CF 'ARCHIV_CREATE_DIALOG_META' is useful for massive photo upload.I tried tat,but getting an error(file_open_error)  eventhough valid file exists.
    And also,
    -What should be the name of  photo? i kept as (emp no).jpg ,
    - Do we need to give ARCHIV_ID? while debugging i found Z2 as archiv_id,but i didnt mention tat  in a call function.
    Please help in this regard.Points will ve rewarded.
    Have a look @ my code:
    *& Data Declaration                                                        *&
    DATA : BEGIN OF T_RECORD OCCURS 0,
           PERNR(12) TYPE C,            "Employee Number
           PATH      LIKE SAPB-SAPPFAD, "Photo Path
           END OF T_RECORD.
    DATA : w_pernr_zero LIKE t_record-pernr,
           w_pernr_pass TYPE SAPB-SAPOBJID.
    *& Selection screen                                                        *&
    SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME.
    SELECT-OPTIONS : PERNR FOR T_RECORD-PERNR,
                     PATH  FOR T_RECORD-PATH NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK A1.
    *& Start of selection                                                        *&
    START-OF-SELECTION.
    LOOP AT PERNR.
    T_RECORD-PERNR = PERNR+3(4).
    T_RECORD-PATH  = PATH+3(140).
    APPEND T_RECORD.
    ENDLOOP.
    LOOP AT t_record.
    "Since the employee photo is always stored in 0002 infotype,
    " - Concatenation of emp id with preceding zeros and pad "0002" in
    " - right into the pernr field which will be passed to object_id.
    SHIFT t_record-pernr LEFT DELETING LEADING '0'.
    CONDENSE t_record-pernr.
    CONCATENATE t_record-pernr '0002' INTO t_record-pernr.
    w_pernr_zero = t_record-pernr.
    CLEAR w_pernr_pass.
    w_pernr_pass = w_pernr_zero.
    CALL FUNCTION 'ARCHIV_CREATE_DIALOG_META'
    EXPORTING
    ar_object  = 'HRICOLFOTO'
    object_id  = w_pernr_pass
    sap_object = 'PREL'
    file = t_record-path.
    IF SY-SUBRC EQ 0.
    WRITE:/ 'SUCCESSFULLY ASSIGNED'.
    ELSE.
    WRITE :/ 'NO RECORDS HAVE BEEN ASSIGNED'.
    ENDIF.
    ENDLOOP.

    Hi,
    for uploading the photograph you need to do some customization.
    1. Initial customization
    Execute transaction code OAQ1 and put X in all the boxes.
    Execute t code OAB4 and schedule the job
    Execute t code SPAD and configure an output device
    Execute T code OANR and configure the number range
    Execute T code OAGI and deactivate Print list management system
    EXecute T code SA38 and execute program RAPARAM and check for rspo/archive_format and make sure it should have 2 assigned on it.
    2. Execute t code OAC0 and configure content repository
        Execute t code OAC2 and make your document type
        Assign JPG doc class to your doc type made in OAC2 in t code OAC3.
    3. Now go to transaction code OAD5 and configure your settings
       Come to t code OAWD and upload all your scanned photo to SAP
    I know the procedure is tedious and lenghthy but there is no way out.
    If it helps you then reward it.
    Enjoy
    For further help contact at [email protected]

  • Photo upload

    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

    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

  • Employee Photo Mass upload

    Hello,
    We are trying to upload Employee photos using FUnction Modulr ARCHIVE_CREATE_FILE
    it is working till we upgraded to patch level 55 after that it is giving Error_Archive
    What needs to be done
    Regards
    Chakravarthy Nalla

    Hi Nalla,
    Please try Function module ARCHIV_CREATE_DIALOG_META.
    Regards,
    Dilek

Maybe you are looking for

  • [SOLVED]Dota and TF2 don't work

    I'm trying to play Dota and TF2 on archlinux, but whenever I try to run either if them an error message pops up saying "Could not find required OpenGL entry point 'glColorMaskIndexedEXT'! Either your video card is unsupported, or your OpenGL driver n

  • Activation of Export LC's

    Friends, So far we are not using Export LC's in our company... LC Application, LC opening are totally handled out of SAP. Special GL Indicator u201CLu201D has been created as Advance LC, 100% LC either in advance along with PO. Till GR and IR happen

  • End user access - Files at the OS level

    Hi all, I am not sure how apt would it be to post this question in this thread. And I am also not aware of the SAP functionality that I am going to detail. With one of the interfaces, we get files dumped in the XI system. I am trying to give access t

  • Hyperion Position

    Liz Claiborne, Inc. an International, Fortune 500, $4.5+ Billion, Best in Industry, Wholesale/Retail, Fashion Apparel and Accessories Corporation with 35+ brands worldwide is seeking a Financial Systems & Reporting Analyst.SUMMARYWorking as a member

  • Download Trial version of Dreamweaver

    Hi There i am trying to Download a Trial version of Dreamweaver . But when i click on a link for Download trial,It doesn't work for me , it just show me new black window on my browser