2013 Oct 22 8:15 AM
Dear Gurus,
Hope you all are good. I have a requirement in which pictures of family members need to be displayed in transaction PA20 infotype 0021 (Family Member/Dependents). The users actually want that pics of each family member (spouse, children, mother, father) should be displayed in infotype 0021 in related family member section. Can anybody tell me how can this be done? is there any standard function available for this or do i need to require enhancements? let me know please.
Thanks in advance
Regards
Imran
2013 Oct 22 8:38 AM
I guess you will have to enhannce through PM01 to show pic.
But how are family members pics being stored in the system?
2013 Oct 24 11:50 AM
Dear hitesh,
I dont know yet how pics being stored in system. It is some where in repository. Can you tell how would you do it?
Regards
2013 Oct 24 1:23 PM
Hi Imran,
Picture might be stored in content server using the content repository,
Anyway you can display the family members picture only through enhancement.
And later you need to use the FM to pass the URL of the image, which needs to be displayed on the screen.
With regards,
SuDEESH
2013 Oct 24 3:51 PM
Hi Imran,
We need to do customization in this regard.
The below code is for uploading mass photos into SAP system.
The input will be in the form of excel sheet with SAP ArchiveLink: Object ID (object identifier) and SAP ArchiveLink file paths.The files need to be in JPG format alone.
Here is a sample code, to perform mass upload of the pictures in SAP system.
DATA: sapobjid LIKE sapb-sapobjid,
sappfad LIKE sapb-sappfad.DATA: gd_path TYPE string ,
filetab TYPE TABLE OF file_info WITH HEADER LINE,
count TYPE i.DATA: filename(40) TYPE c ,
fileext(10) TYPE c ,
len TYPE i .
PARAMETERS: filepath LIKE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filepath.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
window_title = 'File Directory'
initial_folder = 'C:\'
CHANGING
selected_folder = gd_path.
CALL METHOD cl_gui_cfw=>flush.
CONCATENATE gd_path '' INTO filepath.
START-OF-SELECTION.
gd_path = filepath .
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = gd_path
filter = '*.jpg'
CHANGING
file_table = filetab[]
count = count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
LOOP AT filetab.
SPLIT filetab-filename AT '.' INTO filename fileext.
len = STRLEN( filename ) .
IF len <> 8 .
MESSAGE e000(oo) WITH 'File name length must be equal to 8'.
ENDIF.
ENDLOOP.
LOOP AT filetab.
CONCATENATE gd_path '\' filetab-filename INTO sappfad.
CONCATENATE filetab-filename+0(8) '0002' INTO sapobjid.
CALL FUNCTION 'ARCHIV_CREATE_FILE'
EXPORTING
ar_object = 'HRICOLFOTO'
object_id = sapobjid
sap_object = 'PREL'
doc_type = 'JPG'
path = 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.
ELSE.
WRITE : / 'Upload ',sappfad,'To pernr ',filetab-filename+0(8),'Sccuess!'.
ENDIF.
ENDLOOP.
Hope this helps!
Reward points if found useful...
Regards,
Chandni