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:
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: