Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

xml file

Former Member
0 Kudos
241

Hi All,

my requirement is to download the xml from the application server (specific directory) and create sales order and after creation i have to upload the sales order data with some other information in the same place in xml format. this process should done automatically..

now how the system knows when the xml file is kept in the application server directory.

is there any method, function module or some thing to identify the file imd after it has been kept in that directory ?

can any one give me some idea on this process...

thanks

3 REPLIES 3

Former Member
0 Kudos
139

Hi,

1. I don't think there is any direct way (eg. event etc)

provided by sap, so that we can know if some file

has been put on the application server.

2. That file will be put on server (by some other server)

using ftp, at the OS level, so SAP will not come

to know that a file has been put.

3. So, in such case, our program has to run in background,

scanning if there is some new file (based upon some naming convention and time etc). If file is found, then it can process the data.

regards,

amit m.

0 Kudos
139

hi amit,

thanks for ur reply....

hw do we scan on the file names because diff customers will send files with diff names in diff times..

so if v execute program in background for every 1 hr for example,

what abt the performance.. ?

is this the right way ?

can u explain me in detail..

it will be helpful if u provide any relevant code also if possible..

thanks

Former Member
0 Kudos
139

Hi,

if I understand your need, the file lives in trans. AL11. If this is correct, you must work with OPEN DATASET like this:

OPEN DATASET '/usr/sap/TDO/EXT/trans/data/in/FILE.XML' IN TEXT MODE.

IF sy-subrc NE 0.

SKIP 4.

WRITE:/10 'Error in file ! Not possible to open file !'

COLOR COL_NEGATIVE.

EXIT.

ENDIF.

you can know in that way, whether the file exists.