cancel
Showing results for 
Search instead for 
Did you mean: 

How to Upload a file in a Batch Mode ?

kai_unewisse3
Active Contributor
0 Kudos

Hi, I want to upload a Comma separated value File via RFC to a BW system.

The scenario is the following: From a Portal server i call the BAPI using JC0/JCA.

The problem is that GUI_UPLOAD does not support a BATCH job. At least i get a error when calling the BAPI: Exception condition "NO_BATCH" raised.

How do i upload a file in a Batch Mode ?

Thanks,

Kai

Accepted Solutions (1)

Accepted Solutions (1)

kai_unewisse3
Active Contributor
0 Kudos

Thanks for your answers, but i need more clarifications.

I thought there i no difference between Function GUI_UPLOAD and CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD ?

Regarding the DATASET statements:

From which location can the BW system read that ? only from its own appserver or other hosts as well ?

Thanks,

Kai

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

To answer your first question. Yes, CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD calls the function modudule GUI_UPLOAD. So yes, they are the same. But no, you can't use them as they need the SAPgui to work.

Can you please expand on your requirment a little for me. You want to upload a file thru the portal and write the data to a BW system? Is this correct?

Regards,

Rich Heilman

Former Member
0 Kudos

The file can be read from pretty much any host provided your Basis team sets it up properly with all required access.

At our client, we don't use the appserver or the database server to store flat file. We use separate file servers to store all incoming and outgoing files.

Every SAP instance has a id which the basis people refer to as '<SID>adm' where SID is the system id (ex. TSTADM)

This id should be given access to the other external system to do file reads or writes.

Hope this helps and does not confuse you more.

kai_unewisse3
Active Contributor
0 Kudos

Hi Rich,

The assumption you made was correct.

The requirement is the following:

A user on the portal access an iview containing a form where he enters BW Information : Infosource and he also selects the file which should be uploaded.

The user clicks on submit.The submitted data are in the request and the file is stored in the java iview subfolder

"upload/ dynamic username"

The receiving iview will then call a custom BW BAPI and shows the results (success or error)

That upload is where i have currently a problem. I saw a SDN weblog where the author did something similar using a dialog for the upload (GUI_UPLOAD), whereas i want to call this via batch job (JCA calls BAPI).

Kai

kai_unewisse3
Active Contributor
0 Kudos

Hi Ramesh,

this means that the folder is mapped and the folder is visible via Tcode AL11 ?

OR is this SAPFTP ? I just saw this weblog at /people/thomas.jung3/blog/2004/11/15/performing-ftp-commands-from-abap

Thanks,

Kai

Former Member
0 Kudos

Hi Kai,

Sorry for the delay. The delay was in trying to get to talk to the Basis team.

Here is how we have it.

On the message server of every instance, there will be a SAP admin id that is '<SID>ADM' or 'SAPSERVER<SID>' where SID is the system ID. We use the '<SID>ADM' user id.

On the external NT fileserver, there has to be a user id created on the NT box with the same SAP admin id and this id on the NT box should have access rights do Read/Write.

All of these have to be in the same domain (or different domains that have trust access to each other).

So, there is basis,network and security groups involved.

Once these are in place, we can have file access to the external fileserver box.

We use logical filenames at our place (Transaction FILE).

This makes all the file transfer locations well organized and manageable.

Hope that answers your question regarding this.

Regards,

-Ramesh

Answers (3)

Answers (3)

kai_unewisse3
Active Contributor
0 Kudos

HI thanks for the answer.

I will try it and if this solves the problem, i will reward the points....

Kai

Former Member
0 Kudos

Can you upload the file manually to file server and use that file in the program using dataset commands.

The files cannot be uploaded in background processing.

Former Member
0 Kudos

Did you try using methods from class

"CL_GUI_FRONTEND_SERVICES"

The only way that I know of to upload in batch mode is to

use the OPEN DATASET/READ DATASET/CLOSE DATASET

statements and the location of the file cannot be on the

presentation server.

Hope you can do that.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, you must use the OPEN DATASET/READ DATASET/CLOSE DATASET when reading a file in background. All gui functions are rendered useless when running in background.

Regards,

Rich Heilman