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.








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).


    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



          loio     = is_loio

          phio     = is_phio

          url_type = crmkw_url-standard


          url      = lv_uri


          no_io    = 1

          others   = 2


      if sy-subrc <> 0.



    * 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'


            absolute_uri    = lv_uri

            expiration      = lv_expiration


            http_uri        = lv_uri_http

            https_uri       = lv_uri_https


            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'
           #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!



    Add comment
    10|10000 characters needed characters exceeded