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

using structures in reporting

Former Member
0 Likes
642

If i given only structures for generating a reports how can i code SQL for the same as SQL cannot accept the structures for fetching the data.

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
616

If you're only given structures, and your expected to code from them, tell your functional analyst he's not given you enough information. You have to have table names.

If you're permitted to do some analysis yourself, then you need to understand first that the technicals names of fields on screens is the name given to the screen structure. Sometimes that maps directly to a table, but more often than not, it doesn't.

In those cases, you can go through debug to find out which table is used to populate the structure, or you can run SQL trace or Run Time Analysis to find the same.

matt

4 REPLIES 4
Read only

Former Member
0 Likes
616

Hi,

You have to use the structures in the following situations.\

Ex 1. If you want to show the reports based on same characteristic and some other restricted char then u have to use structures. For ex you have posting period and fiscal year then you want to show quarterly reports then you have to create structures then using these chars you have to create quarters.

Ex 2. If you want to use cell defination then you need two structures one in row and another in column.

For more info see here:

http://help.sap.com/saphelp_nw04/helpdata/en/4d/e2bebb41da1d42917100471b364efa/content.htm

Regards

Read only

matt
Active Contributor
0 Likes
617

If you're only given structures, and your expected to code from them, tell your functional analyst he's not given you enough information. You have to have table names.

If you're permitted to do some analysis yourself, then you need to understand first that the technicals names of fields on screens is the name given to the screen structure. Sometimes that maps directly to a table, but more often than not, it doesn't.

In those cases, you can go through debug to find out which table is used to populate the structure, or you can run SQL trace or Run Time Analysis to find the same.

matt

Read only

Former Member
0 Likes
616

Hi

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.

Read only

Former Member
0 Likes
616

Hi,

Structres contains data only at runtime. Hence SELECT query is not applicable to it as SELECT statment can be used to fetch data from Tables/Views only.

Regards,

Amit