Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

call transaction - problems with running

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?

Tags:
Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question