cancel
Showing results for 
Search instead for 
Did you mean: 

Add attachment by SQL

Former Member
0 Kudos

Good morning everyone,

we are trying to add attachment on marketing documents using SQL in a sap b1 9.1.

We add an entry in OATC and the relative row in ATC1, then we entry the OATC values (AbsEntry) in the document header table (AtcEntry). All works fine, I can open the attachment directly from the document.

The problem is that after that we cannot manually insert new attachment in any documents (error: this entry already exists in OATC table), seems that there is another index or "next number" like in documents numbering series...

Could you help us, please?

Thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Johan_H
Active Contributor

Hi Paolo,

Never, never, never, never, never, never, never, never use direct SQL on system tables and fields!

You will lose your SAP support, and the effect you have witnessed is another great example of why you should not do it.

When you perform an action in the B1 client, like adding an attachment, the system will often create entries in several other tables and/or fields. What tables or fields are not disclosed by SAP.

Please restore a backup of your company database, and use the client, the DTW, or an addon (DI API).

Regards,

Johan

P.S. You can use direct SQL on user defined fields and tables, and if you don't tell anyone, on the Comments field in documents

0 Kudos

ATC1 Table is only related to OATC?

If i upload an attachment to a Purchase Request form, how can i relate ATC1 record entry to OPOR table ?

regards