Application Development and Automation 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: 
Read only

Function Module That Creates URL with Picture

Former Member
0 Likes
1,064

Hi

I have looked at old threads but I'm not coming right.

Is there a function module that returns a url with a picture. Obviuosly we would like to say which picture to be loaded. So after executing the function module I would expect it to return a URL.

If I take the url and place it in a web browser I would like it to display.

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
899

Hi,

Pls try get the URL of the Image using FM HR_ESS_WHO_PROG_GET_PICT_URI .

OR use TCODE OOAD.

If nt clear , pls let me know ...

Thanks

Ravi

5 REPLIES 5
Read only

Former Member
0 Likes
900

Hi,

Pls try get the URL of the Image using FM HR_ESS_WHO_PROG_GET_PICT_URI .

OR use TCODE OOAD.

If nt clear , pls let me know ...

Thanks

Ravi

Read only

0 Likes
899

Hi

Can you give some more detail.

What are the import paramaters?? Do you have a sample program??

Does this program tie in with HR?? The pictures will be in a folder on a server.

Thanks in advance

Read only

0 Likes
899

Hi,

Exactly this FM is related to HR it is used to display the image of an employee.

U have to just pass the Pernr ( Personnal Number ) from table PA0001.

U SHALL get the image if it exits in the application server...

if not just load the pic using tcode se78.

if u want a normal image

or try out the following code



REPORT  YH_UPLOAD_EMPLOYEE_PHOTO.

tables: toav0, toaom, twfdb, toapa.

data:
      key        like ojint-key,
      object     like ojint-name,
      object_id  like toav0-object_id,
      archiv_id  like toav0-archiv_id,
      arc_doc_id like toav0-arc_doc_id,
      ablagedatum like sapb-sapabldate,
      ar_date    like toav0-ar_date,
      del_date   like toav0-del_date,
      sap_object like toaom-sap_object,
      ar_object  like toaom-ar_object,
      expiry_tim like toaom-expiry_tim,
      method     like ojint-method,
      return     like ojint-return,
      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: create(2) value '01'.

data: w_pernr_zero like sapb-sapobjid,
      w_pernr_pass like sapb-sapobjid,
      p_pernr like pa0001-pernr.

data: lw_ar_object like toaom-ar_object,
      lw_object_id like sapb-sapobjid,
      lw_sap_object like toaom-sap_object,
      lw_doc_type  like toadd-doc_type,
      lw_path       like sapb-sappfad.        "toav0-arc_doc_id

data: archiv_doc_id like toav0-arc_doc_id.
data : doc_type like toadt-doc_class.

types:
  begin of types_s_empphoto,
    path  type rlgrap-filename,
    pernr type rp50g-pernr,
  end of types_s_empphoto.

data:
  fs_emp type types_s_empphoto.

data:
  it_emp like standard table of fS_emp.

constants: c_sap_object type toaom-sap_object value 'PREL',
           c_ar_object  type toaom-ar_object  value 'HRICOLFOTO',
           c_doc_type  type toaom-doc_type  value 'JPG'.


CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                = 'C:\Documents and Settings\C5131542\Desktop\emp_image1.txt'
    HAS_FIELD_SEPARATOR     = 'X'
  TABLES
    DATA_TAB                = it_emp
  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.
* Implement suitable error handling here
ENDIF.


loop at it_emp into fs_emp.

  w_pernr_zero = fs_emp-pernr.
  clear w_pernr_pass.
  w_pernr_pass = w_pernr_zero.

  select single * from toaom
    where ar_object = c_ar_object
      and sap_object = c_sap_object.

  if sy-subrc eq 0.
    archiv_id = toaom-archiv_id.
    move fs_emp-path to lw_path.
  endif.

  CALL FUNCTION 'ARCHIV_CREATE_FILE'
    EXPORTING
      AR_OBJECT               = c_ar_object
      OBJECT_ID               = w_pernr_pass
      SAP_OBJECT              = c_sap_object
      DOC_TYPE                = c_doc_type
      PATH                    = lw_path
    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.

  commit work.

Hope i am clear...

Thanks

Ravi

Edited by: Ravi Aswani on Sep 11, 2009 11:20 AM

Read only

0 Likes
899

Hi

I need this to show pictures, teh pictures have nothing to do with HR.

I need this to show material pictures, parts, etc.

Can I use this for that also??

The program shows on my side as one big paragraph.....no gaps, very difficult to read. Is there a way to display it properly if I can use it for my purpose.

I would prefer to have all the pics on a folder on the server, then enter the pic I want and returns it like that.

Thanks in advance.

Read only

0 Likes
899

Hi

I have resolved this by using Knowledge Management functionality