2006 Aug 31 11:46 AM
can someone give me sample code for import and export to memory id.... the reason io need it is that i have to write a routine and based on one condtion value i have to change another condtion . i need to pass a value...any suggestions?
2006 Aug 31 11:48 AM
Hi
Export:
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.
Import:
TABLES INDX.
DATA: INDXKEY LIKE INDX-SRTFD,
F1(4), F2 TYPE P,
BEGIN OF TAB3 OCCURS 10,
CONT(4),
END OF TAB3,
BEGIN OF DIRTAB OCCURS 10.
INCLUDE STRUCTURE CDIR.
DATA END OF DIRTAB.
INDXKEY = 'INDXKEY'.
EXPORT F1 F2 TAB3 TO
DATABASE INDX(ST) ID INDXKEY. " TAB3 has 17 entries
...
IMPORT DIRECTORY INTO DIRTAB FROM DATABASE INDX(ST) ID INDXKEY.
Regards,
Raj
can someone give me sample code for import and export to memory id.... the reason io need it is that i have to write a routine and based on one condtion value i have to change another condtion . i need to pass a value...any suggestions?
2006 Aug 31 11:48 AM
Hi
Export:
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.
Import:
TABLES INDX.
DATA: INDXKEY LIKE INDX-SRTFD,
F1(4), F2 TYPE P,
BEGIN OF TAB3 OCCURS 10,
CONT(4),
END OF TAB3,
BEGIN OF DIRTAB OCCURS 10.
INCLUDE STRUCTURE CDIR.
DATA END OF DIRTAB.
INDXKEY = 'INDXKEY'.
EXPORT F1 F2 TAB3 TO
DATABASE INDX(ST) ID INDXKEY. " TAB3 has 17 entries
...
IMPORT DIRECTORY INTO DIRTAB FROM DATABASE INDX(ST) ID INDXKEY.
Regards,
Raj
2006 Aug 31 12:15 PM
the problem is this routine is in purchase order. i have to export from the first section and then import in the second. when i import sy-subrc is 0 but still data does not get transfered. note: both this section get executed in the PO itself.
data: zpb1 like komv occurs 1 with header line.
data: wa_zpb1 like line of zpb1.
data: spb1 type komv-kwert.
BREAK CVSNAVID.
************************
first section
********************
IF XKOMV-KSCHL = 'ZPB1'.
IF XKOMV-kwert IS NOT INITIAL.
.
data: tkomv like komv occurs 1 with header line..
move xkomv to tkomv.
append tkomv.
export tkomv[] TO MEMORY ID 'ZPB1'.
ENDIF.
ENDIF.
****************
second section
**************
if xkomv-kschl = 'JVRD'.
CLEAR: ZPB1,spb1.
IMPORT ZPB1[] FROM MEMORY ID 'ZPB1'.
ENDIF.
2006 Aug 31 12:23 PM
HI Navid,
The name of the internal tables in the import and export should be same.
<b>export tkomv[] TO MEMORY ID 'ZPB1'.</b>
<b>IMPORT tkomv[] FROM MEMORY ID 'ZPB1'.</b>
Regard,
2006 Oct 31 8:03 AM
2006 Aug 31 11:52 AM
Hi,
<b>Program A :</b>
SELECT-OPTIONS: S_BELNR FOR BKPF-BELNR.
EXPORT S_BELNR TO MEMORY ID 'ZXC9'.
<b>Program B :</b>
DATA: BEGIN OF S_BELNR OCCURS 10.
INCLUDE STRUCTURE STRUC1.
DATA: LOW LIKE BKPF-BELNR,
HIGH LIKE BKPF-BELNR.
DATA: END OF S_BELNR.
IMPORT S_BELNR FROM MEMORY ID 'ZXC9'.
For EXPORT: http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/export01.htm
For IMPORT: http://www.geocities.com/siliconvalley/campus/6345/import01.htm
Hope this helps
Regards
Sudheer
2006 Aug 31 11:52 AM
hi,
export matnr to memory id 'TEST'.
import matnr from memory id 'TEST '
free memory id 'TEST'.
matnr defined in export and import should be of same
type and length
Regards
Amole
2006 Aug 31 11:52 AM
Hello Navid,
You may see this standard code at ABAPDOCU transaction:
<b>REPORT demo_data_ext_cluster_import.
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 FROM 'Literal'
TO MEMORY ID 'text'.
EXPORT itab
TO MEMORY ID 'table'.
SUBMIT demo_data_ext_cluster_import2 AND RETURN.
SUBMIT demo_data_ext_cluster_import3.</b>
2006 Aug 31 11:53 AM
HI,
<b>REPORT ZTEST2 .
data: it_bkpf type table of bkpf with header line.
SELECT * FROM bkpf into table it_bkpf.
EXPORT it_bkpf[] TO MEMORY ID 'MID'.
refresh it_bkpf.
IMPORT it_bkpf[] FROM MEMORY ID 'MID'.
LOOP AT It_bkpf.
write:/ it_bkpf-belnr, 'found' color col_positive.
ENDLOOP.</b>REgards,
2006 Aug 31 12:00 PM
Hi Navid,
here an simple example:
REPORT ZGRO_EXPORT.
*
DATA: TEST(10) VALUE 'Export'.
*
START-OF-SELECTION.
*
EXPORT TEST TO MEMORY ID 'TEXT'.
*
WRITE: / SY-REPID, TEST.
*
SUBMIT ZGRO_TESTT AND RETURN.
*
IMPORT TEST FROM MEMORY ID 'TEXT'.
*
WRITE: / SY-REPID, TEST.
*
END-OF-SELECTION.
REPORT ZGRO_IMPORT MESSAGE-ID ZZ.
*
DATA: TEST(10).
*
START-OF-SELECTION.
*
IMPORT TEST FROM MEMORY ID 'TEXT'.
*
WRITE: / SY-REPID, TEST.
*
Test = 'Back'.
*
export TEST TO MEMORY ID 'TEXT'.
*
WRITE: / SY-REPID, TEST.
*
END-OF-SELECTION.
Regards, Dieter
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |