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

types

Former Member
0 Likes
715

hi!

i have a field which is type WERTV13.

i am reading an excel file into an internal table.

this field is empty and gets the value

20202020202020202020202.02

when i am running on the internal table i am using the collect command and moving records with the same matnr

to another internal table with the same structure.

after a while when it tries to collect more then 4 records to the same line i get dump on this field

and it says that the field is not long enough.

what can i do in order to get rid from the value

20202020202020202020202.02. and move zero instead.

thanks its very urgent

yifat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
596

Hi Yifat,

When you upload files you should only use character fields in the internal table where you load the data in.

You'll never know how the input will be (empty, decimal point or comma, alphanumeric characters in number fields, etc..)

After some checks you can move the characters fields to an other internal table converting them to the correct type you need.

Hope this helps.

Regards,

Arjan

By the way: the value 20202020... is the internal display of spaces in a packed (= "numeric") field. This is not a situation you want to see. Again: don't use packed/numeric fields directly when uploading data.

Message was edited by: Arjan Aalbers

3 REPLIES 3
Read only

Former Member
0 Likes
596

Hi,

U can have a field of more length what u r adding, as in addition there r chances to overflow eg. whenu add 99 + 99 the result will be a three digit number, so consider this and choose a field with length larger.

As collect will add the numeric fields.

Read only

Former Member
0 Likes
597

Hi Yifat,

When you upload files you should only use character fields in the internal table where you load the data in.

You'll never know how the input will be (empty, decimal point or comma, alphanumeric characters in number fields, etc..)

After some checks you can move the characters fields to an other internal table converting them to the correct type you need.

Hope this helps.

Regards,

Arjan

By the way: the value 20202020... is the internal display of spaces in a packed (= "numeric") field. This is not a situation you want to see. Again: don't use packed/numeric fields directly when uploading data.

Message was edited by: Arjan Aalbers

Read only

Former Member
0 Likes
596

Hi Yifat Bar,

The field you are using is of type CURR ( Basically it is a number) now when you use 'COLLECT' statement it summerizes the table contents and gives the sum of the numerical fields There is a condition for this....

"When the line is inserted, the system checks whether there is already a table entry that matches the key. If there is no corresponding entry already in the table, the COLLECT statement has the same effect as inserting the new line. If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry."

Check the below link...

http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb36d5358411d1829f0000e829fbfe/content.htm

So, Instead of that try to use APPEND Statement to insert values into the internal table.

Regards,

Vara