Application Development 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: 

Turn off the 'print immediately' option for call transaction temporaily

Former Member
0 Kudos

Hi,

Does anyone know if there is a way to turn off the 'print immediately' option temporary for call transaction that will be executed in background? We do not want to update the batch user setting. The main program will be executed in background which will call a transaction which the bdc has a sy-ucomm = '=SJOB'.

Thus, by using FM SET_PRINT_PARAMATER will not work in this case since the call transaction resets to the user print parameter again when call in background.

Can the BDC screens turns off the print immeidately option? Tried this BDC screen sequence but did not work.


SAPLSPRI	0100	X
BDC_OKCODE	=EXPT
PRI_PARAMS-PDEST  <printer ID>
SAPLSPRI	0300	X
BDC_OKCODE	=%_GC 115 22
SAPLSPRI	0300	X
BDC_OKCODE	=PTON
BDC_CURSOR	PRIPAR_DYN-PRIMM2
PRIPAR_DYN-PRIMM2
SAPLSPRI	0100	X
BDC_OKCODE	=SAVE

Please help!!

14 REPLIES 14

Former Member
0 Kudos

Hi,

Just call table NAST & update the field DIMME,which is print immediately field.

0 Kudos

Isn't the NAST populated after the spool request is already created and sent to the printer if the print immediately field is on? So that would be too late in our scenario.

0 Kudos

Ok..Call table USR01 ,where you have a field for the print immediately.change that value before the call transaction & stry it out.

0 Kudos

Yes by changing user setting table USR01 will turn off the print immediately indicator but we do not want to change the USR01 setting since a generic user ID will be use to run the batch job and the same user ID will be used to run other batch program as well so the user setting cannot be changed in our scenario.

Former Member
0 Kudos

Are you creating a job that is running the transaction? If so, you can turn off the 'print immediately' at that time.

Rob

0 Kudos

I am creating a job that run the <b>Main program</b> which then <b>Call</b> different <b>Transaction</b> based on the selection. Each transaction (e.g. CK64) will be executed in background. This will generate two background jobs and two spools, one from the main program and the second for the transaction itself. When I turn off the 'print immediately' option for the job, it will only turn off for the spool generated from the main program but the <u>spool from the transaction itself still uses the user setting parameter</u>.

0 Kudos

Hi,

Just before calling the transaction,change the value in USR01 & then after the call transaction ,update back the USR01.

0 Kudos

Hi all,

Can I join this Post.

Minami--> You want to turn off the 'print immediately' of a schdule job.

You can set the print settings while defining you schedule job .

While Schedule your job through T/code SM36>Setp1>Print Specifications> enter Output device Name> Properties> General Attributes> time of printing--> Select Print Later.

Hope this may help you.

Lanka

0 Kudos

Since I am scheduling the job to run the main program which will then call another transaction and execute that in background, changing the print specification while scheduling the job will only change the spool generated by the main program (the 1st spool), but not he spool generated by the called transaction (the 2nd spool).

0 Kudos

Hello. I am trying to understand your requirement. You have a MAIN program that is running in background. From what I've read, you are spawning 2 additional background jobs from the first MAIN job.

How are you spawning off the additional background jobs? You could have the option of calling the function modules for creating and submitting jobs, where you can define the print parameters.

Hope this helps.

0 Kudos

Thanks for the advice but my second background job is a 'call-transaction' with BDC screen that the final SY-UCOMM is "=SJOB" so it actually starts a second background job. It is standard transaction that every run will need to have different parameters....so I cannot use the job submit technic.

The most preferable way is to be able to let the BDC to change the 'print immediately' checkbox for the second job but the BDC does not seem to take what is recorded in the recorder (tcode: SHDB)

0 Kudos

Hi all,

I was able to get a satisfied output by using

submit <program> with selection-table <seltab> 
to sap-spool without sap dynpro 
destination <printer ID> 
immediately ' ' 
keep in spool 'X'.

This will execute the transaction with all the selection paramters filled into the selection-table <seltab> and then send all the message and output to the spool directly but without outputing to the printer. So the problem is solved. For anybody interested in more details on the submit command, here is the thread:

0 Kudos

Hi,

If you extend the statement with 'AND RETURN' it will return to your program after executing the submitted program.

Message was edited by: Phani Kiran Nudurupati

former_member210857
Participant
0 Kudos

This message was moderated.