cancel
Showing results for 
Search instead for 
Did you mean: 

uploading any file from desktop to app server

Former Member
0 Kudos

hi

how to upload any file (.txt,.doc,.xls,.pdf etc.) from desktop to application server without validating and without bringing into internal table ,in webdynpro abap .

your afforts will be appriciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member199126
Participant
0 Kudos

It cannot be done. What ever file u upload, It is first filled in the internal table and then processed further.Morever i recommend validating is a good practice. May i know the requirement that why u want to do like that ?

Former Member
0 Kudos

I want to upload any sort of file which may contains logo also .these files i need to upload to application server.

Former Member
0 Kudos

you may want to try transactions CG3Z and CG3Y.

Former Member
0 Kudos

Hi,

Use file upload UI element to upload the file from desktop to webdynpro, and then read the file content(XSTRING format) from the attribute binded to FILE UPLOAD UI element and write below logic to transfer the content to Application server.

CONSTANTS path_name TYPE localfile VALUE '/usr/sap/tmp/'.

DATA lo_nd_upload TYPE REF TO if_wd_context_node.
DATA lo_el_upload TYPE REF TO if_wd_context_element.
DATA ls_upload TYPE wd_this->element_upload.
*
**   navigate from <CONTEXT> to <UPLOAD> via lead selection
*  lo_nd_upload = wd_context->get_child_node( name = wd_this->wdctx_upload ).
*
*  lo_el_upload = lo_nd_upload->get_element( ).
**   get all declared attributes
*  lo_el_upload->get_static_attributes(
*    IMPORTING
*      static_attributes = ls_upload ).

CONCATENATE path_name ls_upload-file_name into file.

OPEN DATASET file FOR OUTPUT IN BINARY MODE MESSAGE msg.
TRANSFER ls_upload-file_content TO file.
CLOSE DATASET file.

Regards, Venkat.

Former Member
0 Kudos

but my excel sheet includes logo also.

how to upload xl sheet with logo to applicaiton server.

Former Member
0 Kudos

Hi Jani,

It works for all kind of files. Every file will be stored in Binary format, While downloading file from App Server to desktop, you need to provide correct MIME type of the file.

Regards, Venkat.