cancel
Showing results for 
Search instead for 
Did you mean: 

Difference Between a Structure and a Table in ABAP

Former Member
0 Kudos

Hello,

I'm new to SAP and ABAP. Could any body tell me what are the differences between a structure and a Table in ABAP?

I used Trans se16 to view the content of what I thought to be a table but I got the Message that it was a structure and not a table. Is there any transaction I could use to view the content of the structure?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I guess you have looked at a standard SAP transaction and fit F1 help, followed by F9 technical information on a field?

You were hoping to find where the data was stored for a given transaction?

Unfortunately its not so easy. SAP often selects data from the database and then formats it before presenting it on the screen. Often it creates structures with specific fields (which may span many tables) to paint onto the screen.

To find where the data is actually stored you need to dig deeper than just the screen.

Ways to find the tables include:

- use SQL trace ST05 (and a display transaction)

- look at the code of the transaction

- search in SE11 and repository info system SE84

- experience

- I'm sure there are others...

Hope that helps.

Brad

Answers (9)

Answers (9)

Former Member

HI

Structure can have only single record at run time..

whereas table can have multiple records ..

Praveen.

former_member191161
Participant
0 Kudos

Hi all,

How to find storage table by using particular field value...???

former_member184367
Active Participant
0 Kudos

This message was moderated.

Former Member
0 Kudos

Structure in ABAP can not store data.

Former Member
0 Kudos

Hi,

In simple words we can say a table has an underlying database in it, while a structure has no underlying database.

Thanks:

Sapna

Former Member
0 Kudos

Hi All,

I read all your posts & have some understanding of what Structure is. I would like to know can i join a structure & a table? Find below the steps followed by me

1. Created an infoset, in the initial dialog box, the data source tab section, i selected 'data retrieval by program' & in the Data stucture field, entered the structure name.

2. I then added the table into my infoset, through the Extras tab. The system automatically proposed the join conditions between the table & structure.

3. I saved the infoset & asked for generation, but it gave an error saying 'Commentary <Query_head> or <Query_body> is missing'. I am not able to figure out what to do.

My requirement - To join the table MARD with Structure MDPS, so that i can have a query where i can enter the material number & plant number & view if a purchase requisition has been firmed or not (Field - FIX01).

I hope my problem is clear, await your inputs.

Vivek

Former Member
0 Kudos

Thank you all very much.If a structure is just a list of fields defined under a name(which I presume can reference an underlying table or the field could be used in SAP for internal calculation), can one pass values to a named strucuture? After SAP has done the internal calculations with the data passed to it using the structure, can the same data be returned by SAP to the same structure?

"From the previous answers it should be possible to return the data using the same structure because a structure is just a list of fields defined under a name."

My problem here is that I have passed some data to an SAP structure using jdbc and jco. And I want to retrieve the result sent back to me by SAP using the same structure but the result seems ambiguous. The result does not reflect what I intend to receive back from the structure.

I hope very much on your feed backs. Thank you.

Former Member
0 Kudos

Hi Rudolph,

How are you sending data to an SAP <b>structure</b> using JCO/JDBC?

Are you calling a BAPI or an RFC? (JCO)

Or are you accessing the SAP database directly with JDBC?

Either way, you can't be sending data to an SAP structure.

Please elaborate more on what you are doing.

Cheers,

Brad

Former Member
0 Kudos

Hi Brad,

I'm sending data to SAP structure using jco calling a RFC.

I'm using an array to send data from jdbc application to jco application. I might be wrong here. Could I send you the code to an email for you to see what I'm trying to do?

Thanks

Former Member
0 Kudos

Hi Rudolph,

So you are having problems loading the RFC parameters/structures from java.

Sorry, thats getting a bit beyond my expertise.

Its clear now, however, that you should be posting this question in the Java forum.

Jump into and post it there.

I'm sure you'll get a quick response.

Brad

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

In this link, you can find some useful coding samples.

http://www.sapdevelopment.co.uk/java/jco/jcohome.htm

http://www.henrikfrank.dk/abapexamples/Java/sapjava_getcompanycode_list.htm

Following are the weblogs about JCO

/people/gregor.wolf3/blog/2004/09/23/from-function-module-to-jco-application--part-1-of-3

/people/gregor.wolf3/blog/2004/09/24/from-function-module-to-jco-application--part-2-of-3

/people/gregor.wolf3/blog/2004/09/25/from-function-module-to-jco-application--part-3-of-3

/people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection

For Tables and Structures refer this.

http://help.sap.com/saphelp_40b/helpdata/en/4f/991f82446d11d189700000e8322d00/applet.htm

For RFC related information,check this.

http://help.sap.com/printdocu/core/Print46c/en/Data/Index_en.htm

http://www.sap-img.com/abap-function.htm

Former Member
0 Kudos

Hello:

Welcome to SAP

Curious to know how you got the name that you wanted to browse through SE16. Sometimes what happens is that the field or the collection of fields that you are viewing on the screen - to get details about where these fields are stored in the database, you try to get more info on those fields by pressing F1 on that field. The name that you retrieve from the additional info screen - looks like a table name but sometimes it is not (and I think in your case it turned out to be a structure).

Structure are nothing but record definition. Data that gets stored using the record definition goes in SAP table. For example:

data: begin of emp_info,

emp_name(20) type c,

emp_age(3) type n,

end of emp_info.

Above is a record definition (which could also be thought of as a structure). When you want to store the data, you would move name to emp_name and age to emp_age and finally insert the emp_info information to the table. The fields in table may be named as EMPLOYEE_NAME and EMPLOYEE_AGE, but the type specification should be consistent with the record/structure specification.

I hope now you can make out why you don't see data in the structure - and the difference between the structure and the table.

Hope it helps - and good lukc!

Regards,

Chetan Singh

Former Member
0 Kudos

Hi Rudolph,

Structure in ABAP can not store data.

at DDIC level both are same but a table in SAP has mapping

to a table in the underlying database.

In se16 you can see data only from a table.

Regards,

Narinder Hartala

Former Member
0 Kudos

Hi Rudolph,

A table is a table that has been created in the database.

A structure is just a list of fields defined under a name. Structures are useful for painting screen fields, and for manipulating data that has a consistent format defined by a discrete number of fields.

There is no content to view in a structure. You can, however, view the definition of a structure in SE11.

Cheers,

Brad