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

BAPI_DOCUMENT_CHANGE and parallel processing

andrea_galluccio2
Contributor
0 Likes
2,583

Hi to all,

just one question about bapi's and parallel processing.

I'm using BAPI_DOCUMENT_CHANGE and BAPI_DOCUMENT_CREATE2 bapi to modify material documents. With SM50, i see that the bapi, uses all free DIALOG work process of the application server.

Is that a parallel processing. Isn't it? All BAPI's works in that way??

Probably this could improve the performance, but i dont' care and i would like to avoid this way of work, and use ONLY ONE dialog work process (also if i run the program in batch).

Is there a method to use ONLY one DIALOG work process with these BAPIs??

Thx a lot

Andrea

1 ACCEPTED SOLUTION
Read only

christian_wohlfahrt
Active Contributor
0 Likes
2,113

Hi,

same for me: time is running out before travelling.

Background won't help in case of starting new task.

There is general system parameter, which can prohibte usage of last 1-2 dailog sessions (not much of a help, but system stays unblocked).

I bet for user-exits, not standard.

Sophisticated resource usage needs additional programming (examples can follow later, anyway calls have to be identified in beforehand).

Regards,

Christian

9 REPLIES 9
Read only

Former Member
0 Likes
2,113

Hello Andrea,

I don't think what you see can be classified as <i>parallel processing.</i>

Only one work process will be utilized at any instant of time, unless you explicitly specify the options to make use of parallel processing (STARTING NEW TASK etc.,).

It may be possible (though I don't think it likely) that the two BAPIs use a different work process to execute. But the processing is actually still serial in nature.

Just observe one thing. Are the two BAPIs ( in one instance of your running program ) getting executed at the same instant with different work processes? Please confirm.

Also, this topic can be best understood if you supplement your observations with the online documentation.

Regards,

Anand Mandalika.

Read only

0 Likes
2,113

Hi Anand,

thx a lot for your answer (also if it not solve my problem).

I understand what u say.

If i run the program, five different dialog processing are occupated. They remains occupied until the program end (or if i kill it).

In the bapi, i don't use switch like "starting new task".

Also the standard documentation don't help me .

So, each bapi call, occupies one dialog work process.

Again, how i can force to use one (and only one) work process for the whole program ?

Thx a lot again

Andrea

Read only

0 Likes
2,113

Hi Andrea,

I think what Christian says makes complete sense. If you are not using any additons to explicitly specify the use of parallel processing, then there's nothing that you can do about it if some FM down the line is using that addition.

By the way, I have come across scenarios where the programmer wants to use parallel processing. But in your case it's the opposite. Is there a specific reason? Or is it something that you want to try out just to see if it's technically possible?

Regards,

Anand Mandalika.

Read only

0 Likes
2,113

Hi Anand,

I guess, 'all' is the problem: you never want your parallel processing eat up all your resources (and your collegues yelling: my SAP doesn't respond!).

Christian

Read only

0 Likes
2,113

Hello Christian,

I see your point and if you excuse me, I must say that it makes me a bit <i>nostalgic</i>. In my early days of working on SAP, we had an application server with just 8 dialog work processes and 35 concurrent users. Slow system-response was almost an everyday problem. But later on when I started working with systems of higher configuration, I almost never had this problem. So this did not occur to me.

Anyways, coming back to the future (), do you think there's a way to deliberately serialize this process? I can't think of anything simple and implementable.

<b>Andrea:</b>

If what Christian says is indeed your problem, then can you think of scheduling your program in the background?

Regards,

Anand Mandalika.

Read only

0 Likes
2,113

Hi guys,

Christian Wohlfahrt "hits" exactly the problem.

If the programs takes all dialog processes free, how i can login in sap after i started the program??

This is the problem.

If i start the program in backgroud (BTC process), i have the same problem:

1 BTC work process occupied by the "main" program

5 DIA work process comes used by BAPI (seemd that the BAPI is processed using a DIA wp).

Thx

Andrea

Read only

0 Likes
2,113

Hello Andrea,

There's one thing that you must see - Christian was just suggesting a theoretical possibility. It <i>may be</i> that some FM somewhere deep down the line is triggering a new task. But we cannot be sure about that till we have actually identified that. I have done a quick debug of the BAPI and have not found any such statements which would trigger a new task. Some of the code would not have been executed for some of the conditions of the data that I have used.

In any case, I think it is unlikely that a BAPI would be written such that it would spawn across multiple work-processes. Are you sure that all the work-processes you see in SM50 are yours and are resulting only from the execution of this BAPI? If yes, then I guess there's nothing much that you can do about it.

If it is a problem with only this BAPI, then I think it should have been identified already - bu I could find no SAP Note for this problem.

As a last thing that I can think of before the weekend, can you try calling this BAPI with the Addition IN BACKGROUND TASK ? (I doubt it will work, but just give it a try )

Regards,

Anand Mandalika.

Read only

christian_wohlfahrt
Active Contributor
0 Likes
2,113

Hi Andrea,

to sum some facts: obviously you are not starting new sessions with '... new task', obviously your calling is total sequential.

And now a really blind guess: there are some minor extensions in user-exit(s), which are calling new tasks to make some necessary steps of a follow-on process...

BAPI's don't have a hidden life. Only update might be asynchronous - which you can avoid by calling bapi_transaction_commit with 'wait'.

Do you have a complete overview of customer programming in this part?

Regards,

Christian

Read only

christian_wohlfahrt
Active Contributor
0 Likes
2,114

Hi,

same for me: time is running out before travelling.

Background won't help in case of starting new task.

There is general system parameter, which can prohibte usage of last 1-2 dailog sessions (not much of a help, but system stays unblocked).

I bet for user-exits, not standard.

Sophisticated resource usage needs additional programming (examples can follow later, anyway calls have to be identified in beforehand).

Regards,

Christian