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

batch job

Former Member
0 Likes
934

Hi I am working on batch job .

my program is printing invoice as well as downloading and I have run this program in batch,

I am using the FM job_open , job_submit and job_close.

but it is failing in job_submit with sy-subrc eq 1 .

giving me error bad print parameter , I haven;t done this before.

I think it should be option.

CALL FUNCTION 'JOB_SUBMIT'

EXPORTING

authcknam = SY-UNAME "tbtcjob-authcknam

jobcount = tbtcjob-jobcount

jobname = p_jobnam

language = sy-langu

report = c_reprot

variant = pvariant

EXCEPTIONS

OTHERS = 01.

could anybody pls guide me why it is so???

Regards.

Kusum.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
792

Hi Kusum,

To send the print parameters to my program I use the PRIPARAMS, export field. The printer name is filled in PRIPARAMS-PDEST.

Michelle

6 REPLIES 6
Read only

Former Member
0 Likes
793

Hi Kusum,

To send the print parameters to my program I use the PRIPARAMS, export field. The printer name is filled in PRIPARAMS-PDEST.

Michelle

Read only

Former Member
0 Likes
792

Kusum - also bear in mind that you cannot use FMs like GUI_DOWNLOAD in batch jobs.

Rob

Read only

0 Likes
792

Hi Thnaks for your response.

but I am using ws_download to download data on application server...

I haope it should be Ok.

and also on edoubt that the print parameter is an optional parameter and I don't know why without it my job_submit is not working??

Regards.

Kusum.

Read only

0 Likes
792

>

> but I am using ws_download to download data on application server...

> I haope it should be Ok.

Hoping won't make it so.

To download data to the ap server, you have to use OPEN DATASET and TRANSFER.

Rob

Read only

0 Likes
792

you can below code

OPEN DATASET gv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT

WITH SMART LINEFEED.

IF sy-subrc EQ 0.

WHILE sy-subrc IS INITIAL.

READ DATASET gv_file INTO gwa_header_file.

IF sy-subrc NE 0.

EXIT.

ELSE.

APPEND gwa_header_file TO gt_header_file.

ENDIF.

ENDWHILE.

CLOSE DATASET gv_file.

ENDIF.

ENDIF.

Read only

Former Member
0 Likes
792

Does the person who runs this job have a default printer set up on the system? The printer options are optional for several reasons. One is not all submitted jobs are for printing.