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: 

Problems while retrieving from content repository

Former Member
0 Kudos

Hi,

I am facing problems while retrieving documents stored the content repository. I have some pdf files as well as text documents stored in the content repository. I need to get retrieve the contents of the text files. My problem lies with how to retrieve the data from the files.

I have used SCMS_URL_GENERATE, followed by the FM ''HTTP_GET''. Though I do get the File id , my problem is how to proceed from this point. Should i wriite an RFC ?

Thanks and Regards,

Anie

4 REPLIES 4

Former Member
0 Kudos

Hi Anie,

I use SCMS_URL_GENERATE and then SCMS_HTTP_GET.

Result is in data parameter (TABLES section).

Regards,

--

Przemysław

0 Kudos

Hi Przemysław ,

Thanks for your reply. However, i still face some issues regarding data retrieval. I have used 'SCMS_HTTP_GET', but sy-subrc value is 3, despite the fact that the file is present in the content repository. Any reason why? Could you give me the snippet of the code you used?

Thanks and Regards,

Anie

Edited by: anierenie on Feb 7, 2012 5:23 AM

0 Kudos

Hi,

I checked the code one again - SCMS_URL_GENERATE is used to send url to the user (to open file in web browser).

SCMS_HTTP_GET code looks like this:



CONCATENATE <ls>-vbeln space <ls>-optarcnr 
  INTO lv_vbeln_obj 
  RESPECTING BLANKS.

SELECT SINGLE * 
  FROM toa01
  WHERE sap_object EQ 'VBRK'
    AND archiv_id EQ co_arch
    AND ar_object EQ 'SDOINVOICE'
    AND object_id EQ lv_vbeln_obj.

CALL FUNCTION 'SCMS_HTTP_GET'
  EXPORTING
    crep_id   = co_arch
    doc_id    = toa01-arc_doc_id
    comp_id   = 'data'
    length    = 0
    no_cache  = no_cache
  IMPORTING
    length    = comp-size
    mimetype  = comp-type
  TABLES
    data      = comp-bin
  EXCEPTIONS
    not_found = 1
    OTHERS    = 2.
  IF sy-subrc IS NOT INITIAL.
    PERFORM log_create USING <ls>-vbeln.
  ENDIF.
  
IF comp-bin IS NOT INITIAL.
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      bin_filesize = comp-size
      filename     = dstpc
      filetype     = 'BIN'
    TABLES
      data_tab     = comp-bin
    EXCEPTIONS
      OTHERS       = 1.
  IF sy-subrc IS NOT INITIAL.
    PERFORM log_create USING <ls>-vbeln.
  ELSE.
    MESSAGE s000(38) WITH 'Success'.
  ENDIF.
ENDIF.

Regards,

--

Przemysław

0 Kudos

Hi Przemysław,

Thanks for the answer. I resolved the issue.

Thanks and Regards,

Anie