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

How to make signeddata negative

former_member150968
Participant
0 Likes
112

Hello Experts,

I have developed an implementation of badi  "UJ_CUSTOM_LOGIC", in this I have to create a record with the negative value. for that, I am multiplying signeddata by -1

and appending in ct_data. Although it is creating a record but it is creating the record with double value.

for ex:- if I have 400 as value. I multiply it with -1. It is creating record with value -800, not with value -400.

Please suggest how it can be achieved.

Thanks,

Manish

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

Hi Manish,

You have to debug your code - there is some mistake...

Vadim

former_member150968
Participant
0 Likes

Hello Vadim,

I debugged it. From my code, it is going as -400 only. But while posting the record, it is posted as double the original value. I am not able to figure out why is it doing so.

Please let me know if there is a way to figure this out.

Thanks & Regards,

Manish Sethia

former_member186338
Active Contributor
0 Likes

Look like you initially have 400

Then in badi you read 400 and invert the sign and write -400

But in reality delta is written: - 800 (delta between 400 and -400)

Resulting: 400-800=-400

Look on report, not on RSA1!

Vadim

dinesh_veluru
Active Participant
0 Likes

Hi Manish,

Please check your write back method there will be an parameter calc_delta you need to pass value as 'X' to post the desired result to database.

which class name & write back method you are using.

Thanks,

Dinesh.V

dinesh_veluru
Active Participant
0 Likes

Hi Manish,

Agree with Vadim system will create an offset record with -800 so that the net value will be -400.

Did you check the sum in RSA1 whether the net value is -400.

Thanks,

Dinesh.V

former_member186338
Active Contributor
0 Likes

Hi Dinesh,

He is using the default method to write data - change value in ct_data and let default write back to do the rest. Hope it's clear...

Vadim

dinesh_veluru
Active Participant
0 Likes

Oops!! yes its clear now ..:) my mistake missed CT_DATA.

Thanks,

Dinesh.V

former_member150968
Participant
0 Likes

Hello Vadim,

You are correct. It is calculating delta. I made current record as 0 and it updated correctly.

Thanks for your help.

Regard,

Manish Sethia

Answers (0)