‎2008 Dec 08 2:55 PM
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.
‎2008 Dec 08 7:03 PM
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
‎2008 Dec 08 7:03 PM
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
‎2008 Dec 08 7:08 PM
Kusum - also bear in mind that you cannot use FMs like GUI_DOWNLOAD in batch jobs.
Rob
‎2008 Dec 09 8:25 AM
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.
‎2008 Dec 09 2:14 PM
>
> 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
‎2008 Dec 09 2:21 PM
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.
‎2008 Dec 09 11:23 AM
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.