Skip to Content
author's profile photo Former Member
Former Member

How to retrieve attachment file

I am trying to create a program that will retrieve an Attachment that a candidate has uploaded into the eRecruitment system. Infotype HRP5134 has a pointer to the attachment, but where is the attachment stored? Is there a method, function module or BAPI that can retrieve the attachment?

I want to retrieve the file and get the size of the file.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 19, 2007 at 12:02 PM

    Hi,

    Check the FM

    "BAPI_ERC_READ_ATTACHMENTS"

    and "HRRCF_MDL_CAND_ATT_RETRIEVE"

    Hope this may help you.

    Regards,

    Subbu.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Subbu,

      It is not stored in Archive. I got the solution. I just want to share with u. Actually i wanted the size of the documents. I came out with the solution in 2 steps.

      1 step. : I retreived all the attached document through function module HRRCF_MDL_CAND_ATT_RETRIEVE (suggested by u).

      2 step : i took the URL and used the function module SCMS_HTTP_GET_WITH_URL. this gave me the size of the document in bytes. (thats what i wanted)

      Thank you very much for your efforts 😊

      Sample code for your knowledge

      v_obj-plvar = '01'.

      v_obj-otype = 'NA'.

      v_obj-objid = '50000020'.

      CALL FUNCTION 'HRRCF_MDL_CAND_ATT_RETRIEVE'

      EXPORTING

      cand_hrobject = v_obj

      langu = sy-langu

      • HTTPS =

      IMPORTING

      records = it_record

      messages = it_error .

      LOOP AT it_record INTO wa_record.

      CALL FUNCTION 'SCMS_HTTP_GET_WITH_URL'

      EXPORTING

      url = wa_record-attachment_url

      • BLANKSTOCRLF = ' '

      IMPORTING

      length = length

      contenttype = contenttype

      mimetype = mimetype

      charset = charset

      version = version

      TABLES

      data = data1

      EXCEPTIONS

      bad_request = 1

      unauthorized = 2

      not_found = 3

      conflict = 4

      internal_server_error = 5

      error_http = 6

      error_url = 7

      error_signature = 8

      OTHERS = 9

      .

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 04:39 AM

    Got the solution and the solution is replied in the thread

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.