E9.05.700 Configurator Question - Add Material to Part Master

Deb Bland has an example of how to call Business Objects from ABL. You could use her example for the Part business object.

Mark W.


/* Copy Misc Chrgs for Quote at Header level to SO */

Â

/* Quote Misc Chrgs stored in UD07. Call SO business methods to add miscellaneous charges */

Â

DEF VAR iOrdNum as INTEGER no-undo.

DEF VAR iOrdLine as INTEGER no-undo INIT 0.

Â

DEF VAR DEBUGGING AS LOGICAL no-undo.

DEBUGGING = true.

Â

IF DEBUGGING THEN DO:

           output to value("d:\RestekERP\Logs\BPM\SalesOrder_CreateOrderFromQuote_QuoteMiscChrgs.txt").

           export string(Now) + " in Quote Misc Chrgs of SalesOrder.CreateOrderFromQuote".

END.

Â

FIND FIRST ttOrderHed WHERE ttOrderHed.Company = Cur-Comp no-lock no-error.

IF AVAIL ttOrderHed THEN DO:

                       iOrdNum = ttOrderHed.OrderNum.

Â

                       IF DEBUGGING THEN export "Order num=" + string(iOrdNum) + " QuoteNum=" + string(iQuoteNum).

          Â

                       FOR EACH UD07 no-lock WHERE UD07.Company = Cur-Comp AND Key2=string(iQuoteNum):

Â

                                                run GetNewOHOrderMsc({&input-output_dataset_SalesOrderDataSet}, input iOrdNum, input iOrdLine) no-error.

                                               IF DEBUGGING THEN export string(Now) + " in GetNewOHOrderMsc".

Â

                                               FIND FIRST ttOHOrderMsc WHERE ttOHOrderMsc.Company=Cur-Comp AND ttOHOrderMsc.RowMod = 'A' no-lock no-error.

                                               IF AVAIL ttOHOrderMsc THEN DO:

                                                                       IF DEBUGGING THEN export string(Now) + " OrderMsc rec found. UD07.Key3=" + UD07.Key3.

                                                                       ttOHOrderMsc.MiscCode = UD07.Key3.

                                               END.

                                               ELSE DO:

                                                                       If DEBUGGING THEN export string(Now) + " No OrderMsc rec found".

                                               END.

Â

                                                run ChangeMiscCode({&input-output_dataset_SalesOrderDataSet}, input "OHOrderMsc").

                                               IF DEBUGGING THEN export string(Now) + " in ChangeMiscCode".

Â

                                               /* Frequently, when using BO methods inside of BPM, you need to go and get the record again after calling a method. */

                                               FIND FIRST ttOHOrderMsc WHERE ttOHOrderMsc.Company=Cur-Comp AND ttOHOrderMsc.RowMod = 'A' no-lock no-error.

                                               IF AVAIL ttOHOrderMsc THEN DO:

                                                                       IF DEBUGGING THEN export string(Now) + " OrderMsc rec found. UD07.Shortchar02=" + UD07.Shortchar02 + " Number01=" + string(UD07.Number01) + " Number02=" + string(UD07.Number02).

Â

                                                                       /* User can change charge amount/percentage in the quote. Grab the amount/percentage from UD07. */

                                                                       IF UD07.Number01 <> 0 THEN DO:

                                                                                               ttOHOrderMsc.DocDspMiscAmt = UD07.Number01.

                                                                                               run ChangeMiscAmount({&input-output_dataset_SalesOrderDataSet}, input "OHOrderMsc").

                                                                      END.

                                                                       ELSE DO:

                                                                                               IF UD07.Number02 <> 0 THEN DO:

                                                                                                                       ttOHOrderMsc.Percentage = UD07.Number02.

                                                                                                                       run ChangeMiscPercent({&input-output_dataset_SalesOrderDataSet}, input "OHOrderMsc").

                                                                                               END.

                                                                       END.

                                               END.

Â

                                               FIND FIRST ttOHOrderMsc WHERE ttOHOrderMsc.Company=Cur-Comp AND ttOHOrderMsc.RowMod = 'A' no-lock no-error.

                                               IF AVAIL ttOHOrderMsc THEN DO:

                                                                       ttOHOrderMsc.FreqCode = UD07.ShortChar02.

                                               END.

Â

                                                run Update({&input-output_dataset_SalesOrderDataSet}) no-error.

                                               IF DEBUGGING THEN export string(Now) + " in Update".

                       END.

END.



On Wed, Dec 11, 2013 at 9:50 AM, Mark Wagner <mjfw2003@...> wrote:

Â
<div>
  
  
  <p></p><div style="font-size:12pt;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;"><div>We have a purchased material on a configured parts BOM as a placeholder for a part that can be many different colors. When the part is configured we create a job material part number on the fly and it defaults as purchase direct, but we would like to have the part actually create a part master and then allow the material to appear in purchase suggestions as purchase to stock.</div>

Anyone out there creating a part master at the time of the configuration and then adding it to the job BOM as a purchase to stock part?


</div>
 


<div style="color:#fff;min-height:0;"></div>

We have a purchased material on a configured parts BOM as a placeholder for a part that can be many different colors. When the part is configured we create a job material part number on the fly and it defaults as purchase direct, but we would like to have the part actually create a part master and then allow the material to appear in purchase suggestions as purchase to stock.

Anyone out there creating a part master at the time of the configuration and then adding it to the job BOM as a purchase to stock part?