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

Submit Problem

Former Member
0 Likes
1,740

Hi,

When use the below code in report-2 the sy-comm values changes to 'JOBS' instead of 'ONLI'. So please let me know how can I rectify it?

Note: Its working fine if I remove the addition job from the submit statement.

Thanks in advance.

Regards,

Siva.

SUBMIT Report-1

USER LV_BATCHUSER

VIA JOB LV_JOBNAME NUMBER LV_JOBCOUNT

AND RETURN TO SAP-SPOOL

WITHOUT SPOOL DYNPRO

DESTINATION 'LOCL'

IMMEDIATELY ' '

KEEP IN SPOOL ' '

USING SELECTION-SET P_VARIANT

WITH SEL_LOC IN PR_LOCNO

WITH SEL_PROD IN PR_MATNR.

10 REPLIES 10
Read only

Former Member
0 Likes
1,383

Hi

Where is the problem?

I can't see where you check the system variable SY-UCOMM

Max

Read only

Former Member
0 Likes
1,383

The sy-ucomm is populated with 'JOBS' in at selection-screen of report-1. Since there is a check with UCOMM 'ONLI' in report-1 it's not getting triggered.

Read only

0 Likes
1,383

Hi

It's not very clear for me what you need.

U have to program REPORT-1 and REPORT-2, REPORT-1 is submitted by REPORT-2: is it right?

Now do you need REPORT-1 works only in background?

Max

Read only

Former Member
0 Likes
1,383

Yes I call report-1 in report-2.

When I excute the report-1 it calls the report-2. There is a check in report-2.

If sy-ucomm = 'ONLI'.

process.

endif.

But I get the sy-ucomm value as 'JOBS'. I don't know from there it's getting populated.

Read only

0 Likes
1,383

Hi

U can't change that value it depends on how it runs a report.

SY-UCOMM:

- ONLI if the report works ON LINE,

- PRIN if the report works ON LINE and print the data

- SJOB if the report works in bakcground.

So if you need to check if a report is in online or background u can also check the variable SY-BATCH.

Anyway u can update the control

If sy-ucomm = 'ONLI' or 
  sy-ucomm = 'SJOB'.  process.
endif.

Max

Read only

0 Likes
1,383

sy-ucomm would be JOBS as you are submitting the report via a job. The only way you can get the ucomm to be ONLI is by not submitting via job and instead just SUBMIT and RETURN.

Read only

Former Member
0 Likes
1,383

I execute the report in the foreground but still I get the ucomm values as 'JOBS' and more over the Report-2 is a standard program. So I can't change anythign in that.

Read only

0 Likes
1,383

Sorry it is getting a bit confusing...are you submitting report2 or report1 ?

In your submit statement you said report1 and in the above you mention report2 ??

Please note that which ever is the ABAP, if you submit it via JOB then the sy-ucomm field would contain JOBS and not ONLI.

Read only

Former Member
0 Likes
1,383

Thx a lot.

I have removed the option JOB and its working fine.

Since there is some problem in assigning points......... will assign the point later.

Regards,

Siva.

Read only

Former Member
0 Likes
1,383

If you submit it via JOB then the sy-ucomm field would contain JOBS and not ONLI.