Cegid PMI

Hello;

We have adopted, against my will, the CEGID Maunfacturing PMI software (Version 16-20) but we do not have a PDM or ERP to make the link between our Solidworks achievements and the purchases and orders made on PMI...
So I find myself trying to create an intermediate interface between our two software via the VBA/Excel/SmartBom tools (visiativ).
Overall I can't get by too badly but I stumble on a bone:
I try to call the " Purchase Orders " of the selected Item from my interface:
I manage to display the Item Sheet:

Private Const CHEMIN_CEGID As String = "C:\Program Files (x86)\Cegid\ManufacturingPMI\ManufacturingPMI.exe"
Private Const CEGID_SOC As String = "100"           ' numero de societe
Private Const CEGID_USER As String = "****"         ' code utilisateur
Private Const CEGID_BASE As String = "PMI"          ' nom de la base
Private Const CEGID_CC_DEFAUT As String = ""     ' CC envoye si l'article n'a pas de complementaire ("" = pas de CC)
Private Const CEGID_CC_ARTICLE As Boolean = True    ' True : CC = complementaire de l'article ; False : toujours CEGID_CC_DEFAUT
Private Const CEGID_MODE_TEST As Boolean = False    ' True : affiche la commande au lieu de la lancer

' Bouton 1 - fiche article. VALIDE : PROG=ARTICLE affiche la fiche avec son code.
Private Const CEGID_PROG_FICHE As String = "ARTICLE"
Private Const CEGID_MODELE_FICHE As String = "ARTICLE={ARTICLE} CC={CC} APPELANT=COMMANDE"

But for the "Supplier Order" sheet... nothing, nada, wallooo.
The meagre information I managed to find on the CEGID forum (no new message for 6 years) is contained in the attached pdf file, but there, once again, I can't find what I'm looking for.
Cegid-PMI-Liste-des-appel-Programme.pdf (524.2 KB)

I understand that I am targeting a niche market for this specific case, but if anyone ever has a flash of genius on this subject, or is confronted with the same situation (unlikely case I admit) I am willing to discuss the subject.

Regards.

Indeed very niche!
When questioning Copilot, here are the proposed answers. If nothing works, direct access to the SQL database seems the simplest.

Copilot's tracks:

Yes, I have a pretty serious lead.

Looking at the PDF Cegid-PMI-Call-List-Program, I don't see any program that allows you to directly open the " Purchase orders" tab from an item card. I think this is precisely why your call works for the item card but not for the related orders. [Cegid-PMI-... gramme.pdf | PDF]

What can be found in the documentation

For the articles:

Plain Text

PROG=MAJART

ARTICLE=xxx

CC=xxx

CALLER=COMMAND

or

Plain Text

PROG=ARTICLE

ARTICLE=xxx

CC=xxx

CALLER=COMMAND

(according to your current customization) [Cegid-PMI-... gramme.pdf | PDF]

For suppliers:

Plain Text

PROG=PROVIDED

ACCOUNT=xxx

CALLER=TELEPH

or

Plain Text

PROG=UPDATE/F

ACCOUNT=xxx

[Cegid-PMI-... gramme.pdf | PDF]

For order searches, we find for example:

Plain Text

PROG=TABCDE01-CDECLI

but only for sales orders. [Cegid-PMI-... gramme.pdf | PDF]


Which makes me think you're looking for the wrong PROG

In the full list of programs, there are:

  • nor CDEFOU
  • nor FOURNISSEUR-CDE
  • nor TABCDE01-CDEFOU
  • nor program explicitly associated with the consultation of purchase orders. [Cegid-PMI-... gramme.pdf | PDF]

On the other hand, the documentation shows that many windows are not directly callable and pass through internal intermediate screens. CEGID has often coded tabs as sub-windows and not as stand-alone programs.

It is therefore possible that:

  1. The item's " Purchase orders" window isn't exposed on the order line .
  2. it is only accessible after opening the item sheet;
  3. it requires an undocumented internal MCU call.

What I would test

Test 1: Launch the supplier consultation

Try:

BAT

PACKPMI PROG=PROVIDED ACCOUNT=XXXX SOC=100 USER=ME

or

BAT

PACKPMI PROG=SHIFT/F ACCOUNT=XXXX SOC=100 USER=ME

if you know the associated supplier. [Cegid-PMI-... gramme.pdf | PDF]


Test 2: Search PMI Files

On the workstation where PMI is installed, search in:

Plain Text

*. MCU

*. WDL

*. WDW

*. WDP

Channels:

Plain Text

CDEFOU

FOURN

PURCHASE

APPRO

COMFU

TABCDE01

Often, PMI developers have left program names in scripts.


Test 3: Spy on the internal call

As you already open the article page, the most effective approach is probably:

  • open the article from VBA;
  • Send a keyline:

VisualBasic

SendKeys " %A "

SendKeys " F "

(according to PMI shortcuts)

or

VisualBasic

SendKeys " ^{F5} "

If the Commands tab is accessible Keyboard.

A bit of a gruff but often more reliable than trying to discover a hidden PROG.


The lead that I find the most interesting

In the PDF we see:

Plain Text

Prog: AVAILABLE

Pre-selection:

ARTICLE=xxxxxx

CC=xx

[Cegid-PMI-... gramme.pdf | PDF]

However, in PMI, the " Available " window often allows you to display:

  • suppliers,
  • open purchase orders,
  • receptions,
  • stock,
  • needs.

I'll check if this window doesn't already contain the information you're looking for.

Example:

BAT

PACKPMI PROG=AVAILABLE ARTICLE=MYARTICLE CC=MYCC SOC=100 USER=ME

[Cegid-PMI-... gramme.pdf | PDF]


If this was my SmartBom / Excel project

Personally, I wouldn't even try to open the PMI window anymore.

I would read the PMI SQL tables directly:

  • Article
  • purchase order line
  • Purchase order

via ADO from Excel.

You then get directly:

Item Supplier Order No. Qty Expected Date

without depending on a CEGID window.

Since you're already in VBA/Excel/SmartBom, it's often much more robust.

By the way, do you know on what basis your PMI 16.20 runs?

  • SQL Server?
  • PostgreSQL?
  • Pervasive?
  • other?

If you can give the exact name of the PMI menu that you manually open to see the purchase orders for an item, I can probably find the PROG= corresponding one or determine if it is simply not exposed in the external calls.

Hello @Maclane ,

We also use both.

On the other hand, I don't understand the point of going further than importing the bill of materials from Solidworks → Cegid (we stopped there on our side).
This is done via an export/import of .csv in our country since Cegid no longer maintains the Solidworks->Cegid mill (which they had created around 2005-2010).

If you can elaborate on what you're trying to do, I might be interested.

Cegid manages at least 2 databases: the item/bill of materials database and then the things that have been launched (duplication of the bill of materials at a given time). I am not an expert in Cegid databases but I have colleagues who are more specialized in the subject.
Typically orders should be managed on the launch side (since linked to the deal/lot) or even in another database/table.

Thank you for your participation @sbadenis :grin: although I am surprised that " Copilot " makes a response of this " qualié ", I had given up using it when it was impossible to answer me on Microsoft products...

I hadn't thought to try Sendkey, it's an interesting track.

To the question why not attack the SQL database directly, it's because I simply don't have access to it (well yes, it's a mess!)

For your information, the exact name of the PMI menus are: (" ALT+Scroll Stop")
For the Item card => " \ARTICLE " (C2021art window) (this one was easy to find")
For Purchase Order (on this Part) => \ARTILCLE\CDEFOU (C2163DOC window)

@froussel

The objective is to be able to consult the list of existing articles much more easily with an Excel Userform, which points to an export *.csv of our Articles + External References + Labelled 1 and 2 sheets..., without being limited by the display and the slowness of PMI.
Overall, this makes it easier to create items while making sure that they don't already exist in PMI and/or find an existing item with similar features. (We have set strict rules on coding.)

Seeing that this type of search via Excel gives good results, invariably my superiors always ask for more, so now in addition to the direct consultation from this interface (Excel) of PMI's Artilcles sheets, they want to access Supplier orders and God knows what in the future...

Otherwise for the export from Solidworks, it also happens at soft via SmartBom bills of materials + TXT file + import...

As for the Solidworks->Cegid mill (which they had created around 2005-2010)... I thought it didn't work well at all... too bad.

… I dig into the information given and I give feedback for the people who are interested... :sweat_smile:

So you are recreating the CEGID database in excel :+1:

But if you are asked for crazy things, you can also ask for crazy things: like having access to the CEGID SQL database to make queries and output what you want.

NB: you can put SQL queries in Excel and directly retrieve an up-to-date image of Cegid data (I do it from the data in my EPDM SQL database, no reason why it should be different for Cegid).

Very very stupid thing for CEGID: check that you have access to ALL the menus you need. The interface is fully customizable according to users/groups and you can therefore end up with a more or less restricted interface. It's quite difficult to guess that the menu you want exists in Cegid but that you don't see it because the guy who set up the thing thought you didn't need it.

1 Like

Hello,
I am of the opinion of @froussel, you can have access to the SQL database of cegid in reading.
It's risk-free because you're not going to change the data.

That's what I did in my previous company. I had created a program that allowed data to be transferred between SW and the ERP.

You have been using this software for a short time if I understand correctly. Do you have support?

PS: It's starting to be heavy the cobblestones generated with AI that don't make sense. :wink:

Well yes it looks like... :sweat_smile:

Yes and no, let's say that users are more on the side of project managers, after-sales service and purchasing, while for my apple I suffer all the disadvantages on the CAD side:
Adding additional properties, managing nomenclatures, limiting the number of characters available... without having the slightest advantage, so I'm not really interested in it.

And since I'm the only one who has a few notions in CAD, uses Mycad, Excel and vba tools at the same time, I find myself creating the interfaces between Solidworks and PMI.

and to the question: Do you have support?
Again: Yes and No...
Yes we pay (very/too) well an independent service provider but his philosophy seems to forbid him the notions of data imports and exports, so talking to him about remote calls I think it's not worth it ... so on my side the answer is rather no (unless we include this forum, where the trend is reversed a bit :grin:)

@sbadenis : Be careful, the files you share are on your personal Sharepoint...
apart from the fact that you can't access it, it doesn't seem to me to be very " GDPR " as a location.

Try to ask for access to the SQL database.
If you get it, it will be much simpler.
They can create access for you in consultation.

1 Like

I'm going to ask, however, I'm not familiar with SQL queries, it's very likely that I'll ask for your help again...

Another possibility, if not import your database via PowerQuery (in Excel directly).
It's almost instantaneous for more than 65000 articles and then query or excel formula to fetch your data.
That's how our developer had managed the search for spare parts in our database and indeed difficult to do it faster. And no SQL query since we import the database at the moment.

I can help you if you want with my little experience.
But as @sbadenis says, you can do PowerQuery.

By the way, ask what is the type of SQL database: SQL Server, MySQL... :wink: