cancel
Showing results for 
Search instead for 
Did you mean: 

Negative sign for Values. How to shift negative sign from right to left in WDJ?

Former Member
0 Kudos

Hi Experts,

   While i am feching data from table i am getting value as Ex: 100-(negative), but i want to show this as -100.

I got the data from RFC.

Data i am getting now:

Mat Customer Value Qty

M100 C100    100-  10-

But i want to show this as below.

Mat Customer Value Qty

M100 C100    -100  -10

I am not expert in WDJ, please give some suggitions or  sample coding(if possible).

Thank you a lot.

Terry

Accepted Solutions (1)

Accepted Solutions (1)

former_member191044
Active Contributor
0 Kudos

Hi Terry,

what dataType is Value / Qty? It looks like if you are using Strings for those values? For Strings you could use:


  if (value.endsWith("-")) {

   value = "-" + value.substring(0, value.length()-1);

  }

But i think this is rather dirty. You should define this fields as Decimal and the backend system should deliver them the right way.

Regards,

Tobias

Former Member
0 Kudos

Dear Tobias


Thank you for help, I was solve the problem by using the code.


Thank you


Terry

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

ask your abaper to fix it from their end.

Former Member
0 Kudos

Dear Jun

Thank you for Help.

Terry