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

Import from database

dmi
Participant
0 Likes
1,159

Hello Experts

I need to get the information from the table STXFCONT.

In a ABAP-Report I do that in this way:

"import t_ntokens from database stxfcont(xx) id i_formname"

The result is in the table t_ntokens - all ok

But in AbapObject, I get a syntax-error.

What is the correct syntax to read this table.

Thanks a lot

Daniel

1 ACCEPTED SOLUTION
Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
985

What syntax error do you get?

5 REPLIES 5
Read only

Sougata
Active Contributor
0 Likes
985

Hi Daniel,

As well as the statement IMPORT you can, if necessary, use the methods of the following classes:

CL_ABAP_EXPIMP_MEM

CL_ABAP_EXPIMP_SHMEM

CL_ABAP_EXPIMP_SHBUF

CL_ABAP_EXPIMP_DB

CL_ABAP_EXPIMP_CONV

These subclasses of the abstract system class CL_ABAP_EXPIMP extend the functionality of the statements for data clusters. They allow you to access data clusters in the individual storage media, of which only parts of the identifier <b>id</b> or of the area <b>ar</b> are specified, by determining the complete key.

Don't forget to reward points!

Cheers,

Sougata.

Read only

GrahamRobbo
SAP Mentor
SAP Mentor
0 Likes
986

What syntax error do you get?

Read only

0 Likes
985

Oh, sorry, I forgot this little detail, sorry

The message is:

IMPORT Var_1 ...Var_n FROM DATABASE is not supported in the OO

And another important detail, my code must running in Rel. 4.6

so I cant use the CL_ABAP_EXP*

Thanks and have a nice day

Daniel

Read only

0 Likes
985

I think you may need to use:

import t_ntokens = t_ntokens from database stxfcont(xx) id i_formname

or (less recommended by SAP):

import t_ntokens from t_ntokens from database stxfcont(xx) id i_formname

because "<i>When data clusters are exported and imported, explicit names must be specified in ABAP objects for the exported data objects. The notation with an equals sign (=) should be preferred to the old additions FROM and TO.</i>"

Jonathan

Read only

0 Likes
985

Hello Jonathan

So easy - but it works, thanks a lot, you are my hero

Daniel