Skip to Content

Unable to call URL due to space in url parameters

Guys,

I need you all ideas on this.

I need to pass file name( generally file name contains spaces, right? ) as parameter in One URL.

I am calling URL using external window concept, but while calling it is throwing error , and it says fata error script ..... it means url contains spaces....

URL is

http://xxxxxxxxxxxxxxxxxxxxx/sap/bc/gui/sap/its/webgui?~transaction=*ZPMS_UPLOAD%20P_DOCID=LV_AP_DOC';P_FNAME=LV_FILE_NAME

here lv_file_name is string contains file name say for ex:C:\Users\srinivassana\Documents and Settings.................

So while calling URL it is throwing error due to space in file name.

Thanks and Regards

Srinvias

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Aug 08, 2012 at 10:56 AM

    No only the blanks but also the backslashes must be URL encoded.

    blank = %20

    \ = %5C

    C:\Users\srinivassana\Documents and Settings\test.txt

    C%3A%5CUsers%5Csrinivassana%5CDocuments%20and%20Settings%5Ctest.txt

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 06, 2012 at 06:04 AM

    I think when we open any URL in which parameters are separated by space, the browser replaces each space with a specific character string. Something like %20. Just try executing the URL on your own, find this string and in your application replace spaces in file name with this string.

    Hope this works.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 06, 2012 at 06:15 PM

    When ever you are passing any URl take care that if there is any space then insert %20 in that space and then it would work.

    Thanks

    Phani

    Add comment
    10|10000 characters needed characters exceeded