I am working on an ALV program which should show the no. of days as negative...if the due date is past the current date.
For instance if the due date is 07/26/2005, it should show 1-.
I have declared the data as:
no_of_days_1 type I.
no_of_days_1_d(10) type C.
In my code:
disc_d_date: gets calculated at run time.
no_of_days_1 = sy-datum - disc_d_date.
if no_of_days_1 < 0 .
no_of_days_1_d '-' into
condense no_of_days_1_d NO-GAPS.
shift no_of_days_1_d RIGHT
DELETING TRAILING space.
no_of_days_1_d = no_of_days_1.
The problem it appears, no_of_days_1_d being declared as I(integer), cannot store negative nos. A possible solution would be to create a data element with the sign checkbox ticked.
Would appreciate if anybody has a better solution.