cancel
Showing results for 
Search instead for 
Did you mean: 

Writing node elements into a txt file

Former Member
0 Kudos

Hello All,

Could some one please advise on how do I write the data stored in node elements within dynamically created attributes into a txt file and upload that file on to the server running WAS?

I do not necessarily need the source code, but more of a way forward in order to achieve this.

Any help would be highly appreciated.

Thanks in advance.

Regards,

Vicky

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vicky,

Consider following context structure

Address (Node)

Name

Town

PhNumber

let us cosider you have the following data.

Add1 Add2

Anil Thomas

XX yy

11 22

Now you can iterate through the elements in the node and write each element to a file

like following.

Anil;xx;11

Thomas;yy;22

Regards, Anilkumar

Former Member
0 Kudos

Hi Vicky

Could you elobrate why you need to upload to WAS the file you have created at runtime? The reason is in most cases when you upload the files to WAS you need to restart the server.

Regards

NagaKishore

Former Member
0 Kudos

Hi NagaKishore,

The DynPro application that I'm working on grabs some data from SAP R/3 using RFC models. From the user's point of view, they are able to update this data presented to them in a form, which is then written to a text file and uploaded on the server.

The original use case defined had a functionality to store the txt/csv file generated at runtime in SAP R/3, however, due to time and resources, this approach was replaced by having the file now saved on the server the application is running on.

I did go through this thread, but apparently there is no standard RFC function to have a file uploaded from Web Dynpro to R/3 (using a BAPI).

In reference to your answer - assuming once the file created at runtime is uploaded to the server, do we need to have the server restarted to be able to read the file?

Thanks for your help.

Cheers,

Vicky

Former Member
0 Kudos

Hi Vicky

I was thinking that the file you want to upload has some thing to do with WAS configuration. If it is user related data then it is not needed to start the server.

If i understand your requirement, You wanted to pull some data from R/3 and save the data as a CSV file on the WAS server then you can follow the link

if you want to create a file on the server where sap r/3 is running from webdynpro, you can define a function module which creates a file in SAP r/3, call this RFC from webdynpro.

Regards

NagaKishore

If this

Former Member
0 Kudos

Hi NagaKishore,

Thanks for your quick reply.

On another note - could you provide some inputs on this one as well - I need to include a Supply Function for one of the dependent context nodes. I am creating this dependent node at design time in my custom controller.

I have mapped the context nodes from the custom controller to my view controller, however, I am unable to figure out how I can access the supply function sitting in the custom controller context.

Can I access this supply function from my view? If yes, how?

Thanks heaps.

Cheers,

Vicky

Former Member
0 Kudos

Hi Vicky,

Refer the blog for "Supply functions in WebDynpro"

/people/sap.user72/blog/2005/03/15/supply-functions-in-webdynpro

why do you want to access the supplyfunction from the view?

Regards,

Santhosh.C

Former Member
0 Kudos

Hi Vicky

You can refer to the blog given by Santhosh. You can have your supply function written in the custom controller or in the view controller. Supply function is more related to the nodes than the controller. When ever you create a Supply function, Each row of the node is passed to the supply function. You can manipulate the row in this funcion in the way you want.

Regards

NagaKishore V

Former Member
0 Kudos

Hi NagaKishore,

Thanks for your reponses.

I worked out the suppy function and have implemented as desired.

Hi Santhosh,

I had just recently reviewed the blog the link for which you mentioned. Thanks anyways.

Cheers,

Vicky