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

Negative value on table control

Former Member
0 Likes
1,557

Hello @ll,

when I try to put out a negative value in a table control field I get a short dump because the output field is too short. But it's long enough. I assume that the problem is the minus right beside the value. The output field is as a currency field defined and if I delete the minus in debugging mode than it works without short dump. Is there any possibility to put out a negative value in a currency field?

Thanks for any helpful responses

Chris

5 REPLIES 5
Read only

Former Member
0 Likes
983

BEFORE SHOWING THE DATA IN TABL CNTRL.

LOOP AT ITAB.

IF ITAB-AMT LT 0.

ITAB-AMT = ITAB-AMT * (-1).

ENDIF.

MODIFY ITAB.

ENDLOOP.

OR YOU CAN USE ABS FN ALSO.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
983

all i know to this subject is:

at a ALV-Grid i had no problems displaying negative values in a currency field.

Read only

Former Member
0 Likes
983

Sorry I forgot to mention... but I have to display the negative value in the table control field!!! So I think I have to insert an extra column only for the minus sign... or is there a better idea???

regards

chris

Read only

0 Likes
983

declare another itab and change the currecy field to fields of type char.

move the data from original itab to this itab and in the process

conver

newitab-currenyfield = originalitab-currency * -1 .

concatenate '-' newitab-currenyfield into newitab-currenyfield .

now use this new modifed itab in table control.

Regards

Raja

Read only

Former Member
0 Likes
983

YOU CAN DO ONE THING IF YOU ARE NOT DOING ANY CALCULATION OR SOMTHING JUST TAKE THE CURRENCY FIELD TO A CHACTER TYPE FIELD AND SHOW THAT CHARACTER TYPE FIELD.

REGARDS

SHIBA DUTTA