cancel
Showing results for 
Search instead for 
Did you mean: 

SAP BW APD Output - File Name Issue

Former Member
0 Kudos

Hi,

I have an APD (source data - a Bex Query and Destination - a csv file). The output of the csv file is as per the Logical path name.This APD is being called several times by numerous Process Chains . The Process Chains executing the APD are all placed one after the other and before the executing the APD the physical filename is being populated via a program - updating the details of table 'FILENAMECI'.

This solution works for most of the APD executions - however sometimes I can see even though the physical file name is updated in table FILENAMCI - the APD writes to the previous file name. For example :-

APD Execution 1 :- Physical file name in table FILENAMCI is 'XXX' - APD output is 'XXX.csv'

APD Execution 2 :- Physical file name in table FILENAMCI is 'YYY' - APD output is 'XXX.csv' - though contents are as per 'YYY'.

Is there anyway we can fix the issue?

Thanks,

Purbali

Accepted Solutions (1)

Accepted Solutions (1)

RafkeMagic
Active Contributor
0 Kudos

make sure the database has correctly been updated before your APD is started (commit?)

Former Member
0 Kudos

Hi,

I need to know the exact tables to be checked in database. Can you please help.

Thanks,

Purbali

former_member226999
Contributor
0 Kudos

Hi Purbali,

I am not clear on  this..

"physical filename is being populated via a program - updating the details of table 'FILENAMECI'."

I am still not clear how this table is being updated? Is it via a function module (ideal approach) or directly via a custom ABAP program (not recommended)?

For each APD do you use the same logical file name variant?

Former Member
0 Kudos

Hi Francis,

Yes I am using a custom ABAP Program to populate the physical filename in FILENAMECI.Also I am using the same logical file name variant - each time the APD is executed.

So the steps are :-

1.Wait for 3 mins

2.Get parameters for Query Variant

3.Get the details of physical file name - update details of FILENAMECI(same logical file name)

4.Execute APD

The issue of over writing the same file name is happening seldom and anytime/any file.

Hope this helps you to understand the issue.

Thanks for your help so far.

Regards,

Purbali

former_member226999
Contributor
0 Kudos

Change the steps to :-

1.Get parameters for Query Variant

2.Get the details of physical file name - update details of FILENAMECI(same logical file name)

3.Wait for 3 mins

4.Execute APD

If this can not be done then you can try this.

In the Table FILENAMECI set the logical file's Physical file to < F=anyname >  where the anyname is the function module name which will give you the file name programmatically.

This function module when created via SE37 should be named as FILENAME_EXIT_anyname(strictly follow name to start with FILENAME_EXIT). In the function module you can copy paste your existing ABAP program used to fill the table FILENAMECI.

add these code at the end

OUTPUT = <your_file_name>.

WAIT UP TO 30 SECONDS.

Also the file name is not stored anywhere in a table, it is used by the APD execution program  as a variable ( via class Interface cl_rsan_mdl_dt_file).

RafkeMagic
Active Contributor
0 Kudos

obviously the table to be checked is FILENAMECI

are you sure the data is committed to the database before you launch your APD? you can "wait" however long you want, but as long as there has not been a commit, that won't solve your issue...

Former Member
0 Kudos

Thanks for your help.It worked.

Answers (1)

Answers (1)

former_member226999
Contributor
0 Kudos

How does your logical file name variant pick the file name? Is it via a Function Module? (Check FILE transaction and see if the file path is derived via Z_FILENAME_EXIT_name function module)

If so try putting a delay in the function module after the file name has been picked from the table. A delay of 3 or 5 seconds should help. syntax:

WAIT UP TO 5 SECONDS.

Former Member
0 Kudos

Hi,

There is a delay of 3 minutes before each time the APD is executed. Also even when the file names  are not picked up correctly - the logical file names->physical name are all corrected updated. I can see that in the table - FILENAMCI and also in Tcode - file.

I think the last APD parameters are being stored somewhere and they are not being cleared before the next execution.(Even though there is a delay of 3 mins before each execution).

However I am not sure of those tables. It is definitely not the /00000AP* tables.

Do you know of any tables or programs?

Thanks,

Purbali