cancel
Showing results for 
Search instead for 
Did you mean: 

Database update on navigation

Former Member
0 Kudos

Dear All.

I am stuck with a fundamental concept now.

I update a table in a view, do not commit.

Click a button and go to next view. There I rollback.

But the table is still committed.

I think in ABAP dialog it's the same - go from one screen to another, database update will happen internally.

Is it the same way in Webdynpro for abap - i.e. navigation to another view does an implicit commit?

Thanks in adv.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi, Aishi .

You know, in SAP, there are 2 kinds of "Logic Unit of work", one is database-dependent LUW, the another is SAP-LUW. Here the DB-dependent LUW will be submit automatically and implicitly when: then end of Dialog...

For WD4A, is the same, i am afraid.

Very glad to discuss with you.

Best wishes.

Former Member
0 Kudos

Okay Can.

So does it mean I cannot make any database updates until I really want to save, right?

ChrisPaine
Active Contributor
0 Kudos

Yes...

SAP even provide a "transaction" pattern for the FPM GAF for this purpose. (Not that I've ever used it.) Where data is should not be committed until final confirm.

Much standard SAP functionality in HR has this "write to buffer" -> "flush buffer to database" type construct in order to deal with this sort of thing. Which is very useful as it allows you to execute all business logic that would be executed on writing to DB before actually doing it.

Former Member
0 Kudos

Thanks Chris.

Mine is an HR application only, but your reply has puzzled me.

Where data is should not be committed until final confirm.

Do you mean here that I can still say Update database, but not commit it? And continue navigation? I tried the same thing, but it does not work.

Much standard SAP functionality in HR has this "write to buffer" -> "flush buffer to database" type construct in order to deal with this sort of thing.

Sorry, never tried such a thing, and is totally new to me. How do we "WRITE TO BUFFER" and "FLUSH BUFFER"? Can provide me any code snippet please. That would help a lot.

Thanks again.

ChrisPaine
Active Contributor
0 Kudos

Hello Aishi,

The specific example I was referring to is the decoupled infotype framework for updating infotypes.

This is available for both PA and OM/PD infotypes.

for more information I'd suggest having a search on SCN - although some of these links may help you:

[Decoupling Infotypes - SAP Help |http://help.sap.com/erp2005_ehp_04/helpdata/EN/43/a503b963161bbfe10000000a1553f7/frameset.htm]

also refer to the classes/methods:

CL_HRPA_MASTERDATA_FACTORY=>GET_PLAIN_INFOTYPE_ACCESS

CL_HRBAS_PLAIN_INFOTYPE_ACCESS (although it is not as simple to use as the PA access).

These classes allow you to create all the data first in the buffer and then when you are ready - flush the buffer to the database.

Although exactly how they work is probably a topic for a different forum - and I've probably already overstepped the bounds of what is reasonable for this forum by mentioning them

Former Member
0 Kudos

hi,Aishi .

I guess you cannot keep your "database-update" open until your final commit , using Navigation in WD..

In tradition ABAP, we know that, in order to achieve this, we may use such as "Function Module" as "Update" mode, all "Call..return",etc...Then we can submit all the SQL until the final commit.

However, this is also based: no dialog or program ends, as the program ends will submit the SQL implicitly...

Very glad to discuss with you.

Best wishes.

Answers (0)