Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Family members pictures in PA20

Former Member
0 Kudos
322

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

4 REPLIES 4

Former Member
0 Kudos
224

I guess you will have to enhannce through PM01 to show pic.

But how are family members pics being stored in the system?

0 Kudos
224

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

0 Kudos
224

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

Former Member
0 Kudos
224

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