Application Development 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: 

Hi

Former Member
0 Kudos
92

Hi,

Plz let me know in simple words about Field String, structure, internal table. and when we should use these in a program.

n

null

1 ACCEPTED SOLUTION

0 Kudos
68

Hi,

There is nothing like a Functional String as far as I know, But String is a TYPE that can be used to create variable in your program to store CHARATER TYPE data with dynamic lenght, that is when you dont know the lenght and you know that its length may vary.

Strcutre is used to store a group of related data, for example you want to store one record of a Database table, then you need to create a variable which has all the fields of the Database table. So you copy one record of the database table into your program's strucutre.

<b>Example.

DATA: wa-spfli TYPE SPFLI.

SELECT SINGE FROM SPFLI INTO WA_SPFLI WHERE CARRID = 'LH' CONNID = '002' .</b>

Internal table is as you can guess when you want to store more than one record of the table.

<b>Example:

DATA: Itab type table of SPFLI.

SELECT * FROM SPFLI INTO TABLE ITAB.</b>

Regards,

Sesh

4 REPLIES 4

Former Member
0 Kudos
68

refer to the below link for ABAP general.

Reward points if helpful

jayanthi_jayaraman
Active Contributor
0 Kudos
68

Hi,

Structure is like a template.It is having fields with predefined format.It cannot hold values.

Database Tables is also similar to structure but it can hold values.

Internal table is something which will be used by programers in a program to hold database table's(from diffeernt tables) data for the program.

0 Kudos
69

Hi,

There is nothing like a Functional String as far as I know, But String is a TYPE that can be used to create variable in your program to store CHARATER TYPE data with dynamic lenght, that is when you dont know the lenght and you know that its length may vary.

Strcutre is used to store a group of related data, for example you want to store one record of a Database table, then you need to create a variable which has all the fields of the Database table. So you copy one record of the database table into your program's strucutre.

<b>Example.

DATA: wa-spfli TYPE SPFLI.

SELECT SINGE FROM SPFLI INTO WA_SPFLI WHERE CARRID = 'LH' CONNID = '002' .</b>

Internal table is as you can guess when you want to store more than one record of the table.

<b>Example:

DATA: Itab type table of SPFLI.

SELECT * FROM SPFLI INTO TABLE ITAB.</b>

Regards,

Sesh

Former Member
0 Kudos
68

Hi,

Do you mean functions? or Strings?

Anyways,

<b>Structure:</b> A structure (structured type) comprises components (fields). Types are defined for the components A component can refer to an elementary type (via a data element or by directly specifying the data type and length in the structure definition), another structure or a table type. A structure can therefore be nested to any depth.

<b>Internal Table:</b> Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.

<b>Function Module:</b>Function modules allow you to encapsulate and reuse global functions in the SAP System. They are managed in a central function library. The SAP System contains several predefined functions modules that can be called from any ABAP program. Function modules also play an important role during updating and in interaction between different SAP systems, or between SAP systems and remote systems through remote communications.

<b>String:</b> Collection of characters.

Reward if useful!