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 Sign Format

arpit_shah
Contributor
0 Likes
6,409

Hi,

I want to put negative sign in front.

i.e in standard SAP 15.23- will be display,

but my requirement is instead of that i want -15.23.

i want this type of settings in all reports.

so without programming, there is any option for changing the format of negative sign.

Regards,

Arpit

16 REPLIES 16
Read only

Lakshmant1
Active Contributor
0 Likes
4,217

Hi Arpit,

Use FM CLOI_PUT_SIGN_IN_FRONT

Thanks

Lakshman

Read only

0 Likes
4,217

hi Lakshman,

i don't want through programming,

bcoz for using this FM i have to convert into character and change.

so using this i can not use sum,subtotal etc function that is in alv.

so ,

there is any setting for that,

Negative Sign format,

in that option like,

in which type of format u want negative sign.

like,

-1.1

1.1-

etc.

Regards,

Arpit

Read only

Former Member
0 Likes
4,217

Hi Arpit

try from follwoing code explaination.

Data : l_dmbtr(13).

it_bsik-dmbtr = 15.23- "supposed value

if it_bsik-dmbtr < 0.

l_dmbtr = abs(it_bsik-dmbtr).

concatenate '-' l_dmbtr into l_dmbtr.

write :/10 l_dmbtr.

else.

l_dmbtr = it_bsik-dmbtr.

write :/10 l_dmbtr.

endif.

reward point if helpfull.

Regards

Rajesh

Read only

0 Likes
4,217

hi, Rajesh

i m using this with ALV.

so write is not useful to me.

& i want to use function that is provided by alv like

sum, sorting, subtotal etc.

Regards,

Arpit

Read only

0 Likes
4,217

then in ur inetnal table add an extra text field and follow the code.

Data : begin of it_bsik occurs 0.

dmbtr like bsik-dmbtr,

l_dmbtr(13), " extra field

end of it_bsik.

for example.

loop at it_bsik.

if it_bsik-dmbtr < 0.

it_bsik-l_dmbtr = Abc(it_bsik-dmbtr)

concatenate '-' it_bsik-l_dmbtr into it_bsik-l_dmbtr.

else.

it_bsik-l_dmbtr = it_bsik-dmbtr.

endif

modify it_bsik.

endloop.

use this inernal table field to display.

reward point if usefull.

regards

rajesh

Read only

Former Member
0 Likes
4,217

Hi,

You can use the FM CLOI_PUT_SIGN_IN_FRONT .

Thanks,

Sriram Ponna.

Read only

0 Likes
4,217

i don't want to use any FM.

Is there any settings for that?.......

Read only

0 Likes
4,217

Hi,

Please check in SU01 TCode, but doing this it may effect entire systems.

Thanks,

Sriram Ponna.

Read only

0 Likes
4,217

Hi Sriram,

In SU01 where it is?...

pls provide more details.

Regards,

Arpit

Read only

0 Likes
4,217

Any Idea?..

points will be assured...

Read only

0 Likes
4,217

Hi,

I dont think we can make some setting changes to get the negetive in front, you will have to write the code before you pass the value to ALV field.

Reward Points if useful.

Read only

0 Likes
4,217

Any Idea?.......

Read only

0 Likes
4,217

t

Read only

0 Likes
4,217

hi arpit try to use the Fm cloi_pvt_sign_in_front

reward points if useful

Read only

0 Likes
4,217

Hi,

Try this sample code.

DATA: TEXT1(1) TYPE C,

VALUE(5) type c.

value = '90-'.

SEARCH VALUE FOR '-'.

IF SY-SUBRC = 0 AND SY-FDPOS 0.

SPLIT VALUE AT '-' INTO VALUE TEXT1.

CONDENSE VALUE.

CONCATENATE '-' VALUE INTO VALUE.

ELSE.

CONDENSE VALUE.

ENDIF.

Regards,

Satish

Read only

ChrisPaine
SAP Mentor
SAP Mentor
4,217

|{ l_amount SIGN = LEFT }|.