Skip to Content
avatar image
Former Member

Finding Attached document URL

I'd like to find URL of attached document in CRM .

So I found the URL using the class cl_crm_documents=>get_with_url .

But URL Information had a problem.

For example,

this is the URL of attached document.

http://xxx/sap/bc/contentserver/300?get&pVersion=0046&

contRep=CRMORDER&

docId=40F9B6CE0CB4AF41BE10CE3CE0A30F70&

compId=%25EC%25A0%259C%25ED%2592%2588%25EA%25B2%2580%25EC%2588%2598.ppt&

accessMode=r&

authId=CN%3DRDV&

expiration=20100618103631&secKey=xxxxx

The problem is expiration .

When I executed class cl_crm_documents=>get_with_url , this expiration is updated with executed day.

If I obtained that URL , today I can't use .

Because expiration was passed.

Can I solve this problem ?

Is there another method that finding URL of attatched documents ?

Please, help me ^^;;

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 18, 2011 at 12:33 PM

    Has anybody found a solution to this?

    I have the problem that Word says that the URL is longer than 255 characters so I can't access it from a macro (even I don't care the expiration).

    Thanks.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 11, 2012 at 08:23 AM

    Ok i know this thread is older but i have / had the same problem.

    So there are two questions:

     

    1.) How to access a document via a url which validy is expired.

    2.) How to access a docmument via a url longer than 255 chars for macro porcessing.

    Solution to Question 1: You can simply regenerate a url with a new expiration date, this works fine with the folliwing coding:

    * Get URL

      cl_crm_documents=>get_with_url(

        exporting

          loio     = is_loio

          phio     = is_phio

          url_type = crmkw_url-standard

        importing

          url      = lv_uri

        exceptions

          no_io    = 1

          others   = 2

             ).

      if sy-subrc <> 0.

        return.

      endif.

    * Calculate expiration time

    lv_expiration = cl_abap_tstmp=>add( tstmp   = mv_now

                                                secs    = lv_exp_in_sec ).

    * Regenerate Link with new expiration time

    call function 'SCMS_URL_REGENERATE'

          exporting

            absolute_uri    = lv_uri

            expiration      = lv_expiration

          importing

            http_uri        = lv_uri_http

            https_uri       = lv_uri_https

          exceptions

            error_parameter = 1

            others          = 2.

    Question 2:

    I am facing the same problem at the moment but i have no solution....

    I want to access a document for an excel macro processing by:

    * open existing file
       call method of lr_excel 'Workbooks' = lr_workbooks.
       call method of lr_workbooks 'OPEN'
         exporting
           #1 = lv_uri_http.

    But I am not able to open this document. If I copy the URL to the browser it works fine and I can access the document. I guess the problem is that the URL is longer than 255 chars. Did you found any solution for this problem yet? or a alternative way acccessing documents in the kw for a macro processing?

    Thanks a lot!

    Reagrds

    Marc

    Add comment
    10|10000 characters needed characters exceeded