Quantcast
Channel: SCN : Unanswered Discussions - SAP Business ByDesign
Viewing all articles
Browse latest Browse all 4032

Create Material Master Data through SDK

$
0
0

Hello,

 

currently, I have difficulties in creating an instance of material BO as it dumps (Unexpected error during backend processing).

In the BeforeSaveEvent, I have implemented following absl-code:

 

import AP.FO.ProductDataMaintenance.Global;

import AP.Common.GDT;

 

//define root node

var elMaterialRoot: elementsof Material;

var newMaterial;

 

newMaterial = Material.Create(elMaterialRoot);

 

//if new instance was set, set relation from this BO to BO Material:

if ( newMaterial.IsSet() ) {

    this.ToMaterial = newMaterial;}

 

          else  { raise MaterialCreationFailed.Create("E");  }

 

newMaterial.InternalID.content = this.MID.content;

newMaterial.Description.GetFirst().Description.content = this.Description.content;

newMaterial.InventoryQuantityUnit.MeasureUnitCode = this.BaseUoM;

newMaterial.DemandPlanningCategory.ProductCategoryIDKey.ProductCategoryInternalID = this.ProductCategoryID;

 

In the documentation I am told that the Material BO is accessible through queries. Does that mean that I am not able to create material master data in the way I displayed?

 

Best regards and thanks,

Rufat


Viewing all articles
Browse latest Browse all 4032


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>