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

How to get the custom program generated in Background

Former Member
0 Likes
1,524

Dear Freinds,

I have written a below code in my submit program ( zreport) .

REPORT ZHRRPCPRRU0_SUBMIT NO STANDARD PAGE HEADING MESSAGE-ID zhr_msg.

SUBMIT RPTQTA00 VIA SELECTION-SCREEN

WITH pnpbegda = sy-datum

WITH pnpendda = lv_date

with pnppernr = '99007057'.

As per your logic i have used the submit program and i am able to default the dates in the Standard program RPTQTA00 , that is perfectly correct . Now if run the standard report it is giivng me the ouput ..so the foreground concept is working correctly.

Now if iam scheduling the Z report of the custom report (z program) where iam calling the submit program

it is just scheduling and further when i look at the sm37 i can see the job getting finished . However , i dont find any spool because the standard report has not been executed , with my custom report (using the logic with submit program above in zprogram ) i am calling the standard program (RPTQTA00).

so could you please let me know how the standard program will execute and get the spool genereated? in the case of background

because when i have executed only the standard report in background i can see that it is being exceuted spool as well, however when iam calling from custom program no spool is created because my custom program only submiting the standard report and it is not executing the standard report in the case of backround ...because when iam running the custom program in the Foreground it is calling the standard program and getting the values defaulted based on the parameters which i passed , so it gets defaulted later iam running the standard program manually .

So please could you let me know how will the standard program also gets genereated in the backgroung along with my custom report.

Thanks in advance

regards

madhuri,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,001

Hi

Try SUBMIT statement with background options

Regards

Madhan D

Hi

Try SUBMIT statement with background options

Regards

Madhan D

4 REPLIES 4
Read only

Former Member
0 Likes
1,002

Hi

Try SUBMIT statement with background options

Regards

Madhan D

Read only

0 Likes
1,001

Dear Madhan,

I have tried the options along the submi statment, could you please give me if you have

the logic with you , it would be great help.

regards

madhuri

Read only

0 Likes
1,001

Hi Can you try the following?

Hope this helps... (Taken from help)

Example

Scheduling a submitable program as a background task with the number number in a background request name. After scheduling, the background task is completed by function module JOB_CLOSE and released immediately.

DATA: number TYPE tbtcjob-jobcount,

name TYPE tbtcjob-jobname VALUE 'JOB_TEST',

print_parameters TYPE pri_params.

...

CALL FUNCTION 'JOB_OPEN'

EXPORTING

jobname = name

IMPORTING

jobcount = number

EXCEPTIONS

cant_create_job = 1

invalid_job_data = 2

jobname_missing = 3

OTHERS = 4.

IF sy-subrc = 0.

SUBMIT submitable TO SAP-SPOOL

SPOOL PARAMETERS print_parameters

WITHOUT SPOOL DYNPRO

VIA JOB name NUMBER number

AND RETURN.

IF sy-subrc = 0.

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = number

jobname = name

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 = 8.

IF sy-subrc <> 0.

...

ENDIF.

ENDIF.

ENDIF.

Read only

Former Member
0 Likes
1,001

Hi,

From your thread i understood that you are not able to execute thesubmit progrm through Z program.

Put a breakpoint before submit statement and see whether your program calling the standard program perfectly...

also you can write submit and return so that the control will be back to your Z program for the more analysis.

Cheers

Raghav