2006 Dec 05 6:12 PM
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.
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
2006 Dec 05 6:19 PM
perhaps its the lack of a header in the data, where your internal table may have one.
Warren
2006 Dec 05 7:28 PM
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
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |