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: 

how to create a ALV report using fields.

former_member613699
Discoverer
0 Kudos

hi all,

i have a requirement to make a ALV report,

with Parameter : GJAHR

Select Options : PS_POSID

KOSTL

SAKNR

in above 4 fields PS_POSID is from COBL Structure, hoe can i write select stament in program.

And need to generate

Report Output Columns:

Report output will be displayed in ALV format and will include the following fields:

  • 1.PO #r (EKKO-EBELN)
  • 2.Vendor Name (LFA1- NAME1)
  • 3.Vendor Number (LFA1- LIFNR)
  • 4.Original Amount (ACEDSOI- ACE_TOTAL_AMOUNT)
  • 5.Start of Life (ACEDSOH- ACE_VALDATE_FROM)
  • 6.End of Life (ACEDSOH- ACE_VALDATE_TO)
  • 7.GL Account (SKB1- SAKNR)
  • 8.Cost Center (CSKS- KOSTL)
  • 9.WBS Element (PRPS- PS_POSID)
  • 10.Total Spend – calculated field [formulae =(Sum of P1-P12 expenses)]
  • 11.APR|MAY\JUN\JUY|AUG|SEP|OCT|NOV|DEC|JAN|FEB|MAR (12 Columns)
  • 12.Text (ACAC_OBJECTS- TEXT)

can you guys please help me.

2 REPLIES 2

raymond_giuseppi
Active Contributor

'PS_POSID is from COBL Structure, how could I write select statement in program.' You cannot, you can only select data from database (table, view, etc.) not from structures...

Basically you have to identify the main table(s) that contain(s) the ratio to display, do you guess which table in your requirement carry such amount/quantity field (you have 2 seconds)

Then find the tables required for other fields, when available prefer JOIN to separate selects followed by some merging data, Look for foreign relations in Abap ddic, add some personal logic.

Then back to your Abap training manuals...

0 Kudos

mouli mukesh kumar niddapu Activate the SQL trace, ask the functional guy to show you in live the screens where the data come from, what values are expected in the smart form, then deactivate the SQL trace, look at the tables in the trace, and find out which ones contain the data. When you know the tables, the columns and the relationships between those tables, you are ready to write your SQL query.