Autofill cost center in purchase generated from MRP, from item (OITM) defaut cost center

Yannick Fetet

Dears,

 

Despite having correctly set the item cost center it each item master data, the corresponding value is not copied automatically in the purchase order to create (in item by item mode (line 1 of PO number 21000032 bellow), and in list mode (line 2 of PO number 21000032 bellow)).

 

 

The result is that the created purchase order do not contain the expected distribution rule (line 1 and 2 of the 21000032 PO bellow).

 

When filling up the field manually, in item by item order creation, the corresponding purchase order is then created correctly. (line 3 of the PO bellow)

 

 

Thanks in advance for the feature.

Best regards

Comments

1 comment

  • Comment author
    Yannick Fetet

    Thanks to Thorsten for the script below, to handle this request for now:

    On mrp_purchase_master you will have to activate the Cost Center column:


    mrp_purchase_master.src

    windowevent postopen
    setredraw=false
    for ll_loop = 1 to <dw_3.rowcount>
     sql=select "U_beas_prccode" from "OITM" where "ItemCode" = <dw_3.item.itemcode:[ll_loop].value,dbstring>
     if <wert1> <>  then
      dw_3.item.beas_mrp_order_prccode:[ll_loop].setvalue=<wert1>
     end if
    next
    setredraw=true
    end event

    mrp_view_masterrahmen.src

    windowevent tabredraw ldetail
    if <dw_3.dataobject> = program\mrp_view_bestellen.psr then
     sql=select "U_beas_prccode" from "OITM" where "ItemCode" = <dw_2.item.oitm_itemcode.value,dbstring>
     if <wert1> <>  then
      dw_3.item.prccode.setvalue=<wert1>
     end if
    end if
    end event



    0

Please sign in to leave a comment.