10-11-2007 9:23 AM
Dear all
I have a little problem, which I dont understand at all. Im 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 (Im writing everything from itab_messages on screen so I can read that latter from spool) than Im 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 Im calling that transaction (dont know why only 4 letters and not all string). Does anybody know what is reason for such behavior?
10-11-2007 9:29 AM
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
10-11-2007 9:26 AM
Background wll not call the Call transaction statement..It doesnt work..
10-11-2007 9:30 AM
10-11-2007 9:43 AM
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
10-11-2007 9:29 AM
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