cancel
Showing results for 
Search instead for 
Did you mean: 

Use same LUW / create session

NilsO
Advisor
Advisor
0 Kudos

Hi,

I would like to use the BAPI BAPI_BUS2172_CREATE to create a new cProjects Proj.definition. This BAPI requires the BAPI BAPI_CPROJECTS_COMMIT_WORK to be called afterwards in order to acutally create the database entries. Unfortunately it doesn't work because the second BAPI seems to be called from within a different LUW (Logical unit of work). Is there any way to call these two BAPIs "together" so that they use the same connection or LUW in the backendsystem?

Many thanks & regards,

Nils

Accepted Solutions (1)

Accepted Solutions (1)

MichaelTe
Contributor
0 Kudos

Hello Nils,

you could create your own 'BAPI' (a function module which is remote enabled). All import/export parameters of the original BAPIs must be in the interface of your function module.

In this function module call the two BAPIs one after another. So they will be in the same LUW.

In VC you call your own Z function module.

Regards, Michael

NilsO
Advisor
Advisor
0 Kudos

Hi Michael,

many thanks for your answer. I implemented your suggestion and it works fine, but I wonder if there's really no other way to get around the problem. I would expect something like to call a BAPI 'start session', then the 2 BAPIs I actually need and afterwards an 'end session' BAPI.

Regards,

Nils

MichaelTe
Contributor
0 Kudos

Hello Nils,

I think it has something to do with the RFC itself. When you call a BAPI in VC then you get a session id, or something like that. When the BAPI ends the session becomes invalid and therefore the next BAPI becomes another session id.

But to be honest I don't understand that much about RFC, session ids etc...

So I use this workaround: it works fine: and ...

never change a running system!

Regards, Michael

Answers (0)