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

Sap Script Printing Problem

former_member541575
Participant
0 Likes
787

Hi

i am facing one issue

i want Vat% should come in digit or number but not in floating point variable in the script output.

but it is coming floating point value.

i am using below code.

Data:w_vat LIKE konv-kbetr,

  • VAT % to be calculated

SELECT SINGLE kbetr

FROM konv

INTO w_vat

WHERE knumv EQ w_knumv

AND kposn EQ zvxx_oe_inv_item-posnr

AND kschl EQ c_mwst.

UNASSIGN <fs_itcsy>.

READ TABLE ta_out_table

ASSIGNING <fs_itcsy> INDEX c_1.

IF sy-subrc EQ 0.

MOVE w_vat TO lo_sum.

SHIFT lo_sum LEFT DELETING LEADING space.

MOVE lo_sum TO <fs_itcsy>-value.

ENDIF.

Regards

Atul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
766

hi,

DATA:
  f TYPE f, 
  i TYPE i.

f = 123.
i = f.
WRITE:/ f, i.

move the value of the vat% to an integer type variable.

regards

sarves

6 REPLIES 6
Read only

Former Member
0 Likes
766

hi,

In your case in the move statement,

instead the existing target field , specify a target field of type I.

This converts the floating value to a digit or integer as per your requirement.

Use this target field in your text elements in the text editor of your SAP SCRIPTS to generate the requirement output on the form

Thanks

Sharath

Read only

0 Likes
766

Hi

the correct answer is to Declare target field is

data : lw_sum type N.

Thanks

Atul

Read only

former_member541575
Participant
0 Likes
766

i want to add one more thing

data:lo_sum(20) TYPE c.

Read only

Former Member
0 Likes
766

Hi,

use this..

&symbol(.N)&

Ex:

suppose output is 1234.10..

if u want to omit the digits after dot.

write like this..

&symbol(.0)&

Regards

Kiran

Read only

Former Member
0 Likes
767

hi,

DATA:
  f TYPE f, 
  i TYPE i.

f = 123.
i = f.
WRITE:/ f, i.

move the value of the vat% to an integer type variable.

regards

sarves

Read only

Former Member
0 Likes
766

Hi

You can transfer the vat% value to integer type directly by transfering he float into integer type.So that you can get the digit or number.

Regards,

Rajani