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/EXPORT FROM DATA BUFFER

Former Member
0 Likes
4,115

Hi,

I have some code like this:

DATA: b type xstring.

DATA: a type xstirng.

EXPORT '1234' TO DATA BUFFER b.

IMPORT a FROM DATA BUFFER b.

for some reason a does not get set to the value that I assigned to b.

However, this code works:

DATA: b type xstring.

DATA: a type xstirng.

EXPORT some_internal_table TO DATA BUFFER b.

IMPORT a FROM DATA BUFFER b.

Does anybody know why internal tables work but other data types do not?

Thank you.

2 REPLIES 2
Read only

Former Member
0 Likes
1,772

perhaps its the lack of a header in the data, where your internal table may have one.

Warren

Read only

sridhar_k1
Active Contributor
0 Likes
1,772

EXPORT '1234' TO DATA BUFFER b, not working because, you did not assign a variable name to '1234' to be stored as in data buffer B.

Change the code to:

DATA: b type xstring.

DATA: a(4) type c.

EXPORT a = '1234' TO DATA BUFFER b.

IMPORT a FROM DATA BUFFER b.

It's working in the second case because, some_internal_table is the name of the variable in databuffer B and you are importing into the same variable in IMPORT

Regards

Sridhar