‎2008 May 12 1:22 PM
Hi Experts,
Here i am giving requirement of selection screen and outputfields
Plz send me sample code and valuable references for the same.
*Selection screen*
Select-options
Profit Percent (Percentage field with 4 decimal points)
Sold-to-party
Order date (sales order date, can be found in sales header table VBAK)
Plant (can be found in sales item table VBAP)
Output
Sold-to-party, Sold-to-party name (can be found in KNA1), Sales order number, Sales order type, sales item number, Material, Description (material description, can be found in MAKT table), unit price, Net value, Base unit of measure, unit cost (can be found in KONV for the condition number (condition number can be found in VBAK as KNUMV)), Profit (calculate it), profit percentage (Calculate it), Customer district, state, country, sales order created by, Plant, Ship-to-party, Order qty, Purchase order number, Purchase requisition (if exist), Sales order creation date, Sales item creation date, Shipping type (Can be found in VBKD), Description of shipping type, incoterms, required delivery date, and payment terms.
Well, that is the requirement to write a report and write the same report in following types
1) Table display which is using ALV grid
2) Hierarchical display
3) Tree display
Well that is the requirement .
Pls send me suggestions and code (if possible)
Thanks and Regards
chandra mouli
‎2008 Jul 02 1:13 PM
you know, this is a full time job to get analysis and to convert it into code !!!
if you get paid for it, you should do it
‎2008 Jul 03 6:03 AM
Hi,
Well to do it first of all create internal table for all the output fields required.
After creating internal table create work area for the same or use statement with header line.
Then create selection screen with the required fields.
After creating selection screen write a select statement using inner joins to fetch data from database tables by using selection screen fields as selection criteria(depending upon which values are selected from database tables).
After fetching data use loop...endlloop statement to process and display data.
I.e.
to create internal table:
DATA: BEGIN OF itab1 OCCURS 0,
ebeln TYPE ekko-ebeln,
lifnr TYPE ekko-lifnr,
ekorg TYPE ekko-ekorg,
aedat TYPE ekko-aedat,
menge TYPE ekpo-menge,
END OF itab1.
create selection screen:
SELECTION-SCREEN BEGIN OF BLOCK b1.
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
SELECT-OPTIONS: s_lifnr FOR ekko-lifnr.
SELECT-OPTIONS: s_date FOR ekko-aedat.
SELECTION-SCREEN END OF BLOCK b1.
select data based on selection screen values:
SELECT * FROM ekko
INTO CORRESPONDING FIELDS OF TABLE itab1
WHERE ebeln IN s_ebeln.
Display output:
header:
WRITE:/ '|',
'orderno', 20 '|',
'vendor no', 40 '|',
'purchase org',60 '|',
'order creation date',85 '|',
'purchase qty',120 '|'.
ULINE.
Data:
LOOP AT itab1.
FORMAT HOTSPOT ON.
WRITE 😕 '|', itab1-ebeln
'|',itab1-lifnr, 40
'|',itab1-ekorg, 60
'|',itab1-aedat, 85
'|',itab1-menge, 120 '|'.
ULINE.
ENDLOOP.