‎2009 Nov 24 12:57 PM
Hi All,
I have one requirement where I need to trigger and Email after PGI is done for any delivery. So for that I have find one enhancement after PGI Commit(as my SCRIPT output is generating based on data commited after PGI). In the enhancement I am calling one Z Report(report that gives SCRIPT Output of delivery) which generates SPOOL from the CLOSE_FORM of SCRIPT function module. This scenario is working fine for many cases but in few cases it's not generating SPOOL.
There is no problem in user setting as for same user it's generating some time and not generating in some case.
My Enhancement is passing Delivery Number to Z Report(using SUBMIT) which creates NEW SPOOL each time AND RETURNS back to Enhancement for convering SPOOL to PDF and then further processing for sending mail.
After long long analaysis I come to know that it's not generates SPOOL for some cases.
Please suggest some solution.
Thanks,
RP
‎2009 Nov 24 1:47 PM
Hi try this way...
* Subroutine to get the print parameters
* Function Module to get the print parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = 'LP01'
list_name = 'TEST'
list_text = 'SUBMIT ... TO SAP-SPOOL'
immediately = ' '
line_size = '2000'
no_dialog = 'X'
IMPORTING
out_parameters = wa_pri_params
valid = w_valid.
CONCATENATE 'QU'
sy-datum+4(4)
sy-uzeit INTO
wa_pri_params-plist.
* Submit report in background and creating spool
SUBMIT (w_rname) USING SELECTION-SET p_var
TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS wa_pri_params AND RETURN.
COMMIT WORK AND WAIT.
* To fetch the spool number from TSP01 table
IF sy-subrc EQ 0.
SELECT rqident
FROM tsp01
INTO p_spool
UP TO 1 ROWS
WHERE rq2name = wa_pri_params-plist.
ENDSELECT.
ENDIF.
Regards,
Prabhudas
‎2010 Feb 25 9:17 AM
Hi RP,
did you find a solution, as we maybe have the same question in this thread . This thread is about a delayed update of TSP01 making think that the spool has not been generated (in fact TSP01 update seems to be delayed somtimes).
Thx
‎2010 Nov 08 2:55 PM
Hi Sandra,
Can you please help me resolve an issue.
I have to send the spool o/p to application server, as spool is already in pdf format(from adobe). How to read that in pdf format only and write to app server in pdf format.
Regards
Manu
‎2010 Feb 25 9:21 AM
Hi,
Once you create SPOOL request and then converting to PDF and send mail.
After finishing this step delete the created SPOOL request from SPOOL.
Since some times it will not create spool because of memory.....
By doing above process we can reduce the memory usage.
Regards,
Shankar.
‎2010 Mar 23 5:41 AM
Due to server load it was not generating spool in time.
Thanks all for your input.
‎2010 Mar 23 8:51 AM
Hi RP, thx for the feedback.
As you know, in the other thread I mentioned above, Katie was interested to know why the spool was not generated in time, and alternatively what solution could be used instead of the WAIT UP TO 2 SECONDS she had been forced to use.
Could you give us more information why there was a delay, does it depend on Operating system or something else. Did you get some documentation about that (SAP note, etc.)
Thx
Sandra
‎2010 Mar 23 10:21 AM
I tried with putting delay but still server load was crossing the wait seconds.
In my case i have to proceed to SUBMIT program once data available in Z table so i put DO wa_time TIMES to check value in Z table. where value of wa_time is around 50.
Still this program is in UAT.
‎2010 Jun 04 8:43 PM
Hi R P, i am just wondering if you ever got this working. I used a wait and it was successful in UAT. It ran for the first time in production and two of my 38 emails had the wrong attachment because my delay was not long enough. i am hoping you found a solid solution. Thanks.