Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3212

Import Alternative Items

$
0
0

Hi all,

 

I'm using this code to import alternative items into SAP. It was working with previous versions, but now in SAP 9.1 PL10 it is not working. Any ideas why?

 

SAPbobsCOM.CompanyService oCompanyService;

                SAPbobsCOM.AlternativeItemsService AltItemsService;

                SAPbobsCOM.OriginalItem OriItem;

                SAPbobsCOM.OriginalItemParams OriItemParams;

                SAPbobsCOM.AlternativeItem AltItem;

                oCompanyService = Globals.oCompany.GetCompanyService();

                error = 2;

                AltItemsService =

                (SAPbobsCOM.AlternativeItemsService)(oCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.AlternativeItemsService));

                OriItem =

                (SAPbobsCOM.OriginalItem)(AltItemsService.GetDataInterface(SAPbobsCOM.AlternativeItemsServiceDataInterfaces.aisOriginalItem));

                OriItemParams =

                 (SAPbobsCOM.OriginalItemParams)(AltItemsService.GetDataInterface(SAPbobsCOM.AlternativeItemsServiceDataInterfaces.aisOriginalItemParams));

 

 

 

 

                //Add 2 Alternative Items to Item A00003

                OriItem.ItemCode = "A02.11028"; // This item has no Alternative Items

 

 

                 //Adding first Alternative Item

                OriItem.AlternativeItems.Add();

                AltItem = OriItem.AlternativeItems.Item(0);

                AltItem.AlternativeItemCode = "A02.11028.M01";

                AltItem.MatchFactor = 100;

 

 

                //Adding second Alternative Item

                OriItem.AlternativeItems.Add();

                AltItem = OriItem.AlternativeItems.Item(1);

                AltItem.AlternativeItemCode = "A02.11028.M02";

                AltItem.MatchFactor = 100;

 

 

                //Adding the new Alternative Items

                OriItemParams = AltItemsService.AddItem(OriItem);


Viewing all articles
Browse latest Browse all 3212

Trending Articles



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