cancel
Showing results for 
Search instead for 
Did you mean: 

HOW to Get the Folder path in crm webui

Former Member
0 Kudos

     i Have Scenario i want to get the download folder path, down load the file using browse. i am get the the file name using Tag.in .htm page

   <thtmlb:fileUpload id="fileUpload" onUpload="EXECUTE" uploadText="Execute" tooltip="Send file to server" enabled="TRUE" />

     in button i am writing the code for file path.

DATA : lr_file TYPE REF TO cl_thtmlb_fileupload,

        lv_xstring type string.

        CHECK htmlb_event_ex IS BOUND.

   lr_file ?= htmlb_event_ex.

*  lv_xstring = lr_file->FILE_NAME.


from this code i am getting only File Name:  'Text5.txt'





   But my scenario I want to get total file Path ex: 'c://---------------'  .

based on this file path i want to get backend FM.

Pls Let me tell how to get folder path in web ui.

Note: by using 'htmlb_event_ex' we didn't get the folder path

pls reslove this issue as soon as..........................

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello.

I have the same problem, but only in certain machines... Do you know why this happens?

Thank you.

navn_metts
Active Participant
0 Kudos

Hi Nagendra,

Please try below code once.

lv_id = 'fileUpload'.

TRY.
       lr_file ?= cl_htmlb_manager=>get_data(
             request = runtime->server->request
             name = 'thtmlb:fileUpload'
             id = lv_id ).
     CATCH cx_sy_ref_is_initial cx_sy_move_cast_error.
       RETURN.
   ENDTRY.




In lr_file->file_name will contain the full path like below.


Br,

Navn

Former Member
0 Kudos

Hi  Naveen,

  Thanks For Responce,  i tried this code into my button code .

DATA : lr_file TYPE REF TO cl_thtmlb_fileupload,

        lv_xstring type string,

        lv_id type string.

        CHECK htmlb_event_ex IS BOUND.

*  lr_file ?= htmlb_event_ex.

**  lv_xstring = lr_file->FILE_NAME.

*  lv_filelength = lr_file->file_length.

lv_id = 'fileUpload'.

TRY.

        lr_file ?= cl_htmlb_manager=>get_data(

              request = runtime->server->request

              name = 'thtmlb:fileUpload'

              id = lv_id ).

      CATCH cx_sy_ref_is_initial cx_sy_move_cast_error.

        RETURN.

    ENDTRY.

   lv_xstring = lr_file->FILE_NAME.

But i didn't get File Name.

Can you please Expalain how write the code for getting path.

Former Member
0 Kudos

Hi Naveen

I wrote the code for file upload as below.

<thtmlb:fileUpload id="fileUpload" onUpload="EXECUTE" uploadText="Execute" tooltip="Send file to server" enabled="TRUE" />

Can please help me how to resolve this

navn_metts
Active Participant
0 Kudos

Hi Nagendra,

can you tell me what are the steps you followed here.

Have you created a Zclass for "IF_HTTP_EXTENSION" interface?

and are you getting any reference in " runtime->server->request" ?

Kindly let me know.

Br,

Navn

Former Member
0 Kudos

Hi naveen

   I am Not Created any Zclass.

jst i am written the code in .htm page

    <thtmlb:fileUpload id="fileUpload" onUpload="EXECUTE" uploadText="Execute"tooltip="Send file to server" enabled="TRUE" />

And inside button evnt

DATA : lr_file TYPE REF TO cl_thtmlb_fileupload,

        lv_xstring type string,

        lv_id type string.

        CHECK htmlb_event_ex IS BOUND.

*  lr_file ?= htmlb_event_ex.

**  lv_xstring = lr_file->FILE_NAME.

*  lv_filelength = lr_file->file_length.

lv_id = 'fileUpload'.

TRY.

        lr_file ?= cl_htmlb_manager=>get_data(

              request = runtime->server->request

              name = 'thtmlb:fileUpload'

              id = lv_id ).

      CATCH cx_sy_ref_is_initial cx_sy_move_cast_error.

        RETURN.

    ENDTRY.

   lv_xstring = lr_file->FILE_NAME.


regards

Nagendra.

navn_metts
Active Participant
0 Kudos

Hello Nagendra,

Can you do this correction and try.

  lr_file ?= cl_htmlb_manager=>get_data(

              request = runtime->server->request

              name = 'fileUpload'

              id = lv_id ).



Br,

Navn

Former Member
0 Kudos

Hi Naveen,

   I tried this code

lv_id = 'fileUpload'.

TRY.

        lr_file ?= cl_htmlb_manager=>get_data(

              request = runtime->server->request

              name = 'fileUpload'

              id = lv_id ).

      CATCH cx_sy_ref_is_initial cx_sy_move_cast_error.

        RETURN.

    ENDTRY.

It's not Working.

If you dnt mind can you give your mail id.

Regards

Nagendra.