2005 Aug 05 11:50 AM
Ny necessity I am calling a print program from another print program so that the spools can be combined. This is done using the 'submit' program command to go and get the data from the called print program, which is then output in the calling print program. This works fine when the print is kicked off online, but if the print is called as part of the update task when saving the transaction, it falls over as the submit command is not allowed during update task. Can anyone suggest another way of doing this submit? I've searched similar threads on here, but with no luck.
cheers
Phil.
2005 Aug 05 12:53 PM
You can try to use the job functionality in combination with the BP_RAISE_EVENT FM.
1° Put your submit into a program.
2* Create a event(SM62)
3° Create a Background job (SM36) that call your second print program with Start condition After Event.
3° Use in your program the FM BP_RAISE_EVENT ro raise your event.Of course, you must transfer some of your information via import/export from memory.
2005 Aug 05 12:53 PM
You can try to use the job functionality in combination with the BP_RAISE_EVENT FM.
1° Put your submit into a program.
2* Create a event(SM62)
3° Create a Background job (SM36) that call your second print program with Start condition After Event.
3° Use in your program the FM BP_RAISE_EVENT ro raise your event.Of course, you must transfer some of your information via import/export from memory.
2005 Aug 05 1:23 PM
Hi thanks for that Barca but I can't really do that in this instance. To explain further, the probelm arises when you save out of a transaction ( int this case a delivery) and the delivery output is created as part of the update task. The term submit isnt allowed, so I need to find away to call on program from the other that is acceptable when the program is being called in the background when saving the delivery.
does that clarify the requirment a little more?
2005 Aug 05 1:53 PM
Ok, but i don't think it will possible for you to do something like that.Maybe you can see if you cannot use the PERFORM for Calling ABAP Subroutines from your sapscript.
In this perform, you can maybe insert into memory the values you need and retrieve then back in your calling program.
The problem is that the first program must wait unitl the calling application has filled the memory.
2007 Mar 28 9:01 PM
Create a function module, place your sumbit in FM and call it IN BACKGROUND TASK...
2008 Mar 17 7:15 AM
Hi Phil
I am facing similar problem in my program.
I was using following code in my program. This program is triggered in the update task.
SUBMIT ZMDTRAIL
WITH P_BUKRS EQ VBRK-BUKRS
WITH S_VBELN EQ VBRK-VBELN
TO SAP-SPOOL SPOOL PARAMETERS PRI_PARAMS
ARCHIVE PARAMETERS ARC_PARAMS
WITHOUT SPOOL DYNPRO
AND RETURN.
By addition TO SAP-SPOOL first output statement of zmdtrail creates a new spool request number and all outputs are transfered as print list page by page to SAP spool table.
By addition SPOOL PARAMETERS print parameters are transfered in PRI_PARAMS.
ARCHIVE PARAMETERS transfer archive parameters in structure ARC_PARAMS
Now in ECC 6.0 version submit statement is not allowed in update process. So instead of using submit statement i copied code of ZMDTRAIL . That part is working fine.
But now i want to work on SPOOL generation part of it. I am getting spool parameters in PRI_PARAMS by using function module GET_PRINT_PARAMETERS, but i am not able to generate spool number.
Kindly suggest me some appropriate additions so that code will work in same way as it was working earlier.
Thanking you in advance.