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

Using submit while in update task

Former Member
0 Likes
5,401

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,527

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.

5 REPLIES 5
Read only

Former Member
0 Likes
2,528

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.

Read only

0 Likes
2,527

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?

Read only

0 Likes
2,527

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.

Read only

Former Member
0 Likes
2,527

Create a function module, place your sumbit in FM and call it IN BACKGROUND TASK...

Read only

Former Member
0 Likes
2,527

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.