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: 

validate the record while uploading into table

Former Member
0 Kudos

Hi,

I am uploading records into the table, and it so happened that an incorrect record full of text data was there in theinput file, it got uploaded along with the records,

hence I need to modify the code to check for such data -it is text data.

I have an 'empid' field (only numbers). I used that field to check for numeric data some thing like this...

if itab-empid+0(1) between '0' and '1'.

move-corresponding itab to DTABLE.

APPEND DTABLE.

else.

continue.

endif.

it is not working, throwing a short dump.

is there a better way to validate this? All I am doing is if empid field has any text data do not read into the internal table.

Thanks,

SK

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You could try something like this:

if itab-empid+0(1) CA '0123456789'.

move-corresponding itab to DTABLE.

APPEND DTABLE.

else.

continue.

endif.

I hope this helps.

- April King

3 REPLIES 3

Former Member
0 Kudos

You could try something like this:

if itab-empid+0(1) CA '0123456789'.

move-corresponding itab to DTABLE.

APPEND DTABLE.

else.

continue.

endif.

I hope this helps.

- April King

0 Kudos

Thanks,

SK

laxmanakumar_appana
Active Contributor
0 Kudos

Hi,

Check this, It will work.

if itab-empid CO '12345 67890'.
move-corresponding itab to DTABLE.
APPEND DTABLE.
else.
.............
endif.

Regards

L Appana