Thursday, January 19, 2012

ABAP: Store and read data from clusters

Hello,

Here is a simple program to store and read data from the clsuter.

* Create a transperant table , copy structure of table INDX.

DATA: it_info TYPE string,
      is_key(4) .

it_info 'Test to save data to INDX'.
is_key 'TEST'.

* Export to DB clsuter
EXPORT   gs_info    FROM it_info
         TO DATABASE zsandy_test(sy)
         ID is_key.

CLEAR it_info.

* Import from DB cluster.
IMPORT gs_info     it_info
         FROM DATABASE zsandy_test(sy)
         ID is_key.

WRITE:/ it_info. " this will show the record which is inserted with EXPORT

This is for the beginners :)

Cheers,
Sandeep

2 comments:

  1. This statement is will commit the data cluster in database table like INDX. You should also expain how we can use data clusters without storing the cluster in database with "USING" statement!!!!!!!!!!!!!!!!

    ReplyDelete
  2. This was just an example for beginner :) Anyways i enhance this further.

    ReplyDelete