SAP Database

ABAP Programs: Importing from the ABAP/4 Memory

Print This Post Email This Post Written by admin on Dec 12th, 2007 | Filed under: ABAP Programs

REPORT ZSOURCE1402.
* Internal tables which will be imported
DATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100
WITH HEADER LINE,
ALL_BOOKINGS LIKE BOOKINGS OCCURS 10
WITH HEADER LINE,
NEW_BOOKINGS LIKE BOOKINGS OCCURS 50
WITH HEADER LINE.

* Importing from the ABAP/4 Memory
IMPORT ALL_CUSTOMERS ALL_BOOKINGS
FROM MEMORY ID ‘CUSTBOOK’.
IF SY-SUBRC NE 0.
WRITE ‘Import failed.’.
ENDIF.
* Skipping and renaming objects at import
IMPORT ALL_BOOKINGS TO NEW_BOOKINGS
FROM MEMORY ID ‘CUSTBOOK’.
* Displaying the result
LOOP AT ALL_CUSTOMERS.
WRITE / ALL_CUSTOMERS-NAME.
ENDLOOP.
LOOP AT ALL_BOOKINGS.
WRITE / ALL_BOOKINGS-FLDATE.
ENDLOOP.
LOOP AT NEW_BOOKINGS.
WRITE / NEW_BOOKINGS-FLDATE.
ENDLOOP.

If you like this post, you may as well like these too:

  1. ABAP Programs: Exporting to the ABAP/4 Memory REPORT ZSOURCE1401. * Work areas TABLES: CUSTOMERS, BOOKINGS. * Internal tables which will be exported DATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, ALL_BOOKINGS LIKE BOOKINGS OCCURS 10...
  2. ABAP Programs: Using Internal Tables for Selection Criteria REPORT ZSOURCE1112.* Work areasTABLES: CUSTOMERS, BOOKINGS.* Internal tablesDATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, ALL_BOOKINGS LIKE BOOKINGS OCCURS 500 WITH HEADER LINE.* Reading entries from both database...
  3. ABAP Programs: Using where clauses REPORT ZSOURCE1104.* Work areasTABLES: BOOKINGS, CUSTOMERS.* Internal tablesDATA CUSTOMER_ORDERS LIKE BOOKINGS OCCURS 100 WITH HEADER LINE.DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Selecting data with a simple...
  4. ABAP Programs: Working with hide statements REPORT ZSOURCE1704. * work area TABLES CUSTOMERS. * Internal table DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE. * Processing data START-OF-SELECTION. SELECT * FROM CUSTOMERS INTO TABLE...
  5. ABAP Programs: Transferring data to a file Here is a little program, which will teach you to transfer the data to a file. REPORT ZSOURCE2601. * Data declarations for later use PARAMETERS FILENAME(128) DEFAULT '/usr/tmp/testfile.dat' LOWER...



Leave a Reply

  • Help Support CRY