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

offset length

Former Member
0 Likes
924

hi all,

in the report i have the gt_file_export-value = 10000000000.00-

in the below they have written the code to keep the minus value first but due to the follwing code i.e., because of code this

MOVE '-' TO amount_to_print(1).

the value becoming as -0000000000.00 , one is missing and placing minus sign there

i need to get the value as -10000000000.00

check the code for the same.

WRITE: gt_file_export-value TO amount_to_print.

IF amount_to_print+15(1) = '-'.

MOVE '-' TO amount_to_print(1).

MOVE ' ' TO amount_to_print+15(1).

CONDENSE amount_to_print NO-GAPS.

WHILE amount_to_print+14(1) = ' '.

SHIFT amount_to_print RIGHT.

ENDWHILE.

ENDIF.

thanks in advance

9 REPLIES 9
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
836

Hello Hema,

Try this code:


IF amount_to_print CA '-'.
  SHIFT amount_to_print BY 1 PLACES RIGHT CIRCULAR
ENDIF.

Hope this helps.

BR,

Suhas

Edited by: Suhas Saha on Jan 12, 2009 12:45 PM

Read only

Former Member
0 Likes
836

hi,

Refer to this link....

Read only

Former Member
0 Likes
836

try like dis..

IF amount_to_print+15(1) = '-'.

concatenate '-' amount_to_print+0(14) into amount_to_print.

ENDIF.

Read only

Former Member
0 Likes
836

Make sure field amount_to_print is long enough.

Then, first do a

SHIFT amount_to_print RIGHT DELETING TRAILING SPACE.

Next, if it's a negative value, add the minus sign.

amount_to_print(1) = '-'.

Finally condense the field

CONDENSE amount_to_print NO-GAPS.

Read only

Former Member
0 Likes
836

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'

Read only

Former Member
0 Likes
836

Hi

Try this

DATA amount_to_print(15) type c value '10000000000.00-'.

IF amount_to_print+14(1) = '-'.
  MOVE amount_to_print(14) TO amount_to_print+1.
  MOVE '-' TO amount_to_print(1).
  CONDENSE amount_to_print NO-GAPS.
ENDIF.

write: amount_to_print.

Max

Read only

Former Member
0 Likes
836

hi,

check the length of 'amount_to_print'.

if the length is less than that it will condence.

Read only

0 Likes
836

hi ,

you are moving '-' to '1'.

with the statement MOVE '-' TO amount_to_print(1).

Read only

Former Member
0 Likes
836

CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'