text: sap.ui.define(["sap/ui/core/mvc/Controller"],function(e){"use strict";return e.extend("sap.ui.table.sample.Selection.Controller",{onInit:function(){this.sMafId="";var e=sap.ui.core.UIComponent.getRouterFor(this);e.getRoute("r_doc_header").attachPatternMa+
  tched(this.loadHeader,this);e.getRoute("r_list_header").attachPatternMatched(this.newHeader,this)},newHeader:function(e){this.sMafId="";var t=this.getView();t.unbindElement()},loadHeader:function(e){var t=e.getParameter("arguments").iv_mafid;this.sMafId=+
  t;var a="/ZC_MAF_DOC('"+t+"')";var r=this.getView();r.bindElement({path:a})},onSavePress:function(e){if(this.sMafId===""){this.createHeader()}else{this.updateHeader()}},createHeader:function(){var e=this.getView();var t=e.getModel();var a={Approved:e.byI+
  d("chkApproved").getSelected(),Description:e.byId("txtDescription").getValue(),CurrencyCode:e.byId("txtCurrency").getValue(),MaterialDescription:e.byId("txtMaterial").getValue(),Width:e.byId("txtWidth").getValue(),Height:e.byId("txtHeight").getValue(),Le+
  ngth:e.byId("txtLength").getValue(),SizeUom:e.byId("txtSizeUom").getValue(),Volume:e.byId("txtVolume").getValue(),VolumeUom:e.byId("txtVolumeUom").getValue()};t.create("/ZC_MAF_DOC",a,{success:function(e,t){sap.m.MessageToast.show("Created successfully")+
  },error:function(e){sap.m.MessageToast.show(JSON.parse(e.responseText).error.message.value)}})},updateHeader:function(){var e=this.getView();var t=e.getModel();var a="ZC_MAF_DOC('"+this.sMafId+"')";var r=t.oData[a];r.Approved=e.byId("chkApproved").getSel+
  ected();r.Description=e.byId("txtDescription").getValue();r.CurrencyCode=e.byId("txtCurrency").getValue();r.MaterialDescription=e.byId("txtMaterial").getValue();r.Width=e.byId("txtWidth").getValue();r.Height=e.byId("txtHeight").getValue();r.Length=e.byId+
  ("txtLength").getValue();r.SizeUom=e.byId("txtSizeUom").getValue();r.Volume=e.byId("txtVolume").getValue();r.VolumeUom=e.byId("txtVolumeUom").getValue();var s="/ZC_MAF_DOC('"+this.sMafId+"')";t.update(s,r,{success:function(e,t){sap.m.MessageToast.show("U+
  pdated successfully")},error:function(e){sap.m.MessageToast.show("Error")}})}})});                                                                                                                                                                             