Application Development 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: 

Negative Sign in the front for amount

Former Member
0 Kudos

Hi Friends,

i am facing problem in negative sign

while using fm : cloi_put_sign_in_front which accepts char variable.

In my report amount type is char15 and here negative sign appears after using this fm but when i download this data in one other char structure DATA: BEGIN OF itab_proextract OCCURS 0,

line(502) TYPE c,

END OF itab_proextract.

Amount is right justified always..but afterusing this amount gets displayed in left due to this my other variable which are getting downloded after amount comes as concatenated for ex...

Before :

00102384NALCUS/406FED 00AX 4.26- 5126.84-

After

00102384NALCUS/406FED 00AX-4.26 -5126.84

Please help me....

4 REPLIES 4

g_srivastava
Active Contributor
0 Kudos

Hi farheen,

Did you checked the output field length in which you are storing this value if it is less the display will be concatenated.So try using that field with greater length value.You can specify the output field length.Hope your query resolves.We need to know the conversion routine it is follwing once we know it we can easily get the output according to the need.Please have a look on the document Link:[Output|http://help.sap.com/saphelp_nwpi71/helpdata/en/45/a6545e6072731de10000000a1553f6/content.htm]

Have a best day ahead.

Edited by: Srivastava.G on Aug 3, 2009 10:43 AM

Former Member
0 Kudos

Hi Farheen,

You will have to concatenate(fill in) 2 spaces for the first amount field.

Regards,

Vimal.

Former Member
0 Kudos

Hi,

You can reer to the following links:

or

try this code

data : l_amt(15) value '435.46-'.

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

CHANGING

VALUE = l_amt.

write : l_amt.

or

you can try this :

DATA : BEGIN OF IG_DOWNLOAD OCCURS 0,

F1(4),

F2(4),

F3 TYPE DMBTR,

F4 TYPE I,

F5 TYPE NETPR,

F6,

END OF IG_DOWNLOAD.

DATA : BEGIN OF IG_DOWNLOAD1 OCCURS 0,

F1(4),

F2(4),

F3(16),

F4 TYPE I,

F5(16),

F6,

END OF IG_DOWNLOAD1.

DATA : VALUE(16).

IG_DOWNLOAD-F1 = 'AAAA'.

IG_DOWNLOAD-F2 = 'BBBB'.

IG_DOWNLOAD-F3 = '-3.86'.

IG_DOWNLOAD-F4 = 1.

IG_DOWNLOAD-F5 = '4.58-'.

IG_DOWNLOAD-F6 = 'A'.

APPEND IG_DOWNLOAD.

CLEAR IG_DOWNLOAD.

LOOP AT IG_DOWNLOAD.

MOVE-CORRESPONDING IG_DOWNLOAD TO IG_DOWNLOAD1.

VALUE = IG_DOWNLOAD-F3.

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

CHANGING

VALUE = VALUE.

IG_DOWNLOAD1-F3 = VALUE.

VALUE = IG_DOWNLOAD-F5.

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

CHANGING

VALUE = VALUE.

IG_DOWNLOAD1-F5 = VALUE.

APPEND IG_DOWNLOAD1.

CLEAR IG_DOWNLOAD1.

ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = 'C:\A1.xls'

FILETYPE = 'ASC'

WRITE_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = IG_DOWNLOAD1.

Thank You.

Regads,

Dhanalakshmi L

0 Kudos

Hi,

The best possible to way yo get the value is ..



Suppose wa_amount has a value like 789.00 and u want to add minus sign means just add it like.

wa_amount = - ( wa_amount ).


Tnx,

Joe