cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Background job - transferring files or internal tables

Former Member
0 Kudos
100

Hi friends,

The scenario is:

Folder -

-


-

-


Reading mode

-

-


Update mode

where reading mode and update mode are radiobuttons.

If Reading Mode is selected:



Folder (on my PC)

contains many excel files which have to be checked and error records displayed

If update mode is selected:



Program should select the excel files in the

Folder (on my PC)



Ø check the fields in them based on some checks, append, say, itab_error, itab_correct

Ø Using itab_correct to run BDC

Ø Using a Ztable after the above BDC

Ø Give final display list with the itab_error table entries and error records from BDC and Z table update

This BDC and Z table update should be run in background. (or the whole update process including the checking of file should be run in background)

<b>How to go about this background job?? How to pass the internal tables (itab_error and itab_correct) or how to pass all the excel files to this background job??</b>

Advance Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Keep in mind that both storing in database and storing in dataset is persistent memory and the developer needs to take care that the used space is cleared when processing is over.

Now usually there are batch jobs on application server to delete older files but for the data stored in indx table, developer is responsible.

As for performance, Application servers are usually ideal for processing large files, but the GUI_UPLOAD is a bottleneck while uploading the data from presentation server as it has to do a lot of pre-processing. FTPing the data to application server and then reading it from there might be a better option for you.

Answers (1)

Answers (1)

former_member188685
Active Contributor
0 Kudos

Hi,

from PC files fails in BAck ground ..

so what you need to do is to write to al11 and then use open dataset and populate the internal tables.

since the fiels are in PC upload will fail in background..

vijay

Former Member
0 Kudos

Thanks Vijay,

But there are lots and lots of excel files in the folder and I dont think it is feasible to use data sets

Regards

former_member188685
Active Contributor
0 Kudos

hi, you can use this transaction CG3Z to upload from pc to appl.server..

regards

vijay

Former Member
0 Kudos

Hi Vijay,

But this can be used for only one file from PC. But what I have are more than 50 excel files in the folder.

Regards

former_member188685
Active Contributor
0 Kudos

with 50 files what you are going to do,

any business reason..

vijay

Former Member
0 Kudos

Hi vijay,

Yeah business scenation

The scenario is like this:

Folder -

-


-

-


Reading mode

-

-


Update mode


where reading mode and update mode are radiobuttons.

If the user selects the update mode:



Folder (on my PC) contains many excel files which have to be checked and updated.

Program should select the excel files in that folder (on selection screen),

Ø check the fields in them based on some checks, append itab_error, itab_correct

Ø Using itab_correct run BDC by ME12

Ø Using itab_correct update LFEI

Ø Give final display list with the itab_error table entries and error records from BDC and LFEI update

This BDC of ME12 and LFEI update should be run in background. (or the whole update process including the checking of file)

So a spool is generated by background job with errors from BDC, errors from LFEI modify and error records from itab_error.

The problems are :

How to pass correct itab and error itab to background job

Import to memory and export from memory are not working.(background job is not able to import)

Will import to database and export from database work?? If so how??

Set parameter and get parameter are also not working (background job is not able to get)

Can datasets be used?? If so how??

Regards

Former Member
0 Kudos

Hi Adarsh,

1. It needs to be clear that

GUI_UPLOAD FM will not work in background.

2. Hence, the required files need to be

present on the application server.

3. If they are present,

they can be read in internal tables.

OPEN DATASET

READ DATASET

CLOSE DATASET.

(please see F1 help on these commands)

They are quite easy to use.

Regards,

Amit M.

Former Member
0 Kudos

Hi Amit and Arun,

Thanks a lot. Yeah, I am able to do them with datasets. The background job is able to access them. The only matter of concern is that the data being sent to datasets is very large

regards

former_member188685
Active Contributor
0 Kudos

are you facing any performance problem.

i don't think so..

vijay

Former Member
0 Kudos

Hi Aadarsh,

1. Don't worry about the size of datasets.

2. R/3 Servers are designed to handle such

transactions and volume.

3. Moreover, there is no alternative for it !!!

Regards,

Amit M.

Former Member
0 Kudos

Hi Arun & Amit,

There is an alternative for it.

Thanks for your answers. Points are being awarded.

The alternative is, exporting to database and importing from database.

<b>Main program:-

EXPORT itab TO database indx(zn) id 1.

Called program:- (background program)

IMPORT itab FROM database indx(zn) id 1.</b>

But the thought now is which is better alternative - datasets or database !!!!

If u have any idea do revert back.

Regards

former_member188685
Active Contributor
0 Kudos

I feel datasets will be better.

i feel database is a performance problem.

vijay

Former Member
0 Kudos

Hi again,

1. Nice workaround aadarsh ! Hats Off to you !

2. I feel that EXPORT IMPORT is the ideal thing.

bcos.

a) thats the way BDC SESSION Method works

it dumps the whole bdc data in cluster

tables to work on it in the future.

b) Performance won't be any problem.

C) Security - Now and then dumping

files from the front-end to

application server is not a

good practice.

(even your basis team wont recommend this )

d) Sometimes it happens, that the

SERVER is upgraded / changed

and the whole hardware/box is

taken a new one.

It may happen that the Operating system

files on your path may not be

duplicated /copied to the new server.

Regards,

Amit M.