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: 

problem using in write to statement

Former Member
0 Kudos

problem as follows below

FORM f200_check_signature TABLES input STRUCTURE itcsy

ouput STRUCTURE itcsy.

DATA:sig(75) TYPE c,

totpayment type REGUH-RBETR,

compcode TYPE reguh-zbukr.

  • DATA: wa_zchqlimit TYPE zchqlimit.

DATA: BEGIN OF int_zchqlimit,

zbukr LIKE zchqlimit-zbukr,

zsiglimit LIKE zchqlimit-zsiglimit,

zsighigh LIKE zchqlimit-zsighigh,

zsiglow LIKE zchqlimit-zsiglow,

END OF int_zchqlimit.

READ TABLE input WITH KEY 'REGUH-RBETR'.

IF sy-subrc = 0.

write input-value TO totpayment . -


>

ENDIF.

at arrow mark actual input-value is 12358 for given input but after moving into totpayment the value is showing as 2020202020.28

please i need advice why it is occuring like that.

3 REPLIES 3

Former Member
0 Kudos

Hi,

The data type of totpayment should be Charchter.

Change this you will get correct value.

<b>Reward if helpful.</b>

former_member188827
Active Contributor
0 Kudos

check value of sy-subrc in debugging..is it 0?

Former Member
0 Kudos

in the statement

write input-value TO totpayment

totpayment should be of type c.

see f1 help for 'write'

WRITE f TO g[+off][(len)].

Effect

Assigns the contents of the source field f to the target field g as a new value.

In contrast to MOVE, the format of the target field g is the same as when outputting to a list with WRITE. The field type C is always used, regardless of the actual data type.

Regards,

Prasant

*reward if helpful