Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

INDX table - how the data is fetched from INDX table

Former Member
0 Likes
7,234

Hi, there is a standard code which fetches the attributes of Sales organization from INDX table. Code is below.


IMPORT attrib_ext   TO attrib_ext
       seldate      TO l_sdate
       FROM DATABASE indx(p/) ID l_indx_srtfd.

But if i give the id l_indx_srtfd in table INDX (SE11) i am unable to see those attributes (ATTRIB_EXT) in the table output. How can i know the related data base tables associated with INDX table ?

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
3,894

if i give the id l_indx_srtfd in table INDX (SE11) i am unable to see those attributes (ATTRIB_EXT) in the table output.

As long as you use data browser tool (se16) or DDIC (se11) you won't be able to see any fields apart for standard [structure of all INDX tables|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3c12358411d1829f0000e829fbfe/frameset.htm].

This is because the data you are extracting are compressed and stored in DB in raw format. That's why you need specific statement IMPORT FROM DATABASE... in order the system could extract and return specific data objects (i.e. ATTRIB_EXT) store in this table.

How can i know the related data base tables associated with INDX table ?

I don't quite understand this question, could you be more specific.

Regards

Marcin

8 REPLIES 8
Read only

MarcinPciak
Active Contributor
0 Likes
3,895

if i give the id l_indx_srtfd in table INDX (SE11) i am unable to see those attributes (ATTRIB_EXT) in the table output.

As long as you use data browser tool (se16) or DDIC (se11) you won't be able to see any fields apart for standard [structure of all INDX tables|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3c12358411d1829f0000e829fbfe/frameset.htm].

This is because the data you are extracting are compressed and stored in DB in raw format. That's why you need specific statement IMPORT FROM DATABASE... in order the system could extract and return specific data objects (i.e. ATTRIB_EXT) store in this table.

How can i know the related data base tables associated with INDX table ?

I don't quite understand this question, could you be more specific.

Regards

Marcin

Read only

0 Likes
3,894

For one record i am able to get the data related to ATTRIB_EXT using IMPORT FROM DB statement and for other record i am not.

Here my intention is to know why i am unable to pic the ATTRIB_EXT data from INDX table for other record. See below the output of the INDX table for those two records.

220 P/ SALE O 50014189 0 20.08.2010 RNIJJAR 000338 20.08.2010 20.08.2010 176 FF0602010202800034313033000000006D010000121F9D0219331F0303038B059060E062C0021C1942803088C193C189219EC1952102C85B0BD1B3004C89AD02

for the above record i am unable to get the ATTRIB_EXT details.

but for below record, yes i am able to get the Organization attribute.

220 P/ SALE O 50027367 0 20.08.2010 RNIJJAR 000230 20.08.2010 20.08.2010 467 FF0602010202800034313033000000000F410000121F9D02B46B2EAB09035118FEBDD04229D6854897D227A837AA4B4D821582829762BBC9ABD5ADA04F50F5CD

So i want to know where was the problem.

How can i know the related data base tables associated with INDX table ?

Is there any other tables are linked to INDX table (like check tables) so that in run time it will fetch the data ?

And how can convert the compressed DATA (LRAW) from INDX table into string?

Edited by: Kishore Kumar Vemula on Aug 20, 2010 8:50 PM

Read only

0 Likes
3,894

SAP Best Practice is to use INDX as a model to create your own table, or as SAP says "INDX-like" table. You export data from your internal table(s) to the INDX-like table, setting specific values at the time of export. Another process/program can then import that data from your INDX-like table into an internal table of the same type used for the export statement, using same data values. You supply values at runtime to export and therefore use the same values to import (they're static, not dynamic).

There's documentation for how to do this...search SCN and SAP HELP.

Read only

0 Likes
3,894

There is no problem, you just can only IMPORT what was EXPORTed.

Example

- 1 - EXPORT a b c d e TO DATABASE indx(p/) ID id1

- 2 - EXPORT a b d e TO DATABASE indx(p/) ID id2

You will never be able to IMPORT field c from databse for id id2

There are no other database table behind the cluster database, the information on which fields, structures and internal table are stored in a record (it may vary from record to record) is stored in the cluster of data in an hexadecimal way.

Also if you export many or large data, there will be multiple records for a single id.

Regards,

Raymond

Read only

0 Likes
3,894

Hi Raymond,

Thanks for the detailed info.

You said the data will be stored in Hexadecimal format. Do we have ny conversion FM to see the data in CHAR format. In INDX table there is a field CLUSTD which holds the data in LRAW-2886 format. How can i convert this ? Do we have any Function modules for conversion.

Read only

0 Likes
3,894

You can't directly convert this HEX data to char as these are in compressed format. Similary as you would want to translate zipped file to some MS word format, it doesn't really make sense. This is why you need to use IMPORT/EXPORT and list the data objects stored in this underlying clusters so the system can mapp it to their data with corresponing structure.

Regards

Marcin

Read only

0 Likes
3,894

I don't know any such FM. I suppose there is some C code behind EXPORT TO/IMPORT FROM DATABASE, but i don't care perform some reverse engineering on SAP copyrighted code

Regards,

Raymond

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,894

The database INDX is a cluster database, read first some documentation at [Structure of a Cluster Database|http://help.sap.com/saphelp_470/helpdata/en/fc/eb3c12358411d1829f0000e829fbfe/content.htm]

The mapping of key between IMPORT FROM/EXPORT TO DATABSE between parameters of the statement and actual key of the database table are explained in [Saving Data Objects in Cluster Databases|http://help.sap.com/saphelp_470/helpdata/en/fc/eb3c2c358411d1829f0000e829fbfe/frameset.htm] and [Reading Data Objects From Cluster Databases|http://help.sap.com/saphelp_470/helpdata/en/fc/eb3c46358411d1829f0000e829fbfe/frameset.htm]

Regards,

Raymond