Skip to main content

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

Comments

1 comment

  • 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



Please sign in to leave a comment.