cancel
Showing results for 
Search instead for 
Did you mean: 

How To Display Minus value in SAP SCript

Former Member
0 Kudos

Hello Guys.

I am working on a Script. My Problem is that For a fields BSAD-DMBTR.

I have to show this fields value as minus or plus as per condition with fields

<b>bsad-shkzg</b>. In my Internal table it's update as minus but when I am calling Write form with loop. the value is not display with minus sign.

How can I display value with minus sign in SAP script.

Regards

Swati,,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Guys.

I got the Answer. In SAP SCript I have change like .

if Shkg = 'H'.

&Wa_dmbtr&(-)

else.

endif.

This Way my Problem is solved.

Simha_
Employee
Employee
0 Kudos

Hi,

U have to check this in the script itself...

Just based on the credit and debit indicator u can multiply with (* -1).

wherever u want..

Hope this helps...

Cheers,

Simha.

Reward all the helpful answers...

Former Member
0 Kudos

Hello Guys..

Thanks for Reply. But I am doing that thing already. My Internal table is updated with minus value. My Problem is not That.

let's suppose.

itab-name = 'xyz'.

itab-value = 100.

append itab.

itab-name = 'xyz1'.

itab-value = -1 * 100.

append itab.

loop at itab.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'LINE'

function = 'SET'

type = 'BODY'

window = 'MAIN'

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

endloop.

Now when value is printed in SAP Script both value is display as plus .I want to display secound value as minus.

Please reply it's urgent.

Thanks

Swati....

Former Member
0 Kudos

Hi,

Based on the condition ..like Credit or debit ...

Mutliply the amount field by -1 ..like itab-dmbtr = itab-dmbtr * -1

Reward points if it is useful".

Thanks,

Manjunath MS