‎2007 Jun 21 2:38 PM
Dear All,
How do I import data clusters from a database table to view the data it contains. I know, or at least I think, I have to use the IMPORT command which has the following syntax:
IMPORT parameter_list FROM medium [conversion_options].
But how do I find what the parameter list, their type, etc. and is medium the name of the table? Is there a tool that enables me to read data clusters similar to se16 for data fields?
Thank you for your help,
Philon
‎2007 Jun 21 2:55 PM
See the simple example :
REPORT ZTEST_AMEM1.-> Main program and usinge export
tables : lfa1.
data : begin of i_lfa1 occurs 0 ,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
land1 like lfa1-land1,
end of i_lfa1.
start-of-selection.
select lifnr
name1
land1 from lfa1
into table i_lfa1 up to 100 rows.
Export
export i_lfa1 to memory id 'SAP'.
submit ztest_amem2 and return.
write:/ 'hello'.
&----
*& Report ZTEST_AMEM2
*&
&----
*&
*&
&----
REPORT ZTEST_AMEM2.-> called program and used import command
data : begin of j_lfa1 occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
land1 like lfa1-land1,
end of j_lfa1.
start-of-selection.
import i_lfa1 to j_lfa1 from memory id 'SAP'.
loop at j_lfa1.
write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.
endloop.
‎2007 Jun 21 2:49 PM
What I have done is use the "where used" for the table and try to see how SAP uses the IMPORT statement.
Rob
‎2007 Jun 21 2:55 PM
See the simple example :
REPORT ZTEST_AMEM1.-> Main program and usinge export
tables : lfa1.
data : begin of i_lfa1 occurs 0 ,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
land1 like lfa1-land1,
end of i_lfa1.
start-of-selection.
select lifnr
name1
land1 from lfa1
into table i_lfa1 up to 100 rows.
Export
export i_lfa1 to memory id 'SAP'.
submit ztest_amem2 and return.
write:/ 'hello'.
&----
*& Report ZTEST_AMEM2
*&
&----
*&
*&
&----
REPORT ZTEST_AMEM2.-> called program and used import command
data : begin of j_lfa1 occurs 0,
lifnr like lfa1-lifnr,
name1 like lfa1-name1,
land1 like lfa1-land1,
end of j_lfa1.
start-of-selection.
import i_lfa1 to j_lfa1 from memory id 'SAP'.
loop at j_lfa1.
write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.
endloop.