cancel
Showing results for 
Search instead for 
Did you mean: 

Uploading a XML file in Web dynpro Component

Former Member
0 Kudos

Hi Abap Experts,

In my requirement i have to uplaod an XML file in Web dynpro Component. Is possible to do so? We have any function modules or Classes For it?

Thanks,

Sandeep.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sandy,

Similar q's

Cheers,

Kris.

Former Member
0 Kudos

Hi Kris,

Thank you for those links, but in web dynpro function module Gui Uplaod is Not accpeted its showing dump. Even cl_frontend_services=>gui_uplaod has the same problem.

Thanks,

Sandy.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

Should the XML File be uploaded via User Interaction on the Application? If yes, use the UI-Element FileUpload, make an XSTRING attribute in Context and bind it to the UI-element. In UI-property MIME-Type set it to XML.

Hope this helps, or do you want to do it in background? If you want to do it in background, please elaborate more what exactly you want to do.

cheers, Lukas

Former Member
0 Kudos

Hi Lukas,

Ya i want, upload functionality to be done in background. Actually Our's is a ECS product in which if we click on plan shipment button an xml file is downloaded in a Request folder. As soon as we run the dot net Thread we will get an Xml file in Response folder which consits of Tracking number and frieght charges. Now this Xml file should be uploded in background in webdynpro. Hope this gives you some idea.

Thanks.

Sandy.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi Sandy,

where exactly lie these "Request Folder" and "Response Folder". Is it on your Presentation Server (Client) ? Is it on the Application server?

I understood so far: You click a button, something is happening, and you have the response XML file which you want to upload back to WD4A runtime.

Should this happen automatically within the whole "Click on shipment-button action"? If yes, can your System know when the Response XML File is available?

In general, I think you could just use

DATA: lv_xstring_response TYPE xstring.

OPEN DATASET <path_for_response_xml_file> FOR INPUT IN BINARY MODE.

READ <path_for_response_xml_file> INTO lv_xstring_response.

CLOSE DATASET <path_for_response_xml_file>.

Then you can convert this xml or bind it to context or whatever you need.

cheers, Lukas

Former Member
0 Kudos

Thank you lukas it's working

Former Member
0 Kudos

Hi Lukas,

Regarding the same issue. Now i should not download them on application server. File should be downloaded in cdrive

shipping folder that to it should be done in background. Are their any function modules related to this.

Thanks,

Sandy.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>Now i should not download them on application server

Application server or client side? For writing files to the ABAP application server you can use the same DATASET commands - specifically TRANSFER TO DATASET. However there is nothing Web Dynpro specific about these old DATASET commands or writting files to the ABAP application server.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi Sandy,

Thomas is right.

Do it like this:

OPEN DATASET <path_to_cd_drvie_file> FOR OUTPUT IN BINARY MODE.
TRANSFER lv_xstring_response TO <path_to_cd_drvie_file> .
CLOSE DATASET <path_to_cd_drvie_file>.

regards, Lukas

Former Member
0 Kudos

Hi Lukas,

Thanks for Reply, I Used this approach already but it's showing a dump file could not be open.

Thanks,

Sandy.

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

I anwered in your new thread, I wager more people will post there because it is marked unanswered.

regards, Lukas

Answers (0)