Regarding vents in reports
hi,
In Reports is it mandatory that we have to provide start -of-selection with end-of-selection.
Hi,
<b>START-OF-SELECTION.</b>
Effect
In an executable program, the corresponding event is processed after the selection screen has been displayed and before data is read using a logical database.
Note
The REPORT statement always executes a START-OF-SELECTION implcitly. Consequently all processing logic between the REPORT statement and the next event keyword is automatically processed in the START-OF-SELECTION event.
Immediately afterwards, the system processes the statements that belong to an explicit START-OF-SELECTION block.
<b>END-OF-SELECTION.</b>
Event keyword:
The END-OF-SELECTION event is triggered in type 1 programs once the logical database has finished reading all data and before the list processor is started.
Hope this makes u clear wat the vent does.
*****Reward points if useful
Similar Messages
-
Regarding purchase order report in bw
Hi guys,
I have a requirement for report in bw. I am getting data form datasources from po header and item level. In the report i have to show Purchase order quantity,
Goods recived quantity, MRP and goods reciept value. Can u tell me what all the infoobjects i have to take for these fields in BW. Its urgent. I will definitley award points.Also tell me the fields from R/3 and from which tables they are coming from.
Regards,
Niranjan
[email protected]Hi Niranjan,
check this link u will know all fields in bw and r/3..if u have any concerns get back to me.
http://help.sap.com/saphelp_nw2004s/helpdata/en/ed/62073c44564d59e10000000a114084/frameset.htm(header level)
http://help.sap.com/saphelp_nw2004s/helpdata/en/ed/62073c44564d59e10000000a114084/frameset.htm ( Item level)
Regards anil. -
Regarding standard aging reports
Hi Experts/Gurus
I need the standard reports for customer aging report and vendor aging report.
Need immediate replies.
Your answers can be rewarded with good points.
Regards,
kumarREPORT zfi_customer_ageing
NO STANDARD PAGE HEADING
LINE-COUNT 58
line-size 168
MESSAGE-ID zh_msg.
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: kna1, " Customer Master (General)
t001, " Company Codes
rfpdo.
I N T E R N A L T A B L E S D E C L A R A T I O N S *
Internal Table for Customer Open Items Data
DATA: BEGIN OF int_bsid OCCURS 0,
kunnr LIKE bsid-kunnr, " Customer Number
name1 LIKE kna1-name1, " Customer Name
shkzg LIKE bsid-shkzg, " Dr/Cr Indicator
belnr LIKE bsid-belnr, " Document Number
xblnr LIKE bsid-xblnr, " Ref Doc No
blart LIKE bsid-blart, " Document Type
zfbdt LIKE bsid-zfbdt, " Base Line Date
zbd1t LIKE bsid-zbd1t, " Due date1
zbd2t LIKE bsid-zbd2t, " Due Date2
zbd3t LIKE bsid-zbd3t, " Due Date3
waers LIKE bsid-waers, " Currency
dmbtr LIKE bsid-dmbtr, " Amount in Local Curr
END OF int_bsid.
Internal Table for Amounts Sum Up Data
DATA: BEGIN OF int_final OCCURS 0,
kunnr LIKE bsid-kunnr, " Customer Number
name1 LIKE kna1-name1, " Customer Name
total1 LIKE bsid-dmbtr, " Amount in Local Curr
total2 LIKE bsid-dmbtr, " Amount in Local Curr
total3 LIKE bsid-dmbtr, " Amount in Local Curr
total4 LIKE bsid-dmbtr, " Amount in Local Curr
total5 LIKE bsid-dmbtr, " Amount in Local Curr
total6 LIKE bsid-dmbtr, " Amount in Local Curr
total LIKE bsid-dmbtr, " Amount in Local Curr
END OF int_final.
D A T A D E C L A R A T I O N S
DATA : v_flag, " Flag
v_gtotal1 LIKE bsid-dmbtr, " Amount Totals
v_gtotal2 LIKE bsid-dmbtr, " Amount Totals
v_gtotal3 LIKE bsid-dmbtr, " Amount Totals
v_gtotal4 LIKE bsid-dmbtr, " Amount Totals
v_gtotal5 LIKE bsid-dmbtr, " Amount Totals
v_gtotal6 LIKE bsid-dmbtr, " Amount Totals
v_gtotal LIKE bsid-dmbtr, " Amount Totals
v_subtotal1 LIKE bsid-dmbtr, " Amount Totals
v_subtotal2 LIKE bsid-dmbtr, " Amount Totals
v_subtotal3 LIKE bsid-dmbtr, " Amount Totals
v_subtotal4 LIKE bsid-dmbtr, " Amount Totals
v_subtotal5 LIKE bsid-dmbtr, " Amount Totals
v_subtotal6 LIKE bsid-dmbtr, " Amount Totals
v_subtotal LIKE bsid-dmbtr, " Amount Totals
v_date LIKE bsid-zfbdt, " Due Date
v_tage1(4), " Age 30 days
v_tage2(4), " Age 60 days
v_tage3(4), " Age 90 days
v_fir(15), " Column Text1
v_sec(15), " Column Text2
v_thir(15), " Column Text3
v_four(17), " Column Text4
v_fidd(4), " Days field1
v_sedd(4), " Days field2
v_thdd(4), " Days field3
v_fodd(4), " Days field4
v_str TYPE SY-LISEL, " String
v_str1(11), " String
v_tage(3), " String
v_date1(10). " Date field
R A N G E D E C L A R A T I O N S
RANGES: r_date1 FOR bsid-zfbdt, " Date Range 1
r_date2 FOR bsid-zfbdt, " Date Range 2
r_date3 FOR bsid-zfbdt, " Date Range 3
r_date4 FOR bsid-zfbdt. " Date Range 4
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_kunnr FOR kna1-kunnr. "Customer account
PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
"Open items at key date
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
SELECTION-SCREEN END OF BLOCK b3.
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_flds.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P O F P A G E
Header
TOP-OF-PAGE.
PERFORM header.
E N D O F P A G E
Footer
END-OF-PAGE.
ULINE.
T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
Top of Page in Secondary List
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header1.
A T L I N E S E L E C T I O N *
AT LINE-SELECTION.
Perform Line Selections
PERFORM line_selection.
E N D O F S E L E C T I O N
END-OF-SELECTION.
List generation
PERFORM basic_list.
*& Form validate_flds
Validation of Selection Screen fields
FORM validate_flds .
Validate Customer Code
CLEAR kna1-kunnr.
SELECT kunnr UP TO 1 ROWS
INTO kna1-kunnr
FROM kna1
WHERE kunnr IN s_kunnr AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Customer Code range'(023).
ENDIF.
Validate Company Code
CLEAR t001-bukrs.
SELECT bukrs UP TO 1 ROWS
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e021. " Invalid Company Code range
ENDIF.
IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 1 greater'(004)
'than Column# 2 or 3 or 4'(005).
ENDIF.
*column 2
IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 2 greater'(006)
'than Column# 3 or 4'(007).
ENDIF.
*column3
IF ( p_tage3 > p_tage4 ).
MESSAGE e999 WITH 'Column 3 greater'(008)
'than Column#4'(009).
ENDIF.
ENDFORM. " validate_flds
*& Form fetch_data
Fetching Data from Database Tables
FORM fetch_data .
Date Range Population
r_date1-sign = 'I'.
r_date1-option = 'BT'.
r_date1-low = p_allgst.
r_date1-high = r_date1-low + p_tage1.
APPEND r_date1.
r_date2-sign = 'I'.
r_date2-option = 'BT'.
r_date2-low = r_date1-high + 1.
r_date2-high = r_date1-low + p_tage2.
APPEND r_date2.
r_date3-sign = 'I'.
r_date3-option = 'BT'.
r_date3-low = r_date2-high + 1.
r_date3-high = r_date1-low + p_tage3.
APPEND r_date3.
r_date4-sign = 'I'.
r_date4-option = 'BT'.
r_date4-low = r_date3-high + 1.
r_date4-high = r_date1-low + p_tage4.
APPEND r_date4.
Select the Customer Open Items data from bsid
SELECT l~kunnr
l1~name1
b~waers
b~dmbtr
b~zfbdt
b~zbd1t
b~zbd2t
b~zbd3t
b~belnr
b~xblnr
b~shkzg
b~blart
INTO CORRESPONDING FIELDS OF TABLE int_bsid
FROM knb1 AS l INNER JOIN kna1 AS l1
ON lkunnr = l1kunnr
INNER JOIN bsid AS b
ON lkunnr = bkunnr AND
lbukrs = bbukrs
WHERE l~kunnr IN s_kunnr AND
l~bukrs = p_bukrs and
b~zfbdt le p_allgst.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'No Data found'(027).
ENDIF.
Removing the date limit to get the due items in the past
DELETE int_bsid WHERE
( blart NE 'RE' AND blart NE 'KR' ) OR
shkzg NE 'H'.
SORT int_bsid BY kunnr.
ENDFORM. " fetch_data
*& Form header
Display the Report Columns
FORM header .
v_tage1 = p_tage1 + 1.
v_tage2 = p_tage2 + 1.
v_tage3 = p_tage3 + 1.
v_fidd = p_tage1.
v_sedd = p_tage2.
v_thdd = p_tage3.
v_fodd = p_tage4.
MOVE v_fodd0(4) TO v_fodd1(3).
v_fodd+0(1) = space.
CONCATENATE '1 to'(010) v_fidd INTO v_fir.
CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Summary of Ageing Analysis for Customer Open Invoices as on'(013)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
FORMAT COLOR 1 INTENSIFIED.
WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
50(101) 'Invoices Due For(In Days)'(014) CENTERED,
151 sy-vline, 168 sy-vline .
WRITE :/1 sy-vline, 2(11) 'Customer#'(015) CENTERED,
13 sy-vline ,14(35) 'Customer Name'(016) CENTERED,
49 sy-vline,
50(101) sy-uline,151 sy-vline,
152(16) 'Total'(017) CENTERED,
168 sy-vline.
WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
50(16) v_fir CENTERED, 66 sy-vline,
67(16) v_sec CENTERED, 83 sy-vline,
84(16) v_thir CENTERED, 100 sy-vline,
101(16) v_four CENTERED, 117 sy-vline,
118(16) v_str1 centered, 134 sy-vline,
135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
168 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
ENDFORM. " header
*& Form basic_list
Display the Basic List
FORM basic_list .
NEW-PAGE LINE-SIZE 168.
LOOP AT int_bsid.
CLEAR v_date.
IF int_bsid-zbd3t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd3t.
ELSE.
IF int_bsid-zbd2t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd2t.
ELSE.
v_date = int_bsid-zfbdt + int_bsid-zbd1t.
ENDIF.
ENDIF.
IF int_bsid-zbd1t = ' '.
v_date = int_bsid-zfbdt.
ENDIF.
IF v_date IN r_date1.
int_final-total1 = int_final-total1 + int_bsid-dmbtr.
ELSEIF v_date IN r_date2.
int_final-total2 = int_final-total2 + int_bsid-dmbtr.
ELSEIF v_date IN r_date3.
int_final-total3 = int_final-total3 + int_bsid-dmbtr.
ELSEIF v_date IN r_date4.
int_final-total4 = int_final-total4 + int_bsid-dmbtr.
ELSEif v_date > r_date4-high.
int_final-total5 = int_final-total5 + int_bsid-dmbtr.
ELSEif v_date < p_allgst.
int_final-total6 = int_final-total6 + int_bsid-dmbtr.
ENDIF.
AT END OF kunnr.
v_flag = 1.
ENDAT.
IF v_flag = 1.
int_final-kunnr = int_bsid-kunnr.
int_final-name1 = int_bsid-name1.
int_final-total = int_final-total1 + int_final-total2 +
int_final-total3 + int_final-total4 + int_final-total5 +
int_final-total6.
APPEND int_final.
v_gtotal1 = v_gtotal1 + int_final-total1.
v_gtotal2 = v_gtotal2 + int_final-total2.
v_gtotal3 = v_gtotal3 + int_final-total3.
v_gtotal4 = v_gtotal4 + int_final-total4.
v_gtotal5 = v_gtotal5 + int_final-total5.
v_gtotal6 = v_gtotal6 + int_final-total6.
v_gtotal = v_gtotal + int_final-total.
WRITE: /1 sy-vline,
2 int_final-kunnr COLOR 4 INTENSIFIED ON,
13 sy-vline,
14 int_final-name1 COLOR 4 INTENSIFIED ON,
49 sy-vline.
DATA : v_rem.
v_rem = sy-tabix MOD 2.
IF v_rem NE 0.
FORMAT COLOR 2 INTENSIFIED.
WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsid-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsid-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsid-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsid-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsid-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsid-waers,
168 sy-vline.
ELSE.
WRITE : 50 int_final-total1 CURRENCY int_bsid-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsid-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsid-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsid-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsid-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsid-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsid-waers,
168 sy-vline.
ENDIF.
FORMAT COLOR OFF.
HIDE int_final.
CLEAR int_final.
v_flag = 0.
ENDIF.
AT LAST.
WRITE : /1(168) sy-uline.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
49 sy-vline, 50 v_gtotal1 CURRENCY int_bsid-waers,
66 sy-vline, 67 v_gtotal2 CURRENCY int_bsid-waers,
83 sy-vline, 84 v_gtotal3 CURRENCY int_bsid-waers,
100 sy-vline,101 v_gtotal4 CURRENCY int_bsid-waers,
117 sy-vline,118 v_gtotal5 CURRENCY int_bsid-waers,
134 sy-vline,135 v_gtotal6 CURRENCY int_bsid-waers,
151 sy-vline,152 v_gtotal CURRENCY int_bsid-waers,
168 sy-vline.
HIDE : v_gtotal1,
v_gtotal2,
v_gtotal3,
v_gtotal4,
v_gtotal5,
v_gtotal6,
v_gtotal.
ENDAT.
FORMAT COLOR OFF.
ENDLOOP.
WRITE : /1(168) sy-uline.
ENDFORM. " basic_list
*& Form line_selection
When double clicked on the line display the seconday list
FORM line_selection .
NEW-PAGE LINE-SIZE 206.
Sy-lsind = 1.
DATA : v_rem,v_cnt LIKE sy-tabix.
v_cnt = 0.
SORT int_bsid BY belnr zfbdt.
LOOP AT int_bsid WHERE kunnr EQ int_final-kunnr.
v_rem = v_cnt MOD 2.
CLEAR v_date.
IF int_bsid-zbd3t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd3t.
ELSE.
IF int_bsid-zbd2t <> ' '.
v_date = int_bsid-zfbdt + int_bsid-zbd2t.
ELSE.
v_date = int_bsid-zfbdt + int_bsid-zbd1t.
ENDIF.
ENDIF.
IF int_bsid-zbd1t = ' '.
v_date = int_bsid-zfbdt.
ENDIF.
IF v_rem NE 0.
format color 2 intensified.
WRITE :/1 sy-vline, 2 int_bsid-belnr,
12 sy-vline,13 int_bsid-kunnr,
23 sy-vline,24 int_bsid-name1,
59 sy-vline,60 int_bsid-xblnr,
76 sy-vline,77 int_bsid-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline, 189 sy-vline,
190 int_bsid-dmbtr CURRENCY int_bsid-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
ENDIF.
format color off.
ELSE.
WRITE :/1 sy-vline, 2 int_bsid-belnr,
12 sy-vline,13 int_bsid-kunnr,
23 sy-vline,24 int_bsid-name1,
59 sy-vline,60 int_bsid-xblnr,
76 sy-vline,77 int_bsid-zfbdt,
87 sy-vline.
WRITE : 104 sy-vline,121 sy-vline,
138 sy-vline,155 sy-vline,
172 sy-vline,189 sy-vline,
190 int_bsid-dmbtr CURRENCY int_bsid-waers,
206 sy-vline.
IF v_date IN r_date1.
v_subtotal1 = v_subtotal1 + int_bsid-dmbtr.
WRITE : 88 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date2.
v_subtotal2 = v_subtotal2 + int_bsid-dmbtr.
WRITE : 105 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date3.
v_subtotal3 = v_subtotal3 + int_bsid-dmbtr.
WRITE : 122 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEIF v_date IN r_date4.
v_subtotal4 = v_subtotal4 + int_bsid-dmbtr.
WRITE : 139 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date > r_date4-high.
v_subtotal5 = v_subtotal5 + int_bsid-dmbtr.
WRITE : 156 int_bsid-dmbtr CURRENCY int_bsid-waers.
ELSEif v_date < p_allgst.
v_subtotal6 = v_subtotal6 + int_bsid-dmbtr.
WRITE : 173 int_bsid-dmbtr CURRENCY int_bsid-waers.
ENDIF.
ENDIF.
FORMAT COLOR OFF.
v_cnt = v_cnt + 1.
ENDLOOP.
WRITE : /1(206) sy-uline.
v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
+ v_subtotal4 + v_subtotal5 + v_subtotal6.
FORMAT COLOR 3 INTENSIFIED.
WRITE : /1 sy-vline,
2(85) 'Total'(017) CENTERED CURRENCY int_bsid-waers ,
87 sy-vline,
88 v_subtotal1 CURRENCY int_bsid-waers,
104 sy-vline,
105 v_subtotal2 CURRENCY int_bsid-waers,
121 sy-vline,
122 v_subtotal3 CURRENCY int_bsid-waers,
138 sy-vline,
139 v_subtotal4 CURRENCY int_bsid-waers,
155 sy-vline,
156 v_subtotal5 CURRENCY int_bsid-waers,
172 sy-vline,
173 v_subtotal6 CURRENCY int_bsid-waers,
189 sy-vline,
190 v_subtotal CURRENCY int_bsid-waers,
206 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(206) sy-uline.
CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
ENDFORM. " line_selection
*& Form header1
Secondary List Header
FORM header1 .
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Details of Ageing Analysis for Customer Open Invoices as on'(024)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR 1 intensified.
WRITE :/1(206) sy-uline.
WRITE :/1 sy-vline,12 sy-vline ,
23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
88(101) 'Invoices Due For(In Days)'(014) CENTERED,
189 sy-vline,206 sy-vline.
WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
12 sy-vline, 13(10) 'Customer#'(015) CENTERED,
23 sy-vline, 24(35) 'Customer Name'(016) CENTERED,
59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
87 sy-vline, 88(101) sy-uline,
189 sy-vline,190(16) 'Total'(017) CENTERED,
206 sy-vline.
WRITE : /1 sy-vline, 12 sy-vline,
23 sy-vline,59 sy-vline,
76 sy-vline,87 sy-vline,
88(16) v_fir CENTERED, 104 sy-vline,
105(16) v_sec CENTERED, 121 sy-vline,
122(16) v_thir CENTERED, 138 sy-vline,
139(16) v_four CENTERED, 155 sy-vline,
156(16) v_str1 CENTERED,
172 sy-vline,
173(16) 'Already Overdue'(018) CENTERED,
189 sy-vline,
206 sy-vline.
format color off.
WRITE : /1(206) sy-uline.
ENDFORM. " header1
REPORT zfi_vendor_ageing
NO STANDARD PAGE HEADING
LINE-COUNT 58
line-size 168
MESSAGE-ID zh_msg.
Report Name : Vendor Open Items Ageing Report
Purpose : This report displays the Vendor Open Items based on
different Ageing days (Calculated by taking the Base
Line date and the days mentioned in Payment Terms)
M O D I F I C A T I O N L O G
Date | Change Number | Initials | Description
30-Aug-2004 | DTSK900**** | Anji Reddy | Initial
D A T A B A S E T A B L E S D E C L A R A T I O N
TABLES: lfa1, " Vendor Master (General)
t001, " Company Codes
rfpdo.
I N T E R N A L T A B L E S D E C L A R A T I O N S *
Internal Table for Vendor Open Items Data
DATA: BEGIN OF int_bsik OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
belnr LIKE bsik-belnr, " Document Number
xblnr LIKE bsik-xblnr, " Ref Doc No
blart LIKE bsik-blart, " Document Type
zfbdt LIKE bsik-zfbdt, " Base Line Date
zbd1t LIKE bsik-zbd1t, " Due date1
zbd2t LIKE bsik-zbd2t, " Due Date2
zbd3t LIKE bsik-zbd3t, " Due Date3
waers LIKE bsik-waers, " Currency
dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_bsik.
Internal Table for Amounts Sum Up Data
DATA: BEGIN OF int_final OCCURS 0,
lifnr LIKE bsik-lifnr, " Vendor Number
name1 LIKE lfa1-name1, " Vendor Name
total1 LIKE bsik-dmbtr, " Amount in Local Curr
total2 LIKE bsik-dmbtr, " Amount in Local Curr
total3 LIKE bsik-dmbtr, " Amount in Local Curr
total4 LIKE bsik-dmbtr, " Amount in Local Curr
total5 LIKE bsik-dmbtr, " Amount in Local Curr
total6 LIKE bsik-dmbtr, " Amount in Local Curr
total LIKE bsik-dmbtr, " Amount in Local Curr
END OF int_final.
D A T A D E C L A R A T I O N S
DATA : v_flag, " Flag
v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
v_gtotal LIKE bsik-dmbtr, " Amount Totals
v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
v_subtotal LIKE bsik-dmbtr, " Amount Totals
v_date LIKE bsik-zfbdt, " Due Date
v_tage1(4), " Age 30 days
v_tage2(4), " Age 60 days
v_tage3(4), " Age 90 days
v_fir(15), " Column Text1
v_sec(15), " Column Text2
v_thir(15), " Column Text3
v_four(17), " Column Text4
v_fidd(4), " Days field1
v_sedd(4), " Days field2
v_thdd(4), " Days field3
v_fodd(4), " Days field4
v_str TYPE SY-LISEL, " String
v_str1(11), " String
v_tage(3), " String
v_date1(10). " Date field
R A N G E D E C L A R A T I O N S
RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
r_date2 FOR bsik-zfbdt, " Date Range 2
r_date3 FOR bsik-zfbdt, " Date Range 3
r_date4 FOR bsik-zfbdt. " Date Range 4
S E L E C T I O N S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
"Open items at key date
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
SELECTION-SCREEN END OF BLOCK b3.
A T S E L E C T I O N S C R E E N *
AT SELECTION-SCREEN.
Validate the screen fields
PERFORM validate_flds.
S T A R T O F S E L E C T I O N *
START-OF-SELECTION.
Fetch main data
PERFORM fetch_data.
T O P O F P A G E
Header
TOP-OF-PAGE.
PERFORM header.
E N D O F P A G E
Footer
END-OF-PAGE.
ULINE.
T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
Top of Page in Secondary List
TOP-OF-PAGE DURING LINE-SELECTION.
PERFORM header1.
A T L I N E S E L E C T I O N *
AT LINE-SELECTION.
Perform Line Selections
PERFORM line_selection.
E N D O F S E L E C T I O N
END-OF-SELECTION.
List generation
PERFORM basic_list.
*& Form validate_flds
Validation of Selection Screen fields
FORM validate_flds .
Validate Vendor Code
CLEAR lfa1-lifnr.
SELECT lifnr UP TO 1 ROWS
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
ENDIF.
Validate Company Code
CLEAR t001-bukrs.
SELECT bukrs UP TO 1 ROWS
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs AND
spras = sy-langu.
ENDSELECT.
IF sy-subrc <> 0.
MESSAGE e021. " Invalid Company Code range
ENDIF.
IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 1 greater'(004)
'than Column# 2 or 3 or 4'(005).
ENDIF.
*column 2
IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
MESSAGE e999 WITH 'Column 2 greater'(006)
'than Column# 3 or 4'(007).
ENDIF.
*column3
IF ( p_tage3 > p_tage4 ).
MESSAGE e999 WITH 'Column 3 greater'(008)
'than Column#4'(009).
ENDIF.
ENDFORM. " validate_flds
*& Form fetch_data
Fetching Data from Database Tables
FORM fetch_data .
Date Range Population
r_date1-sign = 'I'.
r_date1-option = 'BT'.
r_date1-low = p_allgst.
r_date1-high = r_date1-low + p_tage1.
APPEND r_date1.
r_date2-sign = 'I'.
r_date2-option = 'BT'.
r_date2-low = r_date1-high + 1.
r_date2-high = r_date1-low + p_tage2.
APPEND r_date2.
r_date3-sign = 'I'.
r_date3-option = 'BT'.
r_date3-low = r_date2-high + 1.
r_date3-high = r_date1-low + p_tage3.
APPEND r_date3.
r_date4-sign = 'I'.
r_date4-option = 'BT'.
r_date4-low = r_date3-high + 1.
r_date4-high = r_date1-low + p_tage4.
APPEND r_date4.
Select the Vendor Open Items data from BSIK
SELECT l~lifnr
l1~name1
b~waers
b~dmbtr
b~zfbdt
b~zbd1t
b~zbd2t
b~zbd3t
b~belnr
b~xblnr
b~shkzg
b~blart
INTO CORRESPONDING FIELDS OF TABLE int_bsik
FROM lfb1 AS l INNER JOIN lfa1 AS l1
ON llifnr = l1lifnr
INNER JOIN bsik AS b
ON llifnr = blifnr AND
lbukrs = bbukrs
WHERE l~lifnr IN s_lifnr AND
l~bukrs = p_bukrs and
b~zfbdt le p_allgst.
IF SY-SUBRC <> 0.
MESSAGE i000 WITH 'No Data found'(027).
ENDIF.
Removing the date limit to get the due items in the past
DELETE int_bsik WHERE
( blart NE 'RE' AND blart NE 'KR' ) OR
shkzg NE 'H'.
SORT int_bsik BY lifnr.
ENDFORM. " fetch_data
*& Form header
Display the Report Columns
FORM header .
v_tage1 = p_tage1 + 1.
v_tage2 = p_tage2 + 1.
v_tage3 = p_tage3 + 1.
v_fidd = p_tage1.
v_sedd = p_tage2.
v_thdd = p_tage3.
v_fodd = p_tage4.
MOVE v_fodd0(4) TO v_fodd1(3).
v_fodd+0(1) = space.
CONCATENATE '1 to'(010) v_fidd INTO v_fir.
CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
Standard header
clear: v_date1, v_str, v_str1, v_tage.
write p_allgst to v_date1.
Move p_tage4 to v_tage.
concatenate '>' v_tage text-025 into v_str1.
concatenate
'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
v_date1 into v_str separated by space.
CALL FUNCTION 'Z_STANDARD_HEADER'
EXPORTING
title1 = 'Saudi International Petrochemical Company'(012)
title2 = v_str.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
FORMAT COLOR 1 INTENSIFIED.
WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
50(101) 'Invoices Due For(In Days)'(014) CENTERED,
151 sy-vline, 168 sy-vline .
WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
49 sy-vline,
50(101) sy-uline,151 sy-vline,
152(16) 'Total'(017) CENTERED,
168 sy-vline.
WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
50(16) v_fir CENTERED, 66 sy-vline,
67(16) v_sec CENTERED, 83 sy-vline,
84(16) v_thir CENTERED, 100 sy-vline,
101(16) v_four CENTERED, 117 sy-vline,
118(16) v_str1 centered, 134 sy-vline,
135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
168 sy-vline.
FORMAT COLOR OFF.
WRITE : /1(168) sy-uline.
ENDFORM. " header
*& Form basic_list
Display the Basic List
FORM basic_list .
NEW-PAGE LINE-SIZE 168.
LOOP AT int_bsik.
CLEAR v_date.
IF int_bsik-zbd3t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd3t.
ELSE.
IF int_bsik-zbd2t <> ' '.
v_date = int_bsik-zfbdt + int_bsik-zbd2t.
ELSE.
v_date = int_bsik-zfbdt + int_bsik-zbd1t.
ENDIF.
ENDIF.
IF int_bsik-zbd1t = ' '.
v_date = int_bsik-zfbdt.
ENDIF.
IF v_date IN r_date1.
int_final-total1 = int_final-total1 + int_bsik-dmbtr.
ELSEIF v_date IN r_date2.
int_final-total2 = int_final-total2 + int_bsik-dmbtr.
ELSEIF v_date IN r_date3.
int_final-total3 = int_final-total3 + int_bsik-dmbtr.
ELSEIF v_date IN r_date4.
int_final-total4 = int_final-total4 + int_bsik-dmbtr.
ELSEif v_date > r_date4-high.
int_final-total5 = int_final-total5 + int_bsik-dmbtr.
ELSEif v_date < p_allgst.
int_final-total6 = int_final-total6 + int_bsik-dmbtr.
ENDIF.
AT END OF lifnr.
v_flag = 1.
ENDAT.
IF v_flag = 1.
int_final-lifnr = int_bsik-lifnr.
int_final-name1 = int_bsik-name1.
int_final-total = int_final-total1 + int_final-total2 +
int_final-total3 + int_final-total4 + int_final-total5 +
int_final-total6.
APPEND int_final.
v_gtotal1 = v_gtotal1 + int_final-total1.
v_gtotal2 = v_gtotal2 + int_final-total2.
v_gtotal3 = v_gtotal3 + int_final-total3.
v_gtotal4 = v_gtotal4 + int_final-total4.
v_gtotal5 = v_gtotal5 + int_final-total5.
v_gtotal6 = v_gtotal6 + int_final-total6.
v_gtotal = v_gtotal + int_final-total.
WRITE: /1 sy-vline,
2 int_final-lifnr COLOR 4 INTENSIFIED ON,
13 sy-vline,
14 int_final-name1 COLOR 4 INTENSIFIED ON,
49 sy-vline.
DATA : v_rem.
v_rem = sy-tabix MOD 2.
IF v_rem NE 0.
FORMAT COLOR 2 INTENSIFIED.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ELSE.
WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
66 sy-vline,
67 int_final-total2 CURRENCY int_bsik-waers,
83 sy-vline,
84 int_final-total3 CURRENCY int_bsik-waers,
100 sy-vline,
101 int_final-total4 CURRENCY int_bsik-waers,
117 sy-vline,
118 int_final-total5 CURRENCY int_bsik-waers,
134 sy-vline,
135 int_final-total6 CURRENCY int_bsik-waers,
151 sy-vline,
152 int_final-total CURRENCY int_bsik-waers,
168 sy-vline.
ENDIF.
FORMAT COLOR OFF.
HIDE int_final.
CLEAR int_final.
v_flag = 0.
ENDIF. -
Urgent: Regarding Stock Ageing report
hi,
i want to have stock ageing report in which i want to have the deatils :-
This is the material which is present in the palnt from dis <b>date</b> and further details of it consumption. plzz tell the <b>tcode</b> for it.
plzz help me out as it is most urgent to me..
regards,
ric.s
Message was edited by:
ric .sHi
The report MC.9 shows Last movement date/Last receipt date / Last issue date.
In period to analyze give appropriate date range
Or
check MSEG & MARD table to get details about material documents with date
Vishal... -
Regarding creation of report categeory
hi friends,
could u help me how to create report categeory of my own .
i mean while using ldb we get the standard selection screen.
instead of that i need just 3 fields in the selection screen of my own.
how can i create that and add it to report category.
explain me briefly asap.
thanks & regards
devender reddy.Dear Devender Reddy,
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/HRREPORTING/HRREPORTING.pdf
http://help.sap.com/saphelp_erp2005vp/helpdata/en/23/7fde36857ccd15e10000009b38f889/frameset.htm
Create Report Categories :
In this step, you define the report categories and determine the layout of the standard selection screen for these report categories. You can create report categories for programs or queries that are based on the PNP or PNPCE logical databases.
The definition of report categories is divided into two sections:
o In the Change Report Category view, you define general attributes such as sort order, input fields for date, and so on.
o In the Change Selection Criteria view, you define which selection fields of the logical database should be avaliable on the selection screen.
Adjusting the Standard Selection Screen:
In this step, you can adapt the standard selection screen for reports which use the logical database PNP or PNPCE to your requirements.
To do this, you assign a program class to the reports whose selection screen you want to change. The program class determines which selection parameters appear and which characteristics these parameters have.
Reports are assigned to report classes in the standard SAP system. By making entries in Customizing, you can override the SAP report classes.
When you call up a report, a check is carried out first to see whether you have assigned a program class to the report. If you have, the selection screen belonging to the report class appears. Otherwise, the selection screen that was assigned to the report class in the standard SAP system, appears.
Regards,
Naveen. -
URGENT: REGARDING PRINTOUT OF REPORT
hi,
i had made report who's width is 310 and i had taken printout but is not displaying all fields when i take printout . can any body tell me d solution of dis problem as i dont wanna reduce d width of it.
CAN ANYBODY TELL ME D FORMAT FOR 310 LINE WIDTH FOR ALL FIELDS TO BE DISPLYED WHEN PRINTOUT IS TAKEN.
plz reply as fast as possible n he or she will be rewardedHi Yaki,
If your printer is not displaying the entire 310 characters, then solution can be to break down your report into 2 line format instead of using 1 line.
Many SAP standard reports come out that way you can check program SDV03V02 its output is in 2 lines.
Or other option can be to download the report in Excel Format using List-Save
and then take a printout of it..
Reward if helpful.
Best Regards,
Imran -
Urgent: regarding sales invoice report
hi,
i am making a report in which i have to dislplay for sales invoice ,d format of dis report is:-
sales order,date,customer,material,invoice no,invioce date,invoice qty,amount.
i wat to know which tables to be used and if possible which fields should be taken,plzz help me out as it s erally urgent to me.
s help will be definately rewarded.Tables to be considered: VBAK, VBAP, VBFA, VBRK, VBRP.
And dont keep the message "help will be definately rewarded " in your threads as we know how good you are at judging the replies and how you do appreciate the replies from your earlier threads.
This might be a bit harsh, but expect tips and advices here rather than the whole solutions to problems in SDN.
Kind Regards
Eswar -
Urgent : Regarding Purchase Requsition Report
Hi,
I am making a report on Purchase Requisition in which i have to display that these are the persons who have released this requisition (i.e. If General Manager has released that should be displayed,if Director had released it should be displayed and if Managing Director had released it should display it and also the dates on which they released..)
In my report i am not allowed to displayed that these are released by MMCONS OR SDCONS BUT it should display General Manager,Director or Managing Director.. at these particular dates...
If anybody help me out in this report he or she will be definately rewarded with points as it is most urgent to me ,,so plz reply as fast as possible.
Regards,
Ric.s
Message was edited by:
ric .sHai ric,
i have done a pr tracking report. it will show the persons name, plant, and department, etc .i have added that program here. if u dnt mine u can take
with regards,
safiq
TYPE-POOLS slis.
TABLES: t024, ekko, lfa1, ekpo, ekkn, cdhdr, cdpos, t16fs,
eban, eket, ekbe, t024d.
DATA: repid LIKE sy-repid.
DATA: releasedat LIKE cdhdr-udate.
CONSTANTS: c_to(4) TYPE c VALUE ' to ',
c_vgabe_1 TYPE c VALUE '1',
c_vgabe_2 TYPE c VALUE '2',
c_object_banf LIKE cdpos-objectclas VALUE 'BANF',
c_fname_frgzu LIKE cdpos-fname VALUE 'FRGZU',
c_tcode like cdhdr-tcode value 'ME54',
c_tcode1 like cdhdr-tcode value 'ME55',
A1=add one more constant and value for ME55.
c_tcode2 like cdhdr-tcode value 'ME28',
CN 2 >> Addition
CN 2 Start
c_tcode3 like cdhdr-tcode value 'ME54N',
c_tcode4 like cdhdr-tcode value 'ME29N',
CN 2 End
c_object_eink LIKE cdpos-objectclas VALUE 'EINKBELEG',
c_fname_frgke LIKE cdpos-fname VALUE 'FRGKE'.
DATA: list_layout TYPE slis_layout_alv, "Layout
ist_fieldcat TYPE STANDARD TABLE OF "Field Catalog
slis_fieldcat_alv,
tmp_fieldcat TYPE slis_fieldcat_alv, "Temp. Field Cat.
gt_xevents TYPE slis_t_event, "Events Table
xs_event TYPE slis_alv_event. "Event Line
RANGES: tcode for cdhdr-tcode.
A1=Add range to store ME54 & ME55
*& To store Summary report information - added 30/5
data: begin of i_summary occurs 100,
PlantName1 LIKE T001W-Name1, "Plant Name
plant1 LIKE ekpo-werks, "Plant
Dept LIKE t024d-dsnam, "MRP Contrl Code
PRafIR type i,
PRbfIR type i,
Grandtotal type i,
PerPRafIR type p decimals 2,
PerPRbfIR type p decimals 2,
end of i_summary.
STRUCTURES
DATA: BEGIN OF t_ekko OCCURS 0.
INCLUDE STRUCTURE ekko.
DATA: END OF t_ekko.
DATA: BEGIN OF st_itab,
pur_grp(22) TYPE c,
vendor_name LIKE lfa1-name1,
po_num LIKE ekko-ebeln,
item_num LIKE ekpo-ebelp,
mat_num LIKE ekpo-matnr,
description LIKE ekpo-txz01,
qty_order LIKE ekpo-menge,
unit_price LIKE ekpo-netpr,
total_price LIKE ekpo-netwr,
plant LIKE ekpo-werks,
cost_center LIKE ekkn-kostl,
internal_order LIKE ekkn-aufnr,
gl_code LIKE ekkn-sakto,
dept LIKE t024d-dsnam,
po_release_dat LIKE cdhdr-udate,
delivery_dat LIKE eket-eindt,
* gr_dat like ekbe-budat, "MICH01- 24/04/03
gr_dat LIKE ekbe-bldat, "MICH01+ 24/04/03
on_time_delivery TYPE c,
gr_qty LIKE ekbe-menge,
gr_doc_num LIKE ekbe-belnr,
ir_posting_date LIKE ekbe-budat, "??? change to budat
ir_doc_num LIKE ekbe-belnr,
END OF st_itab.
DATA: BEGIN OF st_itab1,
aedat LIKE ekko-aedat, "PO creation date
lifnr LIKE ekko-lifnr,
ebeln LIKE ekko-ebeln, "PO number
ekgrp LIKE ekko-ekgrp,
matnr LIKE ekpo-matnr,
banfn LIKE ekpo-banfn, "PR number
werks LIKE ekpo-werks, "PO item number
ebelp LIKE ekpo-ebelp,
bnfpo like eban-bnfpo, "PR item number
txz01 LIKE ekpo-txz01,
menge LIKE ekpo-menge,
netpr LIKE ekpo-netpr,
netwr LIKE ekpo-netwr,
kostl LIKE ekkn-kostl,
aufnr LIKE ekkn-aufnr,
sakto LIKE ekkn-sakto,
prctr LIKE ekkn-prctr,
anln1 LIKE ekkn-anln1,
pstyp LIKE eban-pstyp,
badat LIKE eban-badat,
afnam LIKE eban-afnam,
dispo LIKE eban-dispo,
vgabe LIKE ekbe-vgabe,
belnr LIKE ekbe-belnr,
bldat LIKE ekbe-bldat, "GR Creation date
budat LIKE ekbe-budat, "IR Creation date
gr_qty LIKE ekbe-menge,
eindt LIKE eket-eindt,
udate LIKE cdhdr-udate,
beln1 LIKE ekbe-belnr, "IR Doc. No.
dsnam LIKE t024d-dsnam, "MRP Controller Desc
pur_grp LIKE t024-eknam, "Desc. of Purchasing Gp
name1 LIKE lfa1-name1, "Vendor Code
on_time_delivery TYPE c, "On-time-delivery
flag type c, "Flag
Added by @, 21.05.2007 >>
PRAFIR TYPE i,
PRBFIR TYPE i,
TOTPR TYPE i,
Added by @, 21.05.2007 <<
END OF st_itab1.
GR History Movements
DATA: BEGIN OF st_history,
bldat LIKE ekbe-bldat,
menge LIKE ekbe-menge,
belnr LIKE ekbe-belnr,
END OF st_history.
PO Release Data
DATA: BEGIN OF st_change,
changenr LIKE cdpos-changenr,
value_new LIKE cdpos-value_new,
END OF st_change.
data: begin of st_change1,
udate like cdhdr-udate,
end of st_change1.
INTERNAL TABLES
DATA: itab LIKE TABLE OF st_itab,
ist_history LIKE TABLE OF st_history,
wa_history LIKE st_history,
ist_change LIKE TABLE OF st_change,
wa_change LIKE st_change,
ist_change1 like table of st_change1,
wa_change1 like st_change1.
data: begin of ist_itab occurs 0.
include structure st_itab1.
DATA : vgabe LIKE ekbe-vgabe,
belnr LIKE ekbe-belnr,
bldat LIKE ekbe-bldat, "GR Creation date
budat LIKE ekbe-budat, "IR Creation date
beln1 LIKE ekbe-belnr, "IR Doc. No.
gr_qty like ekbe-menge, "GR Qty
gr_unres LIKE ekbe-menge, "GR to unrestricted
gr_inspec_stk like ekbe-menge, "GR to inspection stock
gr_blk_stk like ekbe-menge, "GR to blocked stock
gr_rejected_stk like ekbe-menge, "GR to rejected stock
relcode1 like t16fs-FRGC1, "Release code 1
reldate1 like cdhdr-udate, "Release date 1
relcode2 like t16fs-FRGC1, "Release code 2
reldate2 like cdhdr-udate, "Release date 2
relcode3 like t16fs-FRGC1, "Release code 3
reldate3 like cdhdr-udate, "Release date 3
relcode4 like t16fs-FRGC1, "Release code 4
reldate4 like cdhdr-udate, "Release date 4
relcode5 like t16fs-FRGC1, "Release code 5
reldate5 like cdhdr-udate, "Release date 5
po_rel_date like cdhdr-udate. "PO release date
data: end of ist_itab.
data: wa_itab LIKE ist_itab.
Added on 21.05.2007 >>
data: s_po Type C.
data: s_pr Type C.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK screen1 WITH FRAME TITLE text-001.
SELECT-OPTIONS:
so_aedat FOR ekko-aedat no-display, "Purchase Order Creation Date
so_udate FOR cdhdr-udate no-display, "PO Release Date
so_eindt FOR eket-eindt no-display, "Delivery Date
so_ekgrp FOR t024-ekgrp no-display, "Purchasing Group
so_lifnr FOR ekko-lifnr no-display, "Vendor Code
so_ebeln FOR ekko-ebeln no-display, "PO Number
so_matnr FOR ekpo-matnr no-display, "Material No.
so_banfn FOR ekpo-banfn no-display, "PR No.
so_dispo for eban-dispo no-display, "MRP controller
so_pstyp FOR ekpo-pstyp no-display, "Item Category
so_badat FOR eban-badat OBLIGATORY, "PR Creation Date
so_afnam FOR eban-afnam no-display, "PR Requester Name
so_werks FOR ekpo-werks OBLIGATORY, "Plant
so_kostl FOR ekkn-kostl no-display, "Cost Center
so_aufnr FOR ekkn-aufnr no-display, "Internal Order
so_sakto FOR ekkn-sakto no-display, "G/L Account
so_prctr FOR ekkn-prctr no-display, "Profit Center
so_anln1 FOR ekkn-anln1 no-display, "Asset Number
so_belnr FOR ekbe-belnr no-display, "GR Doc. No.
so_bldat FOR ekbe-bldat no-display, "GR Creation Date
so_budat FOR ekbe-budat no-display, "IR Posting Date
so_beln1 FOR ekbe-belnr no-display, "IR Doc. No
so_frgkz for eban-frgkz no-display. "Release status of PR
SELECTION-SCREEN SKIP 1.
PARAMETERS:
p_pr_rel(1) TYPE C no-display, "PR Release Indicator
p_on_del(1) TYPE C no-display. "On-time-delivery
SELECTION-SCREEN END OF BLOCK screen1.
Selection Screen - add 30/5
selection-screen begin of block screen2 with frame title text-002.
selection-screen begin of line.
parameters: r_sum radiobutton group grp1.
selection-screen comment 2(20) text-003 for field r_sum.
selection-screen end of line.
selection-screen begin of line.
parameters: r_det radiobutton group grp1 default 'X'.
selection-screen comment 2(20) text-004 for field r_det.
selection-screen end of line.
selection-screen end of block screen2.
MAIN *
*s_pr = 'X'.
Added on 21.05.2007 <<
*repid = sy-repid.
Assign release indicator
*if p_pr_rel = 'Y'.
so_frgkz-low = '2'.
so_frgkz-option = 'EQ'.
so_frgkz-sign = 'I'.
append so_frgkz.
clear so_frgkz.
*elseif p_pr_rel = 'N'.
so_frgkz-low = 'X'.
so_frgkz-option = 'EQ'.
so_frgkz-sign = 'I'.
append so_frgkz.
clear so_frgkz.
*endif.
*tcode-low = 'ME54'.
*tcode-option = 'EQ'.
*tcode-sign = 'I'.
*append tcode.
CN 2 >> Addition
CN 2 Start
*tcode-low = 'ME54N'.
*tcode-option = 'EQ'.
*tcode-sign = 'I'.
*append tcode.
CN 2 End
*tcode-low = 'ME55'.
*tcode-option = 'EQ'.
*tcode-sign = 'I'.
*append tcode.
*PERFORM:
get_details,
get_data,
get_gr_ir_data,
get_other_data,
Setup events --> Top-of-page
setup_events,
Build up ALV field catalogue
setfieldcat,
Output the data
output_alv_report TABLES ist_fieldcat.
Perform print_data.
top-of-page.
perform print_heading.
END-OF-PAGE.
WRITE :/ SY-ULINE(126).
FORM Assign_Values *
FORM assign_values.
ENDFORM.
FORM setFieldCat *
FORM setfieldcat.
PERFORM:
add_field_to_fieldcat TABLES ist_fieldcat
USING 'T024D'
'DSNAM'
'IST_ITAB'
'DSNAM'
'Dept'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKPO'
'WERKS'
'IST_ITAB'
'WERKS'
'Plant'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EBAN'
'AFNAM'
'IST_ITAB'
'AFNAM'
'PR Requestor Name'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING ''
'IST_ITAB'
'PRBFIR'
'PRbfIR'
'6'
add_field_to_fieldcat TABLES ist_fieldcat
USING ''
'IST_ITAB'
'PRAFIR'
'PRafIR'
'6'
add_field_to_fieldcat TABLES ist_fieldcat
USING ''
'IST_ITAB'
'TOTPR'
'TotalPR'
'7'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EBAN'
'BADAT'
'IST_ITAB'
'BADAT'
'PR Creation Date'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EBAN'
'BANFN'
'IST_ITAB'
'BANFN'
'PR No'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKO'
'EBELN'
'IST_ITAB'
'EBELN'
'PO Number'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKO'
'EBELP'
'IST_ITAB'
'EBELP'
'PO Item'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKO'
'AEDAT'
'IST_ITAB'
'AEDAT'
'PO Creation Date'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'BLDAT'
'IST_ITAB'
'BLDAT'
'GR Date'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'BUDAT'
'IST_ITAB'
'BUDAT'
'IR Document Date'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKPO'
'TXZ01'
'IST_ITAB'
'TXZ01'
'Description'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKPO'
'MENGE'
'IST_ITAB'
'MENGE'
'Qty Ordered'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKPO'
'NETPR'
'IST_ITAB'
'NETPR'
'Unit Price'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKPO'
'NETWR'
'IST_ITAB'
'NETWR'
'Total Price'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'T024'
'EKNAM'
'IST_ITAB'
'PUR_GRP'
'PO PurGrp'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'LFA1'
'NAME1'
'IST_ITAB'
'NAME1'
'Vendor Name'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKPO'
'MATNR'
'IST_ITAB'
'MATNR'
'Material Number'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKN'
'KOSTL'
'IST_ITAB'
'KOSTL'
'Cost Center'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKN'
'AUFNR'
'IST_ITAB'
'AUFNR'
'Internal Order'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKN'
'SAKTO'
'IST_ITAB'
'SAKTO'
'GL Code'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKN'
'ANLN1'
'IST_ITAB'
'ANLN1'
'Asset'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKKN'
'PRCTR'
'IST_ITAB'
'PRCTR'
'Profit Centre'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'T16FS'
'FRGC1'
'IST_ITAB'
'RELCODE1'
'PR RelCode1'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'CDHDR'
'UDATE'
'IST_ITAB'
'RELDATE1'
'PR RelDate1'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'T16FS'
'FRGC2'
'IST_ITAB'
'RELCODE2'
'PR RelCode2'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'CDHDR'
'UDATE'
'IST_ITAB'
'RELDATE2'
'PR RelDate2'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'T16FS'
'FRGC3'
'IST_ITAB'
'RELCODE3'
'PR RelCode3'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'CDHDR'
'UDATE'
'IST_ITAB'
'RELDATE3'
'PR RelDate3'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'T16FS'
'FRGC4'
'IST_ITAB'
'RELCODE4'
'PR RelCode4'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'CDHDR'
'UDATE'
'IST_ITAB'
'RELDATE4'
'PR RelDate4'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'T16FS'
'FRGC5'
'IST_ITAB'
'RELCODE5'
'PR RelCode5'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'CDHDR'
'UDATE'
'IST_ITAB'
'RELDATE5'
'PR RelDate5'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'CDHDR'
'UDATE'
'IST_ITAB'
'PO_REL_DATE'
'PO Release Date'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKET'
'EINDT'
'IST_ITAB'
'EINDT'
'PO Dlv Date'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING ''
'IST_ITAB'
'ON_TIME_DELIVERY'
'On Time Delivery'
'16'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'MENGE'
'IST_ITAB'
'GR_QTY'
'GR Qty'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'BELNR'
'IST_ITAB'
'BELNR'
'GR Doc Num'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'MENGE'
'IST_ITAB'
'GR_UNRES'
'GR to Unrestricted'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'MENGE'
'IST_ITAB'
'GR_INSPEC_STK'
'GR to Inspection Stock'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'MENGE'
'IST_ITAB'
'GR_BLK_STK'
'GR to Blocked Stock'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'MENGE'
'IST_ITAB'
'GR_REJECTED_STK'
'GR to Rejected Stock'
'X'
Added by @, 21.05.2007 >>
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'BELNR'
'IST_ITAB'
'BELN1'
'IR Doc Num'
'X'
add_field_to_fieldcat TABLES ist_fieldcat
USING 'EKBE'
'BELNR'
'IST_ITAB'
'BELN1'
'IR Doc Num'
'X'
Added by @, 21.05.2007 <<
ENDFORM.
FORM XEVENTS *
FORM setup_events.
CLEAR xs_event.
xs_event-name = slis_ev_end_of_page.
xs_event-form = 'XEND_OF_PAGE'.
APPEND xs_event TO gt_xevents.
CLEAR xs_event.
xs_event-name = slis_ev_top_of_page.
xs_event-form = 'XTOP_OF_PAGE'.
APPEND xs_event TO gt_xevents.
CLEAR xs_event.
xs_event-name = slis_ev_top_of_list.
xs_event-form = 'XTOP_OF_LIST'.
APPEND xs_event TO gt_xevents.
CLEAR xs_event.
xs_event-name = slis_ev_end_of_list.
xs_event-form = 'XEND_OF_LIST'.
APPEND xs_event TO gt_xevents.
ENDFORM.
FORM XTOP_OF_PAGE *
FORM xtop_of_page.
Write at 117 sy-pagno right-justified.
WRITE: / 'PR Tracking Report (against Invoice Date)'.
WRITE:/(42) sy-uline.
PO Creation Date
IF NOT so_aedat-low IS INITIAL AND
so_aedat-high IS INITIAL.
WRITE:/ 'PO Creation Date:', so_aedat-low.
ELSEIF NOT so_aedat-low IS INITIAL AND
NOT so_aedat-high IS INITIAL.
WRITE:/ 'PO Creation Date:', so_aedat-low, c_to, so_aedat-high.
ENDIF.
PR Creation Date
IF NOT so_badat-low IS INITIAL AND
so_badat-high IS INITIAL.
WRITE:/ 'PR Creation Date: ', so_badat-low.
ELSEIF NOT so_badat-low IS INITIAL AND
NOT so_badat-high IS INITIAL.
WRITE:/ 'PR Creation Date: ', so_badat-low , c_to, so_badat-high.
ENDIF.
Plant
IF NOT so_werks-low IS INITIAL AND
so_werks-high IS INITIAL.
WRITE:/ 'Plant: ', so_werks-low.
ELSEIF NOT so_werks-low IS INITIAL AND
NOT so_werks-high IS INITIAL.
WRITE:/ 'Plant: ', so_werks-low , c_to, so_werks-high.
ENDIF.
Delivery Date
IF NOT so_eindt-low IS INITIAL AND
so_eindt-high IS INITIAL.
WRITE:/ 'Delivery Date: ', so_eindt-low.
ELSEIF NOT so_eindt-low IS INITIAL AND
NOT so_eindt-high IS INITIAL.
WRITE:/ 'Delivery Date: ', so_eindt-low , c_to, so_eindt-high.
ENDIF.
Purchasing Group
IF NOT so_ekgrp-low IS INITIAL AND
so_ekgrp-high IS INITIAL.
WRITE:/ 'Purchasing Group: ', so_ekgrp-low.
ELSEIF NOT so_ekgrp-low IS INITIAL AND
NOT so_ekgrp-high IS INITIAL.
WRITE:/ 'Purchasing Group: ', so_ekgrp-low , c_to, so_ekgrp-high.
ENDIF.
Vendor Code
IF NOT so_lifnr-low IS INITIAL AND
so_lifnr-high IS INITIAL.
WRITE:/ 'Vendor Code: ', so_lifnr-low.
ELSEIF NOT so_lifnr-low IS INITIAL AND
NOT so_lifnr-high IS INITIAL.
WRITE:/ 'Vendor Code: ', so_lifnr-low , c_to, so_lifnr-high.
ENDIF.
PO Number
IF NOT so_ebeln-low IS INITIAL AND
so_ebeln-high IS INITIAL.
WRITE:/ 'PO Number: ', so_ebeln-low.
ELSEIF NOT so_ebeln-low IS INITIAL AND
NOT so_ebeln-high IS INITIAL.
WRITE:/ 'PO Number: ', so_ebeln-low , c_to, so_ebeln-high.
ENDIF.
Material No
IF NOT so_matnr-low IS INITIAL AND
so_matnr-high IS INITIAL.
WRITE:/ 'PO Number: ', so_matnr-low.
ELSEIF NOT so_matnr-low IS INITIAL AND
NOT so_matnr-high IS INI -
Regarding Downloading of Report[List] output into Excel Sheet
Hi All,
Hi i have written one Classical report. I got the output Correctly.
Now i want to download that data into Excel Sheet in excatly the way it displayed in List[Report] output.
I had followed the path <b>System->List->Save->LocalFile->Spread Sheet</b> and tried to download the same.
Though it is downloaded it has not come in exact format.
Now what i want is to add a button above that report & write a program in that to download that data into Excel Sheet.
Can anybody tell me how can solve this issue. If i follow above procedure will the data[List Output] be downloaded into exact format into excel.
If anybody knows other way please sujjest.
Thanks in advance.
Thanks & Regards,
Prasad.Hi Prasad,
I have done a program which downloads the output in the excel sheet in the correct format.
Just check the program. The code given in bold is what you have to use.
REPORT zexp MESSAGE-ID f4 LINE-SIZE 195.
Tables Used ***********************************
TABLES : bseg, bkpf, bsak, lfa1, payr .
Declaring Internal Tables **************************
DATA :
Internal table to hold header data *************
BEGIN OF header OCCURS 0,
ext_date(10) TYPE c,
delimit(1) TYPE c,
ext_time(8) TYPE c,
END OF header,
Internal table to hold detail info **************
BEGIN OF i_data OCCURS 0,
belnr LIKE bsak-belnr,
gjahr LIKE bsak-gjahr,
bukrs LIKE bsak-bukrs,
bldat LIKE bsak-bldat,
xblnr LIKE bsak-xblnr,
blart LIKE bsak-blart,
augdt LIKE bsak-augdt,
augbl LIKE bsak-augbl,
wrbtr LIKE bsak-wrbtr,
shkzg LIKE bsak-shkzg,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
chect LIKE payr-chect,
status(1) TYPE c,
END OF i_data,
Internal table to to collect *****************
BEGIN OF i_data1 OCCURS 0,
belnr LIKE bsak-belnr,
gjahr LIKE bsak-gjahr,
bukrs LIKE bsak-bukrs,
bldat LIKE bsak-bldat,
xblnr LIKE bsak-xblnr,
blart LIKE bsak-blart,
augdt LIKE bsak-augdt,
augbl LIKE bsak-augbl,
wrbtr LIKE bsak-wrbtr,
shkzg LIKE bsak-shkzg,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
chect LIKE payr-chect,
status(1) TYPE c,
END OF i_data1,
String variables for formatting file data *************
fidoc_year TYPE string,
comp_code TYPE string,
check_numbr TYPE string,
vendor TYPE string,
inv_date TYPE string,
inv_nbr TYPE string,
paid_dat TYPE string,
inv_amt TYPE string,
status TYPE string,
ref_doc TYPE string,
************Internal table to store the file contents **************
BEGIN OF i_final_file OCCURS 0,
record(300) TYPE c,
END OF i_final_file,
Internal table to store the list of allowed document types ****
BEGIN OF i_doctype OCCURS 0,
blart LIKE bsak-blart,
END OF i_doctype,
Internal table to hold vendor information ************
BEGIN OF i_lfa1 OCCURS 0,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
END OF i_lfa1,
Internal table to hold check information *************
BEGIN OF i_payr OCCURS 0,
chect LIKE payr-chect,
vblnr LIKE payr-vblnr,
gjahr LIKE payr-gjahr,
zbukr LIKE payr-zbukr,
END OF i_payr.
Data declarations **************************
DATA : ws_stblg TYPE bkpf-stblg,
todate TYPE bsak-augdt,
fromdate TYPE bsak-augdt,
w_day LIKE dtresr-weekday,
day LIKE scal-indicator,
d TYPE n,
e_date LIKE sy-datum,
e_time LIKE sy-uzeit,
dd(2) TYPE c,
mm(2) TYPE c,
yy(4) TYPE c,
hh(2) TYPE c,
min(2) TYPE c,
sec(2) TYPE c.
DATA : wa_filepath(50) TYPE c,
wa_filename(50) TYPE c,
wa_c_filename(100) TYPE c,
arch_path(50) TYPE c.
<b>* Data for downloading to list
DATA : list LIKE TABLE OF abaplist WITH HEADER LINE.
DATA : BEGIN OF list_asc OCCURS 0,
msg(300) TYPE c,
END OF list_asc.
DATA: BEGIN OF i_invoiceheader OCCURS 0,
name(30) TYPE c,
END OF i_invoiceheader.
RANGES dates FOR bkpf-budat.</b>
Selection Screen ************************
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS:
s_bukrs FOR bkpf-bukrs ,
s_blart FOR bkpf-blart ,
s_augdt FOR bsak-augdt. " memory id todat TO fromdat.
PARAMETERS :submit AS CHECKBOX DEFAULT ' ' .
<b>* Download list to file.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'LIST'.
PERFORM download.
WHEN 'BACK'.
EXIT.
ENDCASE.</b>
<b>----
FORM download *
FORM download.
if s_augdt is initial.
dates-sign = 'I'.
dates-option = 'BT'.
dates-low = '20050901'.
dates-high = '20050920'.
APPEND dates.
else.
dates = s_augdt.
append dates.
endif.
/* Submit the same program .
SUBMIT zexp WITH s_augdt IN dates
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list
EXCEPTIONS
not_found = 1.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1 "LIST_INDEX SY-LSIND.
TABLES
listasci = list_asc
listobject = list.
PERFORM download_file.
ENDFORM.
FORM download_file *
FORM download_file.
DATA fname TYPE rlgrap-filename VALUE 'c:\audit_report.xls'.
DATA ftype TYPE rlgrap-filetype VALUE 'DAT'.
DATA numeric_data(10) TYPE c VALUE '0123456789'.
*Table structure should match with list output.
DATA : BEGIN OF i_data1 OCCURS 0,
belnr(12) TYPE c,
gjahr(6) TYPE c,
bukrs(8) TYPE c,
chect(13) TYPE c,
lifnr(12) TYPE c,
name1(37) TYPE c,
bldat(14) TYPE c,
xblnr(18) TYPE c,
augdt(14) TYPE c,
wrbtr(17) TYPE c,
status(4) TYPE c,
augbl(18) TYPE c,
sortl(17) TYPE c,
END OF i_data1.
Header record of the excel sheet.
PERFORM fill_header.
LOOP AT list_asc.
Reads lines starting from the first record in the report. All informatory statements in the report are not read.
IF list_asc+1(10) CO numeric_data.
i_data1 = list_asc .
APPEND i_data1.
ENDIF.
ENDLOOP.
Call the download function.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = fname
filetype = ftype
TABLES
data_tab = i_data1
FIELDNAMES = i_invoiceheader.
ENDFORM.
FORM fill_header *
FORM fill_header.
i_invoiceheader-name = 'Doc Number'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Fsc Year'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Cmp Code'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Check No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Vendor No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Entered by'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Doc Date'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Ref Doc No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Clearing Date'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Amount'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Status'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Clearing Doc No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Sort field'.
APPEND i_invoiceheader.
ENDFORM. " fill_header</b>
Initialization *************************
INITIALIZATION.
To initialize the date parameter on the selection screen.
The date by default ranges from previous Monday to Sunday.
todate = sy-datum.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = todate
IMPORTING
day = day.
d = day.
if d < 4.
todate = sy-datum - d - 4 .
else.
todate = sy-datum - d + 3 .
endif.
fromdate = todate - 6.
MOVE: 'BT' TO s_augdt-option,
fromdate TO s_augdt-low,
todate TO s_augdt-high.
APPEND s_augdt.
Start of Selection **************************
START-OF-SELECTION.
Checking the validity of the inputted dates ****************
IF s_augdt-low > sy-datum OR s_augdt-high > sy-datum.
MESSAGE i999 WITH 'You cannot input future date'.
EXIT.
ENDIF.
IF NOT s_bukrs IS INITIAL.
MESSAGE i999 WITH 'Program will run with input parameters in screen!!'.
ENDIF.
Initialize the header data ***********************
e_time = sy-uzeit.
MOVE e_time+0(2) TO hh.
MOVE e_time+2(2) TO min.
MOVE e_time+4(2) TO sec.
CONCATENATE hh min sec INTO header-ext_time SEPARATED BY ':'.
e_date = sy-datum.
MOVE e_date+0(4) TO yy.
MOVE e_date+4(2) TO mm.
MOVE e_date+6(2) TO dd.
CONCATENATE mm dd yy INTO header-ext_date SEPARATED BY '/'.
header-delimit = '~'.
APPEND header.
List allowed document types **********************
PERFORM fill_doc_types.
**To select the documents within the range of week or as inputted **
IF s_augdt IS INITIAL.
MOVE: 'I' TO s_augdt-sign,
'BT' TO s_augdt-option,
fromdate TO s_augdt-low,
todate TO s_augdt-high.
APPEND s_augdt.
ENDIF.
Selecting the records from the database ****************
IF s_bukrs IS INITIAL AND s_blart IS INITIAL.
Select all documents of company code 1000, *********
4200 and 8000, and allowed document types *********
SELECT belnr gjahr augdt augbl bukrs
blart bldat xblnr lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
FOR ALL ENTRIES IN i_doctype
WHERE blart EQ i_doctype-blart
AND augdt IN s_augdt
AND ( bukrs = '1000' OR bukrs ='4200' OR
( bukrs = '8000' AND blart NE 'ZP' ) ).
loop at i_data.
Exclude reversed documents
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
endif.
endloop.
ELSEIF s_blart IS INITIAL.
Select all documents of allowed document types ******
and inputted company code ************
SELECT belnr gjahr augdt augbl bukrs
blart bldat xblnr lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
FOR ALL ENTRIES IN i_doctype
WHERE blart EQ i_doctype-blart
AND augdt IN s_augdt
AND bukrs IN s_bukrs .
LOOP AT i_data.
Exclude documents of type ZP
for company code 8000.
IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
DELETE i_data.
continue.
ENDIF.
Exclude reversed documents
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
continue.
endif.
ENDLOOP.
READ TABLE i_data INDEX 1.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
ELSE.
Select the documents matching the company codes *****
and document types inputted in the selection screen ****
SELECT belnr gjahr augdt augbl bukrs bldat xblnr
blart lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
WHERE bukrs IN s_bukrs AND blart IN s_blart
AND augdt IN s_augdt.
SORT i_data BY blart.
LOOP AT i_data.
Filtering the records selected
based on the document type
READ TABLE i_doctype WITH KEY blart = i_data-blart.
IF sy-subrc NE 0.
DELETE i_data.
continue.
ENDIF.
Exclude documents of type ZP
for company code 8000.
IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
DELETE i_data.
continue.
ENDIF.
Exclude reversed documents.
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
continue.
endif.
ENDLOOP.
READ TABLE i_data INDEX 1.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
ENDIF.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
credit/debit identification ***********************
LOOP AT i_data.
IF i_data-shkzg EQ 'H'.
i_data-wrbtr = i_data-wrbtr * 1.
ELSEIF i_data-shkzg EQ 'S'.
i_data-wrbtr = i_data-wrbtr * -1.
ENDIF.
MODIFY i_data.
ENDLOOP.
for summarizing ******************************
LOOP AT i_data.
MOVE-CORRESPONDING i_data TO i_data1.
COLLECT i_data1.
ENDLOOP.
Vendor informations and Check Informations *****************
SELECT lifnr name1 sortl
FROM lfa1
APPENDING CORRESPONDING FIELDS OF TABLE i_lfa1
FOR ALL ENTRIES IN i_data1
WHERE lifnr = i_data1-lifnr.
SELECT chect vblnr gjahr zbukr FROM payr APPENDING CORRESPONDING
FIELDS OF TABLE i_payr FOR ALL ENTRIES
IN i_data1 WHERE vblnr = i_data1-augbl
AND gjahr = i_data1-augdt(4)
AND zbukr = i_data1-bukrs.
SORT i_data1 BY augbl gjahr bukrs lifnr.
SORT i_payr BY vblnr gjahr zbukr.
SORT i_lfa1 BY lifnr.
LOOP AT i_data1.
READ TABLE i_payr WITH KEY vblnr = i_data1-augbl
gjahr = i_data1-gjahr
zbukr = i_data1-bukrs.
IF sy-subrc EQ 0.
i_data1-chect = i_payr-chect.
ENDIF.
READ TABLE i_lfa1 WITH KEY lifnr = i_data1-lifnr.
IF sy-subrc EQ 0.
i_data1-name1 = i_lfa1-name1.
i_data1-sortl = i_lfa1-sortl.
ENDIF.
i_data1-status = 'X'.
MODIFY i_data1.
ENDLOOP.
**The records are sorted by clearing date, check number and doc type**
SORT i_data1 BY augdt chect blart.
**********The header record is outputted on the screen****************
PERFORM write_header.
********Data is moved to internal table in the file format *************
PERFORM move_data.
Line items are outputted on the screen *********************
PERFORM write_output.
*& Form write_header &*
*& This outputs the header information to screen &*
FORM write_header.
SKIP.
SET PF-STATUS 'LIST'.
Outputting the header information *********************
WRITE : / 'Extraction Date : ' , header-ext_date.
WRITE : / 'Extraction Time : ' , header-ext_time.
FORMAT COLOR 1." INTENSIFIED.
SKIP.
ULINE AT 0(190) NO-GAP.
Outputting line level information **********************
WRITE:/ sy-vline NO-GAP,
(10) 'DOC NUMBER',
sy-vline NO-GAP,
(4) 'F-YR',
sy-vline NO-GAP,
(6) 'C-CODE',
sy-vline NO-GAP,
(10) 'CHECK NUM',
sy-vline NO-GAP,
(10) 'VENDOR NUM',
sy-vline NO-GAP,
(35) 'VENDOR NAME',
sy-vline NO-GAP,
(12) 'INVOICE DATE',
sy-vline NO-GAP,
(16) 'INVOICE NUMBER',
sy-vline NO-GAP,
(12) 'PAID DATE',
sy-vline NO-GAP,
(15) 'INVOICE AMOUNT',
sy-vline NO-GAP,
(2) 'SC',
sy-vline NO-GAP,
(16) 'REFERENCE FI DOC',
sy-vline NO-GAP,
(15) 'SORT FIELD',
sy-vline NO-GAP.
ULINE AT 0(190) NO-GAP.
ENDFORM. " write_header
*& FORM MOVE_DATA &*
*& Formats data in internal table as is required in the file &*
FORM move_data.
LOOP AT i_data1.
Document number and fiscal year should be separted by '|' *****
CONCATENATE i_data1-belnr i_data1-gjahr INTO fidoc_year
SEPARATED BY '|'.
MOVE i_data1-bukrs TO comp_code.
MOVE i_data1-chect TO check_numbr.
Vendor number and vendor name should be separted by '|' *****
CONCATENATE i_data1-lifnr i_data1-name1 INTO vendor
SEPARATED BY '|'.
SHIFT vendor LEFT DELETING LEADING '0'.
SHIFT vendor RIGHT DELETING TRAILING space.
Date fields converted to MM/DD/YYYY format ****************
MOVE i_data1-bldat+0(4) TO yy.
MOVE i_data1-bldat+4(2) TO mm.
MOVE i_data1-bldat+6(2) TO dd.
CONCATENATE mm dd yy INTO inv_date SEPARATED BY '/'.
MOVE i_data1-xblnr TO inv_nbr.
SHIFT inv_nbr RIGHT DELETING TRAILING space.
MOVE i_data1-augdt+0(4) TO yy.
MOVE i_data1-augdt+4(2) TO mm.
MOVE i_data1-augdt+6(2) TO dd.
CONCATENATE mm dd yy INTO paid_dat SEPARATED BY '/'.
MOVE i_data1-wrbtr TO inv_amt.
CONDENSE inv_amt.
SHIFT inv_amt RIGHT DELETING TRAILING space.
MOVE i_data1-status TO status.
MOVE i_data1-augbl TO ref_doc.
CONCATENATE fidoc_year
comp_code
check_numbr
vendor
inv_date
inv_nbr
paid_dat
inv_amt
status
ref_doc
INTO i_final_file-record SEPARATED BY '~'.
APPEND i_final_file.
ENDLOOP.
ENDFORM. " MOVE_DATA
*& Form write_output &*
*& Outputs all data to screen &*
FORM write_output.
LOOP AT i_data1.
FORMAT COLOR 2 INTENSIFIED.
Outputting line level information *******************
WRITE : / sy-vline NO-GAP,
(10) i_data1-belnr,
sy-vline NO-GAP,
(4) i_data1-gjahr,
sy-vline NO-GAP,
(6) i_data1-bukrs,
sy-vline NO-GAP,
(10) i_data1-chect,
sy-vline NO-GAP,
(10) i_data1-lifnr,
sy-vline NO-GAP,
(35) i_data1-name1,
sy-vline NO-GAP,
(12) i_data1-bldat MM/DD/YYYY,
sy-vline NO-GAP,
(16) i_data1-xblnr,
sy-vline NO-GAP,
(12) i_data1-augdt MM/DD/YYYY,
sy-vline NO-GAP,
(15) i_data1-wrbtr,
sy-vline NO-GAP,
(2) i_data1-status,
sy-vline NO-GAP,
(16) i_data1-augbl,
sy-vline NO-GAP,
(15) i_data1-sortl,
sy-vline NO-GAP.
ENDLOOP.
ULINE AT 0(190) NO-GAP.
ENDFORM. " write_output
In the program, I am downloading only the list.. The description of report outputted in the beginning of the report is not downloaded to excel.
What has to be taken into consideration is that, the structure of the table i_data1 which contains the data to be downloaded to the table.
I hope that this will help you.
Regards,
Susmitha -
Regarding Balance sheet report
Hello,
I want to create a balance sheet report as on all the periods of the fiscal year.
Like. the output should have:
Balance sheet as on April2009,Balance sheet as on May2009,Balance sheet as on Junel2009......
And this all should reflect in one report with different coloumns.
So how should i achieve this.
Regards,
PratighyaHi,
Create a structure for all keyfigures in columns. Drag and drop the time characterstic calendar year/month above that
structure.
Place the G/L account characterstic in rows.
In filter restrict the G/L account infobject to specif hierarchy nodes and restrict the calendar year/month to user entry
mandatory variable (range).
Let me know if you want more information.
Regards
Prasad -
Regarding Sales Order Report in SD
Hii
I want to create reports in SD module such as sales order report, which covers all organization levels, delivery status, invoice status, shipping details and partner function details.
Any inputs would be appreciated
Regards,
GuruHello Guru,
Please use basic SD transactions VA01,VA02,VA03(Create/change/display Sales order).
Here, places the mouse cursor on any of the fields and hit F1.
You will be given Technical help info (Table name ,field name,screen name)
For example in VA03 when we hit F1 on Sales order number input help field, we get the following information.
Table name VBAK
Field: VBELN
Data element: VBELN_VA
Also as mentioned in the previous threads, please go through the tables VBAK,VBAP,VBFA,VBRP for the information required.
Please mark as answered if my suggestion helped in resolving your problem.
Regards,
Himanshu Limaye -
Regarding Purchase Requsition Report
hi,
i am making report on Purchase Requsition in which i have to display that these are the persons who had approved at this date.
i am currently using tables: EBAN,T16FG but it is not giving the desierd result ,can anybody help me out in making thisreport ,HE OR SHE will be definately rewarded.
Reply as fast as possible.
regards,
ric.sHi
Check/Use the Tables
<b>T161E and T161F</b> for the PR Release info
by taking the related fields from EBAN
also check the Pur requisition Business Object BUS2105 Program for the other release info in SWO1 Tcode, you will find it
Regards
Anji -
Re: Regarding Purchase Requsition Report
HI,
I am making purchase Requisition Report and i want to display<b> that these are the PURCHASE REQUISITIONS and these are approved by these persons at these dates.</b>
if anybody provide me help he or she will be definately rewarded.
Message was edited by:
ric .sHi
First fetch the data from the EBAN table
and using the fields
FRGKZ
FRGZU
FRGST
check in the tables like T161s,T162 etc for the release info of PR's and display
also check the business object BUS2105 Program for the release info fun modules like
BAPI_REQUISITION_GETRELINFO
Regards
Anji -
Regarding Customer ageing report logic in R/3.
Dear
Experts
i have requirement to develop customer ageing report logic for input 30,60,90,180,360
i don' t have any idea hw can i take these values in input& hw can i caluclate the values
i searched in sdn, i did n't get any suitable answer..
Regards
SpandanaHello,
Go to transaction code FDI4
Select Form Type RFFRRD20 Line item analysis
Give your form name and description
Structure (Two axis) - as defaulted
Click on Create
You will have lead column
Delete the rows 2, 3 and 4
Double click on column 1
Enter the customer numbers from 1 to 999999
First column double click (A)
Slelect following values
Due date analysis 1
Days for net due date 0 to 30
Give the short name, medium name and long text for the column.
Repeat this step in next columns like 31 to 60, 61 to 90, 91 to 120 and 121 to 99999 days etc in other columns and select due date analysis 1. (B,C,D,E)
Create one more column by way of formula. To create a new column you need to double click on blue line. Put formula add all five columns you have created above. (F = ABCDE)
You prepare one more column with
Due date analysis 2 (G)
Now you prepare one more column add (F+G) = This will be total open items = over due and not due.
Now go to FDI1 and prepare a report - assign the form created in FDI4 to the report.
Characteristics you need to select are
Account Type (Select Account Type as D for customers)
Currency
Customer
Document Type
Special G/L Ind
Company Code
Change the output types and options according to your requirement.
Refer FDI2 and FDI3 for other standard reports created.
Refer FDI5 and FDI6 for other standard forms created.
Save your report and execute.
Regards,
Ravi -
Regarding Generation of Reports
Hi!!
The Link "Generating a report" is not working in tutorial section. Can any one tell me how to learn generating reports using Raptor
Thanx
AmitHi Waldemar,
Maybe the presentation (see link below) is not very relevant. But it may give you some ideas.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/mdm/concept of consolidated infoobjects in sap business information warehouse
Best regards,
Eugene
Maybe you are looking for
-
Hi I keep on receiving the same text message multiple times and at around the same time each night. Any idea how I can stop this happening? The text messages are originating from to separate Saudi Arabian mobile numbers. Both these people are listed
-
SXPG_CALL_SYSTEM performance question
Hi all, I'm using FM <b>SXPG_CALL_SYSTEM</b> in order to execute a server command which grants permissions to a file (just executes <u>CHMOD 777</u>). (also tried with <b>SXPG_COMMAND_EXECUTE</b>) My problem is regarding performance in this FM (progr
-
Need help canceling CC subscription
My Creative Cloud annual subscription expires in February. I do not wish to renew for another year. Every link on the site about canceling a subscription leads me into a circular "please contact us!" loop without actually providing any means by whic
-
Can you export plugins in Indesign CS6?
I have supplied an InDesign CS6 file to a colleague, when he tries to open it it asks for 4 missing plugins? Does anybody know a solution to this? Do I need to 'export' the plugins, if so does anybody know how to do this?
-
On nuber of occasions while downloading a large file of a few hundred MB this download interrupts or ends prematurely. Is there a way to continue this download in download manager? I am running Firefox 3.6.17 on notebook, with Windows XP Professional