Enhancement of the datasource is taking lot of time
Hi Experts,
we enhanced the datasource 0employee_attr almost 35 fileds but every thing fine when we are loading it taking almost 20hrs . these reports are using every day .how to reduce the loading time .iam not written any routines i thought its happened in R/3 side because lot of select statement.can any one suggest me on this issue.
Regards
sivaraju
Hi,
i dont know much about ABAP coding . can you pllz suggest me where i need to put indexes etc.
TABLES: PA0185,HRP1001,PA0001,PA0588, PA0587, PA0021, PA0006, PA0009, PA0003.
TABLES: HRMS_BIW_IO_OCCUPANCY.
TABLES: BWCO_MD_CCTR.
TABLES: BIW_KNA1_S,KNB1.
Internal table - Types -- Declaration for COSTCENTER_ATTR
TYPES : BEGIN OF T_PERNR,
PERNR TYPE PERSNO,
END OF T_PERNR.
DATA : IT_PERNR TYPE STANDARD TABLE OF T_PERNR.
DATA : VL_COUNT TYPE I.
data : s_area like pa0001-mstbr.
Declarations for 0EMPLOYEE_ATTR
DATA : I_W_DATA LIKE HRMS_BIW_IO_OCCUPANCY,
I_W_DATA_KOSTL LIKE BWCO_MD_CCTR,
L_ICNUM TYPE PA0185-ICNUM,
L_RMBEGDA TYPE PA0185-BEGDA,
L_RMENDDA TYPE PA0185-ENDDA,
L_PERNR TYPE PA0001-PERNR,
L_PERNR1 TYPE PA0001-PERNR,
L_PLANS TYPE SOBID,
L_PLANS2 TYPE SOBID,
L_SUBTY TYPE PA0185-SUBTY,
L_NAME TYPE PA0001-ENAME,
L_NAME1 TYPE PA0001-ENAME,
L_AMOUNT TYPE BETRG,
L_AMOUNT_OFF TYPE BETRG,
L_ORGUNITSVP TYPE PA0001-ORGEH,
L_ICNUM_RM TYPE PA0185-ICNUM,
L_ICNUM_TIER2 TYPE PA0185-ICNUM,
L_MSTBR TYPE PA0001-MSTBR,
L_ICNUM_21 TYPE PA0185-ICNUM,
L_ICNUM_20 TYPE PA0185-ICNUM,
L_ICNUM_24 TYPE PA0185-ICNUM,
L_ICNUM_18 TYPE PA0185-ICNUM,
L_ISSPL TYPE PA0185-ISSPL,
L_ESINO LIKE PA0588-ESINO,
L_EEBAS LIKE PA0587-TSTID,
I_W_DATA1 LIKE BIW_KNA1_S,
L_TLFXS LIKE KNB1-TLFXS,
L_NAME4 LIKE KNA1-NAME4,
new fields added by pandu
L_GBDAT TYPE GBDAT,
L_FAVOR TYPE PAD_VORNA,
L_NAME2 TYPE PAD_CONAM,
L_STRAS TYPE PAD_STRAS,
L_PSTLZ TYPE PSTLZ_HR,
L_ORT01 TYPE PAD_ORT01,
L_USRID TYPE SYSID,
L_XMETXT TYPE REBDXRO,
L_BANKL TYPE BANKK,
L_BANKN TYPE BANKN,
L_CNAME TYPE ZCNAME,
L_USRID1 TYPE SYSID,
L_MGRID TYPE SOBID,
L_INCDAT TYPE BEGDA,
L_LIFNR TYPE LIFNR,
L_RDATE TYPE BEGDA,
L_LWDAY TYPE BEGDA,
L_REDAT TYPE BEGDA,
L_SCHKZ TYPE SCHKN,
L_PRDAT TYPE PRDAT,
L_ABRDT TYPE LABRD,
L_ABRSP TYPE ABRSP,
L_BANKA TYPE BANKA,
L_SMDAT TYPE BEGDA.
l_ctc_amt type betrg.
*endchange
DATA: BEGIN OF TP_RGDIR OCCURS 0.
INCLUDE STRUCTURE PC261.
DATA: END OF TP_RGDIR.
*Decleration for monthly salary
DATA : L_PA0008 LIKE PA0008.
DATA : V_AMOUNT TYPE PAD_AMT7S,
FLDNAM(30),
NUM(2) VALUE '01'.
FIELD-SYMBOLS: <FS> TYPE ANY.
FIELD-SYMBOLS: <FS1> TYPE ANY.
CASE I_DATASOURCE.
*Getting Customer branch in 0customer_attr
WHEN '0CUSTOMER_ATTR'.
LOOP AT I_T_DATA.
MOVE-CORRESPONDING I_T_DATA TO I_W_DATA1 .
*Getting Customer branch in 0customer_attr
SELECT SINGLE TLFXS INTO L_TLFXS FROM KNB1 WHERE KUNNR EQ I_W_DATA1-KUNNR.
*Getting Customer Name4 in 0customer_attr from table KNA1
SELECT SINGLE NAME4 INTO L_NAME4 FROM KNA1 WHERE KUNNR EQ I_W_DATA1-KUNNR.
I_W_DATA1-ZZTLFXS = L_TLFXS.
I_W_DATA1-ZZNAME4 = L_NAME4.
MODIFY I_T_DATA FROM I_W_DATA1.
CLEAR L_TLFXS.
CLEAR L_NAME4.
ENDLOOP.
Getting the RM for the employee and SVP using the ICNUM
WHEN '0EMPLOYEE_ATTR'.
LOOP AT I_T_DATA INTO I_W_DATA.
SELECT SINGLE ICNUM INTO L_ICNUM FROM PA0185
WHERE PERNR EQ I_W_DATA-PERNR
AND SUBTY = '23'
AND ENDDA GE SY-DATUM.
Getting the Joining date of RM
SELECT SINGLE BEGDA INTO L_RMBEGDA FROM PA0000
WHERE PERNR EQ I_W_DATA-PERNR
AND MASSN EQ '01'.
Getting the Resignation Date of RM
SELECT SINGLE BEGDA INTO L_RMENDDA FROM PA0000
WHERE PERNR EQ I_W_DATA-PERNR
AND MASSN EQ '14'.
*Getting the Tier II code and Name
SELECT SINGLE SOBID INTO L_PLANS FROM HRP1001
WHERE OTYPE EQ 'S'
AND OBJID EQ I_W_DATA-PLANS
AND RSIGN EQ 'A'
AND RELAT EQ '002'
AND ENDDA GE I_W_DATA-ENDDA
AND endda GE sy-datum
AND SCLAS EQ 'S'.
AND sobid EQ i_w_data-plans.
SELECT SINGLE PERNR INTO L_PERNR FROM PA0001
WHERE ENDDA GE SY-DATUM
WHERE endda GE i_w_data-endda
AND PLANS EQ L_PLANS.
SELECT SINGLE ENAME INTO L_NAME FROM PA0001
WHERE ENDDA GE SY-DATUM
AND PLANS EQ L_PLANS.
*Getting the TIER II branch
SELECT SINGLE ICNUM INTO L_ICNUM_TIER2 FROM PA0185
WHERE ENDDA GE SY-DATUM
AND PERNR EQ L_PERNR
AND SUBTY = '05'.
*Getting the Supervisor/HOD for Employee----
SELECT SINGLE MSTBR FROM PA0001 INTO L_MSTBR WHERE PERNR = I_W_DATA-PERNR AND
ENDDA GE SY-DATUM.
*Getting the Employee Product from infotype 185 styp 21.
SELECT SINGLE ICNUM INTO L_ICNUM_21 FROM PA0185
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR
AND SUBTY = '21'.
*Getting the Employee Branch Discription/Place of issue from infotype 185 styp 05.
SELECT SINGLE ISSPL INTO L_ISSPL FROM PA0185
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR
AND SUBTY = '05'.
*Getting the Employee Library no/business from infotype 185 styp 18.
SELECT SINGLE ICNUM INTO L_ICNUM_18 FROM PA0185
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR
AND SUBTY = '18'.
*Getting the Employee Department from infotype 185 styp 20.
SELECT SINGLE ICNUM INTO L_ICNUM_20 FROM PA0185
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR
AND SUBTY = '20'.
*Getting the Employee RBT Codefrom infotype 185 styp 24.
SELECT SINGLE ICNUM INTO L_ICNUM_24 FROM PA0185
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR
AND SUBTY = '24'.
*Getting the Employee ESI number from Infotype 588.
SELECT SINGLE ESINO INTO L_ESINO FROM PA0588
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR.
*Getting the Employee PF Eligibility no from Infotype 587.
SELECT SINGLE TSTID INTO L_EEBAS FROM PA0587
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR.
*Getting the Employee Basic salary amt from Infotype 0008.
NUM = '01'.
CLEAR V_AMOUNT.
SELECT SINGLE * INTO L_PA0008 FROM PA0008 WHERE PERNR EQ I_W_DATA-PERNR
AND ENDDA EQ '99991231'.
DO 30 TIMES.
IF STRLEN( NUM ) = 1.
CONCATENATE '0' NUM INTO NUM.
ENDIF.
CONCATENATE 'L_PA0008-LGA' NUM INTO FLDNAM.
ASSIGN (FLDNAM) TO <FS>.
CONCATENATE 'L_PA0008-BET' NUM INTO FLDNAM.
ASSIGN (FLDNAM) TO <FS1>.
IF <FS> = '1000'.
V_AMOUNT = <FS1>.
ENDIF.
CLEAR : <FS>, <FS1>.
NUM = NUM + 1.
ENDDO.
I_W_DATA-ZZBASPAY = V_AMOUNT.
endif.
HRMS_BIW_IO_OCCUPANCY-ZZMSTBR = s_area.
select single mstbr into l_mstbr from pa0001
where endda GE sy-datum
and pernr eq l_pernr.
*Bringing RM branch
SELECT SINGLE ICNUM INTO L_ICNUM_RM FROM PA0185
WHERE ENDDA GE SY-DATUM
AND PERNR EQ I_W_DATA-PERNR
AND SUBTY = '05'.
new code for fields by pandu
*bringing date-of-birth
SELECT SINGLE GBDAT INTO L_GBDAT FROM PA0002 WHERE PERNR = I_W_DATA-PERNR.
bringing fathers name
SELECT SINGLE FAVOR INTO L_FAVOR FROM PA0021 WHERE PERNR = I_W_DATA-PERNR
AND SUBTY = '2'.
bringing address details
SELECT SINGLE * FROM PA0006 WHERE PERNR = I_W_DATA-PERNR
AND SUBTY = '2'
AND ENDDA GE SY-DATUM.
L_NAME2 = PA0006-NAME2.
L_STRAS = PA0006-STRAS.
L_ORT01 = PA0006-ORT01.
L_PSTLZ = PA0006-PSTLZ.
bringing communication dteails
SELECT SINGLE USRID INTO L_USRID FROM PA0105 WHERE PERNR = I_W_DATA-PERNR
AND SUBTY = '0010'
AND ENDDA GE SY-DATUM.
bringing location details
SELECT SINGLE XMETXT INTO L_XMETXT FROM PA9005 WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM.
bringing bank details
SELECT SINGLE * FROM PA0009 WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM.
L_BANKN = PA0009-BANKN.
L_BANKL = PA0009-BANKL.
bringing the bankname
SELECT SINGLE BANKA INTO L_BANKA FROM BNKA WHERE BANKL = L_BANKL.
bringing esop details
SELECT SINGLE CNAME INTO L_CNAME FROM PA9008 WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM.
bringing vendor details
SELECT SINGLE LIFNR INTO L_LIFNR FROM LFB1 WHERE PERNR = I_W_DATA-PERNR.
SELECT SINGLE CTC_DATE INTO L_INCDAT FROM PB9007 WHERE REPORT = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM.
*select single ctc_amt into l_ctc_amt from pb9007 where report = i_w_data-pernr
and endda ge sy-datum.
*l_incdat = pa9007-ctc_date.
*l_ctc_amt = pa9007-ctc_amt.
bringing resignation date
SELECT SINGLE BEGDA FROM PA0000 INTO L_RDATE WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM
AND MASSN = '14'.
to get last working day
L_LWDAY = L_RDATE - 1.
to get reentry date
SELECT SINGLE BEGDA FROM PA0000 INTO L_REDAT WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM
AND MASSN = '15'.
bringing workschedule details
SELECT SINGLE SCHKZ FROM PA0007 INTO L_SCHKZ WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM.
bringing payroll status details
SELECT SINGLE * FROM PA0003 WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM.
L_PRDAT = PA0003-PRDAT.
L_ABRDT = PA0003-ABRDT.
L_ABRSP = PA0003-ABRSP.
bringing paydate
SELECT SINGLE BEGDA INTO L_SMDAT FROM PA0008 WHERE PERNR = I_W_DATA-PERNR
AND ENDDA GE SY-DATUM.
*endadd
Getting wage type for the salaries calc
I_W_DATA-ZZRMID = L_ICNUM.
I_W_DATA-ZZICNUM = L_ICNUM_RM.
I_W_DATA-ZZRMBEGDA = L_RMBEGDA.
I_W_DATA-ZZRMENDDA = L_RMENDDA.
I_W_DATA-ZZEVPID = L_PERNR.
I_W_DATA-ZZEVPNAME = L_NAME.
I_W_DATA-ZZORGUTSVP = L_ICNUM_TIER2.
I_W_DATA-ZZMSTBR = L_MSTBR.
I_W_DATA-ZZICNUM_21 = L_ICNUM_21.
I_W_DATA-ZZICNUM_20 = L_ICNUM_20.
I_W_DATA-ZZICNUM_24 = L_ICNUM_24.
I_W_DATA-ZZICNUM_18 = L_ICNUM_18.
I_W_DATA-ZZESINO = L_ESINO.
I_W_DATA-ZZEEPF1 = L_EEBAS.
I_W_DATA-ZZISSPL = L_ISSPL.
code added by pandu
I_W_DATA-ZZGBDAT = L_GBDAT.
I_W_DATA-ZZFAVOR = L_FAVOR.
I_W_DATA-ZZNAME2 = L_NAME2.
I_W_DATA-ZZORT01 = L_ORT01.
I_W_DATA-ZZSTRAS = L_STRAS.
I_W_DATA-ZZPSTLZ = L_PSTLZ.
I_W_DATA-ZZUSRID = L_USRID.
I_W_DATA-ZZXMETXT = L_XMETXT.
I_W_DATA-ZZBANKL = L_BANKL.
I_W_DATA-ZZBANKN = L_BANKN.
I_W_DATA-ZZCNAME = L_CNAME.
I_W_DATA-ZZLIFNR = L_LIFNR.
I_W_DATA-ZZINCDAT = L_INCDAT.
i_w_data-zzctc_amt = l_ctc_amt.
I_W_DATA-ZZRDAT = L_RDATE.
I_W_DATA-ZZLWDAY = L_LWDAY.
I_W_DATA-ZZRDAT = L_REDAT.
I_W_DATA-ZZSCHKZ = L_SCHKZ.
I_W_DATA-ZZPRDAT = L_PRDAT.
I_W_DATA-ZZABRDT = L_ABRDT.
I_W_DATA-ZZABRSP = L_ABRSP.
I_W_DATA-ZZBANKA = L_BANKA.
I_W_DATA-ZZSMDAT = L_SMDAT.
*endchange
*Getting The details for EVP
CLEAR L_PERNR.
CLEAR L_NAME.
CLEAR L_ICNUM_TIER2.
CLEAR L_ICNUM_RM.
CLEAR L_RMBEGDA.
CLEAR L_RMENDDA.
CLEAR L_ESINO.
CLEAR L_EEBAS.
CLEAR L_ICNUM_21.
CLEAR L_ICNUM_20.
CLEAR L_ICNUM_24.
CLEAR L_ICNUM_18.
CLEAR L_MSTBR.
CLEAR L_ISSPL.
CLEAR L_PLANS.
*code added by pandu
CLEAR L_GBDAT.
CLEAR L_FAVOR.
CLEAR L_NAME2.
CLEAR L_ORT01.
CLEAR L_STRAS.
CLEAR L_PSTLZ.
CLEAR L_USRID.
CLEAR L_XMETXT.
CLEAR L_BANKN.
CLEAR L_BANKL.
CLEAR L_CNAME.
CLEAR L_LIFNR.
CLEAR L_RDATE.
CLEAR L_LWDAY.
CLEAR L_REDAT.
CLEAR L_PRDAT.
CLEAR L_SCHKZ.
CLEAR L_ABRDT.
CLEAR L_ABRSP.
CLEAR L_BANKA.
CLEAR L_SMDAT.
*endcode
SELECT SINGLE SOBID INTO L_PLANS2 FROM HRP1001
WHERE OTYPE EQ 'S'
AND OBJID EQ L_PLANS
AND RSIGN EQ 'A'
AND RELAT EQ '002'
AND ENDDA GE SY-DATUM
AND SCLAS EQ 'S'.
AND sobid EQ l_plans.
SELECT SINGLE PERNR INTO L_PERNR1 FROM PA0001
WHERE ENDDA GE SY-DATUM
AND PLANS EQ L_PLANS2.
SELECT SINGLE ENAME INTO L_NAME1 FROM PA0001
WHERE ENDDA GE SY-DATUM
AND PLANS EQ L_PLANS2.
I_W_DATA-ZZSRRMEVP = L_PERNR1.
I_W_DATA-ZZSRRMEVPNAME = L_NAME1.
*Monthly salary of Rm from PA0008
NUM = '01'.
IF I_W_DATA-ENDDA EQ '99991231'.
CLEAR V_AMOUNT.
SELECT SINGLE * INTO L_PA0008
FROM PA0008
WHERE PERNR EQ I_W_DATA-PERNR
AND ENDDA EQ '99991231'.
DO 30 TIMES.
IF STRLEN( NUM ) = 1.
CONCATENATE '0' NUM INTO NUM.
ENDIF.
CONCATENATE 'L_PA0008-BET' NUM INTO FLDNAM.
ASSIGN (FLDNAM) TO <FS>.
V_AMOUNT = V_AMOUNT + <FS>.
CLEAR <FS>.
NUM = NUM + 1.
ENDDO.
I_W_DATA-ZZMONSAL = V_AMOUNT.
ENDIF.
Getting salary monthly information
CLEAR : L_AMOUNT, L_AMOUNT_OFF,L_NAME1.
*CALL FUNCTION 'ZIBHR_EMP_INCENTIVE'
EXPORTING
S_PERNR = i_w_data-pernr
IMPORTING
INCENTIVE = l_amount
INCENTIVE_OFF = l_amount_off
i_w_data-zzmonsal_off = l_amount_off.
MODIFY I_T_DATA FROM I_W_DATA.
CLEAR L_ICNUM.
CLEAR L_PERNR.
ENDLOOP.
COst Center Enhancement for data source
Getting the employee count for a COST CENTER
WHEN '0COSTCENTER_ATTR'.
CLEAR : VL_COUNT.
LOOP AT I_T_DATA INTO I_W_DATA_KOSTL.
SELECT PERNR INTO TABLE IT_PERNR FROM PA0185
WHERE ICNUM EQ I_W_DATA_KOSTL-KOSTL
AND SUBTY = '05'
AND ENDDA EQ '99991231'.
DESCRIBE TABLE IT_PERNR LINES VL_COUNT.
MOVE : VL_COUNT TO I_W_DATA_KOSTL-ZZHEADCOUNT.
MODIFY I_T_DATA FROM I_W_DATA_KOSTL.
REFRESH : IT_PERNR.
ENDLOOP.
ENDCASE.
Similar Messages
-
CIN packages - Import taking lot of time
Hi,
We are on SAP 46C, CIN 40A. While i am trying to import CIN suport package 10 in my server, the system is taking lot of time. I have updated my SPAM to the latest version. As of now, the import has taken more than 4 hours. What will be the usual time for the CIN support package import. Is there any way to speed up the process. Please advise at the earliest.
Thanx,
subbuCheck
Note 532596 - FAQ: Country Version India (CIN)- Installation and SPs
. How long does a CIN installation take ?
The time depends on the hardware that is available. If 4 processors and 2 GB RAM is allocated to that instance then it takes about 40 minutes. The maximum time is about 1.5 hrs .
Be also aware of the fact, that 40A is no more supporter after December 2006.
Markus -
Background job is taking lot of time for processing the job.
One background job - which is processing Idocs is processing a job for more than 2000+ seconds.. and completed tho.
But this is happening for the past few days.. is there any way to trouble shoot, or find from any logs of this completed job, to find out why it was taking lot of time for processing.
Can you please tell me the steps of analyzing / trouble shooting why it was taking lot of time daily.
Regards,
Satish.Hi Satish,
Run DB stat from db13 it will improve the performance.
Check number of idocs. You can send part by part, instead of sending huge data.
Check SM58 logs
Suman -
(Urgent) form taking lots of time to load and fetch the data
Hi
I have very serious problem of perfomance. I have installed oracle portal and configured it properly.
Now except form everything working perfectly. but only forms and links are taking lots of time to load
as well as for fetching data. I try to tune my sga and aslo findout hits and miss but i didnt find any
any problem for it. it is ok. can u help me pls. how can i make my form fast.
My operation system is NT.
version of database oracle 8.1.7
Oracle Portal 3.0.8
Thanks in advance
raju parmar
[email protected]
nullhi chetan
Lots of Thanks.
Now it working perfect.
Raju
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Chetan Kashyap ([email protected]):
The workaround is provided at: http://technet.oracle.com:89/ubb/Forum81/HTML/000395.html <HR></BLOCKQUOTE>
null -
Hi All,
I am trying to upload 2LIS_02_SCL data, I am trying to refresh the entire data using Init, it is taking lot of time in Prodcution. This is creating the problem for me for next Back ground Job which runs in the night for delta's. Please can anybody guide me how to speed up the load? This datasource is connected to 2 Infocubes and 1 ODS.
Regards,
RajeshHi Sal,
I have done the same things as you said, my mistake is
R/3:
Locked all R/3 users.
Deleted from LBWG.
Filled setup tables using Document Date from 2006 to 2008 (Month wise i have filled).
BW:
I have cleaned entire data from 0PUR_C01 and 0PUR_C04.
Loaded data at a time to 2 Cubes and 1 ODS using Init upload.
It is started taking long time. Actual problem is load was not finished at the time of Daily load Process Chain starts(Night).
I have cancelled the job. made available only delta to Process Chain.
Now problem is escaled, again i started today same Init for 1 Cube only, again taking long time.
Regards,
Rajesh -
Extractor taking lots of time.
hi experts,
we are using extractor 2LIS_13_VDKON to extract the data.
but its taking lots of time.how can i solve this problem.
any help appreciated.Hi,
Have you done any enhancements(Append) to this DS.If so, make sure that code is performance optimistic.
Basically the setup table for 2LIS_13_VDKON will has the lot of data. For example, it holds at n avarage 10 records for each billing item record.
So also check system is uploading records to the New table of ODS or not.
With rgds,
Anil Kumar Sharma .P -
Taking lot of time for loading
Hi,
We are loading data from HR to BI. Connection between HR and BI has been done recently. When I am trying to load data from HR to BI it taking lot of time--for example to load 5recs its taking 8hrs. Its same for every datasource. Should we change anything in settings to makes IDOCS work proper? ThanksYou have to isolate the part that is taking the time.
- Is R/3 extraction quick? (You can check with RSA3 and see how long does it take.)
- If R/3 extraction is slow, then is the selection using an index? How many records are there in the table / view?
- Is there a user exit? Is user exit slow?
You can find out using monitor screen:
- After R/3 extraction completed, how long did it take to insert into PSA?
- How long did it take in the update rules?
- How long did it take to activate?
Once you isolate the problem area, post your findings here and someone will help you. -
Function Module Extraction from KONV Table taking lot of time for extractio
Hi
I have a requirement wherein i need to get records from KONV Table (Conditions (Transaction Data) ). i need the data corresponding to Application (KAPPL) = 'F'.
For this i had written one function module but it is taking lot of time (@ 2.5 hrs) for fetching records as there are large number of records in KONV Table.
I am pasting the Function Module code for reference.
<b>kindly guide me as to how the extraction performance can be improved.</b>
<b>Function Module Code:</b>
FUNCTION ZBW_SHPMNT_COND.
""Local interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR
*" VALUE(I_ISOURCE) TYPE SBIWA_S_INTERFACE-ISOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_PRIVATE_MODE) OPTIONAL
*" VALUE(I_CALLMODE) LIKE ROARCHD200-CALLMODE OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE ZBW_SHPMNT_COND OPTIONAL
*" E_T_SOURCE_STRUCTURE_NAME OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
The input parameter I_DATAPAKID is not supported yet !
TABLES: KONV.
Auxiliary Selection criteria structure
DATA: l_s_select TYPE sbiwa_s_select.
Maximum number of lines for DB table
STATICS: l_maxsize TYPE sbiwa_s_interface-maxsize.
Maximum number of lines for DB table
STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
counter
S_COUNTER_DATAPAKID LIKE SY-TABIX,
cursor
S_CURSOR TYPE CURSOR.
Select ranges
RANGES: L_R_KNUMV FOR KONV-KNUMV,
L_R_KSCHL FOR KONV-KSCHL,
L_R_KDATU FOR KONV-KDATU.
Declaring internal tables
DATA : I_KONV LIKE KONV OCCURS 0 WITH HEADER LINE.
DATA : Begin of I_KONV occurs 0,
MANDT LIKE konv-mandt,
KNUMV LIKE konv-knumv,
KPOSN LIKE konv-kposn,
STUNR LIKE konv-stunr,
ZAEHK LIKE konv-zaehk,
KAPPL LIKE konv-kappl,
KSCHL LIKE konv-kschl,
KDATU LIKE konv-kdatu,
KBETR LIKE konv-kbetr,
WAERS LIKE konv-waers,
END OF I_KONV.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
IF i_initflag = sbiwa_c_flag_on.
Initialization: check input parameters
buffer input parameters
prepare data selection
The input parameter I_DATAPAKID is not supported yet !
Invalid second initialization call -> error exit
IF NOT g_flag_interface_initialized IS INITIAL.
IF
1 = 2.
MESSAGE e008(r3).
ENDIF.
log_write 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDIF.
Check InfoSource validity
CASE i_isource.
WHEN 'X'.
WHEN 'Y'.
WHEN 'Z'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e009(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'009' "message number
i_isource "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
Check for supported update mode
CASE i_updmode.
For full upload
WHEN 'F'.
WHEN 'D'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e011(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'011' "message number
i_updmode "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
APPEND LINES OF i_t_select TO g_t_select.
Fill parameter buffer for data extraction calls
g_s_interface-requnr = i_requnr.
g_s_interface-isource = i_isource.
g_s_interface-maxsize = i_maxsize.
g_s_interface-initflag = i_initflag.
g_s_interface-updmode = i_updmode.
g_s_interface-datapakid = i_datapakid.
g_flag_interface_initialized = sbiwa_c_flag_on.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
APPEND LINES OF i_t_fields TO g_t_fields.
Interpretation of date selection for generic extraktion
CALL FUNCTION 'RSA3_DATE_RANGE_CONVERT'
TABLES
i_t_select = g_t_select.
ELSE. "Initialization mode or data extraction ?
CASE g_s_interface-updmode.
WHEN 'F' OR 'C' OR 'I'.
First data package -> OPEN CURSOR
IF g_counter_datapakid = 0.
L_MAXSIZE = G_S_INTERFACE-MAXSIZE.
LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'KNUMV'.
MOVE-CORRESPONDING l_s_select TO l_r_knumv.
APPEND l_r_knumv.
ENDLOOP.
LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'KSCHL'.
MOVE-CORRESPONDING l_s_select TO l_r_kschl.
APPEND l_r_kschl.
ENDLOOP.
Loop AT g_t_select INTO l_s_select WHERE fieldnm = 'KDATU'.
MOVE-CORRESPONDING l_s_select TO l_r_kdatu.
APPEND l_r_kdatu.
ENDLOOP.
*In case of full upload
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
OPEN CURSOR G_CURSOR FOR
SELECT MANDT
KNUMV
KPOSN
STUNR
ZAEHK
KAPPL
KSCHL
KDATU
KBETR
WAERS
FROM KONV
WHERE KNUMV IN l_r_knumv
AND KSCHL IN l_r_kschl
AND KDATU IN l_r_kdatu
AND KAPPL EQ 'F'.
ENDIF.
Refresh I_KONV.
FETCH NEXT CURSOR G_CURSOR
APPENDING CORRESPONDING FIELDS OF TABLE I_KONV
PACKAGE SIZE S_S_IF-MAXSIZE.
IF SY-SUBRC <> 0.
CLOSE CURSOR G_CURSOR.
RAISE NO_MORE_DATA.
ENDIF.
LOOP AT I_KONV.
IF I_KONV-KAPPL EQ 'F'.
CLEAR :E_T_DATA.
E_T_DATA-MANDT = I_KONV-MANDT.
E_T_DATA-KNUMV = I_KONV-KNUMV.
E_T_DATA-KPOSN = I_KONV-KPOSN.
E_T_DATA-STUNR = I_KONV-STUNR.
E_T_DATA-ZAEHK = I_KONV-ZAEHK.
E_T_DATA-KAPPL = I_KONV-KAPPL.
E_T_DATA-KSCHL = I_KONV-KSCHL.
E_T_DATA-KDATU = I_KONV-KDATU.
E_T_DATA-KBETR = I_KONV-KBETR.
E_T_DATA-WAERS = I_KONV-WAERS.
APPEND E_T_DATA.
ENDIF.
ENDLOOP.
g_counter_datapakid = g_counter_datapakid + 1.
ENDIF.
ENDFUNCTION.
Thanks in Advance
Regards
Swapnil.Hi,
one option to investigate is to select the data with a condition on KNUMV (primary IDX).
Since shipment costs are store in VFKP I would investigate if all your F condition records are used in this table (field VFKP-KNUMV).
If this is the case then something like
SELECT *
FROM KONV
WHERE KNUMV IN (SELECT DISTINCT KNUMV FROM VFKP)
or
SELECT DISTINCT KNUMV
INTO CORRESPONDING FIELD OF <itab>
FROM VFKP
and then
SELECT *
FROM KONV
FOR ALL ENTRIES IN <itab>
WHERE...
will definitively speed it up.
hope this helps....
Olivier -
Select query is taking lot of time to fetch data.....
Select query is taking lot of time to fetch data.
SELECT algnum atanum abdatu abzeit abname abenum bmatnr bmaktx bqdatu bqzeit bvlenr bnlenr bvltyp bvlber b~vlpla
bnltyp bnlber bnlpla bvsola b~vorga INTO TABLE it_final FROM ltak AS a
INNER JOIN ltap AS b ON btanum EQ atanum AND algnum EQ blgnum
WHERE a~lgnum = p_whno
AND a~tanum IN s_tono
AND a~bdatu IN s_tocd
AND a~bzeit IN s_bzeit
AND a~bname IN s_uname
AND a~betyp = 'P'
AND b~matnr IN s_mno
AND b~vorga <> 'ST'.
Moderator message: Please Read before Posting in the Performance and Tuning Forum
Edited by: Thomas Zloch on Mar 27, 2011 12:05 PMHi Shiva,
I am using two more select queries with the same manner ....
here are the other two select query :
***************1************************
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelpt LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelptrprctr
WHERE rldnr = c_telstra_projects
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
and rzzlstar in r_lstar
AND rpmax = c_max_period.
and the second one is
*************************2************************
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelnt LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelntrprctr
WHERE rldnr = c_telstra_networks
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
and rzzlstar in r_lstar
AND rpmax = c_max_period.
for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables. if i will not use it will delete all the data fetched earlier.
Thanks on advanced......
Sourabh -
Program is taking lot of time for execution
Hi all,
TYPES: BEGIN OF TY_MARA,
MATNR TYPE MATNR, " Material Number
ZZBASE_CODE TYPE ZBASE_CODE, " Base Code
END OF TY_MARA,
BEGIN OF TY_MAKT,
MATNR TYPE MATNR, " Material
MAKTX TYPE MAKTX, " Material Description
END OF TY_MAKT,
BEGIN OF TY_MARC,
MATNR TYPE MATNR , " Material Number
WERKS TYPE WERKS_D, " Plant
END OF TY_MARC,
BEGIN OF TY_QMAT,
MATNR TYPE MATNR, " Material Number
ART TYPE QPART, " Inspection Type
END OF TY_QMAT,
BEGIN OF TY_MAPL,
MATNR TYPE MATNR, " Material
PLNTY TYPE PLNTY, " Task List Type
END OF TY_MAPL,
BEGIN OF TY_PLKO,
PLNTY TYPE PLNTY, " Task List Type
VERWE TYPE PLN_VERWE, " Task list usage
END OF TY_PLKO,
BEGIN OF TY_KLAH,
CLASS TYPE KLASSE_D, " Class Number
END OF TY_KLAH,
BEGIN OF TY_FINAL,
MATNR TYPE MATNR, " Material Number
MAKTX TYPE MAKTX, " Material Description
ZZBASE_CODE TYPE ZBASE_CODE, " Base Code
WERKS TYPE WERKS_D, " Plant
CLASS TYPE KLASSE_D, " Class Number
ART TYPE QPART, " Inspection Type
VERWE TYPE PLN_VERWE, " Task list usage
MESSAGE TYPE STRING, " Message
END OF TY_FINAL.
DATA: I_MARA TYPE STANDARD TABLE OF TY_MARA ,
I_MAKT TYPE STANDARD TABLE OF TY_MAKT ,
I_MARC TYPE STANDARD TABLE OF TY_MARC ,
I_QMAT TYPE STANDARD TABLE OF TY_QMAT ,
I_MAPL TYPE STANDARD TABLE OF TY_MAPL ,
I_PLKO TYPE STANDARD TABLE OF TY_PLKO ,
I_KLAH TYPE STANDARD TABLE OF TY_KLAH ,
I_FINAL TYPE STANDARD TABLE OF TY_FINAL ,
WA_MARA TYPE TY_MARA,
WA_MAKT TYPE TY_MAKT,
WA_MARC TYPE TY_MARC,
WA_QMAT TYPE TY_QMAT,
WA_MAPL TYPE TY_MAPL,
WA_PLKO TYPE TY_PLKO,
WA_KLAH TYPE TY_KLAH,
WA_FINAL TYPE TY_FINAL.
DATA: V_MTART TYPE MARA-MTART,
V_MATNR TYPE MARA-MATNR,
V_ZZBASE_CODE TYPE MARA-ZZBASE_CODE,
V_WERKS TYPE T001W-WERKS,
V_BESKZ TYPE MARC-BESKZ.
*selection-screen
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_MTART FOR V_MTART DEFAULT 'halb' TO 'zraw',
S_MATNR FOR V_MATNR,
S_ZZBASE FOR V_ZZBASE_CODE,
S_WERKS FOR V_WERKS OBLIGATORY,
S_BESKZ FOR V_BESKZ.
SELECTION-SCREEN END OF BLOCK B1.
START-OF-SELECTION.
SELECT MATNR
ZZBASE_CODE
FROM MARA INTO TABLE I_MARA
WHERE MTART IN S_MTART "Material Type
AND MATNR IN S_MATNR "Material
AND ZZBASE_CODE IN S_ZZBASE."Base Code
IF NOT I_MARA IS INITIAL.
SELECT MATNR
MAKTX
FROM MAKT INTO TABLE I_MAKT FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR.
ENDIF.
IF NOT I_MARA IS INITIAL.
SELECT MATNR
WERKS
FROM MARC INTO TABLE I_MARC FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND WERKS IN S_WERKS "plant
AND BESKZ IN S_BESKZ."Procurement Type
ENDIF.
IF NOT I_MARA IS INITIAL.
SELECT MATNR
ART
FROM QMAT INTO TABLE I_QMAT FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND WERKS IN S_WERKS.
ENDIF.
IF NOT I_MARA IS INITIAL.
SELECT MATNR
PLNTY FROM MAPL INTO TABLE I_MAPL FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR.
ENDIF.
IF NOT I_MAPL IS INITIAL.
SELECT PLNTY
VERWE
FROM PLKO INTO TABLE I_PLKO FOR ALL ENTRIES IN I_MAPL
WHERE PLNTY = I_MAPL-PLNTY.
ENDIF.
LOOP AT I_MARA INTO WA_MARA.
CALL FUNCTION 'CLFC_BATCH_ALLOCATION_TO_CLASS'
EXPORTING
MATERIAL = WA_MARA-MATNR
PLANT = WA_MARC-WERKS
CLASSTYPE = '023'
I_IGNORE_MATMASTER = ' '
I_BATCHES_ONLY =
I_IGNORE_BUFFER = ' '
IMPORTING
CLASSTYPE =
CLASS = WA_KLAH-CLASS
EXCEPTIONS
WRONG_FUNCTION_CALL = 1
NO_CLASS_FOUND = 2
NO_CLASSTYPE_FOUND = 3
OTHERS = 4 .
*IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*ENDIF.
APPEND WA_KLAH TO I_KLAH.
ENDLOOP.
LOOP AT I_MARA INTO WA_MARA.
WA_FINAL-MATNR = WA_MARA-MATNR.
WA_FINAL-ZZBASE_CODE = WA_MARA-ZZBASE_CODE.
APPEND WA_FINAL TO I_FINAL.
SORT I_MAKT BY MATNR.
READ TABLE I_MAKT INTO WA_MAKT WITH KEY MATNR = WA_MARA-MATNR BINARY
SEARCH.
IF SY-SUBRC EQ 0.
WA_FINAL-MAKTX = WA_MAKT-MAKTX.
ENDIF.
APPEND WA_FINAL TO I_FINAL.
SORT I_MARC BY MATNR.
READ TABLE I_MARC INTO WA_MARC WITH KEY MATNR = WA_MARA-MATNR BINARY
SEARCH.
IF SY-SUBRC EQ 0.
WA_FINAL-WERKS = WA_MARC-WERKS.
ENDIF.
APPEND WA_FINAL TO I_FINAL.
SORT I_QMAT BY MATNR.
READ TABLE I_QMAT INTO WA_MARC WITH KEY MATNR = WA_MARA-MATNR BINARY
SEARCH.
IF SY-SUBRC EQ 0.
WA_FINAL-ART = WA_QMAT-ART.
ENDIF.
APPEND WA_FINAL TO I_FINAL.
SORT I_MAPL BY MATNR.
READ TABLE I_MAPL INTO WA_MAPL WITH KEY MATNR = WA_MARA-MATNR BINARY
SEARCH.
IF SY-SUBRC EQ 0.
SORT I_PLKO BY PLNTY.
READ TABLE I_PLKO INTO WA_PLKO WITH KEY PLNTY = WA_MAPL-PLNTY BINARY
SEARCH.
ENDIF.
WA_FINAL-VERWE = WA_PLKO-VERWE.
APPEND WA_FINAL TO I_FINAL.
ENDLOOP.
LOOP AT I_KLAH INTO WA_KLAH.
WA_FINAL-CLASS = WA_KLAH-CLASS.
APPEND WA_FINAL TO I_FINAL.
ENDLOOP.
LOOP AT I_FINAL INTO WA_FINAL.
WRITE:/ WA_FINAL-MATNR,
WA_FINAL-MAKTX,
WA_FINAL-ZZBASE_CODE,
WA_FINAL-WERKS,
WA_FINAL-CLASS,
WA_FINAL-ART,
WA_FINAL-VERWE.
ENDLOOP.
This is my program. it is giving out put.but it is taking lot of time for execution. what might be the porblem.pls let me know.
Thanks,Hi Mythily,
Try the following code.
TYPES: BEGIN OF ty_mara,
matnr TYPE matnr, " Material Number
zzbase_code TYPE zbase_code, " Base Code
END OF ty_mara,
BEGIN OF ty_makt,
matnr TYPE matnr, " Material
maktx TYPE maktx, " Material Description
END OF ty_makt,
BEGIN OF ty_marc,
matnr TYPE matnr , " Material Number
werks TYPE werks_d, " Plant
END OF ty_marc,
BEGIN OF ty_qmat,
art TYPE qpart , " Inspection Type
matnr TYPE matnr , " Material Number
werks TYPE werks_d, "Plant
END OF ty_qmat,
BEGIN OF ty_mapl,
matnr TYPE matnr , " Material
werks TYPE werks_d , "Plant
plnty TYPE plnty , " Task List Type
plnnr TYPE plnnr , " Key for Task List Group
plnal TYPE plnal , " Group Counter
zkriz TYPE dzkriz , " Counter for additional criteria
zaehl TYPE cim_count, " Internal counter
END OF ty_mapl,
BEGIN OF ty_plko,
plnty TYPE plnty , " Task List Type
plnnr TYPE plnnr , " Key for Task List Group
plnal TYPE plnal , " Group Counter
zaehl TYPE cim_count, " Internal counter
verwe TYPE pln_verwe, " Task list usage
END OF ty_plko,
BEGIN OF ty_klah,
class TYPE klasse_d, " Class Number
END OF ty_klah,
BEGIN OF ty_final,
matnr TYPE matnr, " Material Number
maktx TYPE maktx, " Material Description
zzbase_code TYPE zbase_code, " Base Code
werks TYPE werks_d, " Plant
class TYPE klasse_d, " Class Number
art TYPE qpart, " Inspection Type
verwe TYPE pln_verwe, " Task list usage
message TYPE string, " Message
END OF ty_final.
DATA: i_mara TYPE STANDARD TABLE OF ty_mara ,
i_makt TYPE HASHED TABLE OF ty_makt
WITH UNIQUE KEY matnr,
i_marc TYPE SORTED TABLE OF ty_marc
WITH NON-UNIQUE KEY matnr,
i_qmat TYPE SORTED TABLE OF ty_qmat
WITH NON-UNIQUE KEY matnr werks,
i_mapl TYPE SORTED TABLE OF ty_mapl
WITH NON-UNIQUE KEY matnr werks,
i_mapl_tmp TYPE STANDARD TABLE OF ty_mapl ,
i_plko TYPE SORTED TABLE OF ty_plko
WITH NON-UNIQUE KEY plnty
plnnr
plnal,
i_final TYPE STANDARD TABLE OF ty_final,
wa_mara TYPE ty_mara,
wa_makt TYPE ty_makt,
wa_marc TYPE ty_marc,
wa_qmat TYPE ty_qmat,
wa_mapl TYPE ty_mapl,
wa_plko TYPE ty_plko,
wa_klah TYPE ty_klah,
wa_final TYPE ty_final.
DATA: v_mtart TYPE mara-mtart,
v_matnr TYPE mara-matnr,
v_zzbase_code TYPE mara-zzbase_code,
v_werks TYPE t001w-werks,
v_beskz TYPE marc-beskz.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_mtart FOR v_mtart DEFAULT 'halb' TO 'zraw',
s_matnr FOR v_matnr,
s_zzbase FOR v_zzbase_code,
s_werks FOR v_werks OBLIGATORY,
s_beskz FOR v_beskz.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
SELECT matnr
zzbase_code
FROM mara
INTO TABLE i_mara
WHERE mtart IN s_mtart "Material Type
AND matnr IN s_matnr. "Material
AND zzbase_code IN s_zzbase."Base Code
IF NOT i_mara[] IS INITIAL.
SELECT matnr
maktx
FROM makt
INTO TABLE i_makt
FOR ALL ENTRIES IN i_mara
WHERE matnr EQ i_mara-matnr
AND spras EQ sy-langu.
SELECT matnr
werks
FROM marc
INTO TABLE i_marc
FOR ALL ENTRIES IN i_mara
WHERE matnr EQ i_mara-matnr
AND werks IN s_werks "plant
AND beskz IN s_beskz."Procurement Type
IF sy-subrc EQ 0.
SELECT art
matnr
werks
FROM qmat
INTO TABLE i_qmat
FOR ALL ENTRIES IN i_marc
WHERE matnr EQ i_marc-matnr
AND werks EQ i_marc-werks.
SELECT matnr
werks
plnty
plnnr
plnal
zkriz
zaehl
FROM mapl
INTO TABLE i_mapl
FOR ALL ENTRIES IN i_marc
WHERE matnr EQ i_marc-matnr
AND werks EQ i_marc-werks.
IF NOT i_mapl[] IS INITIAL.
i_mapl_tmp[] = i_mapl[].
SORT i_mapl_tmp BY plnty
plnnr
plnal.
DELETE ADJACENT DUPLICATES FROM i_mapl_tmp
COMPARING
plnty
plnnr
plnal.
SELECT plnty
plnnr
plnal
zaehl
verwe
FROM plko
INTO TABLE i_plko
FOR ALL ENTRIES IN i_mapl_tmp
WHERE plnty EQ i_mapl_tmp-plnty
AND plnnr EQ i_mapl_tmp-plnnr
AND plnal EQ i_mapl_tmp-plnal.
ENDIF.
ENDIF.
ENDIF.
LOOP AT i_mara INTO wa_mara.
wa_final-matnr = wa_mara-matnr.
wa_final-zzbase_code = wa_mara-zzbase_code.
READ TABLE i_makt INTO wa_makt
WITH KEY matnr = wa_mara-matnr
TRANSPORTING
maktx.
IF sy-subrc EQ 0.
wa_final-maktx = wa_makt-maktx.
ENDIF.
REFRESH i_final.
LOOP AT i_marc INTO wa_marc
WHERE matnr EQ wa_mara-matnr.
CLEAR wa_klah-class.
CALL FUNCTION 'CLFC_BATCH_ALLOCATION_TO_CLASS'
EXPORTING
material = wa_mara-matnr
plant = wa_marc-werks
classtype = '023'
IMPORTING
class = wa_klah-class
EXCEPTIONS
wrong_function_call = 1
no_class_found = 2
no_classtype_found = 3
OTHERS = 4.
IF sy-subrc EQ 0.
wa_final-class = wa_klah-class.
ENDIF.
READ TABLE i_qmat
WITH KEY matnr = wa_mara-matnr
werks = wa_marc-werks
TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
LOOP AT i_qmat INTO wa_qmat
WHERE matnr EQ wa_mara-matnr
AND werks EQ wa_marc-werks.
wa_final-art = wa_qmat-art.
READ TABLE i_mapl
WITH KEY matnr = wa_marc-matnr
werks = wa_marc-werks
TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
LOOP AT i_mapl INTO wa_mapl
WHERE matnr EQ wa_marc-matnr
AND werks EQ wa_marc-werks.
LOOP AT i_plko INTO wa_plko
WHERE plnty EQ wa_mapl-plnty
AND plnnr EQ wa_mapl-plnnr
AND plnal EQ wa_mapl-plnal.
wa_final-verwe = wa_plko-verwe.
APPEND wa_final TO i_final.
ENDLOOP.
ENDLOOP.
ELSE.
APPEND wa_final TO i_final.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT i_mapl INTO wa_mapl
WHERE matnr EQ wa_marc-matnr
AND werks EQ wa_marc-werks.
LOOP AT i_plko INTO wa_plko
WHERE plnty EQ wa_mapl-plnty
AND plnnr EQ wa_mapl-plnnr
AND plnal EQ wa_mapl-plnal.
wa_final-verwe = wa_plko-verwe.
APPEND wa_final TO i_final.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDLOOP.
CLEAR wa_final.
ENDLOOP.
LOOP AT i_final INTO wa_final.
WRITE:/ wa_final-matnr ,
wa_final-maktx ,
wa_final-zzbase_code,
wa_final-werks ,
wa_final-class ,
wa_final-art ,
wa_final-verwe .
ENDLOOP. -
Interface is taking lots of time for first time execution
Hello all,
I have one inbound interface in which i am updating T-code CO01 ,CO15 , MIGO and MB1A respectively
depending upon the condition in the incoming file.
When ever i run this interface for the first time it takes lots of time for execution, but when i run the same interface again with the same file it is taking half time of the first time execution.
I am not able to understand why it is taking lots of time for first execution and after that execution time is redued very much with the same file
Kindly help
Thanks
Sachin Yadavthank you santhosh for your reply..
as this program is in Production system it it taking 3 to 4 hour to execute.
Previously it was OK but from last 2 to 3 moths it is taking more time.
when i debug the code it is working fine. I din't find any point at which it is taking more time.
I am not aware about buffers and SAP memory. can you plz help
Do you have any idea why this is happening.
Or how can i rectify the problem?
Thanks
Sachin -
Partition switching taking lots of time
I have a partitioned table. All the partitions of this table are mapped to a single filegroup.
When I am trying to switch partition, it is taking lots of time more than 5 mins for a single partition.
I can see that there is a file in the filegroup and its size is very high that is 234GB.
Can partition switching take more time due to file size?
or is there any other issue?
I need help in finding out what is the problem.
Thanks,So you are running ALTER TABLE SWITCH? Check for blocking. The operation requires an Sch-M lock which means that it is blocked any query that is running, including queries using NOLOCK.
Erland Sommarskog, SQL Server MVP, [email protected] -
Web-I Report taking lots of time to refresh when filters changed
In BO XI 3.1 Web-I report is taking lot of time to refresh when any changes are made in edit query mode on the filters.
When the query is runned for the first time it runs well, but if we make any changes in the filters pane, it is taking lots of time to refresh, and when we cancel the query web-i server is not releasing the server resources (CPU, Memory)
Did anyone face this kind of a problem, and resolved it.
Please let me know your thoughts
Thank youHi,
why do you need 100K rows in your reports? Is there a way to consolidate/aggregate your data on the database?
Comparing sqlplus and BOBJ is a little bit unfair. Let me explain you why:
sqlplus starts displaying data after the query returns the first results. I am sure that if you measure the time that sqlplus needs to display ALL rows, this should be way more than just 10 secs.
On the other hand BOBJ will display something as soon as the first page can be created. Depending on the way your report is structured, it may be the case that the WebI server should first get ALL rows in order to be able to display the first page of your report. This is for example the case if you let the total number of pages being displayed or if you display total sums already at the header of your report or if you have added a chart based on your data also in the header of your report. Of course, after the first call the report will be cached (and thus fast to be displayed) until you change again the parameters values for your query.
Since you do not display (or do you use this function in a variable or a formula, maybe?) the total number of pages in your report, I can only assume that you either trying to display total sums (or other kinds of aggregated values) or a chart in the first page of your report. Can you confirm this?
Regards,
Stratos -
Browser is taking lot of time in loading forms
Hi
I am working on forms 10g..
when i am running my form.... the browser is loading applet and jar files.
After loading this it is taking lot of time to show forms...
Even I am clearing all my temp files frequently...
Why it is taking so much time??
What I have to do so that it can load forms in very least time??
ThanksAfter loading this it is taking lot of time to show forms...This could be caused by a resource issue on the Client PC. By resource I mean available RAM, JRE memory settings, etc. It could also be a conflict between the Client OS, installed JRE and the Browser. Please tell us what the Client OS, JRE and Browser are as well as how much RAM is installed on the client pc.
Even I am clearing all my temp files frequently...Are you clearing the Browsers temporary internet files or the JRE's JAR cache? If the JRE's JAR cache then you are forcing the client to download the JAR each time you clear the JAR cache.
The slowness can also be caused by how large your FORMS files are and what you are doing in the Pre-Form and When-New-Form-Instance triggers. If you are performing numerous calls to the database or calling SYNCHRONIZE too many time in any of the triggers that fire when a Form initially loads then this will cause your form to load slower.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Hi
I have a delete statement..which is taking lot of time. If I select this scenerio only 500 records are coming. But delete is taking lot of time.
Please advise.
delete from whs_bi.TRACK_PLAY_EVENT a
where a.time_stamp >=to_date('5/27/2013','mm/dd/yyyy')
and a.time_stamp <to_date('5/28/2013','mm/dd/yyyy')Thanks in adv.
KPRLets check the wait events.
Open 2 sessions, 1 for running the update command and another for monitoring wait events. The session in which you want to run UPDATE, find the SID of that session ( SELECT userenv('SID') from dual ).
Now run the update in one session (of which we have already found the SID).
Run following query in another session
select w.sid sid,
p.spid PID,
w.event event,
substr(s.username,1,10) username,
substr(s.osuser, 1,10) osuser,
w.state state,
w.wait_time wait_time,
w.seconds_in_wait wis,
substr(w.p1text||' '||to_char(w.P1)||'-'||
w.p2text||' '||to_char(w.P2)||'-'||
w.p3text||' '||to_char(w.P3), 1, 45) P1_P2_P3_TEXT
from v$session_wait w, v$session s, v$process p
where s.sid=w.sid
and p.addr = s.paddr
and w.event not in ('SQL*Net message from client', 'pipe get')
and s.username is not null
and s.sid = &your_SIDWhile UPDATE is running in another session, run above query in second session for 5-6 times, with gap of (say) 10 seconds. If you can give us the output of monitoring query (from all 5-6 runs), that might throw more light on whats going under the hood.
Maybe you are looking for
-
Partition prevents solaris 10 installation
I am trying to install solaris 10 on a multi-boot system with Win XP and SuSE 9.2 Linux. During the installation I get the WARNING: A Linux fdisk partition was found on this disk (c1d0), which is the default bootdisk. Having a Linux fdisk partition o
-
Unrecognized Windows Sockets error...
Hello everybody! I am encountering the following problem, when I try to run a program which wants to access the internet. I pasted an extract from the source code here, which I think includes the critical lines: import java.net.*; import java.io.*; c
-
What does Acrobat 9 pro have over Acrobat 7 pro?
Does anyone know where I can find what features are available in Acrobat 9 pro that aren't in Acrobat 7 pro? Or know off hand what the differences are. I can't find a comparison anywhere.
-
How can I tranfer photos from my Optimus LG 5 to my imac iphoto
My computer does not reconize my phone when I plug it in. I can't transfer photos then. Suggestions?
-
When I send an email it appears in my inbox
Is there a way to stop this.