05-21-2013 5:26 AM
Hi experts,
guide me how to print the value 710(-) in sap script.i want only for negative numbers and the sign should be in brackets.
Thankx in advance.
05-21-2013 5:43 AM
Hi ,,
suppose the value stored in (ex: menge) and for signs take one key field(like shkzg: if shkzg = x means Positive else negative)
if shkzg = x.
write menge.
else.
concatenate menge '(-)' into menge1.
write menge1.
endif.
05-21-2013 5:43 AM
Hi ,,
suppose the value stored in (ex: menge) and for signs take one key field(like shkzg: if shkzg = x means Positive else negative)
if shkzg = x.
write menge.
else.
concatenate menge '(-)' into menge1.
write menge1.
endif.
05-21-2013 8:12 AM
Hi krishna,
if i do like that, it willl create calculation problem.because -710 is not same as ( - )720
05-21-2013 8:49 AM
Pavan,
while printing that field you apply the logic.
sample code..
REPORT YSIGN.
PARAMETERS var(10) TYPE c.
DATA var1(12) TYPE c.
START-OF-SELECTION.
IF var < 0.
var = var * -1.
CONCATENATE var '(-)' INTO var1.
ENDIF.
WRITE var.
WRITE var1.
05-22-2013 1:47 AM
Thanks krishna,
it works now, it prints like 720(-) but user wants in amount figure like 720.00(-).can you please asist more on this.
05-22-2013 8:42 AM
hi,
first tel me how the value is storing into table/variable . means ex. if suppose value is storing 720.00 then above logic wil work if it not means then check what is the variable type maybe it is a character type then we have to add manually by using above code(concatenate menge '.00' '(-)' into menge1 ) like that but check properly whether the field is currency or what,if it is currency means hw the value is storing you have to consider.
Regards,
Krishna
05-22-2013 1:23 PM
05-24-2013 2:37 AM