cancel
Showing results for 
Search instead for 
Did you mean: 

How to update OINM table value

Former Member
0 Kudos

Dear Support Team,

I wand to update the Goods Receipt document posted on '2015-03-31' to date '2015-04-01'

I successfully updated Goods Receipt document posting date (OIGN & IGN1) through sql update query.

now I wand to update OINM table also to get correct inventory audit report.

While updating OINM table data by using this query '

UPDATE OINM SET DocDate = '2015-04-01 00:00:00.000' WHERE BASE_REF = 23 AND TransType = 59'

That time I am getting an error

Msg 4406, Level 16, State 1, Line 1
'Update or insert of view or function 'OINM' failed because it contains a derived or constant field.'

SELECT * FROM OINM WHERE DocDate = '2015-03-31 00:00:00.000' AND BASE_REF = 23 AND TransType = 59


UPDATE OINM SET DocDate = '2015-04-31 00:00:00.000' WHERE BASE_REF = 23 AND TransType = 59

Thanks & Regards,

Abdul Rasheed P

abdulrasheed.co.in@gmail.com

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Dear Experts,

Thanks for the information.

Regards,

Abdul Rasheed P

jitin_chawla
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

It is not advised nor it is recommended to use update/insert statements in the database. The queries can render the database inconsistent.

Also, you loose the support from SAP.

Please check Note 896891 regarding the support scope of SAP Business One.

Request to contact SAP Business One Support in case of any issue/corruption.

Regards,

Jitin

narayanis
Active Contributor
0 Kudos

Hi,

Firing DML statements on SQL is not recommended. You may loose SAP support.

And OINM is a view and not a table which is dynamically getting updated because of a query definition in the database.

Regards

Pradnya

former_member185682
Active Contributor
0 Kudos

Hi Abdul,

Direct modifications to the SAP Business One tables can affect the integrity of the database & hence any such database will no longer be supported.

About your error with OINM, this occurs because OINM is not a table, is a view.

"A view is the result set of a stored query on the data, which the database users can query just as they would in a persistent database collection object. This pre-established query command is kept in the database dictionary. Unlike ordinary base tables in a relational database, a view does not form part of the physical schema: as a result set, it is a virtual table computed or collated dynamically from data in the database when access to that view is requested. Changes applied to the data in a relevant underlying table are reflected in the data shown in subsequent invocations of the view."

Kind Regards,

Diego Lother