Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

searching for corect data element

Former Member
0 Kudos

Hello,

I would like to calculate beetween two coloumns and I don't find corect data element. The field which be calculated are dates (delivery date - posting GR date). I have choosen the data type NUMC_5, but this data type is also positive. I would like to have - (minus) if the gr is before the delivery date.

Which data element should I choose?

BR

Saso

1 ACCEPTED SOLUTION

former_member387317
Active Contributor
0 Kudos

Hi Saso Poljansek,

There is no dataelement with Sign

You can achieve it as below.. multiply the value by -1 (Negative 1) based on condition. so the value becomes negative

if gr_date < delivery_date.

diff = delivery_date - gr_date.

diff = diff * -1 .

else.

diff = gr_date - delivery_date .

endif.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

2 REPLIES 2

Former Member
0 Kudos

Try using floating point numbers

former_member387317
Active Contributor
0 Kudos

Hi Saso Poljansek,

There is no dataelement with Sign

You can achieve it as below.. multiply the value by -1 (Negative 1) based on condition. so the value becomes negative

if gr_date < delivery_date.

diff = delivery_date - gr_date.

diff = diff * -1 .

else.

diff = gr_date - delivery_date .

endif.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya