Application Development and Automation 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: 
Read only

searching for corect data element

Former Member
0 Likes
538

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
Read only

Former Member
0 Likes
504

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
Read only

Former Member
0 Likes
504

Try using floating point numbers

Read only

Former Member
0 Likes
505

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