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

Background job

Former Member
0 Likes
686

hey guys,

I am trying to call report in background why this goes

to RAISE EXCEPTION -INVALID JOBDATA shortdump?

let me paste the code snippet below.

data:jobname like tbtcjob-jobname.

data:jobcount like tbtcjob-jobcount.

jobname = 'ZUSRTEST'.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

JOBNAME = jobname

IMPORTING

JOBCOUNT = jobcount

EXCEPTIONS

CANT_CREATE_JOB = 1

INVALID_JOB_DATA = 2

JOBNAME_MISSING = 3

OTHERS = 4.

if sy-subrc ne 0.

endif.

CALL FUNCTION 'JOB_SUBMIT'

EXPORTING

  • ARCPARAMS = ' '

AUTHCKNAM = sy-uname

JOBCOUNT = jobcount

JOBNAME = jobname

REPORT = 'zfipr_vat_report_v4'

VARIANT = 'zck_vat200'

.

if sy-subrc <> 0.

endif.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

JOBCOUNT = jobcount

JOBNAME = jobname

STRTIMMED = 'X'

EXCEPTIONS

CANT_START_IMMEDIATE = 1

INVALID_STARTDATE = 2

JOBNAME_MISSING = 3

JOB_CLOSE_FAILED = 4

JOB_NOSTEPS = 5

JOB_NOTEX = 6

LOCK_FAILED = 7

OTHERS = 99.

if sy-subrc eq 0.

endif.

ambichan.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
653

hey lakshman,

Thanks for your reply.

I want to call Report "ZFIPR_VAT_REPORT_v4" in background and i want to pass the output(internal table) from report to calling main program.? is it possible?

how to do this?

ambichan.

5 REPLIES 5
Read only

Lakshmant1
Active Contributor
0 Likes
653

Hi Ambi Chan,

In JOB_SUBMIT fucntion module, specify the program name and variant in upper-case.

Thanks

Lakshman

Read only

Former Member
0 Likes
654

hey lakshman,

Thanks for your reply.

I want to call Report "ZFIPR_VAT_REPORT_v4" in background and i want to pass the output(internal table) from report to calling main program.? is it possible?

how to do this?

ambichan.

Read only

0 Likes
653

Hi Ambi Chan,

Use IMPORT and EXPORT commands to pass internal table.

Thanks

Lakshman

Read only

0 Likes
653

hey lakshman.

Thanks for your reply.

I am able to solve the shortdump.

But i am not get used to EXPORT and IMPORT Commands

in FM. R you talking abouT EXPORT and IMPORT parameter

in FM? could you pls give me sample for this?

ambichan.

Read only

0 Likes
653

Hi Ambi Chan,

Have a look at demo programs on how to import and expot,

DEMO_DATA_EXT_CLUSTER_IMPORT

DEMO_DATA_EXT_CLUSTER_EXPORT

Thanks

Lakshman