Skip to Content
avatar image
Former Member

Add attachment by SQL

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 24, 2017 at 11:05 AM

    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).



    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

    Add comment
    10|10000 characters needed characters exceeded