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

Query data read program

Former Member
0 Likes
1,774

i am a functional developer and i am just trying to get the fields in structure FAGL_S_RFSSLD00_LIST to use in this query. Is it possible.

If yes what is the way to do it.

I have the program generated like this when i created the infoset

REPORT RSAQDVP_TEMPLATE .

*

----


  • declarations

  • (insert your declarations in this section)

----


data:

FAGL_S_RFSSLD00_LIST type FAGL_S_RFSSLD00_LIST ,

it_data type standard table of FAGL_S_RFSSLD00_LIST .

field-symbols: <struc> type FAGL_S_RFSSLD00_LIST .

----


  • selection screen statements

----


  • (define your selection-screen here)

  • !! the following comment MUST NOT BE CHANGED !!

*<QUERY_HEAD>

----


  • read data into IT_DATA

----


  • (select your data here into internal table IT_DATA)

----


  • output of the data

  • (this section can be left unchanged)

----


loop at it_data assigning <struc>.

move-corresponding <struc> to FAGL_S_RFSSLD00_LIST .

  • !! the following comment MUST NOT BE CHANGED !!

*<QUERY_BODY>

I just need to know what i should fill in the query head and body if I need all the fields in the structure to be selected for the Query

6 REPLIES 6
Read only

Former Member
0 Likes
987

Hello Krishna,

The structure FAGL_S_RFSSLD00_LIST should be available in data dictionary (SE11).

REPORT RSAQDVP_TEMPLATE .

*

----


  • declarations

  • (insert your declarations in this section)

----


TABLES: FAGL_S_RFSSLD00_LIST "<----


inserted.

DATA: it_data type standard table of FAGL_S_RFSSLD00_LIST .

field-symbols: <struc> type FAGL_S_RFSSLD00_LIST .

----


  • selection screen statements

----


  • (define your selection-screen here)

  • !! the following comment MUST NOT BE CHANGED !!

*<QUERY_HEAD>

----


  • read data into IT_DATA

----


  • (select your data here into internal table IT_DATA)

example:

SELECT <your list of fields>

FROM <your table name>

INTO TABLE IT_DATA

WHERE <Your filter criteria based on selection screen>.

----


  • output of the data

  • (this section can be left unchanged)

----


loop at it_data assigning <struc>.

move-corresponding <struc> to FAGL_S_RFSSLD00_LIST .

  • !! the following comment MUST NOT BE CHANGED !!

*<QUERY_BODY>

ENDLOOP. "<----


inserted

-


In SQ02 create the info sets with 'program' options. provide the program name and the

Structure name FAGL_S_RFSSLD00_LIST also in SQ02.

generate the infosets and in SQ01 create the query with the fields you want to display in the list .

Message was edited by:

Amarjit Singh

Read only

0 Likes
987

it seems it only works with Tables but not structures. is there a way to make it work for structures.

Could you please clarify.

Thanks

krishna

Read only

0 Likes
987

No it works for structure also.

Here in my code

Tables: <----


does not mean a SAP table.

It is a work area. A stracture to hold the records of your data retrieve from a SAP database table.

You may retrieve data from any SAP tables but finaly your data should be passed to a structure which you define in the info sets.

If you need any help please let me know.

Regards,

A.Singh

Read only

0 Likes
987

If that is the case, could you please provide me detailed exact code for the below. I am having some code errors

As for the select statement, I would need all the fields from structure FAGL_S_RFSSLD00_LIST

REPORT RSAQDVP_TEMPLATE .

*

----


  • declarations

  • (insert your declarations in this section)

----


data:

FAGL_S_RFSSLD00_LIST type FAGL_S_RFSSLD00_LIST ,

it_data type standard table of FAGL_S_RFSSLD00_LIST .

field-symbols: <struc> type FAGL_S_RFSSLD00_LIST .

----


  • selection screen statements

----


  • (define your selection-screen here)

  • !! the following comment MUST NOT BE CHANGED !!

*<QUERY_HEAD>

----


  • read data into IT_DATA

----


  • (select your data here into internal table IT_DATA)

----


  • output of the data

  • (this section can be left unchanged)

----


loop at it_data assigning <struc>.

move-corresponding <struc> to FAGL_S_RFSSLD00_LIST .

  • !! the following comment MUST NOT BE CHANGED !!

*<QUERY_BODY>

endloop.

Read only

0 Likes
987

Hello Krishna,

Could you tell me the table (not structure) from which your want to fetch the records.

Regards,

A.Singh

Read only

0 Likes
987

The above listed structure is the one which provides me with Gl balances.

My problem is there is no way i can do some complex calculations using a query if I take the information from tables. I need to fetch gl balances and these are only stored in structures.