Application Development and Automation 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: 
Read only

Execute a BDC in background

Former Member
0 Likes
3,568

Hi ,

I have a BDC program when it is executed online it works well , but on executing it in background the desired result is not obtained.

The basic requirement is to schedule a transaction , so i have written a BDC program which performs the desired operations .

Regards

Arun

26 REPLIES 26
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
2,456

Sometimes the transactions call different screens when they are running in the background. What transaction are you working with.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
2,456

Hi, compare to running on the foreground, the background case actually has some difference.

So can you figure out which screen action you wrote in the BDC code occur the problem? Please give a more details problem description.

thanks

Read only

0 Likes
2,456

Hi ,

The requirement was to shedule the transaction SM19 , this transaction is being called manually at a perticular time and all the audit classes are to be selected.

Regards

Arun

Read only

Former Member
0 Likes
2,456

Arun,

I feel that there is problem in the LOCK established by the SAP.

Thanks

Kamesh

Read only

Former Member
0 Likes
2,456

Arun,

Please provide information abt the Transaction for which you are creating BDC.

Thanks

Kamesh

Read only

0 Likes
2,456

Hi Kamesh ,

The transaction SM19 is a security audit transaction.

When executed it creates a log

Regards

Arun

Read only

Former Member
0 Likes
2,456

Arun - what exactly is the problem? Are you getting error messages? If so, what message and what screen? Or, is the log incorrect? Or something else?

Rob

Read only

Former Member
0 Likes
2,456

Hi,

Check any problem related with date format, and give the error message in detail

Cheers,

Sasi

Read only

0 Likes
2,456

Hi ,

My program works well when it is executed online , but when executed in the background the status of the process shows Finished , but the required operation is not done.

I am attaching my code below

-


DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

START-OF-SELECTION.

PERFORM bdc_dynpro USING 'SAPMSM19' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ADMIN'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSAUPROF-PROFNAME'.

PERFORM bdc_field USING 'RSAUPROF-PROFNAME'

'Z_AUDIT'.

PERFORM bdc_dynpro USING 'SAPMSM19' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=AUUPDA'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSAUINFO-MANDT'.

PERFORM bdc_dynpro USING 'SAPMSM19' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=AUON'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSAUINFO-LOGIN'.

PERFORM bdc_field USING 'RSAUINFO-MANDT'

'*'.

PERFORM bdc_field USING 'RSAUINFO-LOGIN'

'X'.

PERFORM bdc_field USING 'RSAUINFO-UNAME'

'*'.

PERFORM bdc_field USING 'RSAUINFO-RFCLOGIN'

'X'.

PERFORM bdc_field USING 'RSAUINFO-RFCSTART'

'X'.

PERFORM bdc_field USING 'RSAUINFO-TASTART'

'X'.

PERFORM bdc_field USING 'RSAUINFO-LOW_BUTTON'

'X'.

PERFORM bdc_field USING 'RSAUINFO-REPOSTART'

'X'.

PERFORM bdc_field USING 'RSAUINFO-USERSTAMM'

'X'.

PERFORM bdc_field USING 'RSAUINFO-SONST'

'X'.

PERFORM bdc_dynpro USING 'SAPMSM19' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BACK'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RSAUINFO-MANDT'.

PERFORM bdc_field USING 'RSAUINFO-MANDT'

'*'.

PERFORM bdc_field USING 'RSAUINFO-LOGIN'

'X'.

PERFORM bdc_field USING 'RSAUINFO-UNAME'

'*'.

PERFORM bdc_field USING 'RSAUINFO-RFCLOGIN'

'X'.

PERFORM bdc_field USING 'RSAUINFO-RFCSTART'

'X'.

PERFORM bdc_field USING 'RSAUINFO-TASTART'

'X'.

PERFORM bdc_field USING 'RSAUINFO-LOW_BUTTON'

'X'.

PERFORM bdc_field USING 'RSAUINFO-REPOSTART'

'X'.

PERFORM bdc_field USING 'RSAUINFO-USERSTAMM'

'X'.

PERFORM bdc_field USING 'RSAUINFO-SONST'

'X'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0500'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=OPT1'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0500'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=OPT1'.

PERFORM bdc_dynpro USING 'SAPMSM19' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/EABBR'.

CALL TRANSACTION 'SM19' USING bdcdata MODE 'N' .

-


Please suggest a solution.

Regards

Arun

Read only

0 Likes
2,456

Are you running this under a different user? Does this other user have the correct authorizations?

Regards,

Rich Heilman

Read only

0 Likes
2,456

Hi ,

Yes i am running it for the same user , the program works well when executed online , the problem is when i schedule it.

Regards

Arun

Read only

0 Likes
2,456

Arun - what does OK code EABBR do? Try it with EABBR rather than /EABBR. It's a long shot.

Rob

Read only

0 Likes
2,456

Rob ,

SM19 is a security audit transaction , and the ok code EABBR activates the audit.

Regards

Arun

Read only

0 Likes
2,456

Rob ,

I tried the ok code EABBR insted of /EABBR , but the same problem persists.

Regards

Arun

Read only

0 Likes
2,456

When you run it in foreground, do you run it with mode = 'N'?

Rob

Read only

0 Likes
2,456

Rob ,

Yes i have tried running it in all the three modes in foreground and they all work fine .

Regards

Arun

Read only

0 Likes
2,456

I don't see ok-code eabbr in the program. What version of SAP are you using and can you point us to the program/include and line where it's being checked?

Rob

Read only

0 Likes
2,456

Hi Rob ,

I am using 4.6C Version .

The OK code EABBR is at the second last line in the program.

Regards

Arun

Read only

0 Likes
2,456

What program (include)?

Rob

Read only

0 Likes
2,456

Arun,

There are some transactions that can only run On-line and cannot run in Background.

So check for that before investigating further!!!

Thanks

Kam

Read only

suresh_datti
Active Contributor
0 Likes
2,456

Hi Arun,

It may be worthwhile to debug the finished Job using 'JDBG'... In SM37: Select the job, type JDBG in the command window & it will take you into the debug mode...

Good luck,

Suresh Datti

Read only

0 Likes
2,456

Hi ,

I have still not been able to figure out why this BDC does not work in background .

Please help me out.

Regards

Arun

Read only

0 Likes
2,456

Hi,

Is anyting related with user name and authorization if it so try with SYCHMONTH user.

Cheers,

Sasi

Read only

0 Likes
2,456

Hi Sasi ,

I am able to execute the program correctly in the foreground.

Regards

Arun

Read only

Former Member
0 Likes
2,456

hi ,

i have executed ur program. in that ,there is a popup window is appearing this was not handle by any ok code try to handle that popup window, i hope it will work on background also.and use bdcmsgcoll in the call transaction this may some times use full to check the error and where the transaction have stopped

Read only

Former Member
0 Likes
2,456

Hi Arun,

Any BDC will not run in Background if you have messages coming up in the foreground, be it any message.

I wanted to know, whether you press enter key or something in foreground when the BDC stops/pops up messages in ur status bar at some point in the foreground. I think u should correct such errors first.

Anita