Export to internal table
Hi experts:
I got problems when I'm using 'export/import to internal table'.When 'import to internal table' exected, an ABAP occured, text 'Format error with IMPORT: No further container found.'
Part of my codes is below:
Export:
data: gi_info type standard table of ZBPS_PASSINFO,
itab type standard table of ZBPS_PASSINFO,
gs_info type ZBPS_PASSINFO.
loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_ZNU'.
gs_info-num = <ld_cell>-value.
endloop.
loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_ZNAM'.
v_xmmc = <ld_cell>-value.
endloop.
loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_ZTZ'. "
v_ZTZ = <ld_cell>-value.
endloop.
loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_DEP'. "
v_DEP = <ld_cell>-value.
endloop.
loop at layout->mt_html_cell assigning <ld_cell> where row = row_id and chanm = 'ZBPS_SHRY'. "
v_SHRY = <ld_cell>-value.
endloop.
gs_info-xmmc = v_xmmc.
gs_info-ZTZ = v_ZTZ.
gs_info-DEP = v_DEP.
gs_info-SHRY = v_SHRY.
append gs_info to gi_info.
EXPORT ZPASSINFO FROM gi_info TO INTERNAL TABLE itab.
Import:
data: GI_PASSINFO type standard table of ZBPS_PASSINFO,
itab type standard table of ZBPS_PASSINFO,
GS_PASSINFO type ZBPS_PASSINFO.
import ZPASSINFO to GI_PASSINFO from INTERNAL TABLE itab.
EXPORT - Export data
Variants
1. EXPORT obj1 ... objn TO MEMORY.
2. EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
3. EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.
Variant 1
EXPORT obj1 ... objn TO MEMORY.
Additions
1. ... FROM g (for each field to be exported)
2. ... ID key
Effect
Exports the objects obj1 ... objn (fields, structures or tables) as a data cluster to ABAP/4 memory .
If you call a transaction, report or dialog module (with CALL TRANSACTION , SUBMIT or CALL DIALOG ), the contents of ABAP/4 memory are retained, even across several levels. The called transaction can then retrieve the data from there using IMPORT ... FROM MEMORY . Each new EXPORT ... TO MEMORY statement overwrites any old data, so no data is appended.
If the processing leaves the deepest level of the call chain, the ABAP/4 memory is released.
Note
The header lines of internal tables cannot be exported, because specifying the name of an internal table with a header line always exports the actual table data.
Addition 1
... FROM g (for each object to be exported)
Effect
Exports the contents of the data object g and stores them under the name specified before FROM .
Addition 2
... ID key
Effect
Stores the exported data under the ID key in ABAP/4 memory . You can then use the ID to read it in again (with IMPORT ). The ID can be up to 32 characters long.
Note
If you store data both with and without an ID , the data stored without an ID remains separate and you can re-import it (using IMPORT without ID ).
Note
Runtime errors
EXPORT_NO_CONTAINER : SAP paging exhausted
Variant 2
EXPORT obj1 ... objn TO DATABASE dbtab(ar) ID key.
Additions
1. ... FROM g (for each field to be exported)
2. ... CLIENT h (after dbtab(ar) )
3. ... USING form
Effect
Exports the objects obj1 ... objn (fields, structures or tables) as a data cluster to the database table dbtab .
The database table dbtab must have a standardized structure .
The database table dbtab is divided into different logically related areas ( ar , 2-character name).
You can export collections of data objects (known as data clusters ) under a freely definable key (field key ) to an area of this database.
IMPORT allows you to import individual data objects from this cluster.
Notes
The table dbtab specified after DATABASE must be declared under TABLES .
The header lines of internal tables cannot be exported because specifying the name of an internal table with a header line always exports the actual table data.
Example
Export two fields and an internal table to the database table INDX :
TABLES INDX.
DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
F1(4), F2 TYPE P,
BEGIN OF ITAB3 OCCURS 2,
CONT(4),
END OF ITAB3.
Before the export, the data fields in
front of CLUSTR are filled.
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
Export der Daten.
EXPORT F1 F2 ITAB3 TO
DATABASE INDX(ST) ID INDXKEY.
Addition 1
... FROM g (for each object to be exported)
Effect
Exports the contents of the field g and stores them under the specified name in the database.
Addition 2
... CLIENT h (after dbtab(ar) )
Effect
Stores the data objects in the client h (if the import/export database table dbtab is client-specific).
Addition 3
... USING form
Effect
Does not export the data to the database table. Instead, calls the FORM routine form for every record written to the database without this addition. This routine can take the data from the database table work area and therefore has no parameters.
Note
Runtime errors
Errors in the structure of the EXPORT / IMPORT database can cause runtime errors .
Variant 3
EXPORT obj1 ... objn TO DATASET dsn(ar) ID key.
Note
This variant is not to be used at present.
Similar Messages
-
Import & Export of Internal table
Hello All,
In my requirement I need to call the MB5B program RM07MLBD. I used the code like this.
SUBMIT rm07mlbd AND RETURN
WITH matnr IN so_matnr
WITH werks IN so_werks
WITH datum IN so_budat.
Now from the RM07MLBD program I need the get the values of the table * g_t_totals_flat * to my zprogram.
Is it possible to import & export the Internal table from one program to other.
Regards,
Anil.Hi,
You can export the internal table ot memory id and can access the (Import) in the called program.
Consider this small code from ABAPDOCU.
DATA text1(10) TYPE c VALUE 'Exporting'.
DATA: itab TYPE TABLE OF sbook,
wa_itab LIKE LINE OF itab.
DO 5 TIMES.
wa_itab-bookid = 100 + sy-index.
APPEND wa_itab TO itab.
ENDDO.
EXPORT text1
text2 = 'Literal'
TO MEMORY ID 'text'.
EXPORT itab
TO MEMORY ID 'table'.
Regards
Bikas -
Exporting an internal table to memory
Hi
I want to call an program from another program and want the values stored in an internal table used in the called program.
how can i export an internal table to memory id an then import it.
Regards
ArunSo to be clear, for your requirement it would be:
* Towards the end of the called program
EXPORT it_itab TO MEMORY ID 'ZZ_MEM_ID'.
* And then from calling program after the submit zzzz and return statement
IMPORT it_itab FROM MEMORY ID 'ZZ_MEM_ID'.
Hope that helps.
Brad
Message was edited by: Brad Williams (put back intro text)
Message was edited by: Brad Williams -
Memory Limitation on EXPORT & IMPORT Internal Tables?
Hi All,
I have a need to export and import the internal tables to memory. I do not want to export it to any data base tables. is there a limitation on the amount of memroy that is can be used for the EXPORT & IMPORT. I will free the memory once I import it. The maximum I expect would be 13,000,000 lines.
Thanks,
Alex (Arthur Samson)You don't have limitations, but try to keep your table as small as possible.
Otherwise, if you are familiar with the ABAP OO context, try use Shared Objects instead of IMPORT/EXPORT.
<a href="http://help.sap.com/saphelp_erp2004/helpdata/en/13/dc853f11ed0617e10000000a114084/frameset.htm">SAP Help On Shared Objects</a>
Hope this helps,
Roby. -
Export & Import internal table data across the programs
Hi All,
I have two different reports,let say ZPRO1 & ZPRO2. I want to export internal table data of ZPRO1 to ZPRO2 and then I want to do some calculations in ZPRO2 with the imported internal table data(ZPRO1).
If I use 'SUBMIT' or CALL TRANSACTION syntax ZPRO1 is displaying..but I want to use only internal table data of ZPRO1.
Pls advise.
Pranitha.Hi,
Please follow the simple code and try to solve your issue.
Code in program1
types: begin of ty_itab,
matnr type matnr,
end of ty_itab.
data: it_itab type table of ty_itab,
wa_itab type ty_itab,
it_itab1 type table of ty_itab.
select matnr from mara into table it_itab.
export it_itab to shared buffer indx(st) id 'ABC'.
Code in program2
types: begin of ty_itab,
matnr type matnr,
end of ty_itab.
data: it_itab type table of ty_itab,
wa_itab type ty_itab.
import it_itab from shared buffer indx(st) id 'ABC'.
loop at it_itab into wa_itab.
write:/ wa_itab-matnr.
endloop.
Please delete shared buffer indx(st) id 'ABC', once we don't need the internal table data.
Regards
Dande -
How to export an internal table to another report while submitting ..
Hi ,
I have 2 reports ZR1 and ZR2 . Both contains an Internal table with same structure IT_DATA. After the output of ZR1 comes,I am submitting ZR2 at a click event. The requirement is to pass the data from IT_DATA from ZR1 to IT_DATA of ZR2 while submitting ZR2.
Hope that the requirement is clear.
Thanks & regards,
ShankarHi
You have to use IMPORT/EXPORT statament
REPORT ZREPORT1.
DATA: ITAB LIKE .....
EXPORT ITAB TO MEMORY ID 'ZZZ'.
SUBMIT ZREPORT2.
REPORT ZREPORT2.
DATA ITAB LIKE
INITIALIZATION.
IMPORT ITAB FROM MEMORY ID 'ZZZ'.
Max
Message was edited by: max bianchi -
Exporting Multiple Internal table data to Single Excel file.
Hello Expert,
I want to export more than one internal table data from Web Dynpro Application to single Excel file but in such a way that
each table's data to be get exported to different tabs in (Multiple sheets) that single excel file.
So help me in this matter.
Thank You.
Varun
Moderator message: wrong forum, please post again in "Web Dynpro ABAP".
Edited by: Thomas Zloch on Oct 29, 2010 1:39 PMEach table having different sheet in same CSV file .
A CSV file is a flat file and don't have "Sheets"; you would have to Export to an Excel file, which supports several Sheets in one file.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Exporting internal table in a oops
hi friends,
I have to pass internal table to a method and export that internal table.
now when i am passing this internal table i am getting the last value of the table..
i am enclosing code here please go through and modify me regarding this..
REPORT ZTEST_ABAP_PROXY.
DATA PRXY TYPE REF TO ZCO_MI_PROXY_OUTBOUND.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
ERNAM LIKE MARA-ERNAM,
END OF I_MARA.
CREATE OBJECT PRXY.
DATA IT TYPE ZMT_PROXY_OUTBOUND OCCURS 0 WITH HEADER LINE.
TRY.
SELECT MATNR ERNAM INTO TABLE I_MARA FROM MARA UP TO 10 ROWS.
LOOP AT I_MARA.
IT-MT_PROXY_OUTBOUND-MATNR = I_MARA-MATNR.
IT-MT_PROXY_OUTBOUND-ERNAM = I_MARA-ERNAM.
APPEND IT.
ENDLOOP.
CALL METHOD PRXY->EXECUTE_ASYNCHRONOUS
EXPORTING
OUTPUT = IT.
COMMIT WORK.
CATCH CX_AI_SYSTEM_FAULT .
DATA FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .
CREATE OBJECT FAULT.
WRITE :/ FAULT->ERRORTEXT.
ENDTRY.
i need to pass all the values of internal table to output at once..
Thanks and Regards
VijayHi Vijay,
I think the problem is with the output parameter.
Might be I'll give you the background and then explain you the problem. This may help.
In the older release of ABAP there used to be Tables as one of the tabs where one could import/export tables to/from the FM. The problem was that it would difficult to identify what table are being imported and what are bein exported.
So with later releases of ABAP this tab was removed and currently there are Exporting/Importing/Changing tabs. You can use changing in your case if you are passing the table to modify the same.
Now the problem.
As stated above the OUTPUT is a line type (means structure) while IT is a internal table with header lines. So the record in the wa of this table is only transferred to OUTPUT.
What needs to be done.
You need to change the type of the OUTPUT to table type. I am not sure if you know about table type.
You can create a Table Type is se11 under Data Type.
I hope this helps.
Regards,
Saurabh -
Exporting Internal Table from Methods
Hi Experts,
I wanted to export an internal table from Methods and I am using below syntax and its not working.
METHODS get_data IMPORTING value(s_matnr) type mara-matnr
exporting it_tab TYPE STANDARD TABLE itab.
Please let me know what is the proper syntax.
Thanks
BasanagoudaHi,
Define itab as a 'table type' of standard table.
Example: TYPES: t_sflight TYPE STANDARD TABLE OF sflight.
METHODS : get_data IMPORTING s_carrid type sel_carrid
EXPORTING e_tab type t_sflight.
ENDCLASS -
Exporting An message Internal table to Standard program Internal Table
Hi,
In T-code VOFM, We have Goods issue routine 113, Now in Custmizing 913 is Configured. we are Checking the status of each handling unit of the Delivery. So I am getting the status Incomeplete Message for Multipe HU's. hence AM storing into One internal Table and Now I want To Export That Internal Table to Standard Program Internal Table 'WAT'.
If I raiseElaborate your questions Please.
-
Export internal table to memory in User Exit FM
Hi all,
My scenario here is to export an internal table in one user exit FM and import it back in another user exit FM.
I was trying to use
Export lt_table to memory id 'LABEL'.
then
Import lt_table from memory id 'LABEL'.
But then i hit error in the import statement. How can I rectify this?
Thanks. Answer will be rewarded.Refer to the below related threads
Export an internal table to memory and import from memory into an internal
http://help.sap.com/saphelp_erp2005/helpdata/en/fc/eb3bf8358411d1829f0000e829fbfe/frameset.htm
Regards,
Santosh -
Internal table export and import in ECC 5.0 version
Hi friends,
I am trying to export and import internal table from one program to other program.
The below export and import commands are not working when I run the program in background (using SUBMIT zxxxx via JOB name NUMBER number ..)
EXPORT ITAB TO MEMORY id 'ZMATERIAL_CREATE'.
IMPORT ItAB FROM MEMORY ID 'ZMATERIAL_CREATE'.
Normally it should work. Since Its not working I am trying with another alternative..
i.e EXPORT (ptab) INTERNAL TABLE itab.
My sap version is ECC 5.0 .
For your information, here I am forwarding sap help. Pls have a look and explain how to declare ptab internal table.
+Extract from SAP help+
In the dynamic case the parameter list is specified in an index table ptab with two columns. These columns can have any name and have to be of the type "character". In the first column of ptab, you have to specify the names of the parameters and in the second column the data objects. If the second column is initial, then the name of the parameter in the first column has to match the name of a data object. The data object is then stored under its name in the cluster. If the first column of ptab is initial, an uncatchable exception will be raised.
Outside of classes you can also use a single-column internal table for parameter_list for the dynamic form. In doing so, all data objects are implicitly stored under their name in the data cluster.
My internal table having around 45 columns.
pls help me.
Thanks in advance
raghunathThe export/import should work the way you are using it. Just make sure you are using same memory id and make sure its unique - meaning u are using it only for this itab purpose and not overwriting it with other values. Check itab is not initial before you export in program 1 - then import it in prog2 with same memory id...also check case, I am not sure if its case sensitive...
Here is how you use the second variant...
Two fields with two different identifications "P1" and "P2" with the dynamic variant of the cluster definition are written to the ABAP Memory. After execution of the statement IMPORT, the contents of the fields text1 and text2 are interchanged.
TYPES:
BEGIN OF tab_type,
para TYPE string,
dobj TYPE string,
END OF tab_type.
DATA:
id TYPE c LENGTH 10 VALUE 'TEXTS',
text1 TYPE string VALUE `IKE`,
text2 TYPE string VALUE `TINA`,
line TYPE tab_type,
itab TYPE STANDARD TABLE OF tab_type.
line-para = 'P1'.
line-dobj = 'TEXT1'.
APPEND line TO itab.
line-para = 'P2'.
line-dobj = 'TEXT2'.
APPEND line TO itab.
EXPORT (itab) TO MEMORY ID id.
IMPORT p1 = text2
p2 = text1 FROM MEMORY ID id. -
Export Internal Table to XML in Background
Hi
I need to export a internal table into xml file in background using open dataset. The file is getting created but i am not able to open the file using IE/XML editor . When i open the file uisng wordpad i can see some charcters at the end of file which prevents it from opening in xml editor. if i delete the characters(box like) and save the file. i am able to open the file
When i downalod the same internal table via frontend using ws_downlod it works pefectly. no junk charcters are appended in the end. and hence files opens perfectly
below is the extract of program
START-OF-SELECTION.
PERFORM get_data.
PERFORM create_xml.
FORM get_data.
REFRESH accesos.
CLEAR accesos.
MOVE: '45050' TO accesos-socio-numero,
'MOISES MORENO' TO accesos-socio-nombre,
'0' TO accesos-socio-reposicion.
APPEND accesos.
ENDFORM.
i am using the following function modules
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
name = 'ACCESOS'
dataobject = accesos[]
IMPORTING
data_as_dom = l_dom
CHANGING
document = m_document
EXCEPTIONS
illegal_name = 1
OTHERS = 2.
CHECK NOT l_dom IS INITIAL.
w_rc = m_document->append_child( new_child = l_dom ).
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
document = m_document
IMPORTING
xml_as_string = w_string
size = w_size
TABLES
xml_as_table = it_xml
EXCEPTIONS
no_document = 1
OTHERS = 2.
LOOP AT it_xml INTO xml_tab-d.
APPEND xml_tab.
ENDLOOP.
The following syntax for open datset which does not work
lv_physcial_file = '
hdat03\test.xml'.
OPEN DATASET lv_physcial_file IN BINARY MODE FOR OUTPUT MESSAGE l_msg.
LOOP AT xml_tab.
TRANSFER xml_tab TO lv_physcial_file.
ENDLOOP.
The ws_download function works
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_SIZE
FILENAME = GK_RUTA
FILETYPE = 'BIN'
TABLES
DATA_TAB = XML_TAB
EXCEPTIONS
OTHERS = 10.
many thnaksHi Chetan,
Can you just try changing the syntax to the following, I not sure if that will help but just try and see.
OPEN DATASET lv_physcial_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
Regards
Mohamed -
Export internal table from report to web-dynpro
Hi,
I am trying to export an internal table from a report to my web dynpro pragram however its not working.
Statement used in my report -
EXPORT it_ordbk FROM it_ordbk TO MEMORY ID 'ZORDBK'.
Statement used in my web dynpro program
IMPORT it_ordbk to it_ordbk FROM MEMORY ID 'ZORDBK'.
This dynpro application is being called in HTML container on the screen.
Kindly help.
Cordially,
DanishHi Danish,
do not use export or import in Webdynpro.
try to create a class with global variables and in the report or at the place of Export fille the data .
and next in the place of Import memory to to call the global variable in the webdynpro and fill the internal table
go to se24> create a zclasss-> methods initialize>create a ztable same as export table and also declare in glaobal vairaible
--> next in the webdynpro program -->call the method retrive and push the global data to internal table.
Prabhudas -
Exporting internal table to memory variable
I need to extract some data within a program into an internal table. Then I need to export the internal table into a memory variable
Then in another program i need to import this memory variable into another internal table
How to do the import export into a memory variableSee the simple example :
REPORT ZTEST_AMEM1.
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.
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.
Maybe you are looking for
-
How do I Delete an Email Address from Auto Complete in iPad iOS mail
How can I remove old/unwanted/incorrect email addresses, (which have never been in my contacts list or which have been superseded because they were wrong)? Every time I start writing an email address I get this list of suggestions of any similar addr
-
When I sync my iphone and ipad to itunes on my mac, I have a yellow bar listed as "other" taking space on my phone. Is this something that can be cleaned up on the iphone to make the space it is using avail? I have deleted some photos, music and apps
-
Adobe Flash Player 11.3 r300 still crashing (includes about:crashes)
Just had some more crashes while trying to use youtube this morning. In a previous discussion you asked for the "about:crashes" report, so here they are. https://crash-stats.mozilla.com/report/index/bp-1914231b-4147-4482-bd0c-ab1792120627 https://cra
-
How to enable your disabled iPhone
How do I enable my disable iPhone?
-
What happened to the boards????
What happened to the posting boards. When Adobe took over it seems that the posts dropped by 80-90%. This used to be a great resource. Any ideas?