cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error When Copying Decimal Values

former_member183363
Active Contributor
0 Likes
1,089

Hello everyone,

I have an odd problem in a solution of mine --- I have a custom BO which is used to create customer invoice requests (CIRs) using some values taken from a record of another custom BO. During the AfterModify script which creates this CIR (an XML file input is used to trigger the script), I try to copy some data from fields in the single record of the second custom BO, into matching fields I've put in an XBO for CIR. The odd thing is that the script just stops as soon as it tries to parse the lines which copy the values --- no error message that I can see of any kind. If the fields I'm writing to were read-only it'd say so when I tried to activate the AfterModify script I think. Can anyone shed some light on this?

You'll notice I'm using 'instCustomerInvoiceRequest', which as you can see is the name of the newly-created CIR instance. I also tried putting the same functional code, but using 'elementsofCIRRoot' pre-creation of the CIR.

Many thanks.

Lewis

View Entire Topic
ThomasZwerg
Participant
0 Likes

So what is the actual error? Is there any information in the Dump Analysis window?

Are there any warnings or similar left in your error list?

Regards,

Thomas

former_member183363
Active Contributor
0 Likes

Dump analysis yielded something --- I'd forgotten about that. I know what it means by overflow, but I'm lost as to why it would be happening. See image below, thanks.

ThomasZwerg
Participant
0 Likes

Are you accidentally assigning incompatible types? Actually this should bring a warning. Is your Errorlist clear?

Regards,

Thomas

former_member183363
Active Contributor
0 Likes

Definitely no errors appearing, they're both DecimalValue types and I see no warnings about one being from BASIS.Global and one from GDT.Global or whatever.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Lewis,

Please post the data types of the "Ceiling" fields.

And, if you run a trace the value before the assignment.

Bye,

   Horst

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Lewis,

Did you annotate the DecimalValue in the SAP BO?

Bye,

   Horst

former_member183363
Active Contributor
0 Likes

All of the banding level fields have tooltips and/or labels, if that's what you mean.

ThomasZwerg
Participant
0 Likes

Hi Lewis,

can you post both field declarations (complete with all annotations)?

Regards

Thomas

former_member183363
Active Contributor
0 Likes

HostBilling BO declaration --- this is the BO with the single record I'm taking values from.

The CustomerInvoiceRequest XBO declaration.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Lewis,

In the Extension BO you can annotate the DecimalValue data type with "Decimal"

Example:

    [Decimal (15,3)] element MyDecValue : DecimalValue;

This element has a total of 15 digits with 3 digits after the decimal point

The maximum range is 29 digits, 14 for the fraction.

If you omit the annotation the standard is used, i.e. 7 digits at all, 2 digits for the fraction

In the Customer Business Object you cannot annotate this data type.

Here the maximum is used.

I assume in your case a value larger than 7 digits is in the element of the CBO HostBilling, but the element in the Extension BO CustomerInvoiceRequest can not host that large value => Dump

My suggestions:

  • Annotate in the Extension BO CustomerInvoiceRequest the element with [Decimal(29,14]) to match the data type definition of the Customer BO HostBilling

Or

  • Make sure that the values in the CBO does not exceed 7 digits.

HTH,

    Horst

former_member183363
Active Contributor
0 Likes

We have a winner! Thanks Horst, good explanation. You'd think the decimal would use the maximum by default...

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Lewis,

Sorry for optimization

Glad, that it helps you.

Bye,

   Horst