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: 

Unable to fetch data from IMPORT statment

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi,

The below is my program to export data to a cluster table. A record is

successfully entered into the table by the below code.

TYPES : BEGIN OF ty_itab,
        kunnr TYPE kna1-kunnr,
        name1 TYPE kna1-name1,
        ort01 TYPE kna1-ort01,
        land1 TYPE kna1-land1,
        END OF ty_itab.

DATA : it_itab TYPE TABLE OF ty_itab,
       it_jtab TYPE TABLE OF ty_itab,
       wa_idx TYPE indx.

SELECT kunnr
       name1
       ort01
       land1 FROM kna1 INTO TABLE it_itab UP TO 10 ROWS.

EXPORT it_itab TO DATABASE indx(xy) ID '20090514-thrusday'.

My problem is ,i'm unable to fetch the same data by IMPORT statements.

IMPORT tab TO it_itab FROM DATABASE indx(xy) TO  ID  '20090514-thrusday'.

May i know what i'm missing in the above syntax.

Thanks & Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

the IMPORT statement should not contain "To" .

IMPORT obj1 ... objn FROM DATABASE dbtab(ar) ID key.

Remove the word "To" while importing values from data base.

Even if "To" is removed, if the import is not fetching, check if the entry is correctly exported to data base table or not

4 REPLIES 4

Former Member
0 Kudos

Hello,

the IMPORT statement should not contain "To" .

IMPORT obj1 ... objn FROM DATABASE dbtab(ar) ID key.

Remove the word "To" while importing values from data base.

Even if "To" is removed, if the import is not fetching, check if the entry is correctly exported to data base table or not

0 Kudos

Hi Soumya,

Thanks for your earliest reply.

Actually i made a mistake while copy-pasting my code.

yep i removed that, but still facing the same problem.

Thanks

- Always Learner

Former Member
0 Kudos

Hi,

use this statement...

IMPORT it_tab TO it_itab FROM DATABASE indx(xy) TO  ID  '20090514-thrusday'.

"  OR

IMPORT it_tab TO tab FROM DATABASE indx(xy) TO  ID  '20090514-thrusday'.

"  OR

IMPORT it_tab  FROM DATABASE indx(xy) TO  ID  '20090514-thrusday'.

check these three options... for sure one of them will resolve your issue based on the internal table you have declared in your program...

Regards,

Siddarth

0 Kudos

Thanks ,

This one did the trick

IMPORT it_itab  FROM DATABASE indx(XY) ID  '20090514-thrusday'.

- Always Learner