on 04-26-2019 8:09 AM
Hi, i'm trying to get OVS fields to show the description of the selected value instead of the ID, i've tried to follow what was written here with no luck:
https://answers.sap.com/questions/251038/how-to-make-association-to-bo-material-to-get-the.html
Here's my code:
import AP.Common.GDT as apCommonGDT;
[DeploymentUnit(CustomerRelationshipManagement)] [ChangeHistory] [WithAdministrativeData(IncludeSubnodes)] businessobject SampleDv
{
[DependentObject(TextCollection)] node TextCollection;
[DependentObject(AttachmentFolder)] node AttachmentFolder;
// elements for the node Root
[Label("Name")] element Name [0,1] : AP.Common.GDT:LANGUAGEINDEPENDENT_MEDIUM_Description;
[Label("ID Sample")] element IDSample [0,1] : ID;
[Label("Date of Product")] element DateofProduct [0,1] : AP.Common.GDT:Date;
[Label("Product Expiration Date")] element ProductExpirationDate [0,1] : AP.Common.GDT:Date;
[Label("Use")] element Use [0,1] : AP.Common.GDT:LANGUAGEINDEPENDENT_MEDIUM_Description;
[Label("Amount")] element Amount [0,1] : AP.Common.GDT:Amount;
[Label("Cantidad Inicial")] element CantInicial [0,1] : AP.Common.GDT:Quantity;
[Label("Cantidad Entregada")] element CantEntreg [0,1] : AP.Common.GDT:Quantity;
[Label("Cantidad Actual")] element CantActual [0,1] : AP.Common.GDT:Quantity;
[Label("Delivery Date")] element DeliveryDate [0,1] : AP.Common.GDT:Date;
[Label("Movement Status")] element MovementStatus [1,1] : MoveStatusCodesCode;
element CheckIfNew : Indicator;
// associations for the node Root
[Label("ID Proveedor")] element ProviderID : ID;
element ProviderName : LANGUAGEINDEPENDENT_MEDIUM_Name;
association ToProvider to Provider;
[Label("ID Cliente")] element AccountID : ID;
element AccountName : LANGUAGEINDEPENDENT_MEDIUM_Name;
association ToAccount[0,1] to AP.FO.BusinessPartner.Global:Customer.Root using UUID;
[Label("ID Empleado")] element EmployeeID : ID;
element EmployeeName : LANGUAGEINDEPENDENT_MEDIUM_Name;
association ToEmployee[0,1] to AP.FO.BusinessPartner.Global:Employee.Root using UUID;
[Label("ID Oportunidad")] element OpportunityID : ID;
element OpportunityName : LANGUAGEINDEPENDENT_MEDIUM_Name;
association ToOpportunity[0,1] to AP.CRM.Global:Opportunity.Root using UUID;
[Label("ID Producto")] element ProductID : ID;
element ProductName : LANGUAGEINDEPENDENT_MEDIUM_Name;
association ToProduct[0,1] to AP.FO.ProductDataMaintenance.Global:Material.Root using UUID;
// actions for the node Root
action Copy;
}
Event-AfterModify.absl
import ABSL;
import AP.FO.BusinessPartner.Global;
import AP.FO.ProductDataMaintenance.Global;
if(this.CantInicial.content > 0 && this.CantEntreg.content >= 0)
{
this.CantEntreg.unitCode = this.CantInicial.unitCode;
this.CantActual.unitCode = this.CantInicial.unitCode;
this.CantActual.content = this.CantInicial.content - this.CantEntreg.content;
}
var employeeidentification = Employee.Identification.Retrieve ( this.EmployeeID );
if ( employeeidentification.IsSet() )
{
this.EmployeeName = employeeidentification.ToParent.CurrentCommon.Person.Name.GivenName;
} else
{
this.EmployeeName.Clear();
}
return;
The problem i'm having is this:
Any suggestions?, thanks.
Employee.Retrieve allows passing the Employee's InternalID or its UUID. Employee.InternalID has datatype BusinessPartnerInternalID (namespace http://sap.com/xi/AP/Common/GDT). You need to change your EmployeeID element's datatype to BusinessPartnerInternalID.
If you can't because it's already in production you can make a variable of that type and set the .content to your EmployeeID.content and use that variable for the Retrieve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Simon
hope your issue is resolved by now... if not then please try the following.
data type for the field EmployeeID in the BO Employee is "EmployeeID". You have used data type as "ID". this is causing the issue.
Change the data type as above and your issue should be resolved.
Regards
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.