CoCreate User Forum

CoCreate User Forum (https://www.cocreateusers.org/forum/index.php)
-   Annotation (https://www.cocreateusers.org/forum/forumdisplay.php?f=6)
-   -   Edit and sort BOM table (https://www.cocreateusers.org/forum/showthread.php?t=8223)

Shaba 10-08-2015 12:11 AM

Edit and sort BOM table
 
Hi all :)

There is a way to sort BOM table by part code?
And a way to edit it?
I'm using OSD without MM

Thanks a lot! :cool:

Shaba 10-15-2015 11:33 AM

Re: Edit and sort BOM table
 
up........

Shaba 10-23-2015 05:41 AM

Re: Edit and sort BOM table
 
Someone can help me?

Shaba 12-12-2015 04:06 AM

Re: Edit and sort BOM table
 
up........

jkramer 12-15-2015 01:20 AM

Re: Edit and sort BOM table
 
I'm afraid not... the BOM table functionality is fairly limited.
Jaap

ssusana 01-03-2016 11:21 PM

Re: Edit and sort BOM table
 
1 Attachment(s)
Shaba,
thi is my code to sort the BOM by "codice", "fornitore" and "tipo".
the result in the attachment.

Code:

(defun ordinaBOM ()
    (sd-hide-display-table "AM-BOM-DATA-DTAB")

    (AM_BOM_NUMBERS :clear)  ;azzera tutte le posizioni
    (setq ltab (sd-get-display-table-logical-table "AM-BOM-DATA-DTAB"))
    (setq row-number (sd-get-logical-table-number-of-rows ltab))
    (setq i 0)
    (loop
        (setq POS_NO          (sd-Read-logical-table-cell ltab :row 0 :column :DOCU_BOM_POS_NO))
        (when (sd-string/= POS_NO "") (return) )

        (setq rowtableDB      (sd-read-logical-table-row ltab :row 0))
        (setq ENTRY_ID        (sd-Read-logical-table-cell ltab :row 0 :column :DOCU_BOM_ENTRY_ID ))

        (setq lengrow (length rowtableDB))
        (dotimes (j lengrow)
                  (if (string= (nth j rowtableDB) ":PART_CODE ")                    (setq CODICE          (nth (+ j 1) rowtableDB)))
                  (if (string= (nth j rowtableDB) ":bom3d-Fornitore-attr-cont ")    (setq FORNITORE        (nth (+ j 1) rowtableDB)))
                  (if (string= (nth j rowtableDB) ":bom3d-classe-merc-attr-cont ")  (setq TIPO            (nth (+ j 1) rowtableDB)))
      )
          (if (not FORNITORE) (setq FORNITORE ""))

       
          (COND
            ((OR (and  (sd-string/= (sd-string-trim FORNITORE) "") (sd-string= (sd-string-trim Tipo) "XXX"))     
                (sd-string= (sd-string-trim Tipo) "COM") )                                                    (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "A ~a~a~a" (SD-STRING-UPCASE (sd-string-trim FORNITORE))  (SD-STRING-UPCASE (sd-string-trim CODICE)) i ))) 
            ((AND (sd-string/= (sd-string-trim CODICE) "") (sd-string= (sd-string-trim Tipo) "MEC"))          (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "C ~a" CODICE)))       
            (T                                                                                                        (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "X ~a" i )))
;          (T                                                                                                              (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "D ~a~a~a" (SD-STRING-UPCASE (sd-string-trim DESCRIZIONE)) (SD-STRING-UPCASE (sd-string-trim PARTE)) i )))           
          ) ;COND

    (incf i)
    ) ;endloop
   
    (AM_BOM_NUMBERS :by_step :on :by_step_start 1 :by_step_incr 1)

    (setq i (- row-number 1))
    (loop
        (when (< i 0) (return) )
        (DISPLAY (format nil "~A gia' presente!" CODICE))
        (setq POS_NO          (sd-Read-logical-table-cell ltab :row i :column :DOCU_BOM_POS_NO))
        (setq ENTRY_ID        (sd-Read-logical-table-cell ltab :row i :column :DOCU_BOM_ENTRY_ID ))       

          (setq rowtableDB  (sd-read-logical-table-row ltab :row i))

        (setq lengrow (length rowtableDB))
        (dotimes (j lengrow)
                  (if (string= (nth j rowtableDB) ":PART_CODE ")                    (setq CODICE          (nth (+ j 1) rowtableDB)))
                  (if (string= (nth j rowtableDB) ":bom3d-Fornitore-attr-cont ")    (setq FORNITORE        (nth (+ j 1) rowtableDB)))
                  (if (string= (nth j rowtableDB) ":bom3d-classe-merc-attr-cont ")  (setq TIPO            (nth (+ j 1) rowtableDB)))
      )
      (if (not FORNITORE) (setq FORNITORE ""))         
   
          (COND
            ((sd-string= (sd-string-trim Tipo) "ASS")                        (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "~a" CODICE)))       
            ((AND (sd-string= (sd-string-trim FORNITORE) "")
                            (sd-string/= (sd-string-trim Tipo) "MEC"))            (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "X~a" POS_NO)))
            ((sd-string= (sd-string-trim Tipo) "MEC")                        (AM_POS_CHG_NO :BOM_ENTRY_ID ENTRY_ID :new_pos_no (format nil "~a" CODICE)))       
          ) ;COND

        (decf i)
    )

    (display :clear-hide)

)


Shaba 01-04-2016 04:19 AM

Re: Edit and sort BOM table
 
Thank you!
But it give me error
"La variabile FORNITORE non è associata"
I think it missing some macro
Thank you!

Sono anche io dall'Italia!
Secondo me mancano delle altre macro per funzionare
Hai qualche personalizzazioni su cui gira OSD?
Come fai a far comparire quella tabella?

Grazie

ssusana 01-10-2016 03:14 PM

Re: Edit and sort BOM table
 
Ciao,
devi personalizzare il codice con i tuoi campi, questo è solo un esempio di come ho lavorato per ordinare la tabella.
Posso aiutarti se mi mandi l'esportato in excel della tua tabella DB.

You must customize the lisp. I can help you if you send me your DB tablet in excel file.

Shaba 07-25-2017 07:38 AM

Re: Edit and sort BOM table
 
E' possibile avere a video la tabella come ce l'hai tu nell'immagine allegata?
Grazie :D

ssusana 08-17-2017 05:55 AM

Re: Edit and sort BOM table
 
cosa intendi?

pgagliardi 09-05-2017 10:54 PM

Re: Edit and sort BOM table
 
2 Attachment(s)
Ciao, sarei interessato anche io a mettere in ordine la mia tabella seguendo l'ordine di una colonna. Ho allegato l'esportazione della tabella in excel.
Vorrei riuscire ad ordinare la tabella per la colonna :POSCODICE_BOM.

Puoi darmi indicazione su cosa modificare?

Grazie
Ciao

Kaji 10-02-2017 11:58 AM

Re: Edit and sort BOM table
 
Quote:

Originally Posted by ssusana (Post 25869)
thi is my code to sort the BOM by "codice", "fornitore" and "tipo".
the result in the attachment.

Apologies for writing in Italian, but I can't speak English well.

Inoltre chiedo scusa per la domanda forse troppo banale, ma ho sempre utilizzato il PDM con macro etc ed ora a gestire le licenze da solo mi trovo in grossa difficoltà, pertanto chiedevo se questo "code" va inserito nella stringa dei comandi o in un file tipo am_customize ed inoltre come si fa a personalizzare il codice con i campi opportuni?

Infine ho notato nell'immagine che riesci a far comparire gli spazi nella descrizione delle parti, usi la versione 20 oppure anche questo è frutto di una comando o di un codice?

Grazie per la disponibilità.


All times are GMT -8. The time now is 11:42 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.