cancel
Showing results for 
Search instead for 
Did you mean: 

Can oracle trigger get the SAP system field value?

Former Member
0 Kudos

I want to create some oracle trigger to the SAP database instance,

can the trigger get the system field value (for example:SY-UNAME , SY-DATUM ) from SAP ?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

>

> I want to create some oracle trigger to the SAP database instance,

> can the trigger get the system field value (for example:SY-UNAME , SY-DATUM ) from SAP ?

Hi,

If I understand you correctly you want to design a trigger which is able to read the current value of SAP SY-* fields, probably to assign them to columns of the table you are modifying through the trigger (could this be some kind of audit table?). The SY fields exist in your session context and they are managed by the SAP kernel; I see no possibility to retrieve them inside code that runs at the database level outside the application context. For the date and time you could of course get those from Oracle directtly with "to_char(sysdate,'YYYYMMDD')" replacing SY-DATUM and "to_char (sysdate,'HH24MISS')" replacing SY-UZEIT. SY-UNAME is problematic because at the database level all operations are done by a single user like SAPR3 or SAP<SID>. I can't think of any way a statement in Oracle could capture this information.

As pointed out in other replies, custom triggers are not supported by the SAP dictionary, which means you will lose them when you transport, reorganize, ... the table.

Perhaps it would be better if you explained excatly what you want to achieve, there might be an easier and supported way to solve your question.

Regards,

Mark

fidel_vales
Employee
Employee
0 Kudos

Hi Mark,

Only to "complement" your answer

in kernel 710 (not sure if if it starting in a specific patch) the "SAP" user is updated on V$SESSION.CLIENT_IDENTIFIER.

As mentioned,

1) do not think it makes sense to create a trigger to "audit" (there are SAP and Oracle options)

2) it is not supported, and more when such thing can cause a lot of performance problems

Former Member
0 Kudos

SAP not support any external trigger,procedure etc

if you want then create your document .

SurendraJain

Former Member
0 Kudos

Not sure the purpose of this. But remember any side effect may not be supported by SAP and SAP application logic/security will be ignored by direct access to the database.

Former Member
0 Kudos

I don't think SAP will like this idea.

Have a look at SAP note 105047, chapter 58.