2008 Apr 29 4:52 PM
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
raghunath
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
raghunath
2008 Apr 29 5:18 PM
The 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.
2008 Apr 29 6:29 PM
Hi MKR,
Sorry... I tried so many times. but no use.
My question is.. apart from the
export <itab> to memory id 'zxxx'.
is there any otherway .... can we export internal table directly? i mean with out using memory ID.
like... export <ptab> internal table <itab>
assume... my final_itab consits 45 coulmns.
when I am using my internal table (final_itab) in both places i.e (ptab and itab places), its giving run time error.
pls help me ...
how can i upload internal table directly with out using memory id.
FYI: when I executed in foreground it is working. background it is not working.
Thanks in advance.
Raghunath
2008 Apr 29 6:02 PM
These export and import statements should run in the same session.