2007 Oct 02 10:57 PM
Dear experts,
i am new to ABAP programming. I tried to create a function module and I would like to get some data from a structure but not from a table. Is it possible for me to do that using SQL statements in the 'source code'?
Thanks in advance
2007 Oct 02 11:05 PM
Structure doesnt hold any data. It just has the fields in it.
You have to find the corresponding Table to find the data.
Sri
2007 Oct 02 11:01 PM
Hi,
The structure will not have any data..It is a just a template..You need to select the data from the database table
Thanks
Naren
2007 Oct 02 11:05 PM
Structure doesnt hold any data. It just has the fields in it.
You have to find the corresponding Table to find the data.
Sri
2007 Oct 02 11:45 PM
The structure will only have data if it has been loaded elsewhere, such as if the structure was populated by a function call or BAPI.
If not, you will have to load data into the structure using SQL Select or by calling the approriate function call/method/BAPI etc.
If the structure already has data, you access that data by referencing the structure name and the component
e.g.
w_field = struct-field1.
This will load the value of the component field "field1" in structure "struct" into a separate work field "w_field".
This is how you refer to components of a structure.
structure_name-component_name
Consequently, you should not use a dash "-" in the name of a field or structure. If you need to separate words in the name use an underscore "_".
If you do attempt to use the dash "-" in the name of a field or structure in a Unicode program, you will get a warning message.
Good luck
Brian