cancel
Showing results for 
Search instead for 
Did you mean: 

Client Proxy `

Former Member
0 Kudos

Hi,

The requirement is like I need to use a client proxy to delete a file at a server using file adapter.

Is it feasible ..please suggest how to to do this ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks !!

Former Member
0 Kudos

Just to bring it up !!

Guys ...plz help

Former Member
0 Kudos

Hi Sneha,

u gonna create the scenario just to delete a file in FIle server???

or the requirent is something like.... u will send some data fro SAP using proxy to File server... and u need to delete the old file and create a new file???

Regards

Biplab

Former Member
0 Kudos

Biplab,

You got it absolutely right.

Actually, the data i have to send is very large so I will have to call proxy method number of times with chunks of data but before doing this excercise I need to delete the file first using a seperate proxy method.

Is it possible ?

Former Member
0 Kudos

Sneha,

u can do one thing...

trigger a file to file scenario ..which will delete the necessary files.

then u trigger Proxy to File.. which will create fresh files in the File server.

For Proxy to File see this weblog....

/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy

Regards

Biplab

Former Member
0 Kudos

Biplab,

Can you plz explain, what/how is the idea of using the first file-xi-file scenario?

Secondly, I only want to delete the data when my client proxy is ready with source data and about to create a file.

Please suggest.

Former Member
0 Kudos

Hi Sneha,

Actually i was thinking... u need to write File(report may be) in weekly/daily/monthy once.....

and before writing the File(report) ..u want to delete the old file/report....

1)u need to delete Files from File server, where u want to write file from proxy.why u need to delete the file??

can u please explain ur scenario...whats the requirement???

Regards

Biplab

Former Member
0 Kudos

Biplab,

Currently, what is happeening is I am calling a proxy report to create a file in a file server and the file adapter overwrites the data nad creates a new file. This scenario is working fine for small amount of data ( i.e, daily/weekly) but when I have to send monthly data to a file it is throwing some performance error.

So the workaround I have found is that:

1. I will delete the existing contents of the file in the file server.

2. Then, I will call proxy method number of times with small chunks of data.

Hope you understand my requirement.

Former Member
0 Kudos

Hi Sneha,

yes i understood :)!!

using BPM u can do it easlily.. but again.. it will be a big performance issue

u have to run two scenario simultaneousl

1) a File to File scenario..which will delete the File.(construction mode delete)

2)Proxy to File--will write the report...

but u have to write the report in such way that it first checks the content of the File server is empty or not...the report will trigger the Proxy if and only if File server is empty.

regards

Biplab

Former Member
0 Kudos

Is it possible ,somehow, to do this without BPM ?

1. in the reciever file adpater, there is no such construction mode delete avialable.

Former Member
0 Kudos

Hi Sneha,

u r correct ...delete mode is avialable in sender channel.

...u have to do some R&D....

1)create sender communcation channel...specify the file...construction mode delete.

2)create sender agreement.

No need to create rcvr comm channel & rcvr agrrement..

Although u will get an error message in MONI but File will be definetly deleted.... and no file will be created....

wait a minute.. i think u can do it...using a single scenario............in proxy to file scenario....

in rcvr file adapter u can use operating system command...

or can run some batch file....(u have to give the path of batch file..which will delete the file....)

And the file will be deleted before the channel is executed...

(my XI server is down..other wise i could have tell u more specificly)

All the best!!!!

Regards

Biplab

Former Member
0 Kudos

Thanks a lot Biplab.

Your ideas looks very good:

1)create sender communcation channel...specify the file...construction mode delete.

2)create sender agreement.

No need to create rcvr comm channel & rcvr agrrement..

Although u will get an error message in MONI but File will be definetly deleted.... and no file will be created....

Q: here how can i automate this whole process the file gets deleted just before the proxy is gng to write.

Former Member
0 Kudos

in rcvr file adapter u can use operating system command...

or can run some batch file....(u have to give the path of batch file..which will delete the file....)

And the file will be deleted before the channel is executed...

(my XI server is down..other wise i could have tell u more specificly)

This is a very good way. can you plz supply the batch file which is to be used and what are the steps to execute this.

Secondly, I want the batch file to delete the existing file only the first time the XI is start writing and after that XI will use append to create the new file .

Biplab. i am really thankful to u for helping me. this is a quite urgent requirement ...can you give me your gtalk id so that we can discuss these thioings online.

Thanks in advance.

Former Member
0 Kudos

thanks biplab.

I have done some R&D on OS command method and feel that it can serve my problem.

but i still have one doubt that if i use OS command to delete the existing file and then start creating a new file . I hope it does not delete the file i am creating/appensding.

prabhu_s2
Active Contributor
0 Kudos

unless the file names are different it wont get deleted. but in this case liek first executing the scenario where the file is deleted and again creating the file with chunks for data the file will again be deleted when the first instance is triggered in the next schedule

Former Member
0 Kudos

Snehal,

See, if u r working on Windows OS.. u have to use windows delete command.. and if its unix ..u have to use unix delete command.

And no.. u need not execute 2 scenario...in the single scenario itself u can do it...i mean.. the OS command will delete the existing file before the creation of File by file adpater..

i dont have XI server access.. i am unable to tell u exactly...

But u try to do in that.. ur problem should be solved...

try to do it self.... u can learn alot....

Regards

Biplab

prabhu_s2
Active Contributor
0 Kudos

Biplab

how this would work ? for instance lets consider this file name as tdel.txt to be delted and again another interface that would uplaod chunks of data into the same file. what happens if the same interface that is to delete is file is triggered in the next interval? there will be a data loss.

regds

Prabhu

Former Member
0 Kudos

Hi Prabhu,

for instance lets consider this file name as tdel.txt to be delted and again another interface that would uplaod chunks of data into the same file>>

First of all the whole scenario will be done in single interface trigger.

OS command will delete tdel.txt first.

then tdel.txt will be created.

file will be delted first..then file adapter will create the file.

u have to do some setting in the rcvr Adapter..

Regards

Biplab

prabhu_s2
Active Contributor
0 Kudos

OS command will delete tdel.txt first.

then tdel.txt will be created

thats right but again when the interface is triggered the same file will be deleted and created again and this result in the loss of data i.e. the data that is written to the file during the previous trigger would be lost. corect me if i'm wrong

Former Member
0 Kudos

yes u r correct.. but that is the requirement as far as i understood.

Former Member
0 Kudos

Hi biplab i'm having one doubt as prabhu said in his first post how is it possible for file adapter to delete and write two different files( i mean two different names of those files) is it possible

can u please explain me.

rgrds

venu

Former Member
0 Kudos

Hi snehal have u solved ur problem "If u solved" please try to explain wats the steps u followed.

thanks & rgrds

venu

Former Member
0 Kudos

Hi Xi mates,

With the help of Biplab, I am able to meet one requirement of mine using OS line command before processing.

Actually, the scenario was to create a file once in a month with some sales order data for forcasting purpose. This scenario is to be triggered only once in a month and hence the file creation. Also, i wanted to delete the file once a new file to gng to be created by XI.

Former Member
0 Kudos

Also, I came across a function module which can delete that file from that file server using the same batch program. This FM can be called from our client proxy report.

Hope it helps.

Former Member
0 Kudos

Prabhu,

Going by Biplab's way, I can call the first proxy method just to delete the file at the beginning of the program and later in that program I will call the proxy to create that file. Isn't that possible?

Former Member
0 Kudos

Any resolution friends ?

prabhu_s2
Active Contributor
0 Kudos

snehal

the concern over here is what happens if the proxy is triggered again? u will have th file deleted and again a new file created with previous set of data lost. as u said u can first have the proxy method caled to delete the file and later in the program u can can create a file. this will work fine for the first instance and what abt when caled for the second time. the same process is repeated resulting in deleting for the file first and creating a new file again thus resulting in the loss of data created during the first instance. this case is for when the file name is the same.

prabhu_s2
Active Contributor
0 Kudos

do u want to delte the file only once before creating the same file again?

Former Member
0 Kudos

Yes, i want to do this but I can not use OS line command before the processing function as I want to call proxy method to create file multiple times and this will delete the my new file also.

Also, i have come across a FM : SXPG_COMMAND_EXECUTE

which can delete the file from the target location and this can be called in the client proxy report.

prabhu_s2
Active Contributor
0 Kudos

since u want to delte the file only once it is one-time program u got to use. hence instead of configuring an interface for this purpose u can have the RFC f/n module to perform this task. instead of calling it in the C.proxy u can have a separate report to perform this task as calling this in the proxy is as good as making use of external OS command in the comm.channel.

Former Member
0 Kudos

Thanks Prabhu..this seems like a good approach but any specific reason to do so. Also, do let me know is you have ever used this RFC/FM .

prabhu_s2
Active Contributor
0 Kudos

since u got to delete the file only once u need to have the process initiated as a separate instance for which there are f/n modules aviabkle. i remember my team using the f/n mod earlier but now unbale to track it. why not to use in the same client proxy is the file will be delted and recreated as per the code following in the proxy. as discueed earlier it results in data loss

Former Member
0 Kudos

Thanks a lot Prabhu for your suggestion and time.

I will make these changes and update the forum soon on this. Hope it should as it is expected to