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: 

Background ABAP program is not working

Former Member
0 Kudos
1,547

Dear Experts:

I've created an ABAP program & put that program in a backgroud schedule by the t-code SM36. The issue is that, the backgroud job shows the progra runs & finishes in the message from SM37, but actually it doesn't populate my required information. But if i run the program manually, it does exactly what i need.

For more clarification, in my ABAP program i've calling a function module which i created thru BDC for the FI transaction FB70. In that program i'm fetching some invoicing information which i want to upload in another compnay code. The function module is also running fine.

In this regards need your kind assistance to overcome this unknown issue.

Regards,

Kingshuk.

11 REPLIES 11

Former Member
0 Kudos
380

commit work?

0 Kudos
380

Yes.

matt
Active Contributor
0 Kudos
380

BDCs often work differently in foreground than in background. There's a specific way of getting the correct BDC recording for running in background, which I cannot remember at the moment - but if you search, you will find it.

Former Member
0 Kudos
380

Hi Matthew:

With the help of BDC i've created a function module for posting revenue invoices which user can post by the t-code FB70. Basically i cannot get the exact issue of why the schedule job is not properly updating the customer & revenue ledgers. Whereas, if i run my program from SE38 it works absolutely fine.

And the confusing part is that, from job overview (SM37), it shows the background job started & finished properly.

I need some assistance very urgently. Please help me out.

Former Member
0 Kudos
380

Yes BDC behaves differently in background. Check thru debugging it.

To debug background job :Go to SM37 and give the name of the job and in command window give value as 'JDBG'....and execute it to debug it.....

Priya

Former Member
0 Kudos
380

There are notes related to this. FB70 is an EnjoySAP transaction and does not work in the background.

Rob

0 Kudos
380

Note 310485 in particular.

Rob

former_member209818
Active Contributor
0 Kudos
380

I worked on one of the Requirement for BDC of FB70.

You need to handle this transaction very carefully as it behaves separetly for user depending on the "Edit Option" setting available in the transaction.

Check if your settings and your user settings are same or not

Former Member
0 Kudos
380

Hi All:

Many thanks for the replies. From the Note i got to know that fb70 doesn't run for batch input. Now one by one i'm giving you the scenarios:

1. The ABAP program (where i used the function module of FB70 created through BDC) run perfectly from the T-Code SE38 & creates FI document.

2. The function module of FB70 which was created through BDC run perfectly from the t-code SE37 & creates FI document.

3. The ABAP program starts & finishes perfectly in schedule created through SM36, but doesn't create FI documents.

4. If i debug the program which was scheduled as backgroud job, found no issue in debugging & surprisingly in the end it posts the document & creates finance entry.

5. The user of backgroud job & foregroud tester is same.

Now can anybody guide me, what is wrong & where i need to work on?

matt
Active Contributor
0 Kudos
380

What is wrong is that you CANNOT run FB70 in background. It relies on EnjoySAP controls, which requires a SAPGui to talk to. When you debug, you've got a SAPGui. When you run in foreground, you've got a SAPGui. When you run in background, you don't, so it CANNOT work.

You need another solution - there may be bapis or function modules available that allow you to do what you required, but you cannot fix your BDC.

0 Kudos
380

I think you have two possibilities:

BAPI_ACC_DOCUMENT_POST.

A batch input session based on FB01.

Rob