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

call transaction - problems with running

marcin_cholewczuk
Active Contributor
0 Likes
884

Dear all

I have a little problem, which I don’t understand at all. I’m calling transaction inside of my program with this statement

CLEAR opt.

opt-dismode = 'N'.

opt-updmode = 'A'.

opt-cattmode = ' '.

opt-racommit = 'X'.

CALL TRANSACTION 'FPSA' USING itab_bdcdata OPTIONS FROM opt MESSAGES

INTO itab_messages.

When I run this normally (clicking run / F8 ) than everything is working fine, but when I execute this in background (I’m writing everything from itab_messages on screen so I can read that latter from spool) than I’m getting an error

‘No structure defined for mass activity ZB_V’ with message type ‘A’ (Abort). Those letters ZB_V are 4 beginning letters of report name under which I’m calling that transaction (don’t know why only 4 letters and not all string). Does anybody know what is reason for such behavior?

1 ACCEPTED SOLUTION
Read only

abdulazeez12
Active Contributor
0 Likes
839

You would have to create a job on the fly to do this. This example shows how to kick off a background job via an ABAP program.

report zsure_0004 .

data: sdate type sy-datum,

stime type sy-uzeit,

l_valid,

ls_params like pri_params,

l_jobcount like tbtcjob-jobcount,

l_jobname like tbtcjob-jobname.

start-of-selection.

  • Get Print Parameters

call function 'GET_PRINT_PARAMETERS'

exporting

no_dialog = 'X'

importing

valid = l_valid

out_parameters = ls_params.

  • Open Job

l_jobname = 'ZRICH_0005'.

call function 'JOB_OPEN'

exporting

jobname = l_jobname

importing

jobcount = l_jobcount.

  • Submit report to job

submit zsure_0005

via job l_jobname

number l_jobcount

to sap-spool without spool dynpro

spool parameters ls_params

and return.

  • Schedule and close job.

call function 'JOB_CLOSE'

exporting

jobcount = l_jobcount

jobname = l_jobname

strtimmed = 'X'

Or

you can try to put your call trnasaction in a

call function 'Z_TRANSACTION' in background task

Refer

http://www.sap-img.com/abap/bdc-program-for-purchase-info-records.htm

Regards

Shakir

Yes. Please try it out and let me know if u face problems. Create a job for the purpose or if u have a BAPI, then u can upload it using BAPI..the BAPI will take care of it..

<b>Reward points if it is useful :)</b>

Cheers

Shakir

4 REPLIES 4
Read only

abdulazeez12
Active Contributor
0 Likes
839

Background wll not call the Call transaction statement..It doesnt work..

Read only

0 Likes
839

Are you sure about that? Why it's not working that way?

Read only

0 Likes
839

Yes. Please try it out and let me know if u face problems. Create a job for the purpose or if u have a BAPI, then u can upload it using BAPI..the BAPI will take care of it..

<b>Reward points if it is useful :)</b>

Cheers

Shakir

Read only

abdulazeez12
Active Contributor
0 Likes
840

You would have to create a job on the fly to do this. This example shows how to kick off a background job via an ABAP program.

report zsure_0004 .

data: sdate type sy-datum,

stime type sy-uzeit,

l_valid,

ls_params like pri_params,

l_jobcount like tbtcjob-jobcount,

l_jobname like tbtcjob-jobname.

start-of-selection.

  • Get Print Parameters

call function 'GET_PRINT_PARAMETERS'

exporting

no_dialog = 'X'

importing

valid = l_valid

out_parameters = ls_params.

  • Open Job

l_jobname = 'ZRICH_0005'.

call function 'JOB_OPEN'

exporting

jobname = l_jobname

importing

jobcount = l_jobcount.

  • Submit report to job

submit zsure_0005

via job l_jobname

number l_jobcount

to sap-spool without spool dynpro

spool parameters ls_params

and return.

  • Schedule and close job.

call function 'JOB_CLOSE'

exporting

jobcount = l_jobcount

jobname = l_jobname

strtimmed = 'X'

Or

you can try to put your call trnasaction in a

call function 'Z_TRANSACTION' in background task

Refer

http://www.sap-img.com/abap/bdc-program-for-purchase-info-records.htm

Regards

Shakir