通过VIA ABSL将发货覆盖到销售订单的地址

2020-08-26 05:49发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


专家您好,

我尝试覆盖"发运单"中的"发运地址",但收到消息"必须更改"。

导入ABSL;
 导入AP.CRM.Global;


//定义SalesOrder根节点


 var elSalesOrder_Root:SalesOrder的元素;


 var instSalesOrder;


//定义SalesOrder项目节点


 var elSalesOrder_Item:SalesOrder.Item的元素;


 var instSalesOrder_Item;


 elSalesOrder_Root.Name.content ="传热专家";


 elSalesOrder_Root.BuyerID.content ="检查";






//SalesOrder:创建新实例


 instSalesOrder = SalesOrder.Create(elSalesOrder_Root);


//帐户




 instSalesOrder.Party.GetFirst()。RoleCode =" 1001";


 instSalesOrder.Party.GetFirst()。PartyKey.PartyID.content =" CP100140";


 var saveAccountData = instSalesOrder.Party.Create();





//处理发货至地址


 if(instSalesOrder.ProductRecipientParty.AddressSnapshot.IsSet())
 {
 var address = instSalesOrder.ProductRecipientParty.AddressSnapshot.PostalAddress.GetFirst();



 address.CountryCode =" US";


 address.RegionCode.content =" AK";


 address.CityName =" CHARLOTTE";


 address.StreetPostalCode =" 28269-0000";


 address.StreetName =" 7777 STATESVILLE ROAD";
 }
 其他
 {
 var address = instSalesOrder.ProductRecipientParty.AddressSnapshot.PostalAddress.Create();

 address.RegionCode.content =" AK";


 address.CityName =" CHARLOTTE";


 address.StreetPostalCode =" 28269-0000";


 address.StreetName =" 7777 STATESVILLE ROAD";



 }



//项目


 elSalesOrder_Item.ID =" 1";
 instSalesOrder_Item = instSalesOrder.Item.Create(elSalesOrder_Item);


 instSalesOrder_Item.ItemProduct.ProductKey.ProductID.content =" P100205";




 
  如果(instSalesOrder_Item.FirstRequestedItemScheduleLine.IsSet()){


//设置产品数量和UOM(如果未设置,则系统默认)


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.content = 10;


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.unitCode =" EA";


 }其他{


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Create();


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.content = 10;


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.unitCode =" EA";


 }


//折扣头


 if(instSalesOrder.PriceAndTaxCalculation.MainDiscount.IsSet())
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainDiscount;


 discount.TypeCode.content =" 0007";
 discount.Rate.DecimalValue = -20;
 discount.Rate.MeasureUnitCode =" P1";
 }
 其他
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainDiscount.Create();
 discount.TypeCode.content =" 0007";
 discount.Rate.DecimalValue = -20;
 discount.Rate.MeasureUnitCode =" P1";
 }


//充电头
 if(instSalesOrder.PriceAndTaxCalculation.MainSurcharge.IsSet())
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainSurcharge;


 discount.TypeCode.content =" 7PR8";
 discount.Rate.DecimalValue = 30;
 discount.Rate.CurrencyCode =" USD";
 }
 其他
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainSurcharge.Create();
 discount.TypeCode.content =" 7PR8";
 discount.Rate.DecimalValue = 30;
 discount.Rate.CurrencyCode =" USD";
 }
 

当ABSL创建SO时,如何覆盖发运至销售订单的地址?

此致

Quyen

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


专家您好,

我尝试覆盖"发运单"中的"发运地址",但收到消息"必须更改"。

导入ABSL;
 导入AP.CRM.Global;


//定义SalesOrder根节点


 var elSalesOrder_Root:SalesOrder的元素;


 var instSalesOrder;


//定义SalesOrder项目节点


 var elSalesOrder_Item:SalesOrder.Item的元素;


 var instSalesOrder_Item;


 elSalesOrder_Root.Name.content ="传热专家";


 elSalesOrder_Root.BuyerID.content ="检查";






//SalesOrder:创建新实例


 instSalesOrder = SalesOrder.Create(elSalesOrder_Root);


//帐户




 instSalesOrder.Party.GetFirst()。RoleCode =" 1001";


 instSalesOrder.Party.GetFirst()。PartyKey.PartyID.content =" CP100140";


 var saveAccountData = instSalesOrder.Party.Create();





//处理发货至地址


 if(instSalesOrder.ProductRecipientParty.AddressSnapshot.IsSet())
 {
 var address = instSalesOrder.ProductRecipientParty.AddressSnapshot.PostalAddress.GetFirst();



 address.CountryCode =" US";


 address.RegionCode.content =" AK";


 address.CityName =" CHARLOTTE";


 address.StreetPostalCode =" 28269-0000";


 address.StreetName =" 7777 STATESVILLE ROAD";
 }
 其他
 {
 var address = instSalesOrder.ProductRecipientParty.AddressSnapshot.PostalAddress.Create();

 address.RegionCode.content =" AK";


 address.CityName =" CHARLOTTE";


 address.StreetPostalCode =" 28269-0000";


 address.StreetName =" 7777 STATESVILLE ROAD";



 }



//项目


 elSalesOrder_Item.ID =" 1";
 instSalesOrder_Item = instSalesOrder.Item.Create(elSalesOrder_Item);


 instSalesOrder_Item.ItemProduct.ProductKey.ProductID.content =" P100205";




 
  如果(instSalesOrder_Item.FirstRequestedItemScheduleLine.IsSet()){


//设置产品数量和UOM(如果未设置,则系统默认)


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.content = 10;


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.unitCode =" EA";


 }其他{


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Create();


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.content = 10;


 instSalesOrder_Item.FirstRequestedItemScheduleLine.Quantity.unitCode =" EA";


 }


//折扣头


 if(instSalesOrder.PriceAndTaxCalculation.MainDiscount.IsSet())
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainDiscount;


 discount.TypeCode.content =" 0007";
 discount.Rate.DecimalValue = -20;
 discount.Rate.MeasureUnitCode =" P1";
 }
 其他
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainDiscount.Create();
 discount.TypeCode.content =" 0007";
 discount.Rate.DecimalValue = -20;
 discount.Rate.MeasureUnitCode =" P1";
 }


//充电头
 if(instSalesOrder.PriceAndTaxCalculation.MainSurcharge.IsSet())
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainSurcharge;


 discount.TypeCode.content =" 7PR8";
 discount.Rate.DecimalValue = 30;
 discount.Rate.CurrencyCode =" USD";
 }
 其他
 {
 var discount = instSalesOrder.PriceAndTaxCalculation.MainSurcharge.Create();
 discount.TypeCode.content =" 7PR8";
 discount.Rate.DecimalValue = 30;
 discount.Rate.CurrencyCode =" USD";
 }
 

当ABSL创建SO时,如何覆盖发运至销售订单的地址?

此致

Quyen

付费偷看设置
发送
5条回答
蓋茨
1楼-- · 2020-08-26 06:13

Hello Quyen,

通常:快照根本无法更改。 :-(

您需要找到维修收货方地址的正确位置。

HTH,
。Horst

clasier
2楼-- · 2020-08-26 06:21

@ May Thitsa Oo 霍斯特·肖德

你有什么主意吗?

谢谢

Quyen

xfwsx85
3楼-- · 2020-08-26 06:24

你好Quyen

我不是要在"帐户"中覆盖它,而是在SalesOrder中覆盖它。 :-)

再见,
。 Horst

SAP浪
4楼-- · 2020-08-26 06:21

Hello Horst,

我不想将当前发货覆盖到"帐户"中的该设置默认值。

收货人地址仅用于一次SO。

此致

Quyen

Alawn_Xu
5楼-- · 2020-08-26 06:20

嗨Quyen,

正如已经提到的 Horst Schaude 一样,地址快照无法更改。 您必须使用所需的信息创建一个新的地址快照实例,然后将此新实例设置为"销售订单"的当前实例。

此新实例创建在Address EC处理的SAP Business ByDesing Standard中,但是在这种情况下,您必须通过ABSL进行此操作,我知道这将使此任务不像预期的那么容易;-)。

在最坏的情况下,您可以在系统中创建一个带有Web服务请求(拥有和退出Web服务)的新地址快照,然后在销售订单中使用创建的实例。

最好的问候

Tobias Kuhn

一周热门 更多>