U0095 Vendor performance report this report gives performance of supplier to se
Vendor performance report this report gives performance of supplier to send an order to customer
Kiran,
The functionality you are asking sounds like standard functionality. Doesn't make sense to custom develop the same.
Make sure you search and confirm that standard reports are NOT available for the same.
Regards,
Ravi
Note : please mark the helpful answers
Similar Messages
-
PERFORMANCE of this REPORT object
Hi Experts
I have a REPORT object, having a few SELECT Queries in it. I need to analyze the PERFORMANCE of this REPORT object.
How can I analyze the performance of a SELECT Query alone in it - that is time taken to execute this SELECT Query alone?
How can I find the total execution time taken by the REPORT object?
Plz suggest.
BDHi Bobby,
TYPES : BEGIN OF gtyp_rbkp,
belnr TYPE re_belnr,
gjahr TYPE gjahr,
budat TYPE budat,
usnam TYPE usnam,
lifnr TYPE lifre,
ivtyp TYPE ivtyp,
lieffn TYPE lieffn,
END OF gtyp_rbkp.
DATA : gt_rbkp TYPE STANDARD TABLE OF gtyp_rbkp,
gs_rbkp type gtyp_rbkp.
DATA: gv_str_j TYPE i,
gv_end_j TYPE i,
gv_run_time_join TYPE p DECIMALS 2.
constants : lc_a type char1 value 'A'.
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-015.
SELECT-OPTIONS : so_belnr FOR gs_rbkp-belnr,
so_gjahr FOR gs_rbkp-gjahr NO-EXTENSION NO INTERVALS,
so_usnam FOR gs_rbkp-usnam,
so_lifnr FOR gs_rbkp-lifnr,
so_budat FOR gs_rbkp-budat NO-EXTENSION OBLIGATORY
DEFAULT sy-datum.
SELECTION-SCREEN: END OF BLOCK b1.
start-of-selection.
write: 'testing performance'.
get RUN TIME FIELD gv_str_j.
SELECT belnr
gjahr
budat
usnam
lifnr
ivtyp
lieffn
FROM rbkp
INTO TABLE gt_rbkp
WHERE belnr IN so_belnr
AND gjahr IN so_gjahr
AND budat IN so_budat
AND usnam IN so_usnam
AND lifnr IN so_lifnr.
IF sy-subrc EQ 0.
**delete entries from GT_RBKP where IVTYP ne A(Invoice from Parking Function)
DELETE gt_rbkp WHERE ivtyp NE lc_a.
ENDIF.
get RUN TIME FIELD gv_end_j.
Now get the runtime.
gv_run_time_join = ( gv_end_j - gv_str_j ) / 1000000 .
write:/ 'Report RunTime with delete is ', gv_run_time_join, 'seconds'.
clear : gv_str_j, gt_rbkp[], gv_end_j.
Hope this will help you.
Regards,
Phani -
Plz increase performance of this report
hi all
i want to know how can i improve the performance of my report.
the code is given below and it takes so much time on production even for single record
plz help
HERE COMES THE CODE
*& Report ZGRSTATUS
REPORT ZGRSTATUS.
TYPE-POOLS slis.
TABLES: mseg, qamb, mkpf, rseg.
DATA : BEGIN OF itab OCCURS 0,
mblnr LIKE mseg-mblnr,
zeile LIKE mseg-zeile,
uom LIKE mseg-erfme,
matnr LIKE mseg-matnr,
recqty LIKE mseg-erfmg,
qcins LIKE mseg-insmk, "INSPECTION SIGN
ebeln LIKE mseg-ebeln,
ebelp LIKE mseg-ebelp,
lifnr LIKE mseg-lifnr,
budat LIKE mkpf-budat,
txz01 LIKE ekpo-txz01,
name1 LIKE lfa1-name1,
accqty LIKE mseg-erfmg,
rejqty LIKE mseg-erfmg,
belnr LIKE rseg-belnr,
dqty LIKE mseg-menge,
cqty LIKE mseg-menge,
qcdat like mkpf-budat,
miro_budat like rbkp-budat,
accuom like mseg-erfme,
rejuom like mseg-erfme,
qcstat like mseg-insmk,
acstat(1) type c,
crnote(1) type c,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
mblnr LIKE mseg-mblnr,
zeile LIKE mseg-zeile,
mjahr LIKE mseg-mjahr,
prueflos like qamb-prueflos,
END OF itab1.
DATA: BEGIN OF imiro OCCURS 0,
belnr LIKE rseg-belnr,
lfbnr LIKE rseg-lfbnr, "DOCMENT NO SAME AS MBLRN
shkzg LIKE rseg-shkzg, "DEBIT CREDIT SIGN
menge LIKE rseg-menge,
ebeln LIKE rseg-ebeln,
ebelp LIKE rseg-ebelp,
budat LIKE rbkp-budat,
END OF imiro.
data: begin of iins occurs 0, "NEW INTERNAL TABLE DECLARED for inspection lot numbers
mblnr like mseg-mblnr,
zeile like mseg-zeile,
prueflos like qamb-prueflos,
mjahr like qamb-mjahr,
end of iins.
****************************CODE FOR SELECTION SCREEN****************************
selection-screen begin of block par1 WITH FRAME TITLE TEXT-001.
PARAMETERS : plant LIKE mseg-werks OBLIGATORY DEFAULT 'MFPL'.
PARAMETERS: year LIKE mseg-mjahr OBLIGATORY DEFAULT '2007'.
SELECT-OPTIONS : grno FOR mseg-mblnr,
grdate FOR mkpf-budat,
vendor FOR mseg-lifnr,
item for mseg-matnr.
SELECTION-SCREEN END OF BLOCK par1.
***************************END OF CODE FOR SELECTION SCREEN**********************
*************************FETCHING OF GR INFORMATION FROM MSEG AND MKPF*************************
SELECT amblnr zeile aerfme amatnr aerfmg ainsmk aebeln aebelp alifnr bbudat ctxz01 d~name1
FROM mseg AS a
INNER JOIN mkpf AS b ON amblnr = bmblnr AND amjahr = bmjahr
INNER JOIN ekpo AS c ON aebeln = cebeln AND aebelp = cebelp
INNER JOIN lfa1 as d ON dlifnr = alifnr
INTO TABLE itab
WHERE awerks = plant AND amblnr IN grno AND bwart = '101' AND a~mjahr = year
AND btcode2 = 'MIGO_GR' AND bbudat IN grdate AND alifnr IN vendor and amatnr IN item.
*************************END OF RETERIEVEL***************************************
if sy-subrc <> 0.
Message 'NO RECORD FOUND' type 'E'.
endif.
*******************************SELECTING THE INSPECTED DOC NUMBERS AND CORROSPONDING INSPECTION LOT********************************
select mblnr zeile mjahr prueflos
from qamb into table itab1 for all entries in itab where mblnr = itab-mblnr and zeile = itab-zeile.
**********************************END OF SELECTING THE INSPECTED DOC. NUMBERS & INSPECTION LOTS************************************
**************************SELECTING THE DOC NO FOR ACCEPTED AND REJECTED QTY ACCORDING TO INSPECTION LOT***************************
select mblnr zeile prueflos mjahr into table iins from qamb
for all entries in itab1 where prueflos = itab1-prueflos and mblnr <> itab1-mblnr.
**************************END OF SELECTING ACCEPTED AND REJECTED QTY DOCUMENTS****************************************************
**********************************SELECTING THE DEBIT AND CREDIT QTY FOR THE MIRO TCODE*******************************************
SELECT abelnr lfbnr shkzg menge ebeln ebelp bbudat INTO table imiro
FROM rseg as a
inner join rbkp as b on abelnr = bbelnr
for all entries in itab where a~lfbnr = itab-mblnr.
DATA : v_qcidoc LIKE qamb-prueflos,
v_qcdoc LIKE mseg-mblnr,
v_qcdoc1 LIKE mseg-zeile,
v_qty LIKE mseg-menge,
v_bwart LIKE mseg-bwart,
v_name1 LIKE lfa1-name1,
v_budat like mkpf-budat,
v_newrejqty like mseg-menge,
v_newaccqty like mseg-menge,
CMPACCQTY LIKE MSEG-MENGE,
CMPREJQTY LIKE MSEG-MENGE,
aa TYPE c.
data: begin of iartab occurs 0,
mblnr like mseg-mblnr,
bwart like mseg-bwart,
qty like mseg-menge,
erfme like mseg-erfme,
zeile like mseg-zeile,
budat like mkpf-budat,
end of iartab.
clear iartab.
refresh iartab.
****************************************table for accept and reject qty************************************
SELECT a~mblnr bwart erfmg erfme zeile budat into table iartab
FROM mseg as a
inner join mkpf as b on amblnr = bmblnr
for all entries in iins
WHERE amblnr = iins-mblnr AND azeile = iins-zeile AND xauto <> 'X' AND a~mjahr = iins-mjahr.
******************************************END OF ACCEPT AND REJECTED QTY.***********************************
LOOP AT itab.
clear: itab-accuom, itab-rejuom.
SELECT SINGLE name1 FROM lfa1 INTO itab-name1 WHERE lifnr = itab-lifnr.
**********************GETTING THE ACCEPTED AND REJECTED QTY FROM MSEG FOR ALL RECORDS OF ITAB*********************
IF itab-qcins = 'X'.
clear v_qcidoc.
clear: v_bwart, v_qty, v_budat.
read table itab1 with key mblnr = itab-mblnr zeile = itab-zeile.
if sy-subrc = 0.
v_qcidoc = itab1-prueflos.
endif.
LOOP AT itab1 where prueflos = v_qcidoc and mblnr <> itab-mblnr .
LOOP AT iins where prueflos = v_qcidoc. " and mblnr <> itab-mblnr .
v_qty = 0.
SELECT single bwart erfmg budat
INTO (v_bwart, v_qty, v_budat)
FROM mseg as a
inner join mkpf as b on amblnr = bmblnr
WHERE amblnr = itab1-mblnr AND azeile = itab1-zeile AND xauto <> 'X' AND a~mjahr = itab1-mjahr.
WHERE amblnr = iins-mblnr AND azeile = iins-zeile AND xauto <> 'X' AND a~mjahr = iins-mjahr.
read table iartab with key mblnr = iins-mblnr zeile = iins-zeile.
if sy-subrc = 0.
v_bwart = iartab-bwart.
v_qty = iartab-qty.
v_budat = iartab-budat.
endif.
IF v_bwart = '321'.
v_newaccqty = v_newaccqty + v_qty.
itab-accqty = v_newaccqty.
itab-qcdat = v_budat.
itab-accuom = iartab-erfme.
ELSEIF v_bwart = '122'.
itab-qcdat = v_budat.
v_newrejqty = v_newrejqty + v_qty.
itab-rejqty = v_newrejqty.
itab-rejuom = iartab-erfme.
ENDIF.
ENDLOOP. "*********END OF LOOP FOR ITAB1**************
clear: v_newaccqty, v_newrejqty.
ENDIF. "**********END OF MAIN ENDIF***********************
*****************END OF CODE FOR ACCEPTED AND REJECTED QTY************************************
****************************GETTING DEBIT AND CREDIT QTY******************************************
LOOP AT imiro WHERE lfbnr = itab-mblnr AND ebeln = itab-ebeln AND ebelp = itab-ebelp.
ITAB-MIRO_BUDAT = IMIRO-BUDAT.
itab-belnr = imiro-belnr.
IF imiro-shkzg = 'S'.
itab-dqty = imiro-menge.
ELSEIF imiro-shkzg = 'H'.
itab-cqty = imiro-menge.
ENDIF.
ENDLOOP.
*****************************END OF CODE FOR DEBIT AND CREDIT QTY*******************************
data v_sumqty like mseg-menge.
CLEAR V_SUMQTY.
if itab-qcins = 'X'.
clear: cmpaccqty, cmprejqty.
cmpaccqty = itab-accqty.
cmprejqty = itab-rejqty.
IF ITAB-UOM <> ITAB-ACCUOM AND ITAB-ACCUOM <> SPACE.
CALL FUNCTION 'ZCONVERT_UOM_QTY'
EXPORTING
P_FR_UOM = ITAB-UOM
P_TO_UOM = ITAB-ACCUOM
P_QTY = ITAB-ACCQTY
IMPORTING
P_RETVAL = CMPACCQTY.
ELSEIF ITAB-UOM <> ITAB-REJUOM AND ITAB-REJUOM <> SPACE.
CALL FUNCTION 'ZCONVERT_UOM_QTY'
EXPORTING
P_FR_UOM = ITAB-UOM
P_TO_UOM = ITAB-REJUOM
P_QTY = ITAB-REJQTY
IMPORTING
P_RETVAL = CMPREJQTY.
ENDIF.
v_sumqty = CMPACCQTY + CMPREJQTY.
if ( v_sumqty = itab-recqty ).
itab-qcstat = 'C'.
modify itab.
ELSE.
ITAB-QCSTAT = 'P'.
endif.
ELSE.
ITAB-QCSTAT = 'C'.
endif.
IF ITAB-QCSTAT = 'C'.
IF ITAB-DQTY = ITAB-RECQTY.
ITAB-ACSTAT = 'C'.
ELSE.
ITAB-ACSTAT = 'P'.
ENDIF.
ELSEIF ITAB-QCSTAT = 'P'.
IF ITAB-RECQTY = ITAB-DQTY.
ITAB-ACSTAT = 'O'.
ENDIF.
ENDIF.
IF ITAB-REJQTY > 0.
IF ITAB-ACSTAT = 'C' AND ITAB-REJQTY > ITAB-CQTY.
ITAB-CRNOTE = 'P'.
ELSEIF ITAB-ACSTAT = 'C' AND ITAB-REJQTY < ITAB-CQTY.
ITAB-CRNOTE = 'W'.
ELSEIF ITAB-ACSTAT = 'C' AND ITAB-REJQTY = ITAB-CQTY.
ITAB-CRNOTE = 'C'.
ENDIF.
ELSE.
ITAB-CRNOTE = 'N'.
ENDIF.
MODIFY itab.
ENDLOOP. "*********************************************"END OF MAINT LOOP FOR ITAB.***********************
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
wa_layout TYPE slis_layout_alv.
PERFORM f_layout.
PERFORM f_fieldcat.
PERFORM display.
*& Form F_LAYOUT
text
FORM f_layout.
wa_layout-colwidth_optimize = 'X'.
wa_layout-no_subchoice = 'X'.
wa_layout-zebra = 'X'.
ENDFORM. "F_LAYOUT
*& Form F_FIELDCAT
text
FORM f_fieldcat.
DATA wa_col TYPE i VALUE 1.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'GR. NO'.
wa_fieldcat-fieldname = 'MBLNR'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'GR DATE'.
wa_fieldcat-fieldname = 'BUDAT'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'PO NO'.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'PARTY ID'.
wa_fieldcat-fieldname = 'LIFNR'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'PARTY NAME'.
wa_fieldcat-fieldname = 'NAME1'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-outputlen = '18'.
wa_fieldcat-seltext_l = 'ITEM ID'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'DESCRIPTION'.
wa_fieldcat-fieldname = 'TXZ01'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'UOM'.
wa_fieldcat-fieldname = 'UOM'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'INS REQ'.
wa_fieldcat-fieldname = 'QCINS'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'GR QTY'.
wa_fieldcat-fieldname = 'RECQTY'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'QC DATE'.
wa_fieldcat-fieldname = 'QCDAT'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'ACC QTY'.
wa_fieldcat-fieldname = 'ACCQTY'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'ACC UOM'.
wa_fieldcat-fieldname = 'ACCUOM'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'REJ QTY'.
wa_fieldcat-fieldname = 'REJQTY'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'REJ UOM'.
wa_fieldcat-fieldname = 'REJUOM'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'MIRO NO'.
wa_fieldcat-fieldname = 'BELNR'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'MIRO DATE'.
wa_fieldcat-fieldname = 'MIRO_BUDAT'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'DB.QTY'.
wa_fieldcat-fieldname = 'DQTY'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-seltext_l = 'CR.QTY'.
wa_fieldcat-fieldname = 'CQTY'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'QC STATUS'.
wa_fieldcat-fieldname = 'QCSTAT'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'A/C STATUS'.
wa_fieldcat-fieldname = 'ACSTAT'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-col_pos = wa_col + 1.
wa_fieldcat-seltext_l = 'CR NOTE STATUS'.
wa_fieldcat-fieldname = 'CRNOTE'.
wa_fieldcat-tabname = itab.
APPEND wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
ENDFORM. "F_FIELDCAT
*& Form DISPLAY
text
FORM display.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = wa_layout
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = itab.
ENDFORM. "DISPLAY
FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
clear itab-ebeln.
IF RS_SELFIELD-FIELDNAME = 'EBELN'.
READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
SET PARAMETER ID 'BES' FIELD ITAB-EBELN.
call transaction 'ME23N' AND SKIP FIRST SCREEN.
CLEAR RS_SELFIELD.
ELSEIF RS_SELFIELD-FIELDNAME = 'MBLNR'.
READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
SET PARAMETER ID 'MBN' FIELD ITAB-MBLNR.
SET PARAMETER ID 'MJA' FIELD year.
call transaction 'MIGO' AND SKIP FIRST SCREEN.
CLEAR RS_SELFIELD.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMANDWays of Performance Tuning
1. Selection Criteria
2. Select Statements
Select Queries
SQL Interface
Aggregate Functions
For all Entries
Select Over more than one internal table
Selection Criteria
1. Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement.
2. Select with selection list.
SELECT * FROM SBOOK INTO SBOOK_WA.
CHECK: SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
ENDSELECT.
The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list
SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
WHERE SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
Select Statements Select Queries
1. Avoid nested selects
SELECT * FROM EKKO INTO EKKO_WA.
SELECT * FROM EKAN INTO EKAN_WA
WHERE EBELN = EKKO_WA-EBELN.
ENDSELECT.
ENDSELECT.
The above code can be much more optimized by the code written below.
SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
FROM EKKO AS P INNER JOIN EKAN AS F
ON PEBELN = FEBELN.
Note: A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. One should therefore use nested SELECT loops only if the selection in the outer loop contains very few lines or the outer loop is a SELECT SINGLE statement.
2. Select all the records in a single shot using into table clause of select statement rather than to use Append statements.
SELECT * FROM SBOOK INTO SBOOK_WA.
CHECK: SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
ENDSELECT.
The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list and puts the data in one shot using into table
SELECT CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
WHERE SBOOK_WA-CARRID = 'LH' AND
SBOOK_WA-CONNID = '0400'.
3. When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields. In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
4. For testing existence, use Select.. Up to 1 rows statement instead of a Select-Endselect-loop with an Exit.
SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT.
The above code is more optimized as compared to the code mentioned below for testing existence of a record.
SELECT * FROM SBOOK INTO SBOOK_WA
WHERE CARRID = 'LH'.
EXIT.
ENDSELECT.
5. Use Select Single if all primary key fields are supplied in the Where condition .
If all primary key fields are supplied in the Where conditions you can even use Select Single.
Select Single requires one communication with the database system, whereas Select-Endselect needs two.
Select Statements SQL Interface
1. Use column updates instead of single-row updates
to update your database tables.
SELECT * FROM SFLIGHT INTO SFLIGHT_WA.
SFLIGHT_WA-SEATSOCC =
SFLIGHT_WA-SEATSOCC - 1.
UPDATE SFLIGHT FROM SFLIGHT_WA.
ENDSELECT.
The above mentioned code can be more optimized by using the following code
UPDATE SFLIGHT
SET SEATSOCC = SEATSOCC - 1.
2. For all frequently used Select statements, try to use an index.
SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
WHERE CARRID = 'LH'
AND CONNID = '0400'.
ENDSELECT.
The above mentioned code can be more optimized by using the following code
SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
WHERE MANDT IN ( SELECT MANDT FROM T000 )
AND CARRID = 'LH'
AND CONNID = '0400'.
ENDSELECT.
3. Using buffered tables improves the performance considerably.
Bypassing the buffer increases the network considerably
SELECT SINGLE * FROM T100 INTO T100_WA
BYPASSING BUFFER
WHERE SPRSL = 'D'
AND ARBGB = '00'
AND MSGNR = '999'.
The above mentioned code can be more optimized by using the following code
SELECT SINGLE * FROM T100 INTO T100_WA
WHERE SPRSL = 'D'
AND ARBGB = '00'
AND MSGNR = '999'.
Select Statements Aggregate Functions
If you want to find the maximum, minimum, sum and average value or the count of a database column, use a select list with aggregate functions instead of computing the aggregates yourself.
Some of the Aggregate functions allowed in SAP are MAX, MIN, AVG, SUM, COUNT, COUNT( * )
Consider the following extract.
Maxno = 0.
Select * from zflight where airln = LF and cntry = IN.
Check zflight-fligh > maxno.
Maxno = zflight-fligh.
Endselect.
The above mentioned code can be much more optimized by using the following code.
Select max( fligh ) from zflight into maxno where airln = LF and cntry = IN.
Select Statements For All Entries
The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
The plus
Large amount of data
Mixing processing and reading of data
Fast internal reprocessing of data
Fast
The Minus
Difficult to program/understand
Memory could be critical (use FREE or PACKAGE size)
Points to be must considered FOR ALL ENTRIES
Check that data is present in the driver table
Sorting the driver table
Removing duplicates from the driver table
Consider the following piece of extract
Loop at int_cntry.
Select single * from zfligh into int_fligh
where cntry = int_cntry-cntry.
Append int_fligh.
Endloop.
The above mentioned can be more optimized by using the following code.
Sort int_cntry by cntry.
Delete adjacent duplicates from int_cntry.
If NOT int_cntry[] is INITIAL.
Select * from zfligh appending table int_fligh
For all entries in int_cntry
Where cntry = int_cntry-cntry.
Endif.
Select Statements Select Over more than one Internal table
1. Its better to use a views instead of nested Select statements.
SELECT * FROM DD01L INTO DD01L_WA
WHERE DOMNAME LIKE 'CHAR%'
AND AS4LOCAL = 'A'.
SELECT SINGLE * FROM DD01T INTO DD01T_WA
WHERE DOMNAME = DD01L_WA-DOMNAME
AND AS4LOCAL = 'A'
AND AS4VERS = DD01L_WA-AS4VERS
AND DDLANGUAGE = SY-LANGU.
ENDSELECT.
The above code can be more optimized by extracting all the data from view DD01V_WA
SELECT * FROM DD01V INTO DD01V_WA
WHERE DOMNAME LIKE 'CHAR%'
AND DDLANGUAGE = SY-LANGU.
ENDSELECT
2. To read data from several logically connected tables use a join instead of nested Select statements. Joins are preferred only if all the primary key are available in WHERE clause for the tables that are joined. If the primary keys are not provided in join the Joining of tables itself takes time.
SELECT * FROM EKKO INTO EKKO_WA.
SELECT * FROM EKAN INTO EKAN_WA
WHERE EBELN = EKKO_WA-EBELN.
ENDSELECT.
ENDSELECT.
The above code can be much more optimized by the code written below.
SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
FROM EKKO AS P INNER JOIN EKAN AS F
ON PEBELN = FEBELN.
3. Instead of using nested Select loops it is often better to use subqueries.
SELECT * FROM SPFLI
INTO TABLE T_SPFLI
WHERE CITYFROM = 'FRANKFURT'
AND CITYTO = 'NEW YORK'.
SELECT * FROM SFLIGHT AS F
INTO SFLIGHT_WA
FOR ALL ENTRIES IN T_SPFLI
WHERE SEATSOCC < F~SEATSMAX
AND CARRID = T_SPFLI-CARRID
AND CONNID = T_SPFLI-CONNID
AND FLDATE BETWEEN '19990101' AND '19990331'.
ENDSELECT.
The above mentioned code can be even more optimized by using subqueries instead of for all entries.
SELECT * FROM SFLIGHT AS F INTO SFLIGHT_WA
WHERE SEATSOCC < F~SEATSMAX
AND EXISTS ( SELECT * FROM SPFLI
WHERE CARRID = F~CARRID
AND CONNID = F~CONNID
AND CITYFROM = 'FRANKFURT'
AND CITYTO = 'NEW YORK' )
AND FLDATE BETWEEN '19990101' AND '19990331'.
ENDSELECT.
1. Table operations should be done using explicit work areas rather than via header lines.
READ TABLE ITAB INTO WA WITH KEY K = 'X BINARY SEARCH.
IS MUCH FASTER THAN USING
READ TABLE ITAB INTO WA WITH KEY K = 'X'.
If TAB has n entries, linear search runs in O( n ) time, whereas binary search takes only O( log2( n ) ).
2. Always try to use binary search instead of linear search. But dont forget to sort your internal table before that.
READ TABLE ITAB INTO WA WITH KEY K = 'X'. IS FASTER THAN USING
READ TABLE ITAB INTO WA WITH KEY (NAME) = 'X'.
3. A dynamic key access is slower than a static one, since the key specification must be evaluated at runtime.
4. A binary search using secondary index takes considerably less time.
5. LOOP ... WHERE is faster than LOOP/CHECK because LOOP ... WHERE evaluates the specified condition internally.
LOOP AT ITAB INTO WA WHERE K = 'X'.
ENDLOOP.
The above code is much faster than using
LOOP AT ITAB INTO WA.
CHECK WA-K = 'X'.
ENDLOOP.
6. Modifying selected components using MODIFY itab TRANSPORTING f1 f2.. accelerates the task of updating a line of an internal table.
WA-DATE = SY-DATUM.
MODIFY ITAB FROM WA INDEX 1 TRANSPORTING DATE.
The above code is more optimized as compared to
WA-DATE = SY-DATUM.
MODIFY ITAB FROM WA INDEX 1.
7. Accessing the table entries directly in a "LOOP ... ASSIGNING ..." accelerates the task of updating a set of lines of an internal table considerably
Modifying selected components only makes the program faster as compared to Modifying all lines completely.
e.g,
LOOP AT ITAB ASSIGNING <WA>.
I = SY-TABIX MOD 2.
IF I = 0.
<WA>-FLAG = 'X'.
ENDIF.
ENDLOOP.
The above code works faster as compared to
LOOP AT ITAB INTO WA.
I = SY-TABIX MOD 2.
IF I = 0.
WA-FLAG = 'X'.
MODIFY ITAB FROM WA.
ENDIF.
ENDLOOP.
8. If collect semantics is required, it is always better to use to COLLECT rather than READ BINARY and then ADD.
LOOP AT ITAB1 INTO WA1.
READ TABLE ITAB2 INTO WA2 WITH KEY K = WA1-K BINARY SEARCH.
IF SY-SUBRC = 0.
ADD: WA1-VAL1 TO WA2-VAL1,
WA1-VAL2 TO WA2-VAL2.
MODIFY ITAB2 FROM WA2 INDEX SY-TABIX TRANSPORTING VAL1 VAL2.
ELSE.
INSERT WA1 INTO ITAB2 INDEX SY-TABIX.
ENDIF.
ENDLOOP.
The above code uses BINARY SEARCH for collect semantics. READ BINARY runs in O( log2(n) ) time. The above piece of code can be more optimized by
LOOP AT ITAB1 INTO WA.
COLLECT WA INTO ITAB2.
ENDLOOP.
SORT ITAB2 BY K.
COLLECT, however, uses a hash algorithm and is therefore independent
of the number of entries (i.e. O(1)) .
9. "APPEND LINES OF itab1 TO itab2" accelerates the task of appending a table to another table considerably as compared to LOOP-APPEND-ENDLOOP.
APPEND LINES OF ITAB1 TO ITAB2.
This is more optimized as compared to
LOOP AT ITAB1 INTO WA.
APPEND WA TO ITAB2.
ENDLOOP.
10. DELETE ADJACENT DUPLICATES accelerates the task of deleting duplicate entries considerably as compared to READ-LOOP-DELETE-ENDLOOP.
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING K.
This is much more optimized as compared to
READ TABLE ITAB INDEX 1 INTO PREV_LINE.
LOOP AT ITAB FROM 2 INTO WA.
IF WA = PREV_LINE.
DELETE ITAB.
ELSE.
PREV_LINE = WA.
ENDIF.
ENDLOOP.
11. "DELETE itab FROM ... TO ..." accelerates the task of deleting a sequence of lines considerably as compared to DO -DELETE-ENDDO.
DELETE ITAB FROM 450 TO 550.
This is much more optimized as compared to
DO 101 TIMES.
DELETE ITAB INDEX 450.
ENDDO.
12. Copying internal tables by using ITAB2[ ] = ITAB1[ ] as compared to LOOP-APPEND-ENDLOOP.
ITAB2[] = ITAB1[].
This is much more optimized as compared to
REFRESH ITAB2.
LOOP AT ITAB1 INTO WA.
APPEND WA TO ITAB2.
ENDLOOP.
13. Specify the sort key as restrictively as possible to run the program faster.
SORT ITAB BY K. makes the program runs faster as compared to SORT ITAB.
Internal Tables contd
Hashed and Sorted tables
1. For single read access hashed tables are more optimized as compared to sorted tables.
2. For partial sequential access sorted tables are more optimized as compared to hashed tables
Hashed And Sorted Tables
Point # 1
Consider the following example where HTAB is a hashed table and STAB is a sorted table
DO 250 TIMES.
N = 4 * SY-INDEX.
READ TABLE HTAB INTO WA WITH TABLE KEY K = N.
IF SY-SUBRC = 0.
ENDIF.
ENDDO.
This runs faster for single read access as compared to the following same code for sorted table
DO 250 TIMES.
N = 4 * SY-INDEX.
READ TABLE STAB INTO WA WITH TABLE KEY K = N.
IF SY-SUBRC = 0.
ENDIF.
ENDDO.
Point # 2
Similarly for Partial Sequential access the STAB runs faster as compared to HTAB
LOOP AT STAB INTO WA WHERE K = SUBKEY.
ENDLOOP.
This runs faster as compared to
LOOP AT HTAB INTO WA WHERE K = SUBKEY.
ENDLOOP. -
How do i get this report program
 Contract Compliance Report : This report looks at the actual customer purchases (QTY) by period vs. targeted quantities.
The report created will list all the contracts quantity vs. shipped quantity in the period specified for a given customer or material or sales organization or contract number along with details such as material numbers, contract start date, contract end date, etc.
 Contract Expiration Report : Contracts need to be monitored and quotations sent out for renewal as they approach their expiry date. A report is required to show the contracts expiring.
This report will list all the contracts expiring in the period specified for a given customer or material or sales organization or contract number along with details such as equipment numbers, material numbers, contract start date, contract end date, etc.hi
i have this code for CONTRACT EXPIRATION REPORT.
may this be useful.
TABLES: vbak,veda,vbkd.
TYPE-POOLS: slis,
ibco2.
TYPES : BEGIN OF t_ty_str_contract_dtls,
vbeln TYPE vbeln,
posnr TYPE posnr,
zzp_mfrnr TYPE mfrnr,
zprogram TYPE zsls_dte_program,
cuobj TYPE cuobj,
classnum TYPE char18,
END OF t_ty_str_contract_dtls.
DATA : g_tab_cnt_details TYPE zsls_tab_cntr_expire,
g_wa_cnt_details TYPE LINE OF zsls_tab_cntr_expire,
g_tab_fieldcat TYPE slis_t_fieldcat_alv,
g_fieldcat TYPE slis_fieldcat_alv,
g_pos TYPE i,
g_exit TYPE c,
p_fname TYPE string,
repid TYPE sy-repid,
BEGIN OF g_str_data,
kunnr(12) TYPE c,
name1(30) TYPE c,
vkorg(15) TYPE c,
vkbur(15) TYPE c,
vkgrp(15) TYPE c,
bezei(25) TYPE c,
vbeln(15) TYPE c,
bstkd_m(35) TYPE c,
ktext(40) TYPE c,
vbegdat(15) TYPE c,
venddat(17) TYPE c,
auart(15) TYPE c,
zzp_mfrnr(12) TYPE c,
mnf_des(30) TYPE c,
zprogram(30) TYPE c,
END OF g_str_data,
BEGIN OF g_str_cus_nam,
kunnr TYPE kunnr,
name1 TYPE name1,
END OF g_str_cus_nam,
BEGIN OF g_str_sgrp_nam,
vkgrp TYPE vkgrp,
bezei TYPE bezei,
END OF g_str_sgrp_nam,
BEGIN OF g_str_manf_nam,
lifnr TYPE lifnr,
name1 TYPE name1,
END OF g_str_manf_nam.
DATA : g_tab_data LIKE STANDARD TABLE OF g_str_data,
g_tab_cus_nam LIKE STANDARD TABLE OF g_str_cus_nam,
g_tab_sgrp_nam LIKE STANDARD TABLE OF g_str_sgrp_nam,
g_tab_contract TYPE STANDARD TABLE OF t_ty_str_contract_dtls,
g_wa_contract TYPE t_ty_str_contract_dtls,
g_tab_manf_nam LIKE STANDARD TABLE OF g_str_manf_nam,
g_rc LIKE sy-subrc. "RETURN CODE.
CONSTANTS: con_klart LIKE klah-klart VALUE '300',
con_program LIKE zsls_str_contract_chg-zprogram VALUE 'PROGRAM'.
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_sorg FOR vbak-vkorg OBLIGATORY DEFAULT '0030',
s_soff FOR vbak-vkbur,
s_sgrp FOR vbak-vkgrp,
s_dtyp FOR vbak-auart OBLIGATORY,
s_cnum FOR vbak-vbeln,
s_cust FOR vbak-kunnr,
s_pnum FOR vbkd-bstkd_m NO-EXTENSION NO INTERVALS.
PARAMETERS : p_mfnum LIKE mara-mfrnr.
SELECT-OPTIONS : s_endt FOR veda-venddat OBLIGATORY.
PARAMETERS : p_prg LIKE zsls_str_char_para-zprogram.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-005.
PARAMETER :p_name LIKE rlgrap-filename. " OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF BLOCK b0.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
MOVE sy-repid TO repid.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = repid
dynpro_number = sy-dynnr
field_name = 'P_NAME'
IMPORTING
file_name = p_name.
START-OF-SELECTION.
PERFORM get_data.
IF g_exit NE 'X'.
PERFORM get_prg_mfr_dtls.
IF g_tab_cnt_details IS INITIAL.
MESSAGE i000 WITH text-004.
g_exit = 'X'.
EXIT.
ENDIF.
PERFORM move_data.
ENDIF.
END-OF-SELECTION.
IF g_exit NE 'X'.
MOVE p_name TO p_fname.
PERFORM post_data_report.
PERFORM display_data.
ENDIF.
*& Form get_data
FORM get_data .
SELECT a~vkorg
a~vkbur
a~vkgrp
a~auart
a~kunnr
a~vbeln
a~ktext
c~vbegdat
c~venddat
d~bstkd_m
INTO CORRESPONDING FIELDS OF TABLE g_tab_cnt_details
FROM vbak AS a
INNER JOIN veda AS c
ON a~vbeln EQ c~vbeln AND
c~vposn EQ '000000'
INNER JOIN vbkd AS d
ON a~vbeln EQ d~vbeln
WHERE a~vkorg IN s_sorg AND
a~vkbur IN s_soff AND
a~vkgrp IN s_sgrp AND
a~auart IN s_dtyp AND
a~vbtyp EQ 'G' AND
a~vbeln IN s_cnum AND
a~kunnr IN s_cust AND
c~venddat IN s_endt AND
d~bstkd_m IN s_pnum.
IF sy-subrc NE 0 OR g_tab_cnt_details IS INITIAL.
MESSAGE i000 WITH text-004.
g_exit = 'X'.
EXIT.
ENDIF.
ENDFORM. " get_data
*& Form display_data
FORM display_data .
IF g_tab_cnt_details IS NOT INITIAL.
DELETE ADJACENT DUPLICATES FROM g_tab_cnt_details COMPARING ALL FIELDS.
PERFORM build_field_cat.
PERFORM call_alv.
ENDIF.
ENDFORM. " display_data
*& Form build_field_cat
FORM build_field_cat .
REFRESH g_tab_fieldcat.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'KUNNR' '15' text-010 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'NAME1' '30' text-024 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'VKORG' '10' text-011 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'VKBUR' '15' text-012 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'VKGRP' '15' text-015 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'BEZEI' '25' text-025 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'VBELN' '15' text-013 ' ' 'X' 'X'.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'BSTKD_M' '35' text-014 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'KTEXT' '40' text-023 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'VBEGDAT' '20' text-016 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'VENDDAT' '20' text-017 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'AUART' '18' text-018 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'ZZP_MFRNR' '20' text-028 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'MNF_DES' '30' text-030 ' ' ' ' ' '.
PERFORM fill_field_cat USING g_pos 'G_TAB_CNT_DETAILS' 'ZPROGRAM' '30' text-029 ' ' ' ' ' '.
ENDFORM. " build_field_cat
*& Form fill_field_cat
* text
FORM fill_field_cat USING u_pos TYPE any
value(u_001) TYPE any
value(u_002) TYPE any
value(u_003) TYPE any
u_text TYPE any
value(u_004) TYPE any
value(u_005) TYPE any
value(u_006) TYPE any.
u_pos = u_pos + 1.
g_fieldcat-col_pos = u_pos .
g_fieldcat-tabname = u_001.
g_fieldcat-fieldname = u_002.
g_fieldcat-outputlen = u_003.
g_fieldcat-reptext_ddic = u_text.
g_fieldcat-just = u_004.
g_fieldcat-hotspot = u_005.
g_fieldcat-emphasize = u_006.
APPEND g_fieldcat TO g_tab_fieldcat.
ENDFORM. " fill_field_cat
*& Form call_alv
FORM call_alv.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = g_tab_fieldcat
TABLES
t_outtab = g_tab_cnt_details
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " call_alv
*& Form post_data_report
FORM post_data_report .
IF p_fname IS NOT INITIAL.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_fname
filetype = 'DAT'
TABLES
data_tab = g_tab_data
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDFORM. " post_data_report
**& Form MOVE_DATA
FORM move_data .
IF g_tab_cnt_details IS NOT INITIAL.
MOVE: text-010 TO g_str_data-kunnr,
text-024 TO g_str_data-name1,
text-011 TO g_str_data-vkorg,
text-012 TO g_str_data-vkbur,
text-015 TO g_str_data-vkgrp,
text-025 TO g_str_data-bezei,
text-013 TO g_str_data-vbeln,
text-014 TO g_str_data-bstkd_m,
text-023 TO g_str_data-ktext,
text-016 TO g_str_data-vbegdat,
text-017 TO g_str_data-venddat,
text-018 TO g_str_data-auart,
text-028 TO g_str_data-zzp_mfrnr,
text-030 TO g_str_data-mnf_des,
text-029 TO g_str_data-zprogram.
APPEND g_str_data TO g_tab_data.
LOOP AT g_tab_cnt_details INTO g_wa_cnt_details.
MOVE: g_wa_cnt_details-kunnr TO g_str_data-kunnr,
g_wa_cnt_details-name1 TO g_str_data-name1,
g_wa_cnt_details-vkorg TO g_str_data-vkorg,
g_wa_cnt_details-vkbur TO g_str_data-vkbur,
g_wa_cnt_details-vkgrp TO g_str_data-vkgrp,
g_wa_cnt_details-bezei TO g_str_data-bezei,
g_wa_cnt_details-vbeln TO g_str_data-vbeln,
g_wa_cnt_details-bstkd_m TO g_str_data-bstkd_m,
g_wa_cnt_details-ktext TO g_str_data-ktext,
g_wa_cnt_details-vbegdat TO g_str_data-vbegdat,
g_wa_cnt_details-venddat TO g_str_data-venddat,
g_wa_cnt_details-auart TO g_str_data-auart,
g_wa_cnt_details-zzp_mfrnr TO g_str_data-zzp_mfrnr,
g_wa_cnt_details-mnf_des TO g_str_data-mnf_des,
g_wa_cnt_details-zprogram TO g_str_data-zprogram.
APPEND g_str_data TO g_tab_data.
CLEAR :g_str_data,g_wa_cnt_details.
ENDLOOP.
ENDIF.
ENDFORM. " MOVE_DATA
**& Form user_command
FORM user_command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield."#EC CALLED
READ TABLE g_tab_cnt_details INTO g_wa_cnt_details INDEX selfield-tabindex.
CHECK sy-subrc = 0.
CASE ucomm.
WHEN '&IC1'.
TRANSLATE selfield-sel_tab_field TO UPPER CASE.
CASE selfield-sel_tab_field.
WHEN 'G_TAB_CNT_DETAILS-VBELN'.
IF NOT g_wa_cnt_details-vbeln IS INITIAL.
SET PARAMETER ID 'KTN' FIELD g_wa_cnt_details-vbeln.
CALL TRANSACTION 'VA43' AND SKIP FIRST SCREEN .
ENDIF.
WHEN OTHERS.
MESSAGE w000(zsls_general) WITH text-027 .
EXIT.
ENDCASE.
ENDCASE.
ENDFORM. "user_command
*& Form get_descrip_for_sgrpcust
FORM get_descrip_for_sgrpcust .
IF g_tab_cnt_details[] IS NOT INITIAL.
SELECT kunnr name1
INTO CORRESPONDING FIELDS OF TABLE g_tab_cus_nam
FROM kna1
FOR ALL ENTRIES IN g_tab_cnt_details
WHERE kunnr = g_tab_cnt_details-kunnr.
DELETE ADJACENT DUPLICATES FROM g_tab_cus_nam COMPARING ALL FIELDS.
SELECT vkgrp bezei
INTO CORRESPONDING FIELDS OF TABLE g_tab_sgrp_nam
FROM tvgrt
FOR ALL ENTRIES IN g_tab_cnt_details
WHERE vkgrp = g_tab_cnt_details-vkgrp.
DELETE ADJACENT DUPLICATES FROM g_tab_sgrp_nam COMPARING ALL FIELDS.
ENDIF.
ENDFORM. " get_descrip_for_sgrpcust
**& Form get_class_details
FORM get_class_details .
DATA : l_sy_tabix TYPE sy-tabix.
SELECT vbap~vbeln
vbap~posnr
vbap~matnr
vbap~zzp_mfrnr
vbap~cuobj
INTO CORRESPONDING FIELDS OF TABLE g_tab_contract
FROM vbap
FOR ALL ENTRIES IN g_tab_cnt_details
WHERE vbap~vbeln = g_tab_cnt_details-vbeln.
IF g_tab_contract IS NOT INITIAL.
SORT g_tab_contract BY vbeln zzp_mfrnr.
DELETE ADJACENT DUPLICATES FROM g_tab_contract COMPARING vbeln zzp_mfrnr.
LOOP AT g_tab_contract INTO g_wa_contract.
l_sy_tabix = sy-tabix.
PERFORM get_config USING g_wa_contract-cuobj
CHANGING g_wa_contract-zprogram .
MODIFY g_tab_contract FROM g_wa_contract INDEX l_sy_tabix.
CLEAR : g_wa_contract.
ENDLOOP.
*---Moving the manufacturer details and program details
LOOP AT g_tab_cnt_details INTO g_wa_cnt_details.
l_sy_tabix = sy-tabix.
READ TABLE g_tab_contract INTO g_wa_contract WITH KEY vbeln = g_wa_cnt_details-vbeln.
IF sy-subrc = 0.
g_wa_cnt_details-zzp_mfrnr = g_wa_contract-zzp_mfrnr.
g_wa_cnt_details-zprogram = g_wa_contract-zprogram.
ENDIF.
MODIFY g_tab_cnt_details FROM g_wa_cnt_details INDEX l_sy_tabix.
ENDLOOP.
IF p_prg IS NOT INITIAL.
DELETE g_tab_cnt_details WHERE zprogram <> p_prg.
ENDIF.
IF p_mfnum IS NOT INITIAL.
DELETE g_tab_cnt_details WHERE zzp_mfrnr <> p_mfnum.
ENDIF.
ENDIF.
PERFORM move_manf_desc.
ENDFORM. " get_class_details
**& Form get_config
FORM get_config USING g_wa_contract-cuobj
CHANGING g_wa_contract-zprogram .
DATA : l_name(200),
l_tab_cfg TYPE ibco2_instance_tab2,
l_str_cfg TYPE ibco2_instance_rec2,
l_tab_values TYPE STANDARD TABLE OF ibco2_value_rec WITH HEADER LINE,
l_tab_get_values LIKE comw OCCURS 0 WITH HEADER LINE,
l_tab_features LIKE STANDARD TABLE OF klmerka,
l_str_chr_val LIKE clx2v,
l_tab_chr_val LIKE STANDARD TABLE OF clx2v,
l_atwtb TYPE atwtb.
CLEAR : l_tab_values,
l_name,
l_tab_get_values,
l_str_cfg.
REFRESH : l_tab_features,
l_tab_values,
l_tab_get_values,
l_tab_cfg.
CALL FUNCTION 'CUCB_GET_CONFIGURATION'
EXPORTING
instance = g_wa_contract-cuobj
IMPORTING
configuration = l_tab_cfg
EXCEPTIONS
invalid_instance = 1
instance_is_a_classification = 2
OTHERS = 3.
READ TABLE l_tab_cfg INTO l_str_cfg INDEX 1.
PERFORM get_class_num USING l_str_cfg-type_of-object_type
l_str_cfg-type_of-object_key.
CHECK g_rc EQ 0.
CALL FUNCTION 'CLME_FEATURE_ATTR_OF_CLASS'
EXPORTING
class = g_wa_contract-classnum
classtype = con_klart
TABLES
tfeatures = l_tab_features
tvalues = l_tab_chr_val.
READ TABLE l_tab_cfg INTO l_str_cfg INDEX 1.
IF sy-subrc = 0.
l_tab_values[] = l_str_cfg-values[].
SORT l_tab_values BY atinn.
LOOP AT l_tab_values.
l_tab_get_values-atinn = l_tab_values-atinn.
l_tab_get_values-atwrt = l_tab_values-atwrt.
READ TABLE l_tab_chr_val INTO l_str_chr_val
WITH KEY atinn = l_tab_values-atinn
atwrt = l_tab_values-atwrt.
IF sy-subrc = 0.
l_atwtb = l_str_chr_val-atwtb.
ELSE.
l_atwtb = l_tab_values-atwrt.
ENDIF.
MOVE l_tab_values-atinn TO l_name.
PERFORM conversion_exit_char CHANGING l_name.
CASE l_name.
WHEN con_program.
MOVE l_atwtb TO g_wa_contract-zprogram.
ENDCASE.
ENDLOOP.
ENDIF.
ENDFORM. " get_config
**& Form get_class_num
** text
** --> p1 text
** <-- p2 text
FORM get_class_num USING l_str_cfg-type_of-object_type
l_str_cfg-type_of-object_key.
*--Clear all variables & tables
DATA : l_alloclist TYPE bapi1003_alloc_list OCCURS 0 WITH HEADER LINE,
l_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
clobjectkeyin LIKE bapi1003_key-object_guid,
d_obtab LIKE tcla-obtab.
CLEAR : l_alloclist,
l_return,
clobjectkeyin,
d_obtab,
g_rc .
REFRESH :l_alloclist,
l_return.
*get the db table for class type 300 to be used in different places.
*get the object key number for the material number
d_obtab = l_str_cfg-type_of-object_type.
SELECT SINGLE cuobj FROM inob INTO clobjectkeyin
WHERE klart = con_klart AND
objek = l_str_cfg-type_of-object_key AND
obtab = d_obtab.
IF sy-subrc EQ 0.
*get the class name and type for the material no.
CALL FUNCTION 'BAPI_OBJCL_GETCLASSES_KEY'
EXPORTING
clobjectkeyin = clobjectkeyin
keydate = sy-datum
language = sy-langu
TABLES
alloclist = l_alloclist
return = l_return.
READ TABLE l_alloclist INDEX 1.
MOVE l_alloclist-classnum TO g_wa_contract-classnum.
ELSE.
g_rc = 4.
ENDIF.
ENDFORM. " get_class_num
**& Form conversion_exit_char
FORM conversion_exit_char CHANGING c_name.
CALL FUNCTION 'CONVERSION_EXIT_ATINN_OUTPUT'
EXPORTING
input = c_name
IMPORTING
output = c_name.
ENDFORM. " conversion_exit_char
*& Form get_prg_mfr_dtls
* text
* --> p1 text
* <-- p2 text
FORM get_prg_mfr_dtls .
*---Getting the Description for Customer and Sales group
PERFORM get_descrip_for_sgrpcust.
PERFORM get_class_details.
ENDFORM. " get_prg_mfr_dtls
*& Form move_manf_desc
* text
* --> p1 text
* <-- p2 text
FORM move_manf_desc .
DATA l_sy_tabix TYPE sy-tabix.
SELECT lifnr name1
INTO CORRESPONDING FIELDS OF TABLE g_tab_manf_nam
FROM lfa1
FOR ALL ENTRIES IN g_tab_cnt_details
WHERE lifnr = g_tab_cnt_details-zzp_mfrnr.
DELETE ADJACENT DUPLICATES FROM g_tab_manf_nam COMPARING ALL FIELDS.
LOOP AT g_tab_cnt_details INTO g_wa_cnt_details.
l_sy_tabix = sy-tabix.
READ TABLE g_tab_cus_nam INTO g_str_cus_nam WITH KEY kunnr = g_wa_cnt_details-kunnr.
IF sy-subrc = 0.
MOVE g_str_cus_nam-name1 TO g_wa_cnt_details-name1.
ENDIF.
READ TABLE g_tab_sgrp_nam INTO g_str_sgrp_nam WITH KEY vkgrp = g_wa_cnt_details-vkgrp.
IF sy-subrc = 0.
MOVE g_str_sgrp_nam-bezei TO g_wa_cnt_details-bezei.
ENDIF.
READ TABLE g_tab_manf_nam INTO g_str_manf_nam WITH KEY lifnr = g_wa_cnt_details-zzp_mfrnr.
IF sy-subrc = 0.
MOVE g_str_manf_nam-name1 TO g_wa_cnt_details-mnf_des.
ENDIF.
MODIFY g_tab_cnt_details FROM g_wa_cnt_details INDEX l_sy_tabix.
CLEAR: g_wa_cnt_details.
ENDLOOP.
ENDFORM. " move_manf_desc
thx
pavan
*pls mark for helpful ans -
Single contract details report in Reporting services taking approx 40 secon
Component name: Single contract details report
Application: online application
Problem: Single contract details report in Reporting services taking approx.40 seconds to show the report
Report is look like below screen shot :
The report is designed in order to show as much information as possible for an agreement. In order to present the information in a clearly arranged manner the data is clustered and displayed on separate report tabs. The data clustering is as follows:
u2022 Header Information
u2022 Overall Contract Details
u2022 Vehicle Details
u2022 Driver Details
u2022 Mileage Details
u2022 Maintenance/Services Details
u2022 Tyres Details
u2022 Fuel/Oil Details
u2022 Invoices Details
u2022 Contract History
Single Contract Details report is a very huge report it is split into tabs. Navigation between these tabs is possible with a menu bar at the top of the report. Each tab has its own name and located there as a link. By clicking on it the tab is shown.
This report is a special type of report name as drill down report. Due to the Crystal limitation that a report can only contain one sub report, AOL used java component to call single contract report
Figure: Drill down Report
This is the only report of this type in AOL which is using the drill down functionality in crystal and now we are investigating the performance issue for this report, we have checked all possible area (java, crystal report) where we can improve the performance for this report.
We thought if we can replace the java component with crystal and directly crystal report will connect to single contract report using hyperlink, it may increase the performance but due to the Crystal limitation that a report can only contain one sub report we are not able to do this approach.HI Piroz,
Im actually looking for the same thing...
How can I create a report were I can see if a contract has been changed or cancelled? I use VA45 to see contracts, I would like to run a report to see if there has been any changes on the contracts of if they have been cancelled, thank you soooooo much if you can help me -
Performance tuning of this report
Hello friends iam attaching my report give the performance tuning for this report to avoid nested endloops. how to do without using nested endloops.
give me the reply urgent.
REPORT ZDEMO9 NO STANDARD PAGE HEADING
LINE-SIZE 250
LINE-COUNT 22(3). .
TABLES DECLARATION *
TABLES : MARA, "general material data
MAKT, "material description
MARC, "plant data for material
VBAP, "sales document for item data
EKKO, "purchasing document header
EKPO, "purchasing document item
KNA1. "customer master details
INTERNAL TABLE DECLARATION *
DATA : BEGIN OF T_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MEINS LIKE MARA-MEINS,
END OF T_MARA.
DATA : BEGIN OF T_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
SPRAS LIKE MAKT-SPRAS,
END OF T_MAKT.
DATA : BEGIN OF T_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
END OF T_MARC.
DATA : BEGIN OF T_KNA1 OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
LAND1 LIKE KNA1-LAND1,
END OF T_KNA1.
DATA : BEGIN OF T_VBAP OCCURS 0,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
MATKL LIKE VBAP-MATKL,
VBELN LIKE VBAP-VBELN,
END OF T_VBAP.
DATA : BEGIN OF T_EKPO OCCURS 0,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
BUKRS LIKE EKPO-BUKRS,
WERKS LIKE EKPO-WERKS,
LGORT LIKE EKPO-LGORT,
MATNR LIKE EKPO-MATNR,
MANDT LIKE EKPO-MANDT,
END OF T_EKPO.
FINAL INTERNAL TABLE *
DATA : BEGIN OF T_FINAL OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MEINS LIKE MARA-MEINS,
WERKS LIKE MARC-WERKS,
MAKTX LIKE MAKT-MAKTX,
SPRAS LIKE MAKT-SPRAS,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATKL LIKE VBAP-MATKL,
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
BUKRS LIKE EKPO-BUKRS,
KUNNR LIKE KNA1-KUNNR,
LAND1 LIKE KNA1-LAND1,
NAME1 LIKE KNA1-NAME1,
LGORT LIKE EKPO-LGORT,
END OF T_FINAL.
*DATA: BEGIN OF V_matnr OCCURS 0,
matnr LIKE mara-matnr,
END OF t_matnr.
data:
a(32) type c.
a = 'IBT000000000000000001000000000000000050'.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_BUKRS FOR EKPO-BUKRS,
S_KUNNR FOR KNA1-KUNNR,
S_WERKS FOR MARC-WERKS,
S_MATNR FOR MARA-MATNR obligatory.
SELECTION-SCREEN END OF BLOCK B1.
START OF SELECTION *
START-OF-SELECTION.
SELECT MATNR mtart meins
FROM MARA
INTO CORRESPONDING FIELDS OF TABLE T_MARA
WHERE MATNR IN S_MATNR.
SELECT MATNR WERKS
FROM MARC
INTO CORRESPONDING FIELDS OF TABLE T_MARC
FOR ALL ENTRIES IN T_MARA
WHERE MATNR = T_MARA-MATNR
and werks in s_werks.
select matnr maktx spras
from makt
into corresponding fields of table t_makt
for all entries in t_mara
where matnr = t_mara-matnr
and spras = sy-langu.
select matnr posnr matkl vbeln
from vbap
into corresponding fields of table t_vbap
for all entries in t_mara
where matnr = t_mara-matnr.
select matnr werks bukrs ebeln ebelp lgort
from ekpo
into corresponding fields of table t_ekpo
for all entries in t_mara
where matnr = t_mara-matnr
and werks in s_werks.
LOOP AT T_MARA.
MOVE T_MARA-matnr TO T_FINAL-matnr.
move t_mara-mtart to t_final-mtart.
move t_mara-meins to t_final-meins.
loop at t_marc where matnr eq t_mara-matnr.
move t_marc-werks to t_final-werks.
loop at t_makt.
move t_makt-maktx to t_final-maktx.
move t_makt-spras to t_final-spras.
loop at t_vbap.
move t_vbap-posnr to t_final-posnr.
move t_vbap-matkl to t_final-matkl.
move t_vbap-vbeln to t_final-vbeln.
loop at t_ekpo.
move t_ekpo-bukrs to t_final-bukrs.
move t_ekpo-ebeln to t_final-ebeln.
move t_ekpo-ebelp to t_final-ebelp.
move t_ekpo-lgort to t_final-lgort.
append t_final.
endloop.
endloop.
endloop.
endloop.
endloop.
SELECT werks KUNNR LAND1 NAME1
INTO CORRESPONDING FIELDS OF TABLE T_KNA1
FROM KNA1.
WHERE WERKS in s_werks.
loop at t_kna1.
move t_kna1-kunnr to t_final-kunnr.
move t_kna1-name1 to t_final-name1.
move t_kna1-land1 to t_final-land1.
append t_final.
endloop.
"endloop.
loop at t_final.
write : 4 t_final-matnr,
20 t_final-mtart,
28 t_final-meins,
46 t_final-werks,
58 t_final-maktx,
71 t_final-spras,
78 t_final-posnr,
100 t_final-matkl,
115 t_final-vbeln,
130 t_final-kunnr,
142 t_final-name1,
156 t_final-land1,
168 t_final-bukrs,
190 t_final-ebeln,
205 t_final-ebelp,
208 t_final-lgort.
endloop.
TOP-OF-PAGE *
top-of-page.
uline.
write : /60 'G E N E R A L D E T A I L S' COLOR 2 INVERSE OFF.
ULINE.
write :/ SY-VLINE, 'MATERIAL' COLOR 4, "12 SY-VLINE,
13 SY-VLINE, 'IND SECTOR',
28 SY-VLINE, 'UNITS',
43 SY-VLINE, 'PLANT',
55 SY-VLINE, 'MAT DESC',
68 SY-VLINE, 'LANGU',
70 SY-VLINE, 'SALES DOC ITEM',
95 SY-VLINE, 'MAT GROUP',
110 SY-VLINE, 'SALES DOC',
125 SY-VLINE, 'CUST ID',
140 SY-VLINE, 'NAME',
155 SY-VLINE, 'COUNTRY',
165 sy-vline, 'company code',
205 sy-vline, 'storge loc'.*& Report YTESTCHA *
REPORT ytestcha NO STANDARD PAGE HEADING
LINE-SIZE 250
LINE-COUNT 22(3). .
TABLES DECLARATION *
TABLES : mara, "general material data
makt, "material description
marc, "plant data for material
vbap, "sales document for item data
ekko, "purchasing document header
ekpo, "purchasing document item
kna1. "customer master details
INTERNAL TABLE DECLARATION *
*DECLARE TYPES FIRST AND THE INTERNAL TABLES
*DONT USE MATNR LIKE MARA-MATNR ,INSTEAD USE MARA TYPE MATNR WHERE MATNR
*IS THE DATA ELEMENT FOR FIELD MATNR.
TYPES: BEGIN OF ty_mara,
matnr TYPE matnr,
mtart TYPE mtart,
meins TYPE meins,
kunnr TYPE wettb,
END OF ty_mara.
TYPES: BEGIN OF ty_makt,
matnr TYPE matnr,
maktx TYPE maktx,
spras TYPE spras,
END OF ty_makt.
TYPES: BEGIN OF ty_marc,
matnr TYPE matnr,
werks TYPE werks_d,
END OF ty_marc.
TYPES : BEGIN OF ty_kna1,
kunnr TYPE kunnr,
name1 TYPE name1_gp,
land1 TYPE land1_gp,
END OF ty_kna1.
TYPES: BEGIN OF ty_vbap,
matnr TYPE matnr,
posnr TYPE posnr_va,
matkl TYPE matkl,
vbeln TYPE vbeln_va,
END OF ty_vbap.
TYPES: BEGIN OF ty_ekpo,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
bukrs TYPE bukrs,
werks TYPE werks_d,
lgort TYPE lgort_d,
matnr TYPE matnr,
mandt TYPE mandt,
END OF ty_ekpo.
DATA:t_mara TYPE TABLE OF ty_mara WITH HEADER LINE,
t_makt TYPE TABLE OF ty_makt WITH HEADER LINE,
t_marc TYPE TABLE OF ty_marc WITH HEADER LINE,
t_kna1 TYPE TABLE OF ty_kna1 WITH HEADER LINE,
t_vbap TYPE TABLE OF ty_vbap WITH HEADER LINE,
t_ekpo TYPE TABLE OF ty_ekpo WITH HEADER LINE.
FINAL INTERNAL TABLE *
TYPES: BEGIN OF ty_final,
matnr TYPE matnr,
mtart TYPE mtart,
meins TYPE meins,
werks TYPE werks_d,
maktx TYPE maktx,
spras TYPE spras,
vbeln TYPE vbeln_va,
posnr TYPE posnr_va,
matkl TYPE matkl,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
bukrs TYPE bukrs,
kunnr TYPE kunnr,
land1 TYPE land1_gp,
name1 TYPE name1_gp,
lgort TYPE lgort_d,
END OF ty_final.
DATA : t_final TYPE TABLE OF ty_final WITH HEADER LINE.
*DATA: BEGIN OF V_matnr OCCURS 0,
matnr LIKE mara-matnr,
END OF t_matnr.
DATA:
a(32) TYPE c.
a = 'IBT000000000000000001000000000000000050'.
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_bukrs FOR ekpo-bukrs,
s_kunnr FOR kna1-kunnr,
s_werks FOR marc-werks,
s_matnr FOR mara-matnr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
START OF SELECTION *
START-OF-SELECTION.
*USE SUBROUTINES
*get data
PERFORM get_data.
*populate final table
PERFORM populate_final_table.
END-OF-SELECTION.
*display output
PERFORM display_output.
TOP-OF-PAGE *
TOP-OF-PAGE.
ULINE.
WRITE : /60 'G E N E R A L D E T A I L S' COLOR 2 INVERSE OFF.
ULINE.
WRITE :/ sy-vline, 'MATERIAL' COLOR 4, "12 SY-VLINE,
13 sy-vline, 'IND SECTOR',
28 sy-vline, 'UNITS',
43 sy-vline, 'PLANT',
55 sy-vline, 'MAT DESC',
68 sy-vline, 'LANGU',
70 sy-vline, 'SALES DOC ITEM',
95 sy-vline, 'MAT GROUP',
110 sy-vline, 'SALES DOC',
125 sy-vline, 'CUST ID',
140 sy-vline, 'NAME',
155 sy-vline, 'COUNTRY',
165 sy-vline, 'company code',
205 sy-vline, 'storge loc'.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
*TRY TO CLEAR AND REFRESH TABLES BEFORE SELECT
FORM get_data .
CLEAR t_mara.
REFRESH t_mara.
SELECT matnr
mtart
meins
kunnr
FROM mara
INTO TABLE t_mara
WHERE matnr IN s_matnr.
IF NOT t_mara[] IS INITIAL.
CLEAR t_marc.
REFRESH t_marc.
SELECT matnr
werks
FROM marc
INTO TABLE t_marc
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr
AND werks IN s_werks.
CLEAR t_makt.
REFRESH t_makt.
SELECT matnr
maktx
spras
FROM makt
INTO TABLE t_makt
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr
AND spras = sy-langu.
CLEAR t_vbap.
REFRESH t_vbap.
SELECT matnr
posnr
matkl
vbeln
FROM vbap
INTO TABLE t_vbap
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr.
CLEAR t_ekpo.
REFRESH t_ekpo.
SELECT ebeln
ebelp
bukrs
werks
lgort
matnr
mandt
FROM ekpo
INTO TABLE t_ekpo
FOR ALL ENTRIES IN t_mara
WHERE matnr = t_mara-matnr
AND werks IN s_werks.
ENDIF.
CLEAR t_kna1.
REFRESH t_kna1.
SELECT kunnr
land1
name1
INTO TABLE t_kna1
FROM kna1.
WHERE WERKS in s_werks.
ENDFORM. " GET_DATA
*& Form POPULATE_FINAL_TABLE
text
--> p1 text
<-- p2 text
FORM populate_final_table .
*AVOID LOOPS AND TRY TO USE READ
CLEAR t_final.
REFRESH t_final.
LOOP AT t_mara.
MOVE t_mara-matnr TO t_final-matnr.
MOVE t_mara-mtart TO t_final-mtart.
MOVE t_mara-meins TO t_final-meins.
READ TABLE t_marc WITH KEY matnr = t_mara-matnr.
MOVE t_marc-werks TO t_final-werks.
READ TABLE t_makt WITH KEY matnr = t_mara-matnr.
MOVE t_makt-maktx TO t_final-maktx.
MOVE t_makt-spras TO t_final-spras.
READ TABLE t_vbap WITH KEY matnr = t_mara-matnr.
MOVE t_vbap-posnr TO t_final-posnr.
MOVE t_vbap-matkl TO t_final-matkl.
MOVE t_vbap-vbeln TO t_final-vbeln.
READ TABLE t_ekpo WITH KEY matnr = t_mara-matnr.
MOVE t_ekpo-bukrs TO t_final-bukrs.
MOVE t_ekpo-ebeln TO t_final-ebeln.
MOVE t_ekpo-ebelp TO t_final-ebelp.
MOVE t_ekpo-lgort TO t_final-lgort.
READ TABLE t_kna1 WITH KEY kunnr = t_mara-kunnr.
MOVE t_kna1-kunnr TO t_final-kunnr.
MOVE t_kna1-name1 TO t_final-name1.
MOVE t_kna1-land1 TO t_final-land1.
APPEND t_final.
CLEAR :t_final,t_mara,t_marc,t_makt,t_ekpo,t_vbap.
ENDLOOP.
ENDFORM. " POPULATE_FINAL_TABLE
*& Form DISPLAY_OUTPUT
text
--> p1 text
<-- p2 text
FORM display_output .
LOOP AT t_final.
WRITE : 4 t_final-matnr,
20 t_final-mtart,
28 t_final-meins,
46 t_final-werks,
58 t_final-maktx,
71 t_final-spras,
78 t_final-posnr,
100 t_final-matkl,
115 t_final-vbeln,
130 t_final-kunnr,
142 t_final-name1,
156 t_final-land1,
168 t_final-bukrs,
190 t_final-ebeln,
205 t_final-ebelp,
208 t_final-lgort.
ENDLOOP.
ENDFORM. " DISPLAY_OUTPUT -
Hi Seniors,
Please help me with this issue........i have to develope a New report Vendor balance Reconcillation ......Using the Standard report S_ALR_87012082 vendor balances in local currency.....it should be same like this Standard report but this Report is not Designed to give Line Items Because it has Picked up the Data only from few tables like LFA1 LFB1 LFC3.....which give Direct Balances in these tables......But i have Developed a report to Some Extent....But Finding it Difficult in Adding a Special GL Date which is Reflecting in the LFC3 Table....I have to Keep a Check Box Special GL balances in the Selection-Screen when when ever i select Special GL Balances indicator ....Date from LFC3
should be Selected and Addred to the Final in the Internal Table....I have Written a program .......Based on GSBER And LIFNR SUBTOTALS.....I have to Add this New check box in this Slection-Screen.....this report should be same like this Standard Report....S_ALR_87012082...the Program for this Report is RFKSLD00...please tel me the logic or help me with the Modification my below Report.....If i am not clear please reply me back...
waiting for your replys...
Thank you...
*& Report ZVENDOR_BALANCES
REPORT ZMM_PO_CHECKLIST.
TYPE-POOLS : SLIS.
DATA: it_fcat TYPE slis_t_fieldcat_alv,
wa_fcat LIKE LINE OF it_fcat,
lt_top_of_page TYPE slis_t_listheader,
ls_layout TYPE slis_layout_alv,
gt_events TYPE slis_t_event.
TYPES : BEGIN OF TY_BSEG,
LIFNR TYPE BSEG-LIFNR,
BUKRS TYPE BSEG-BUKRS,
BELNR TYPE BSEG-BELNR,
GJAHR TYPE BSEG-GJAHR,
SHKZG TYPE BSEG-SHKZG,
GSBER TYPE BSEG-GSBER,
DMBTR TYPE BSEG-DMBTR,
WRBTR TYPE BSEG-WRBTR,
SGTXT TYPE BSEG-SGTXT,
buzei TYPE bseg-buzei,
buzid TYPE bseg-buzid,
augdt TYPE bseg-augdt,
augcp TYPE bseg-augcp,
augbl TYPE bseg-augbl,
bschl TYPE bseg-bschl,
koart TYPE bseg-koart,
umskz TYPE bseg-umskz,
zuonr TYPE bseg-zuonr,
saknr TYPE bseg-saknr,
hkont TYPE bseg-hkont,
END OF TY_BSEG,
BEGIN OF TY_LFA1,
LIFNR TYPE LFA1-LIFNR,
LAND1 TYPE LFA1-LAND1,
NAME1 TYPE LFA1-NAME1,
END OF TY_LFA1,
BEGIN OF TY_LFC1,
LIFNR TYPE LFC1-LIFNR,
BUKRS TYPE LFC1-BUKRS,
GJAHR TYPE LFC1-GJAHR,
UMSAV TYPE LFC1-UMSAV,
END OF TY_LFC1,
BEGIN OF TY_BKPF,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLart type bkpf-blart,
BUDAT TYPE BKPF-BUDAT,
bldat TYPE bkpf-bldat,
monat TYPE bkpf-monat,
usnam TYPE bkpf-usnam,
xblnr TYPE bkpf-xblnr,
END OF TY_BKPF,
BEGIN OF it_bsak,
bukrs TYPE bsak-bukrs,
lifnr TYPE bsak-lifnr,
umskz TYPE bsak-umskz,
augdt TYPE bsak-augdt,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsak-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsak-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
monat TYPE bsak-monat,
bschl TYPE bsak-bschl,
shkzg TYPE bsak-shkzg,
gsber TYPE bsak-gsber,
dmbtr TYPE bsak-dmbtr,
wrbtr TYPE bsak-wrbtr,
sgtxt TYPE bsak-sgtxt,
saknr TYPE bsak-saknr,
hkont TYPE bsak-hkont,
END OF it_bsak,
BEGIN OF it_skat,
spras TYPE skat-spras,
saknr TYPE skat-saknr,
txt20 TYPE skat-txt20,
txt50 TYPE skat-txt50,
END OF it_skat,
BEGIN OF TY_ITAB,
GSBER TYPE BSEG-GSBER,
LIFNR TYPE BSEG-LIFNR,
BUKRS TYPE BSEG-BUKRS,
BELNR TYPE BSEG-BELNR,
GJAHR TYPE BSEG-GJAHR,
SHKZG TYPE BSEG-SHKZG,
GSBER TYPE BSEG-GSBER,
DMBTR TYPE BSEG-DMBTR,
WRBTR TYPE BSEG-WRBTR,
SGTXT TYPE BSEG-SGTXT,
buzei TYPE bseg-buzei,
buzid TYPE bseg-buzid,
augdt TYPE bseg-augdt,
augcp TYPE bseg-augcp,
augbl TYPE bseg-augbl,
bschl TYPE bseg-bschl,
koart TYPE bseg-koart,
umskz TYPE bseg-umskz,
zuonr TYPE bseg-zuonr,
saknr TYPE bseg-saknr,
hkont TYPE bseg-hkont,
LIFNR TYPE LFA1-LIFNR,
LAND1 TYPE LFA1-LAND1,
NAME1 TYPE LFA1-NAME1,
DMBTR_H TYPE BSEG-WRBTR,
DMBTR_S TYPE BSEG-WRBTR,
DH TYPE BSEG-WRBTR,
DS TYPE BSEG-WRBTR,
HS TYPE BSEG-WRBTR,
BAL TYPE BSEG-WRBTR,
FLAG TYPE C,
LIFNR TYPE LFC1-LIFNR,
BUKRS TYPE LFC1-BUKRS,
GJAHR TYPE LFC1-GJAHR,
UMSAV TYPE LFC1-UMSAV,
UM(15) TYPE P DECIMALS 2,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLart type bkpf-blart,
BUDAT TYPE BKPF-BUDAT,
bldat TYPE bkpf-bldat,
monat TYPE bkpf-monat,
usnam TYPE bkpf-usnam,
xblnr TYPE bkpf-xblnr,
spras TYPE skat-spras,
saknr TYPE skat-saknr,
txt20 TYPE skat-txt20,
txt50 TYPE skat-txt50,
LINE_COLOR(4) TYPE C,
LINE_CTR(4) TYPE C,
END OF TY_ITAB,
BEGIN OF TY_TEMP,
LIFNR TYPE BSEG-LIFNR,
GSBER TYPE BSEG-GSBER,
BUKRS TYPE BSEG-BUKRS,
BELNR TYPE BSEG-BELNR,
GJAHR TYPE BSEG-GJAHR,
SHKZG TYPE BSEG-SHKZG,
GSBER TYPE BSEG-GSBER,
DMBTR TYPE BSEG-DMBTR,
WRBTR TYPE BSEG-WRBTR,
SGTXT TYPE BSEG-SGTXT,
buzei TYPE bseg-buzei,
buzid TYPE bseg-buzid,
augdt TYPE bseg-augdt,
augcp TYPE bseg-augcp,
augbl TYPE bseg-augbl,
bschl TYPE bseg-bschl,
koart TYPE bseg-koart,
umskz TYPE bseg-umskz,
zuonr TYPE bseg-zuonr,
saknr TYPE bseg-saknr,
hkont TYPE bseg-hkont,
LIFNR TYPE LFA1-LIFNR,
LAND1 TYPE LFA1-LAND1,
NAME1 TYPE LFA1-NAME1,
LIFNR TYPE LFC1-LIFNR,
BUKRS TYPE LFC1-BUKRS,
GJAHR TYPE LFC1-GJAHR,
UMSAV TYPE LFC1-UMSAV,
DMBTR_H TYPE BSEG-WRBTR,
DMBTR_S TYPE BSEG-WRBTR,
HS TYPE BSEG-WRBTR,
BAL TYPE BSEG-WRBTR,
FLAG TYPE C,
FLAG TYPE C,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLart type bkpf-blart,
BUDAT TYPE BKPF-BUDAT,
bldat TYPE bkpf-bldat,
monat TYPE bkpf-monat,
usnam TYPE bkpf-usnam,
xblnr TYPE bkpf-xblnr,
bukrs TYPE bsak-bukrs,
lifnr TYPE bsak-lifnr,
umskz TYPE bsak-umskz,
augdt TYPE bsak-augdt,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsak-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsak-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
monat TYPE bsak-monat,
bschl TYPE bsak-bschl,
shkzg TYPE bsak-shkzg,
gsber TYPE bsak-gsber,
dmbtr TYPE bsak-dmbtr,
wrbtr TYPE bsak-wrbtr,
sgtxt TYPE bsak-sgtxt,
saknr TYPE bsak-saknr,
hkont TYPE bsak-hkont,
spras TYPE skat-spras,
saknr TYPE skat-saknr,
txt20 TYPE skat-txt20,
txt50 TYPE skat-txt50,
LINE_COLOR(4) TYPE C,
LINE_CTR(4) TYPE C,
END OF TY_TEMP.
DATA : IT_BSEG TYPE STANDARD TABLE OF TY_BSEG WITH HEADER LINE,
IT_LFA1 TYPE STANDARD TABLE OF TY_LFA1 WITH HEADER LINE,
IT_LFC1 TYPE STANDARD TABLE OF TY_LFC1 WITH HEADER LINE,
IT_BKPF TYPE STANDARD TABLE OF TY_BKPF WITH HEADER LINE,
IT_BSIK TYPE STANDARD TABLE OF TY_BSIK WITH HEADER LINE,
IT_BSAK TYPE STANDARD TABLE OF TY_BSAK WITH HEADER LINE,
IT_BSIP TYPE STANDARD TABLE OF TY_BSIP WITH HEADER LINE,
IT_SKAT TYPE STANDARD TABLE OF IT_SKAT WITH HEADER LINE,
IT_ITAB TYPE STANDARD TABLE OF TY_ITAB WITH HEADER LINE,
IT_TEMP TYPE STANDARD TABLE OF TY_TEMP WITH HEADER LINE.
TABLES : BSEG, LFA1, LFC1, BKPF ,SKAT.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE T001.
SELECT-OPTIONS: Vendor FOR BSEG-LIFNR OBLIGATORY.
PARAMETERS : CoCd LIKE BSEG-BUKRS OBLIGATORY.
PARAMETERS : Fiscal LIKE BSEG-GJAHR OBLIGATORY.
SELECT-OPTIONS : Period FOR BKPF-MONAT .
*SELECT-OPTIONS : b_monate for rfsdo-allgbmon "Berichtsperioden
no-extension,
*SELECT-OPTIONS: SO_LIFNR FOR BSEG-LIFNR.
SO_BELNR FOR BSEG-BELNR.
SELECTION-SCREEN END OF BLOCK B1.
PERFORM DATA_RETRIVE.
*PERFORM SUB_MOVE_DATA.
**PERFORM SUB_FETCH_EXTRA_DATA.
**PERFORM SUB_MOVE_EXTRA_DATA.
PERFORM SUB_CALC.
PERFORM SUB_FIELDCAT.
PERFORM SUB_DISPLAY.
*& Form DATA_RETRIVE
text
--> p1 text
<-- p2 text
form DATA_RETRIVE .
SELECT LIFNR BUKRS BELNR GJAHR SHKZG GSBER DMBTR WRBTR SGTXT BUZEI
BUZID AUGDT AUGCP AUGBL BSCHL KOART UMSKZ ZUONR SAKNR HKONT
FROM BSEG INTO TABLE IT_BSEG
WHERE LIFNR IN vendor AND BUKRS = CoCd AND GJAHR = Fiscal.
IF NOT IT_BSEG[] IS INITIAL.
SELECT LIFNR LAND1 NAME1
FROM LFA1 INTO TABLE IT_LFA1 FOR ALL ENTRIES IN IT_BSEG
WHERE LIFNR = IT_BSEG-LIFNR.
ENDIF.
IF NOT IT_BSEG[] IS INITIAL.
SELECT LIFNR BUKRS GJAHR UMSAV
FROM LFC1 INTO TABLE IT_LFC1 FOR ALL ENTRIES IN IT_BSEG
WHERE LIFNR = IT_BSEG-LIFNR AND BUKRS = IT_BSEG-BUKRS AND GJAHR = IT_BSEG-GJAHR.
ENDIF.
IF NOT IT_BSEG[] IS INITIAL.
SELECT BUKRS BELNR GJAHR BLART BUDAT BLDAT MONAT USNAM XBLNR
FROM BKPF INTO TABLE IT_BKPF FOR ALL ENTRIES IN IT_BSEG
WHERE MONAT IN Period AND BUKRS = IT_BSEG-BUKRS AND GJAHR = IT_BSEG-GJAHR AND BELNR = IT_BSEG-BELNR.
ENDIF.
LOOP AT IT_BSEG.
IT_ITAB-LIFNR = IT_BSEG-LIFNR.
IT_ITAB-BUKRS = IT_BSEG-BUKRS.
IT_ITAB-BELNR = IT_BSEG-BELNR.
IT_ITAB-GJAHR = IT_BSEG-GJAHR.
IT_ITAB-SHKZG = IT_BSEG-SHKZG.
IT_ITAB-GSBER = IT_BSEG-GSBER.
IT_ITAB-DMBTR = IT_BSEG-DMBTR.
IT_ITAB-WRBTR = IT_BSEG-WRBTR.
IT_ITAB-SGTXT = IT_BSEG-SGTXT.
IT_ITAB-BUZEI = IT_BSEG-BUZEI.
IT_ITAB-BUZID = IT_BSEG-BUZID.
IT_ITAB-AUGDT = IT_BSEG-AUGDT.
IT_ITAB-AUGCP = IT_BSEG-AUGCP.
IT_ITAB-AUGBL = IT_BSEG-AUGBL.
IT_ITAB-BSCHL = IT_BSEG-BSCHL.
IT_ITAB-KOART = IT_BSEG-KOART.
IT_ITAB-UMSKZ = IT_BSEG-UMSKZ.
IT_ITAB-ZUONR = IT_BSEG-ZUONR.
IT_ITAB-SAKNR = IT_BSEG-SAKNR.
IT_ITAB-HKONT = IT_BSEG-HKONT.
READ TABLE IT_LFA1 WITH KEY LIFNR = IT_ITAB-LIFNR.
IF SY-SUBRC = 0.
IT_ITAB-LAND1 = IT_LFA1-LAND1.
IT_ITAB-NAME1 = IT_LFA1-NAME1.
ENDIF.
READ TABLE IT_LFC1 WITH KEY LIFNR = IT_ITAB-LIFNR
BUKRS = IT_ITAB-BUKRS
GJAHR = IT_ITAB-GJAHR
BINARY SEARCH.
IF SY-SUBRC = 0.
IT_ITAB-UMSAV = IT_LFC1-UMSAV.
ENDIF.
READ TABLE IT_BKPF WITH KEY BUKRS = IT_ITAB-BUKRS
BELNR = IT_ITAB-BELNR
GJAHR = IT_ITAB-GJAHR.
IF SY-SUBRC = 0.
IT_ITAB-BLART = IT_BKPF-BLART.
IT_ITAB-BUDAT = IT_BKPF-BUDAT.
IT_ITAB-BLDAT = IT_BKPF-BLDAT.
IT_ITAB-MONAT = IT_BKPF-MONAT.
IT_ITAB-USNAM = IT_BKPF-USNAM.
IT_ITAB-XBLNR = IT_BKPF-XBLNR.
ENDIF.
APPEND IT_ITAB.
CLEAR IT_ITAB.
ENDLOOP.
endform. " DATA_RETRIVE
*& Form SUB_CALC
text
--> p1 text
<-- p2 text
form SUB_CALC .
*SORT IT_ITAB BY LIFNR GSBER GJAHR.
*LOOP AT IT_ITAB.
*IF IT_ITAB-SHKZG = 'S'.
IT_ITAB-DMBTR = IT_ITAB-DMBTR * ( -1 ).
*ENDIF.
*CLEAR IT_ITAB-DMBTR_S.
*MODIFY IT_ITAB.
*ENDLOOP.
*LOOP AT IT_ITAB.
*IT_ITAB-BAL = IT_ITAB-UMSAV + IT_ITAB-DMBTR.
*MODIFY IT_ITAB.
*CLEAR IT_ITAB.
*ENDLOOP.
*LOOP AT IT_ITAB.
IF IT_ITAB-SHKZG = 'S'.
IT_ITAB-DMBTR = IT_ITAB-DMBTR * ( -1 ).
ENDIF.
MODIFY IT_ITAB.
*ENDLOOP.
LOOP AT IT_ITAB.
IF IT_ITAB-SHKZG = 'S'.
IT_ITAB-DMBTR_S = IT_ITAB-DMBTR .
ELSE.
IF IT_ITAB-SHKZG = 'H'.
IT_ITAB-DMBTR_H = IT_ITAB-DMBTR.
ENDIF.
ENDIF.
IT_ITAB-DMBTR = ''.
MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S DMBTR.
"VAR.
CLEAR IT_ITAB.
ENDLOOP.
*MOVE CORRESPONDING IT_LFC1-UMSAV = IT_ITAB-UMSAV.
SORT IT_ITAB BY LIFNR GSBER.
LOOP AT IT_ITAB.
IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.
IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.
IT_ITAB-DH = IT_ITAB-DMBTR_H.
IT_ITAB-DS = IT_ITAB-DMBTR_S.
IT_ITAB-FLAG = 'X'.
IT_ITAB-CTR = 'X'.
IT_ITAB-HS = IT_ITAB-DMBTR_H - IT_ITAB-DMBTR_S.
IT_ITAB-BAL = IT_ITAB-UMSAV + IT_ITAB-HS.
MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S HS
FLAG BAL.
CLEAR IT_ITAB.
ENDLOOP.
*LOOP AT IT_ITAB.
**IF IT_ITAB-MONAT = ''.
DELETE IT_ITAB[] WHERE MONAT = ''.
*MODIFY IT_ITAB.
*ENDLOOP.
LOOP AT IT_ITAB.
AT END OF GSBER.
SUM.
IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.
IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.
IT_ITAB-DH = IT_ITAB-DMBTR_H.
IT_ITAB-DS = IT_ITAB-DMBTR_S.
IT_ITAB-FLAG = 'X'.
IT_ITAB-CTR = 'X'.
IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.
IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.
IT_ITAB-HS = IT_ITAB-DMBTR_S - IT_ITAB-DMBTR_H.
IT_ITAB-BAL = IT_ITAB-UMSAV - IT_ITAB-HS.
MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S HS
FLAG BAL.
ENDAT.
CLEAR IT_ITAB.
ENDLOOP.
LOOP AT IT_ITAB.
AT END OF GSBER.
SUM.
IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.
IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.
IT_ITAB-DH = IT_ITAB-DMBTR_H.
IT_ITAB-DS = IT_ITAB-DMBTR_S.
IT_ITAB-FLAG = 'X'.
IT_ITAB-CTR = 'X'.
IT_ITAB-DMBTR_H = IT_ITAB-DMBTR_H.
IT_ITAB-DMBTR_S = IT_ITAB-DMBTR_S.
IT_ITAB-BAL = IT_ITAB-UMSAV + ( IT_ITAB-DMBTR_H - IT_ITAB-DMBTR_S ).
MODIFY IT_ITAB INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S DH DS
FLAG BAL.
ENDAT.
CLEAR IT_ITAB.
ENDLOOP.
DELETE IT_ITAB[] WHERE FLAG <> 'X'.
SORT IT_ITAB BY LIFNR GSBER.
LOOP AT IT_ITAB.
MOVE-CORRESPONDING IT_ITAB TO IT_TEMP.
APPEND IT_TEMP.
ENDLOOP.
REFRESH IT_ITAB.
SORT IT_TEMP BY LIFNR GSBER.
LOOP AT IT_TEMP.
MOVE-CORRESPONDING IT_TEMP TO IT_ITAB.
APPEND IT_ITAB.
CLEAR IT_ITAB.
AT END OF LIFNR.
SUM.
IT_TEMP-FLAG = ''.
MODIFY IT_TEMP INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S FLAG.
MOVE-CORRESPONDING IT_ITEMP TO IT_ITAB.
IT_ITAB-LIFNR = ''.
IT_ITAB-NAME1 = ''.
IT_ITAB-BELNR = ''.
IT_ITAB-BUKRS = ''.
IT_ITAB-GJAHR = ''.
IT_ITAB-GSBER = ''.
IT_ITAB-UMSAV = '0000'.
IT_ITAB-DMBTR_H = IT_TEMP-DMBTR_H.
IT_ITAB-DMBTR_S = IT_TEMP-DMBTR_S.
IT_ITAB-BAL = IT_TEMP-DMBTR_H - IT_TEMP-DMBTR_S.
IT_ITAB-FLAG = 'Y'.
IT_ItAB-CTR = IT_TEMO-CTR.
APPEND IT_ITAB.
ENDAT.
IF IT_ITAB-FLAG = 'Y'.
it_itab-line_color = 'C600'.
MODIFY IT_ITAB.
ENDIF.
CLEAR IT_TEMP.
ENDLOOP.
LOOP AT IT_ITAB WHERE FLAG = 'Y'.
it_itab-line_color = 'C602'.
MODIFY IT_ITAB INDEX SY-TABIX.
CLEAR IT_ITAB.
ENDLOOP.
loop at it_itab WHERE FLAG = ''.
it_itab-line_color = 'C103'.
IT_ITAB-LINE_CTR = 'C103'.
MODIFY IT_ITAB INDEX SY-TABIX.
CLEAR IT_ITAB.
ENDLOOP.
PERFORM SUB_CALC_1.
endform. " SUB_CALC
*& Form SUB_FIELDCAT
text
--> p1 text
<-- p2 text
FORM SUB_FIELDCAT .
WA_FCAT-FIELDNAME = 'LIFNR'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Vendor No'. "'VENDOR NAME'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'NAME1'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Vendor Name'. "'VENDOR NAME'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'BELNR'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'SAP Document No'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'BLDAT'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Doc Date'. "'FISCAL YEAR'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR wa_fcat.
WA_FCAT-FIELDNAME = 'GSBER'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'BusA'. "'BUSINESS AREA'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'UMSAV'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Balance Carry Forward'. "'BAL CARRIED FORWARD'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'FLAG'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'FLAG'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'SHKZG'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'SHKZG'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'DMBTR_S'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Credit'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'DMBTR_H'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Debit'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'MONAT'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'PERIOD'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'DH'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'DH'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'DS'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'DS'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'BAL'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Accumlated Bal'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
WA_FCAT-FIELDNAME = 'SGTXT'.
WA_FCAT-TABNAME = 'IT_ITAB'.
WA_FCAT-SELTEXT_M = 'Text'. "'DOC NUMBER'.
APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.
ls_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " SUB_FIELDCAT
*& Form SUB_DISPLAY
text
--> p1 text
<-- p2 text
FORM SUB_DISPLAY .
IF NOT IT_ITAB[] IS INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = 'SY-REPID'
IT_FIELDCAT = IT_FCAT
I_SAVE = 'A'
is_layout = ls_layout
TABLES
T_OUTTAB = IT_ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " SUB_DISPLAY
*& Form SUB_CALC_1
text
--> p1 text
<-- p2 text
FORM SUB_CALC_1 .
LOOP AT IT_ITAB WHERE FLAG = 'Y'.
it_itab-line_color = 'C603'.
MODIFY IT_ITAB INDEX SY-TABIX.
CLEAR IT_ITAB.
ENDLOOP.
ENDFORM. " SUB_CALC_1This is the Report which i am trying to do....please help me with this Report....
*& Report ZVENDOR_RECONCILLATION
REPORT ZVENDOR_RECONCILLATION.
*ALV
TYPE-POOLS: SLIS.
*TYPE-POOLS icon.
DATA: It_SORT TYPE SLIS_T_SORTINFO_ALV ."WITH HEADER LINE.
DATA: TOP TYPE slis_t_listheader,
END TYPE slis_t_listheader,
EVENTS TYPE slis_t_event.
DATA : NAME1 LIKE T001W-NAME1,
WERKS LIKE T001W-WERKS .
DATA : T_KEY TYPE SLIS_KEYINFO_ALV.
DATA : FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
LAYOUT TYPE SLIS_LAYOUT_ALV OCCURS 1 WITH HEADER LINE ,
LCAT TYPE SLIS_FIELDCAT_ALV.
TABLES : BSAK , BSIK , LFC1 , LFC3 , LFA1.
*INTERNAL TABLE
DATA: BEGIN OF sd_bsak,
bukrs TYPE bsak-bukrs,
lifnr TYPE bsak-lifnr,
umsks TYPE bsak-umsks,
umskz TYPE bsak-umskz,
augdt TYPE bsak-augdt,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsak-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsak-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
monat TYPE bsak-monat,
bschl TYPE bsak-bschl,
zumsk TYPE bsak-zumsk,
shkzg TYPE bsak-shkzg,
gsber TYPE bsak-gsber,
dmbtr TYPE bsak-dmbtr,
wrbtr TYPE bsak-wrbtr,
sgtxt TYPE bsak-sgtxt,
saknr TYPE bsak-saknr,
hkont TYPE bsak-hkont,
END OF sd_bsak.
DATA: BEGIN OF sd_bsik,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsik-lifnr,
umsks TYPE bsik-umsks,
umskz TYPE bsik-umskz,
augdt TYPE bsik-augdt,
augbl TYPE bsik-augbl,
zuonr TYPE bsik-zuonr,
gjahr TYPE bsik-gjahr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
budat TYPE bsik-budat,
bldat TYPE bsik-bldat,
xblnr TYPE bsik-xblnr,
blart TYPE bsik-blart,
monat TYPE bsik-monat,
bschl TYPE bsik-bschl,
zumsk TYPE bsik-zumsk,
shkzg TYPE bsik-shkzg,
gsber TYPE bsik-gsber,
dmbtr TYPE bsik-dmbtr,
wrbtr TYPE bsik-wrbtr,
sgtxt TYPE bsik-sgtxt,
saknr TYPE bsik-saknr,
hkont TYPE bsik-hkont,
zlsch TYPE bsik-zlsch,
END OF sd_bsik.
DATA: BEGIN OF it_lfa1,
lifnr TYPE lfa1-lifnr,
name1 TYPE lfa1-name1,
END OF it_lfa1.
DATA: BEGIN OF sd_lfc1,
lifnr TYPE lfc1-lifnr,
bukrs TYPE lfc1-bukrs,
gjahr TYPE lfc1-gjahr,
erdat TYPE lfc1-erdat,
usnam TYPE lfc1-usnam,
umsav TYPE lfc1-umsav,
END OF sd_lfc1.
DATA: BEGIN OF sd_lfc3,
lifnr TYPE lfc3-lifnr,
bukrs TYPE lfc3-bukrs,
gjahr TYPE lfc3-gjahr,
shbkz TYPE lfc3-shbkz,
saldv TYPE lfc3-saldv,
solll TYPE lfc3-solll,
habnl TYPE lfc3-habnl,
END OF sd_lfc3.
*FINAL INTERNAL TABLE DECLARATION
DATA: BEGIN OF IT_FINAL,
gsber TYPE bsak-gsber,
bukrs TYPE bsak-bukrs,
lifnr TYPE bsak-lifnr,
umsks TYPE bsak-umsks,
umskz TYPE bsak-umskz,
augdt TYPE bsak-augdt,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsak-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsak-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
monat TYPE bsak-monat,
bschl TYPE bsak-bschl,
zumsk TYPE bsak-zumsk,
shkzg TYPE bsak-shkzg,
gsber TYPE bsak-gsber,
dmbtr TYPE bsak-dmbtr,
wrbtr TYPE bsak-wrbtr,
sgtxt TYPE bsak-sgtxt,
saknr TYPE bsak-saknr,
hkont TYPE bsak-hkont,
DMBTR_S TYPE BSAK-DMBTR,
DMBTR_H TYPE BSAK-DMBTR,
DS TYPE P DECIMALS 2,
DH TYPE P DECIMALS 2,
SUB TYPE P DECIMALS 2,
ADD TYPE P DECIMALS 2,
BAL TYPE P DECIMALS 2,
lifnr TYPE bsik-lifnr,
umsks TYPE bsik-umsks,
umskz TYPE bsik-umskz,
augdt TYPE bsik-augdt,
augbl TYPE bsik-augbl,
zuonr TYPE bsik-zuonr,
gjahr TYPE bsik-gjahr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
budat TYPE bsik-budat,
bldat TYPE bsik-bldat,
xblnr TYPE bsik-xblnr,
blart TYPE bsik-blart,
monat TYPE bsik-monat,
bschl TYPE bsik-bschl,
zumsk TYPE bsik-zumsk,
shkzg TYPE bsik-shkzg,
gsber TYPE bsik-gsber,
dmbtr TYPE bsik-dmbtr,
wrbtr TYPE bsik-wrbtr,
sgtxt TYPE bsik-sgtxt,
saknr TYPE bsik-saknr,
hkont TYPE bsik-hkont,
zlsch TYPE bsik-zlsch,
lifnr TYPE lfa1-lifnr,
name1 TYPE lfa1-name1,
lifnr TYPE lfc1-lifnr,
bukrs TYPE lfc1-bukrs,
gjahr TYPE lfc1-gjahr,
erdat TYPE lfc1-erdat,
usnam TYPE lfc1-usnam,
umsav TYPE lfc1-umsav,
lifnr TYPE lfc3-lifnr,
bukrs TYPE lfc3-bukrs,
gjahr TYPE lfc3-gjahr,
shbkz TYPE lfc3-shbkz,
saldv TYPE lfc3-saldv,
solll TYPE lfc3-solll,
habnl TYPE lfc3-habnl,
END OF IT_FINAL.
DATA: BEGIN OF SD_FINAL,
lifnr TYPE bsak-lifnr,
bukrs TYPE bsak-bukrs,
lifnr TYPE bsak-lifnr,
umsks TYPE bsak-umsks,
umskz TYPE bsak-umskz,
augdt TYPE bsak-augdt,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsak-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsak-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
monat TYPE bsak-monat,
bschl TYPE bsak-bschl,
zumsk TYPE bsak-zumsk,
shkzg TYPE bsak-shkzg,
gsber TYPE bsak-gsber,
dmbtr TYPE bsak-dmbtr,
wrbtr TYPE bsak-wrbtr,
sgtxt TYPE bsak-sgtxt,
saknr TYPE bsak-saknr,
hkont TYPE bsak-hkont,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsik-lifnr,
umsks TYPE bsik-umsks,
umskz TYPE bsik-umskz,
augdt TYPE bsik-augdt,
augbl TYPE bsik-augbl,
zuonr TYPE bsik-zuonr,
gjahr TYPE bsik-gjahr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
budat TYPE bsik-budat,
bldat TYPE bsik-bldat,
xblnr TYPE bsik-xblnr,
blart TYPE bsik-blart,
monat TYPE bsik-monat,
bschl TYPE bsik-bschl,
zumsk TYPE bsik-zumsk,
shkzg TYPE bsik-shkzg,
gsber TYPE bsik-gsber,
dmbtr TYPE bsik-dmbtr,
wrbtr TYPE bsik-wrbtr,
sgtxt TYPE bsik-sgtxt,
saknr TYPE bsik-saknr,
hkont TYPE bsik-hkont,
zlsch TYPE bsik-zlsch,
lifnr TYPE lfa1-lifnr,
name1 TYPE lfa1-name1,
lifnr TYPE lfc1-lifnr,
bukrs TYPE lfc1-bukrs,
gjahr TYPE lfc1-gjahr,
erdat TYPE lfc1-erdat,
usnam TYPE lfc1-usnam,
umsav TYPE lfc1-umsav,
lifnr TYPE lfc3-lifnr,
bukrs TYPE lfc3-bukrs,
gjahr TYPE lfc3-gjahr,
shbkz TYPE lfc3-shbkz,
saldv TYPE lfc3-saldv,
solll TYPE lfc3-solll,
habnl TYPE lfc3-habnl,
line_color(4) TYPE c,
END OF SD_FINAL.
DATA IT_STD_BSAK LIKE TABLE OF SD_BSAK WITH HEADER LINE.
DATA IT_STD_BSIK LIKE TABLE OF SD_BSIK WITH HEADER LINE.
DATA IT_STD_LFA1 LIKE TABLE OF IT_LFA1 WITH HEADER LINE.
DATA IT_STD_LFC1 LIKE TABLE OF SD_LFC1 WITH HEADER LINE.
DATA IT_STD_LFC3 LIKE TABLE OF SD_LFC3 WITH HEADER LINE.
DATA IT_STD_FINAL LIKE TABLE OF IT_FINAL WITH HEADER LINE.
DATA IT_FINAL_DISPLAY LIKE TABLE OF SD_FINAL WITH HEADER LINE.
*SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK HEADER WITH FRAME TITLE TEXT-001.
PARAMETERS: P_BUKRS LIKE BSAK-BUKRS OBLIGATORY,
P_GJAHR LIKE BSAK-GJAHR OBLIGATORY.
P_EBELN LIKE EKPO-EBELN .
*PARAMETER: PA_RPT AS CHECKBOX DEFAULT 'X'.
SELECT-OPTIONS: S_LIFNR FOR BSAK-LIFNR.
SELECT-OPTIONS: S_MONAT FOR BSAK-MONAT.
SELECTION-SCREEN END OF BLOCK HEADER.
START-OF-SELECTION.
SET PF-STATUS 'STATUS'.
PERFORM DATA_RETRIVAL.
PERFORM FIELD.
PERFORM SORT USING IT_SORT.
PERFORM EVENTS USING EVENTS.
PERFORM EVENTS_1 USING EVENTS.
PERFORM HEADER USING TOP.
PERFORM LAYOUT.
PERFORM DISPLAY.
END-OF-PAGE.
*& Form DATA_RETRIVAL
text
--> p1 text
<-- p2 text
FORM DATA_RETRIVAL .
SELECT BUKRS LIFNR UMSKS UMSKZ AUGDT AUGBL ZUONR GJAHR BELNR BUZEI BUDAT BLDAT XBLNR BLART
MONAT BSCHL ZUMSK SHKZG GSBER DMBTR WRBTR SGTXT SAKNR HKONT
FROM BSAK INTO TABLE IT_STD_BSAK
WHERE BUKRS = P_BUKRS
AND GJAHR = P_GJAHR AND ZUMSK = ''
AND LIFNR IN S_LIFNR
AND MONAT IN S_MONAT.
IF NOT IT_STD_BSAK[] IS INITIAL.
SELECT BUKRS LIFNR UMSKS UMSKZ AUGDT AUGBL ZUONR GJAHR BELNR BUZEI BUDAT BLDAT XBLNR
BLART MONAT BSCHL ZUMSK SHKZG GSBER DMBTR WRBTR SGTXT SAKNR HKONT ZLSCH
FROM BSIK INTO TABLE IT_STD_BSIK FOR ALL ENTRIES IN IT_STD_BSAK
WHERE BUKRS = IT_STD_BSAK-BUKRS AND LIFNR = IT_STD_BSAK-LIFNR AND GJAHR = IT_STD_BSAK-GJAHR AND ZUMSK = ''.
ENDIF.
IF NOT IT_STD_BSAK[] IS INITIAL.
SELECT LIFNR NAME1
FROM LFA1 INTO TABLE IT_STD_LFA1 FOR ALL ENTRIES IN IT_STD_BSAK
WHERE LIFNR = IT_STD_BSAK-LIFNR.
ENDIF.
IF NOT IT_STD_BSAK[] IS INITIAL.
SELECT LIFNR BUKRS GJAHR ERDAT USNAM UMSAV
FROM LFC1 INTO TABLE IT_STD_LFC1 FOR ALL ENTRIES IN IT_STD_BSAK
WHERE LIFNR = IT_STD_BSAK-LIFNR AND BUKRS = IT_STD_BSAK-BUKRS AND GJAHR = IT_STD_BSAK-GJAHR.
ENDIF.
IF NOT IT_STD_BSAK[] IS INITIAL.
SELECT LIFNR BUKRS GJAHR SHBKZ SALDV SOLLL HABNL
FROM LFC3 INTO TABLE IT_STD_LFC3 FOR ALL ENTRIES IN IT_STD_BSAK
WHERE LIFNR = IT_STD_BSAK-LIFNR AND BUKRS = IT_STD_BSAK-BUKRS AND GJAHR = IT_STD_BSAK-GJAHR.
ENDIF.
LOOP AT IT_STD_BSAK.
IT_STD_FINAL-BUKRS = IT_STD_BSAK-BUKRS.
IT_STD_FINAL-LIFNR = IT_STD_BSAK-LIFNR.
IT_STD_FINAL-UMSKS = IT_STD_BSAK-UMSKS.
IT_STD_FINAL-UMSKZ = IT_STD_BSAK-UMSKZ.
IT_STD_FINAL-AUGDT = IT_STD_BSAK-AUGDT.
IT_STD_FINAL-AUGBL = IT_STD_BSAK-AUGBL.
IT_STD_FINAL-ZUONR = IT_STD_BSAK-ZUONR.
IT_STD_FINAL-GJAHR = IT_STD_BSAK-GJAHR.
IT_STD_FINAL-BELNR = IT_STD_BSAK-BELNR.
IT_STD_FINAL-BUZEI = IT_STD_BSAK-BUZEI.
IT_STD_FINAL-BUDAT = IT_STD_BSAK-BUDAT.
IT_STD_FINAL-BLDAT = IT_STD_BSAK-BLDAT.
IT_STD_FINAL-XBLNR = IT_STD_BSAK-XBLNR.
IT_STD_FINAL-BLART = IT_STD_BSAK-BLART.
IT_STD_FINAL-MONAT = IT_STD_BSAK-MONAT.
IT_STD_FINAL-BSCHL = IT_STD_BSAK-BSCHL.
IT_STD_FINAL-ZUMSK = IT_STD_BSAK-ZUMSK.
IT_STD_FINAL-SHKZG = IT_STD_BSAK-SHKZG.
IT_STD_FINAL-GSBER = IT_STD_BSAK-GSBER.
IT_STD_FINAL-DMBTR = IT_STD_BSAK-DMBTR.
IT_STD_FINAL-WRBTR = IT_STD_BSAK-WRBTR.
IT_STD_FINAL-SGTXT = IT_STD_BSAK-SGTXT.
IT_STD_FINAL-SAKNR = IT_STD_BSAK-SAKNR.
IT_STD_FINAL-HKONT = IT_STD_BSAK-HKONT.
READ TABLE IT_STD_LFA1 WITH KEY LIFNR = IT_STD_FINAL-LIFNR.
IF SY-SUBRC = 0.
IT_STD_FINAL-NAME1 = IT_STD_LFA1-NAME1.
ENDIF.
READ TABLE IT_STD_LFC1 WITH KEY LIFNR = IT_STD_FINAL-LIFNR
BUKRS = IT_STD_FINAL-BUKRS
GJAHR = IT_STD_FINAL-GJAHR.
IF SY-SUBRC = 0.
IT_STD_FINAL-ERDAT = IT_STD_LFC1-ERDAT.
IT_STD_FINAL-USNAM = IT_STD_LFC1-USNAM.
IT_STD_FINAL-UMSAV = IT_STD_LFC1-UMSAV.
ENDIF.
*READ TABLE IT_STD_LFC3 WITH KEY LIFNR = IT_STD_FINAL-LIFNR
BUKRS = IT_STD_FINAL-BUKRS
GJAHR = IT_STD_FINAL-GJAHR.
IF SY-SUBRC = 0.
IT_STD_FINAL-SHBKZ = IT_STD_LFC3-SHBKZ.
IT_STD_FINAL-SALDV = IT_STD_LFC3-SALDV.
IT_STD_FINAL-SOLLL = IT_STD_LFC3-SOLLL.
IT_STD_FINAL-HABNL = IT_STD_LFC3-HABNL.
ENDIF.
APPEND IT_STD_FINAL.
CLEAR IT_STD_FINAL.
ENDLOOP.
LOOP AT IT_STD_BSIK.
IF SY-SUBRC = 0.
IT_STD_FINAL-BUKRS = IT_STD_BSIK-BUKRS.
IT_STD_FINAL-LIFNR = IT_STD_BSIK-LIFNR.
IT_STD_FINAL-UMSKS = IT_STD_BSIK-UMSKS.
IT_STD_FINAL-UMSKZ = IT_STD_BSIK-UMSKZ.
IT_STD_FINAL-AUGDT = IT_STD_BSIK-AUGDT.
IT_STD_FINAL-AUGBL = IT_STD_BSIK-AUGBL.
IT_STD_FINAL-ZUONR = IT_STD_BSIK-ZUONR.
IT_STD_FINAL-GJAHR = IT_STD_BSIK-GJAHR.
IT_STD_FINAL-BELNR = IT_STD_BSIK-BELNR.
IT_STD_FINAL-BUZEI = IT_STD_BSIK-BUZEI.
IT_STD_FINAL-BUDAT = IT_STD_BSIK-BUDAT.
IT_STD_FINAL-BLDAT = IT_STD_BSIK-BLDAT.
IT_STD_FINAL-XBLNR = IT_STD_BSIK-XBLNR.
IT_STD_FINAL-BLART = IT_STD_BSIK-BLART.
IT_STD_FINAL-MONAT = IT_STD_BSIK-MONAT.
IT_STD_FINAL-BSCHL = IT_STD_BSIK-BSCHL.
IT_STD_FINAL-ZUMSK = IT_STD_BSIK-ZUMSK.
IT_STD_FINAL-SHKZG = IT_STD_BSIK-SHKZG.
IT_STD_FINAL-GSBER = IT_STD_BSIK-GSBER.
IT_STD_FINAL-DMBTR = IT_STD_BSIK-DMBTR.
IT_STD_FINAL-WRBTR = IT_STD_BSIK-WRBTR.
IT_STD_FINAL-SGTXT = IT_STD_BSIK-SGTXT.
IT_STD_FINAL-SAKNR = IT_STD_BSIK-SAKNR.
IT_STD_FINAL-HKONT = IT_STD_BSIK-HKONT.
IT_STD_FINAL-ZLSCH = IT_STD_BSIK-ZLSCH.
ENDIF.
APPEND IT_STD_FINAL.
CLEAR IT_STD_FINAL.
ENDLOOP.
LOOP AT IT_STD_LFC3.
IF SY-SUBRC = 0.
IT_STD_FINAL-SHBKZ = IT_STD_LFC3-SHBKZ.
IT_STD_FINAL-SALDV = IT_STD_LFC3-SALDV.
IT_STD_FINAL-SOLLL = IT_STD_LFC3-SOLLL.
IT_STD_FINAL-HABNL = IT_STD_LFC3-HABNL.
ENDIF.
APPEND IT_STD_FINAL.
CLEAR IT_STD_FINAL.
ENDLOOP.
LOOP AT IT_STD_FINAL.
IF IT_STD_FINAL-SHKZG = 'S'.
IT_STD_FINAL-DMBTR_S = IT_STD_FINAL-DMBTR.
ELSE.
IF IT_STD_FINAL-SHKZG = 'H'.
IT_STD_FINAL-DMBTR_H = IT_STD_FINAL-DMBTR.
ENDIF.
ENDIF.
IT_STD_FINAL-DMBTR = ''.
MODIFY IT_STD_FINAL INDEX SY-TABIX TRANSPORTING DMBTR_H DMBTR_S DMBTR.
"VAR.
CLEAR IT_STD_FINAL.
ENDLOOP.
LOOP AT IT_STD_LFC3.
*AT NEW LIFNR.
IF SY-SUBRC = 0.
IT_STD_FINAL-LIFNR = IT_STD_LFC3-LIFNR.
IT_STD_FINAL-BUKRS = IT_STD_LFC3-BUKRS.
IT_STD_FINAL-GJAHR = IT_STD_LFC3-GJAHR.
IT_STD_FINAL-SHBKZ = IT_STD_LFC3-SHBKZ.
IT_STD_FINAL-UMSAV = IT_STD_LFC3-SALDV.
IT_STD_FINAL-DMBTR_S = IT_STD_LFC3-SOLLL.
IT_STD_FINAL-DMBTR_H = IT_STD_LFC3-HABNL.
ENDIF.
*ENDAT.
APPEND IT_STD_FINAL.
CLEAR IT_STD_FINAL.
ENDLOOP.
LOOP AT IT_STD_FINAL.
IT_STD_FINAL-DS = IT_STD_FINAL-DMBTR_S.
IT_STD_FINAL-DH = IT_STD_FINAL-DMBTR_H.
IT_STD_FINAL-SUB = ( IT_STD_FINAL-DS ) - ( IT_STD_FINAL-DH ).
IT_STD_FINAL-ADD = ( IT_STD_FINAL-UMSAV ) + ( IT_STD_FINAL-SUB ).
MODIFY IT_STD_FINAL.
ENDLOOP.
ENDFORM. " DATA_RETRIVAL
*& Form FIELD
text
--> p1 text
<-- p2 text
form FIELD .
LCAT-FIELDNAME = 'LIFNR'.
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'Vendor No'.
*LCAT-REF_TABNAME = 'EKKO'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'NAME1'.
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'Vendor Name'.
*LCAT-REF_TABNAME = 'EKKO'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'GJAHR'. "MATERIAL GROUP
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'Fiscal Year'.
*LCAT-REF_TABNAME = 'LFA1'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'GSBER'. "MATERIAL GROUP
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'BussArea'.
*LCAT-REF_TABNAME = 'LFA1'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'SHBKZ'.
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'S G/L'.
LCAT-REF_TABNAME = 'LFC3'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'UMSAV'.
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'Bal Carry Forward'.
*LCAT-REF_TABNAME = 'EKKO'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'DMBTR_S'.
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'Debit Balanace'.
*LCAT-REF_TABNAME = 'EKKO'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'DMBTR_H'.
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'Credit Balance'.
*LCAT-REF_TABNAME = 'EKKO'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LCAT-FIELDNAME = 'ADD'.
LCAT-TABNAME = 'IT_STD_FINAL'.
LCAT-SELTEXT_L = 'Accumulated Balance'.
*LCAT-REF_TABNAME = 'EKKO'.
LCAT-JUST = 'M'.
APPEND LCAT TO FIELDCAT.
CLEAR LCAT.
LOOP AT FIELDCAT INTO LCAT WHERE FIELDNAME = 'DMBTR_S'.
LCAT-DO_SUM = 'X'.
MODIFY FIELDCAT FROM LCAT." TRANSPORTING DO_SUM.
ENDLOOP.
LOOP AT FIELDCAT INTO LCAT WHERE FIELDNAME = 'DMBTR_H'.
LCAT-DO_SUM = 'X'.
MODIFY FIELDCAT FROM LCAT." TRANSPORTING DO_SUM.
ENDLOOP.
LOOP AT FIELDCAT INTO LCAT WHERE FIELDNAME = 'ADD'.
LCAT-DO_SUM = 'X'.
MODIFY FIELDCAT FROM LCAT." TRANSPORTING DO_SUM.
ENDLOOP.
endform. " FIELD
*& Form DISPLAY
text
--> p1 text
<-- p2 text
form DISPLAY .
CLEAR: IT_STD_BSAK,IT_STD_BSIK, IT_STD_LFA1 , IT_STD_LFC1, IT_STD_LFC3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = EVENTS
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_CHARG
t_outtab = IT_STD_FINAL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. "DISPLAY
*& Form EVENTS
text
--> p1 text
<-- p2 text
form EVENTS USING P_EVENTS TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
ls_event-name = 'TOP_OF_PAGE'.
ls_event-form = 'TOP_OF_PAGE'.
APPEND ls_event TO P_EVENTS.
endform. " EVENTS
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = TOP.
ENDFORM. "TOP_OF_PAGE
**& Form SORT
text
-->P_IT_SORT text
form SORT using p_sort TYPE SLIS_T_SORTINFO_ALV.
DATA : LT_SORT TYPE slis_sortinfo_alv.
LT_SORT-fieldname = 'LIFNR'.
LT_SORT-tabname = 'IT_STD_FINAL'.
LT_SORT-up = 'X'.
LT_SORT-SUBTOT = 'X'.
APPEND LT_SORT TO P_SORT.
CLEAR LT_SORT.
LT_SORT-fieldname = 'GSBER'.
LT_SORT-tabname = 'IT_STD_FINAL'.
LT_SORT-up = 'X'.
LT_SORT-SUBTOT = 'X'.
APPEND LT_SORT TO P_SORT.
CLEAR LT_SORT.
LT_SORT-fieldname = 'UMSAV'.
LT_SORT-tabname = 'IT_LFC3'.
LT_SORT-up = 'X'.
LT_SORT-SUBTOT = 'X'.
APPEND LT_SORT TO P_SORT.
CLEAR LT_SORT.
endform. " SORT
*& Form LAYOUT
text
--> p1 text
<-- p2 text
form LAYOUT .
LAYOUT-ZEBRA = 'X'.
LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
APPEND LAYOUT." TO LAYOUT.
endform. " LAYOUT
*& Form EVENTS_1
text
-->P_EVENTS text
FORM EVENTS_1 USING P_EVENTS TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
WRITE: SY-UNAME.
ls_event-name = 'END_OF_PAGE'.
ls_event-form = 'END_OF_PAGE'.
APPEND ls_event TO P_EVENTS.
ENDFORM. " EVENTS_1
waiting for ur reply... -
Hi Friends,
Can you please give me the exact answer for the below question.
Suppose my report program is taking long time to execute, what are the reasons that may effect the report.
and what are the remedies should i follow, please provide appropriate answer.
Advance thanks,
Chandra.hi,,
Go to tranx SE30 here you will get Tips and Trciks for the performance tuning.
Check it carefully and check whether you can do something for improving performance of you code.
It will help you a lot and will reduce your Execution time.
If you are using READ TABLE command in your program then you can check whether you can use HASHED TABLE it will improve performance of your code a lot but it has some restrictions.
I will explain some of the points to improve the performance of the report try to write code according to that ok.
SOME STEPS USED TO IMPROVE UR PERFORMANCE:
1. Avoid using SELECT...ENDSELECT... construct and use SELECT ... INTO TABLE.
2. Use WHERE clause in your SELECT statement to restrict the volume of data retrieved.
3. Design your Query to Use as much index fields as possible from left to right in your WHERE statement
4. Use FOR ALL ENTRIES in your SELECT statement to retrieve the matching records at one shot.
5. Avoid using nested SELECT statement, SELECT within LOOPs.
6. Avoid using INTO CORRESPONDING FIELDS OF TABLE. Instead use INTO TABLE.
7. Avoid using SELECT * and Select only the required fields from the table.
8. Avoid nested loops when working with large internal tables.
9. Use assign instead of into in LOOPs for table types with large work areas
10. When in doubt call transaction SE30 and use the examples and check your code
11. Whenever using READ TABLE use BINARY SEARCH addition to speed up the search. Be sure to sort the internal table before binary search. This is a general thumb rule but typically if you are sure that the data in internal table is less than 200 entries you need not do SORT and use BINARY SEARCH since this is an overhead in performance.
12. Use "CHECK" instead of IF/ENDIF whenever possible.
13. Use "CASE" instead of IF/ENDIF whenever possible.
14. Use "MOVE" with individual variable/field moves instead of "MOVE-
CORRESPONDING", creates more coding but is more effcient.
Reward points if helpful.
regards,
rekha -
Performance issue webi report-BOXI3.1
Hi,
We have a requirement for a report where we will give user a set of objects (26 u2013 31) to do analysis using interactive viewing feature. Here we are facing severe performance issues and memory issues as the data that we are calling is huge( around 6 million records). At the report level we will be summarizing the data.
No of rows in the report is depending on the no of objects.
Mode of view : Interactive view.
Note:
1. Objects which are using in conditional level those have indexes.
2. No of report level variable are two.
3. Version of Business objects: BOXI3.1
4. OS: Sun Solaris
Please let me know if there are any means by which the memory requirements for the report can be minimized/ performance of the report can be improved.
Thanks,
SubashSubash,
At the report level we will be summarizing the data ... any means by which the memory requirements for the report can be minimized/ performance of the report can be improved
Is there any way that you can summarize this on the database side versus the report level? The database should be sized with memory and disk space properly to handle these types of summarizations versus expecting the application to perform it.
Thanks,
John -
Performance analysis of report or transaction
Hello Experts,
How do we analyse the performance of a report or a transacton in SAP. I want to know thetransactions and the steps that needs to be followed in order to get this.
points are guaranteed...
thanks
sankarhi,
SE30 - gives you a run time analysis and points out the issues more at design time.
ST05 - Is the most useful if you want to track time taken for execution of each of the sections.
SM50 - Will give you a work process overview, not sure at a program level how can it help you.
Some times you will have to use a combination of SE30 and ST05.
I would like to use St05 personally.
SQL Trace (ST05) we use for performance tuning
In se38,you have a report and you want to test the performance of that report
ST05 tells about the summary of sql statements used in that program.
-Go to Tcode ST05
-Select Trace on
-In se38,Execute your report-
-Come back to st05 and select Trace off
-Select Trace list.
Now you check your select stmnts and how much time taking
-Some columns showing pink color are expensive select stmnts
You have so many options inside to check for summary and also index..
http://help.sap.com/saphelp_47x200/helpdata/en/f2/31adaa810c11d288ec0000e8200722/frameset.htm
ST02 --> Memory management
ST03 --> Dialog Service
OS06 --> Operating System
SCI --> Code Inspector
Regards
Reshma -
Give Me Some Tips For doing this report.
hi frd. help me in this report.
parameter : plant,material no,company code,storage location.
display: material no, material desc, UOM, ROL, warehouse, open po, open po qty, open pr no, open pr qty.
Kindly Give me tips for doing this report.
thank u
Pari Vendhan.RHi,
Its will not fullfill ur requirement but upto some extent...just have a look.
TYPE-POOLS : slis.
TABLES : mkpf,
mseg,
t001w,
t001l.
TYPES : BEGIN OF ty_t001w,
werks TYPE t001w-werks,
name1 TYPE t001w-name1,
END OF ty_t001w,
BEGIN OF ty_makt,
matnr TYPE makt-matnr,
maktx TYPE makt-maktx,
END OF ty_makt,
BEGIN OF ty_t001l,
lgort TYPE t001l-lgort,
lgobe TYPE t001l-lgobe,
END OF ty_t001l.
DATA : BEGIN OF it_mat OCCURS 0,
mbln LIKE mseg-mblnr, " Number of Material Document
zeile LIKE mseg-zeile, " Item in Material Document
mjahr LIKE mseg-mjahr, " Material Document Year
bwart LIKE mseg-bwart, " Movement Type
matnr LIKE mseg-matnr, " Material Number
erfmg LIKE mseg-erfmg, "Quantity in unit of entry
erfme LIKE mseg-erfme, "Unit of entry
werks LIKE mseg-werks, "Plant
lgort LIKE mseg-lgort, "Storage location
umwrk LIKE mseg-umwrk, "Receiving plant/issuing plant
umlgo LIKE mseg-umlgo, "Receiving/issuing storage location
bldat LIKE mkpf-bldat, "Document Date in Document
budat LIKE mkpf-budat, "Posting Date in the Document
maktx LIKE makt-maktx, "Material description
name1 LIKE t001w-name1, "Name
name2 LIKE t001w-name1, "Name
lgobe LIKE t001l-lgobe, "Description of storage location
lgobe1 LIKE t001l-lgobe, "Description of storage location
END OF it_mat.
DATA : it_t001w TYPE TABLE OF ty_t001w
WITH HEADER LINE,
it_makt TYPE TABLE OF ty_makt
WITH HEADER LINE,
it_t001l TYPE TABLE OF ty_t001l
WITH HEADER LINE.
DATA : ls_layout TYPE slis_layout_alv,
it_fcat TYPE slis_t_fieldcat_alv ,
wa_fcat TYPE slis_fieldcat_alv,
"lh TYPE slis_t_listheader,
" ls TYPE slis_listheader,
i_events TYPE slis_t_event WITH HEADER LINE ,
"ls_event TYPE slis_alv_event ,
w_var TYPE i.
DATA : l_date(10).
DATA : l_date1(20),
ztabix LIKE sy-tabix.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_werks FOR mseg-werks,
s_lgort FOR mseg-lgort,
s_umwrk FOR mseg-umwrk,
s_umlgo FOR mseg-umlgo,
s_bwart FOR mseg-bwart,
s_budat FOR mkpf-budat,
s_mjahr FOR mkpf-mjahr NO-EXTENSION.
SELECTION-SCREEN END OF BLOCK a1.
AT SELECTION-SCREEN.
SELECT SINGLE * FROM t001w INTO t001w
WHERE werks IN s_werks.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Supplying Plant'.
ENDIF.
SELECT SINGLE * FROM t001w INTO t001w
WHERE werks IN s_umwrk.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Receiving Plant'.
ENDIF.
SELECT SINGLE * FROM t001l INTO t001l
WHERE lgort IN s_lgort.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Supplying St.Loc'.
ENDIF.
SELECT SINGLE * FROM t001l INTO t001l
WHERE lgort IN s_umlgo.
IF sy-subrc <> 0.
MESSAGE e000(8i) WITH 'Enter a Valid Receiving St.Loc'.
ENDIF.
START-OF-SELECTION.
PERFORM field_cat.
PERFORM get_data.
*END-OF-SELECTION.
IF it_mat[] IS INITIAL.
MESSAGE i000(8i) WITH 'No data Found'(m01).
* EXIT.
ELSE.
PERFORM process_data.
PERFORM display_data.
ENDIF.
*& Form field_cat
* text
* --> p1 text
* <-- p2 text
FORM field_cat .
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'MBLN'.
wa_fcat-key = 'X'.
wa_fcat-hotspot = 'X'.
wa_fcat-ref_fieldname = 'MBLNR'.
wa_fcat-ref_tabname = 'MSEG'.
wa_fcat-seltext_m = 'Material Doc'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'ZEILE'.
wa_fcat-ref_fieldname = 'ZEILE'.
wa_fcat-ref_tabname = 'MSEG'.
wa_fcat-seltext_m = 'Item No'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'MJAHR'.
wa_fcat-ref_fieldname = 'MJAHR'.
wa_fcat-ref_tabname = 'MSEG'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'BWART'.
wa_fcat-ref_fieldname = 'BWART'.
wa_fcat-ref_tabname = 'MSEG'.
wa_fcat-seltext_m = 'Mvmt Type'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'BLDAT'.
wa_fcat-ref_fieldname = 'BLDAT'.
wa_fcat-ref_tabname = 'MKPF'.
wa_fcat-seltext_m = 'Document Date'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'BUDAT'.
wa_fcat-ref_fieldname = 'BUDAT'.
wa_fcat-ref_tabname = 'MKPF'.
wa_fcat-seltext_m = 'Posting Date'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-ref_fieldname = 'MATNR'.
wa_fcat-ref_tabname = 'MSEG'.
wa_fcat-seltext_m = 'Material No'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'MAKTX'.
wa_fcat-ref_fieldname = 'MAKTX'.
wa_fcat-ref_tabname = 'MAKT'.
wa_fcat-seltext_m = 'Material Description'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'ERFMG'.
wa_fcat-ref_fieldname = 'ERFMG'.
wa_fcat-ref_tabname = 'MSEG'.
wa_fcat-seltext_m = 'Quantity'.
wa_fcat-do_sum = 'X'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'ERFME'.
wa_fcat-ref_fieldname = 'ERFME'.
wa_fcat-ref_tabname = 'MSEG'.
wa_fcat-seltext_m = 'Uom'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'WERKS'.
wa_fcat-seltext_m = 'Supplying Plant'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'NAME1'.
wa_fcat-seltext_m = 'S.Plnt Desc.'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'LGORT'.
wa_fcat-seltext_m = 'Supplying St.Loc'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'LGOBE'.
wa_fcat-seltext_m = 'Su.St.Loc Desc.'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'UMWRK'.
wa_fcat-seltext_m = 'Receiving Plant'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'NAME2'.
wa_fcat-seltext_m = 'R.Plnt Desc.'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'UMLGO'.
wa_fcat-seltext_m = 'Receiving St.Loc'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
wa_fcat-col_pos = w_var.
wa_fcat-tabname = 'IT_MAT'.
wa_fcat-fieldname = 'LGOBE1'.
wa_fcat-seltext_m = 'Re.St.Loc Desc.'.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ADD 1 TO w_var.
ENDFORM. " field_cat
*& Form get_data
* text
* --> p1 text
* <-- p2 text
FORM get_data .
SELECT a~mblnr a~zeile a~mjahr a~bwart a~matnr
a~erfmg a~erfme a~werks a~lgort a~umwrk a~umlgo
b~budat b~bldat
INTO CORRESPONDING FIELDS OF TABLE it_mat
FROM mseg AS a INNER JOIN mkpf AS b
ON a~mblnr = b~mblnr
AND a~mjahr = b~mjahr
CLIENT SPECIFIED
WHERE a~mandt EQ sy-mandt
AND a~werks IN s_werks
AND a~lgort IN s_lgort
AND a~umwrk IN s_umwrk
AND a~umlgo IN s_umlgo
AND a~bwart IN s_bwart
AND b~budat IN s_budat
AND b~mjahr IN s_mjahr.
IF sy-subrc EQ 0.
SELECT matnr maktx
INTO TABLE it_makt FROM makt
CLIENT SPECIFIED
FOR ALL ENTRIES IN it_mat
WHERE matnr = it_mat-matnr AND mandt EQ sy-mandt.
ENDIF.
SELECT werks name1
INTO TABLE it_t001w FROM t001w
CLIENT SPECIFIED
WHERE mandt EQ sy-mandt.
IF sy-subrc <> 0.
MESSAGE e000(zmss).
ENDIF.
SELECT lgobe INTO TABLE it_t001l FROM t001l
CLIENT SPECIFIED
WHERE mandt EQ sy-mandt.
IF sy-subrc <> 0.
MESSAGE e000(zmss).
ENDIF.
ENDFORM. " get_data
*& Form process_data
* text
* --> p1 text
* <-- p2 text
FORM process_data .
LOOP AT it_mat.
ztabix = sy-tabix.
READ TABLE it_makt WITH KEY matnr = it_mat-matnr.
IF sy-subrc = 0.
it_mat-maktx = it_makt-maktx.
ENDIF.
IF it_mat-bwart+2(1) = '2'.
it_mat-erfmg = - ( it_mat-erfmg ).
ENDIF.
READ TABLE it_t001w WITH KEY werks = it_mat-werks.
IF sy-subrc = 0.
it_mat-name1 = it_t001w-name1.
ENDIF.
READ TABLE it_t001w WITH KEY werks = it_mat-umwrk.
IF sy-subrc = 0.
it_mat-name2 = it_t001w-name1.
ENDIF.
READ TABLE it_t001l WITH KEY lgort = it_mat-lgort.
IF sy-subrc = 0.
it_mat-lgobe = it_t001l-lgobe.
ENDIF.
READ TABLE it_t001l WITH KEY lgort = it_mat-umlgo.
IF sy-subrc = 0.
it_mat-lgobe1 = it_t001l-lgobe.
ENDIF.
MODIFY it_mat INDEX ztabix .
ENDLOOP.
ENDFORM. " process_data
*& Form display_data
* text
* --> p1 text
* <-- p2 text
FORM display_data .
REFRESH i_events.
i_events-form = 'TOP'.
i_events-name = 'TOP_OF_PAGE'.
APPEND i_events.
CLEAR i_events.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = SY-CPROG
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'TOP'
* i_callback_html_top_of_page = 'TOP'
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
i_background_id = 'ALV_BACKGROUND'
* I_GRID_TITLE =
* I_GRID_SETTINGS =
* IS_LAYOUT = LS_LAYOUT
it_fieldcat = it_fcat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
it_events = i_events[]
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_mat
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " display_data
*& Form top
* text
FORM top.
DATA : idate(10),
idate1 TYPE sy-datum.
DATA : ls_line TYPE slis_listheader,
i_listheader TYPE slis_t_listheader .
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = sy-repid.
APPEND ls_line TO i_listheader.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = 'MATERIAL DOCUMENT LIST'.
APPEND ls_line TO i_listheader.
CLEAR ls_line.
idate1 = sy-datum.
WRITE idate1 TO idate USING EDIT MASK '__/__/____'.
ls_line-typ = 'S'.
ls_line-info = idate.
APPEND ls_line TO i_listheader.
CLEAR ls_line.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_listheader
i_logo = 'LOGO'.
* I_END_OF_LIST_GRID =
ENDFORM. "TOP -
Report performance while creating report on BEx
All all!
I am creating a report on BOE 4.0 on top of BEx connection as a source. I have developed reports on top of universe in the past and i know that if we keep calculations on reporting end it hampers the report performance. Is this the same case with BEx? if we are following the best practices is it ok to say that we should keep all heavy calculations/ aggregation on BEx or backend for better report performance.
Can you guys please provide your opinion based on your experiance and knowledge. Any feedbacks will help! Thanks.Hi,
Definitely best-practice to delegate a maximum of CKF to the Cube where possilble, put RKF in the BEx query, and Filters too.
also, add Default Values to your Variables (this will speed up generation of the bics transient universe)
also, since Patch2.10, we are seeing some significant performance improvements reducing 'document initialization' and 'time to prompts' by up to 50% (step such as these often took 1.5 minutes, even on sized systems)
Also, make sure you have BW corrections like this implemented: 1593802 Performance optimization when loading query views
In the BusinessObjects landscape - especially with BI 4.0 - it's all about Sizing and Tuning . Here is your bible the 'sizing companion' guide : http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000738725&_OBJECT=011000358700000307202011E
Pay particular attention to BICSChunkSize registry settings
Also, the -Xmx JVM Heap Size for the Adaptive Processing Server that is running the DSL_Bridge service.
Regards,
H -
Performance issue in Report (getting time out error)
Hi experts,
I am doing Performance for a Report (getting time out error)
Please see the code below and .
while looping internal table IVBAP after 25 minutes its showing time out error at this poit ->
SELECT MAX( ERDAT ) .
please send alternate code for this .
Advance thanks
from
Nagendra
Get Sales Order Details
CLEAR IVBAP.
REFRESH IVBAP.
SELECT VBELN POSNR MATNR NETWR KWMENG WERKS FROM VBAP
INTO CORRESPONDING FIELDS OF TABLE IVBAP
FOR ALL ENTRIES IN IVBAK
WHERE VBELN = IVBAK-VBELN
AND MATNR IN Z_MATNR
AND WERKS IN Z_WERKS
AND ABGRU = ' '.
Check for Obsolete Materials - Get Product Hierarhy/Mat'l Description
SORT IVBAP BY MATNR WERKS.
CLEAR: WK_MATNR, WK_WERKS, WK_PRDHA, WK_MAKTX,
WK_BLOCK, WK_MMSTA, WK_MSTAE.
LOOP AT IVBAP.
CLEAR WK_INVDATE. "I6677.sn
SELECT MAX( ERDAT ) FROM VBRP INTO WK_INVDATE WHERE
AUBEL EQ IVBAP-VBELN AND
AUPOS EQ IVBAP-POSNR.
IF SY-SUBRC = 0.
MOVE WK_INVDATE TO IVBAP-INVDT.
MODIFY IVBAP.
ENDIF. "I6677.e n
SELECT SINGLE * FROM MBEW WHERE "I6759.sn
MATNR EQ IVBAP-MATNR AND
BWKEY EQ IVBAP-WERKS AND
BWTAR EQ SPACE.
IF SY-SUBRC = 0.
MOVE MBEW-STPRS TO IVBAP-STPRS.
IVBAP-TOT = MBEW-STPRS * IVBAP-KWMENG.
MODIFY IVBAP.
ENDIF. "I6759.en
IF IVBAP-MATNR NE WK_MATNR OR IVBAP-WERKS NE WK_WERKS.
CLEAR: WK_BLOCK, WK_MMSTA, WK_MSTAE, WK_PRDHA, WK_MAKTX.
MOVE IVBAP-MATNR TO WK_MATNR.
MOVE IVBAP-WERKS TO WK_WERKS.
SELECT SINGLE MMSTA FROM MARC INTO MARC-MMSTA
WHERE MATNR = WK_MATNR
AND WERKS = WK_WERKS.
IF NOT MARC-MMSTA IS INITIAL.
MOVE '*' TO WK_MMSTA.
ENDIF.
SELECT SINGLE LVORM PRDHA MSTAE MSTAV FROM MARA
INTO (MARA-LVORM, MARA-PRDHA, MARA-MSTAE, MARA-MSTAV)
WHERE MATNR = WK_MATNR.
IF ( NOT MARA-MSTAE IS INITIAL ) OR
( NOT MARA-MSTAV IS INITIAL ) OR
( NOT MARA-LVORM IS INITIAL ).
MOVE '*' TO WK_MSTAE.
ENDIF.
MOVE MARA-PRDHA TO WK_PRDHA.
SELECT SINGLE MAKTX FROM MAKT INTO WK_MAKTX
WHERE MATNR = WK_MATNR
AND SPRAS = SY-LANGU.
ENDIF.
IF Z_BLOCK EQ 'B'.
IF WK_MMSTA EQ ' ' AND WK_MSTAE EQ ' '.
DELETE IVBAP.
CONTINUE.
ENDIF.
ELSEIF Z_BLOCK EQ 'U'.
IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
DELETE IVBAP.
CONTINUE.
ENDIF.
ELSE.
IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
MOVE '*' TO WK_BLOCK.
ENDIF.
ENDIF.
IF WK_PRDHA IN Z_PRDHA. "I4792
MOVE WK_BLOCK TO IVBAP-BLOCK.
MOVE WK_PRDHA TO IVBAP-PRDHA.
MOVE WK_MAKTX TO IVBAP-MAKTX.
MODIFY IVBAP.
ELSE. "I4792
DELETE IVBAP. "I4792
ENDIF. "I4792
IF NOT Z_ALNUM[] IS INITIAL. "I9076
SELECT SINGLE * FROM MAEX "I9076
WHERE MATNR = IVBAP-MATNR "I9076
AND ALNUM IN Z_ALNUM. "I9076
IF SY-SUBRC <> 0. "I9076
DELETE IVBAP. "I9076
ENDIF. "I9076
ENDIF. "I9076
ENDLOOP.Hi Nagendra!
Get Sales Order Details
CLEAR IVBAP.
REFRESH IVBAP.
check ivbak is not initial
SELECT VBELN POSNR MATNR NETWR KWMENG WERKS FROM VBAP
INTO CORRESPONDING FIELDS OF TABLE IVBAP
FOR ALL ENTRIES IN IVBAK
WHERE VBELN = IVBAK-VBELN
AND MATNR IN Z_MATNR
AND WERKS IN Z_WERKS
AND ABGRU = ' '.
Check for Obsolete Materials - Get Product Hierarhy/Mat'l Description
SORT IVBAP BY MATNR WERKS.
CLEAR: WK_MATNR, WK_WERKS, WK_PRDHA, WK_MAKTX,
WK_BLOCK, WK_MMSTA, WK_MSTAE.
avoid select widin loop. instead do selection outside loop.u can use read statement......and then loop if required.
LOOP AT IVBAP.
CLEAR WK_INVDATE. "I6677.sn
SELECT MAX( ERDAT ) FROM VBRP INTO WK_INVDATE WHERE
AUBEL EQ IVBAP-VBELN AND
AUPOS EQ IVBAP-POSNR.
IF SY-SUBRC = 0.
MOVE WK_INVDATE TO IVBAP-INVDT.
MODIFY IVBAP.
ENDIF. "I6677.e n
SELECT SINGLE * FROM MBEW WHERE "I6759.sn
MATNR EQ IVBAP-MATNR AND
BWKEY EQ IVBAP-WERKS AND
BWTAR EQ SPACE.
IF SY-SUBRC = 0.
MOVE MBEW-STPRS TO IVBAP-STPRS.
IVBAP-TOT = MBEW-STPRS * IVBAP-KWMENG.
MODIFY IVBAP.
ENDIF. "I6759.en
IF IVBAP-MATNR NE WK_MATNR OR IVBAP-WERKS NE WK_WERKS.
CLEAR: WK_BLOCK, WK_MMSTA, WK_MSTAE, WK_PRDHA, WK_MAKTX.
MOVE IVBAP-MATNR TO WK_MATNR.
MOVE IVBAP-WERKS TO WK_WERKS.
SELECT SINGLE MMSTA FROM MARC INTO MARC-MMSTA
WHERE MATNR = WK_MATNR
AND WERKS = WK_WERKS.
IF NOT MARC-MMSTA IS INITIAL.
MOVE '*' TO WK_MMSTA.
ENDIF.
SELECT SINGLE LVORM PRDHA MSTAE MSTAV FROM MARA
INTO (MARA-LVORM, MARA-PRDHA, MARA-MSTAE, MARA-MSTAV)
WHERE MATNR = WK_MATNR.
IF ( NOT MARA-MSTAE IS INITIAL ) OR
( NOT MARA-MSTAV IS INITIAL ) OR
( NOT MARA-LVORM IS INITIAL ).
MOVE '*' TO WK_MSTAE.
ENDIF.
MOVE MARA-PRDHA TO WK_PRDHA.
SELECT SINGLE MAKTX FROM MAKT INTO WK_MAKTX
WHERE MATNR = WK_MATNR
AND SPRAS = SY-LANGU.
ENDIF.
IF Z_BLOCK EQ 'B'.
IF WK_MMSTA EQ ' ' AND WK_MSTAE EQ ' '.
DELETE IVBAP.
CONTINUE.
ENDIF.
ELSEIF Z_BLOCK EQ 'U'.
IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
DELETE IVBAP.
CONTINUE.
ENDIF.
ELSE.
IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
MOVE '*' TO WK_BLOCK.
ENDIF.
ENDIF.
IF WK_PRDHA IN Z_PRDHA. "I4792
MOVE WK_BLOCK TO IVBAP-BLOCK.
MOVE WK_PRDHA TO IVBAP-PRDHA.
MOVE WK_MAKTX TO IVBAP-MAKTX.
MODIFY IVBAP.
ELSE. "I4792
DELETE IVBAP. "I4792
ENDIF. "I4792
IF NOT Z_ALNUM[] IS INITIAL. "I9076
SELECT SINGLE * FROM MAEX "I9076
WHERE MATNR = IVBAP-MATNR "I9076
AND ALNUM IN Z_ALNUM. "I9076
IF SY-SUBRC 0. "I9076
DELETE IVBAP. "I9076
ENDIF. "I9076
ENDIF. "I9076
endloop.
U have used many select queries widin loop-endloop which is a big hindrance as far as performance is concerned.Avoid such practice.
Thanks
Deepika -
How to improve the query performance in to report level and designer level
How to improve the query performance in to report level and designer level......?
Plz let me know the detail view......first its all based on the design of the database, universe and the report.
at the universe Level, you have to check your Contexts very well to get the optimal performance of the universe and also your joins, keep your joins with key fields, will give you the best performance.
at the report level, try to make the reports dynamic as much as you can, (Parameters) and so on.
and when you create a paremeter try to get it match with the key fields in the database.
good luck
Amr -
Performance issue in report programming..
Hi,
I am using one customized Function Module whithin a loop of internal table containing fields of PROJ table for about 200 records . And in the source code of function module there is set of select queries for different tables like COSS COSP , AUFK , PRPS , BPJA PRHI , AFPO , AFKO etc . so due to that my performance of a report is very low , So how can i improve it .
Is there any other way to change a code.
regards
ChetanHi John ,
I am using SAP ECC 6.0 .
The report is used to update a ztable which is already created for Project System plan data .
So i am calling function module which will return a internal table , I am appending this to other internal table and refreshing it , like this I am doing for each project within a loop of PROJ internal table , finaly by using the final itab I am modifying the ztable fields.
Code is as below..
select pspid from proj client specified into corresponding fields of
table t_itab1 where mandt = sy-mandt
and pspnr in s_pspnr
and vbukr = p_vbukr
and prctr in s_prctr.
loop at t_itab1.
l_pspid = t_itab1-pspid.
CALL FUNCTION 'ZPS_FUN_BUDGETS'
EXPORTING
L_PSPID = l_pspid
L_VBUKR = p_vbukr
TABLES
T_DATA = t_itab2 .
loop at t_itab2.
append t_itab2 to t_itab.
endloop.
clear : t_itab2.
refresh : t_itab2.
endloop.
LOOP AT t_itab.
***MODIFY ZTABLE.*****
ENDLOOP.
Regards
Chetan
Maybe you are looking for
-
Spinning ball problems--need to do a clean install--have questions
Hi background: I have a G4 (quicksilver) since July 2002, it came with OS9.2 and OS10.1.3. I've upgraded a few times since and currently have 10.3.9. I mainly work in OS9.2 due to most of my programs being used are only in 9 and the PC network I'm ho
-
Now can't send texts as usual after receiving 1st iMessage
someone just sent me an iMessage (my first). Now I can't send a normal text. When I try to type in a message as usual, my keystrokes don't make anything happen now. What can I do?
-
FM BBP_UPDATE_ATTRIBUTES
Hi SRMs. SRM 4.0, server 5.0. Here is the case. I need to set up a batch run that can update the attributes in the PPOMA with a specific value from the SU01 user data. I need a daily batch run that can do the following: The FM BBP_UPDATE_ATTRIBUTES s
-
I cant log in to iCloud Control Panel
I cant log in to iCloud Control Panel on PC it says "You can't sign in because of a server error" but there is no problem with iCloud status. It will be the first time i open Control Panel. I already restarted it.
-
Restore7.exe application error
So, when I try to start my windows, an error box pop up, which says: "Restore7.exe - Application error. The instruction at 0x77892591 referenced memory at 0x00008084. The memory could not be read." when clicking OK, computer starts over and get stuck