on 06-18-2010 8:23 AM
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 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
I read your answer to the article "mass upload of employee image".
In a similar coding I receive the error
"E X C E P T I O N E R R O R _ C O N E C T I O N T A B L E R A I S E D"
Could you tell me more about this error? I like to find out, what is the problem. In your coding...
error_comunicationtable = 7
...is defined. So when this sy_subrc is taking place?
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.