Skip to Content
author's profile photo Former Member
Former Member

Insert data into ATC1


I'm inserting data into the ATC1 (Attachments) table. Each row contains information abount PDF files generated by a third party application. The PDF files need to be connected to the service contracts (OCTR).

It runs well, but the problem is that SAP errors when we are trying to connect customer equipment (OINS) to a service contract.

These queries are being ran when inserting data into the ATC1 table:

1. SELECT AtcEntry FROM dbo.OCTR WHERE CstmrCode = '<customer code>';

2. SELECT MAX(Line) + 1 AS Line FROM dbo.ATC1 WHERE AbsEntry = '<AtcEntry from query 1.>'

3. INSERT INTO dbo.ATC1 (AbsEntry, Line, <some other fields>) VALUES (<AtcEntry from query 1.>, <Line from query 2.>');

Am I missing something? Has it anything to do with ONNM?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2012 at 02:55 PM


    You should never update system table by direct SQL command. It will void SAP support to your database whenever you get issue for database inconsistency.



    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Emiel,

      The fact that you are having this problem, is exactly the reason why SAP voids your support, when you go and manually play around with B1 system tables. The problem is, that for any and all transactions, B1 tends to make checks and/or entries in many more than just the obvious tables and fields.

      For the same reason, no one else does this, and therefore it will be next to impossible for you to get useful help with this problem.

      If you are a B1 customer / user (like me, I am not a SAP employee), I urge you not to try and automate any processes the way you are doing right now. It will come back and bite you in the ass sooner or later. I have automated our own system to the hilt, and I say this from personal experience.

      If you are a consultant building the automation for a customer, you are doing them a big disservice. I urge you to be honest with them, and hand the job over to a SAP partner company, or to get B1 certification yourself first.

      The DTW (Data Transfer Workbench) can be automated with scripts, that is why Gordon recommended it.

      If you are adamant about using direct sql, I strongly recommend that you use either user tables (tables that you can add in B1 through the client) and/or user fields (fields that you can add to almost all B1 system forms, through the client). Although SAP has the same rules about these tables and fields, in practice applying direct inserts and updates on them, won't harm your system.

      Alternatively create a database of your own that contains all necessary data, and/or build your own .net GUI for all user interaction, and the DI API for interaction with the B1 system.



      P.S. I can tell you this same story in Dutch if you like. 😉

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.