BI CMOD Performance
Dear Friends,
I have a performance related question.
We need to develop a report in which Sum of top 5 materials based on delivery quantity has to be displayed monthwise.
Eg: If in January Materials M1 M2 M5 M6 M7 are top 5 in delivery quantity, then the sum of their delivery quantity.
If in Feb Materials M2 M3 M5 M8 M9 are top 5 in delivery quantity, then the sum of their delivery quantity.
and so on till December.
I thought of using condition TOP N on delivery quantity in Bex query. (Pls correct me if i am wrong)
Problem: Top N will work only for one month in a single query. It cant work for different month (different top 5 materials)
Solution Proposed:
1. Make 12 different queries, one for each month (using Top N) and put each result in a workbook.
2. 12 different CMOD variables and cmod code picksup top 5 materials for each month and put in each variables of respective months. Restrict using these cmod variables for respective columns.
So I wanted your valuable suggestions which of the above method will be of good performance (considering maintenance, etc factors) and the reason also.
Approximate number of records 1 lakh per year.
Kindly give ur suggestions.
Thanks,
Guru
Hi
I think I hv answered this in some other thread. Pl close this thread.
Cheers
Umesh
Similar Messages
-
Hi All,
While executing the extractor(data source) 0customer_text i am getting the dump in RSA3. The dump says one of the filed names in the SELECT clause was not recongnized.
In RSA3 i am only providing Data records / Call = 100000 and No. of . Extr.calls = 1000.
Please tell me why it is happening...Hello,
When you are selecting more number of records, the RSA3 extractor checker is giving dump because the internal tables or Database read statements you are using are consuming all the temproary system place.
In the dump you might get some error messages like:
o The maximum size of an SQL statement has been exceeded.
o The statement contains too many input variables.
o The space needed for the input data exceeds the available memory.
In such cases, the best way to eliminate these errors is to try and improve the enhancement CMOD performance. In my case, I faced the same issue, we were passing our records to a different database program from CMOD and storing the result which we got from the program into a internal table and using it in CMOD. To eliminate this problem, we instead of passing all the records passed portions to the program and it worked.
The best way to improve performance is to eliminate the duplicates when looping the DataSource data, it helps!
Regards,
Pankaj -
Performance wise: CMOD or dividing the queries.
Dear Friends,
I have a performance related question.
We need to develop a report in which Sum of top 5 materials based on delivery quantity has to be displayed monthwise.
Eg: If in January Materials M1 M2 M5 M6 M7 are top 5 in delivery quantity, then the sum of their delivery quantity.
If in Feb Materials M2 M3 M5 M8 M9 are top 5 in delivery quantity, then the sum of their delivery quantity.
and so on till December.
I thought of using condition TOP N on delivery quantity in Bex query. (Pls correct me if i am wrong)
Problem: Top N will work only for one month in a single query. It cant work for different month (different top 5 materials)
Solution Proposed:
1. Make 12 different queries, one for each month (using Top N) and put each result in a workbook.
2. 12 different cmod variables and cmod code picksup top 5 materials for each month and put in each variables of respective months. Restrict using these cmod variables for respective columns.
So I wanted your valuable suggestions which of the above method will be of good performance (considering maintenance, etc factors) and the reason also.
Approximate number of records 1 lakh per year.
Kindly give ur suggestions.
Thanks,
Guru
Edited by: hi2guru on Nov 17, 2010 5:21 AM
Edited by: hi2guru on Nov 17, 2010 5:55 AMHi
Interesting situation !!!
I think writing 12 queries is not a good idea. For a simple reason that you will have either run a Query at a time (with a different input for each of this) .. isnt it ?
Creating variables for each of the month would be a good idea. You could generate value of 11 months based on a single input from the user. Moreover, the user can give any input ...say for eg the input is 11.2010 then through the customer exit you could find values for the past 11 months. Similarly even if the user changes the input value (say to 08.2010) the system can easily calculate the previous 11 months thus giving you the desired output.
Cheers
Umesh -
Need to perform calculations on a specific characteristic in a BeX query
Hi,
I have a requirement to perform calculations based on Characters.
The data that is currently displayed in the report.
Date User Activity A B
04/24/2014 BR3TXA PTWY 10 12
04/24/2014 BR3TXA CLX1 25 04
04/24/2014 YEXM035 NOWE 14 15
04/24/2014 YAXP134 DONQ 08 05
04/24/2014 YRST112 PTWY 12 05
If Activity is PTWY, then A should be A * B = A. For the rest of the activity type, the value in A should be the same.
The result should display as Below:
Date User Activity A B
04/24/2014 BR3TXA PTWY 120 12
04/24/2014 BR3TXA CLX1 25 04
04/24/2014 YEXM035 NOWE 14 15
04/24/2014 YAXP134 DONQ 08 05
04/24/2014 YRST112 PTWY 60 05
Is there a way out in IF, THEN, ELSE statements. Or Customer Exit variable with Code in CMOD would work?This can be achieved just with the help of two simple selections or RKF.
Restrict the KF A with the activity = PTWY--Lets call this RKF1..Now this will populate value against PWTY only.
Create another Restricted KF--with A--This time Exclude value = PWTY--This will populate values against activity other than PWTY...Lets name it RKF2.
Now create a new formula say F1 = (RKF1*B)--Multiply RKF1 with B keyfigure.
Now the final formula say F2 = (F1+RKF2)--This will give the desired result.
Hide the other objects.
Regards,
AL -
Function Module Call Via CMOD Logic for Master Data Enhancement
Hi Friends Please help me to resolve this, would really be very kind of all of you.
Requirement. I want to Enhance the field ZFACTREG from VIBDBE table in my datasource 0busentity_attr extract structure l_s_REIS_BUSENTITY_ATTR, I want to create the logic in CMOD exit_saplrsap_002 to call my function module for enhancement of master data. Please help me Step by Step
Thanks
Poonam Roy
<b>Step #1</b>
I put this code which gives me error in CMOD like this
ERROR : Das formale Argument 'OTHERS' muss am Schluss der Ausnahmeliste stehen.
ABAP Code#1 IN exit_saplrsap_002
DATA: l_d_fmname(30) TYPE c.
CONCATENATE 'Z_DS_' i_datasource(25) INTO l_d_fmname.
TRY.
CALL FUNCTION l_d_fmname
EXPORTING
I_DATASOURCE = I_DATASOURCE
I_UPDMODE = I_UPDMODE
TABLES
I_T_SELECT = I_T_SELECT
I_T_FIELDS = I_T_FIELDS
I_T_DATA = I_T_DATA
C_T_MESSAGES = C_T_MESSAGES
EXCEPTIONS
RSAP_CUSTOMER_EXIT_ERROR = 1
OTHERS = 2
IF FOUND.
IF SY-SUBRC <> 0.
RASIE RSAP_CUSTOMER_EXIT_ERROR.
END IF
CATCH CX_SY_DYN_CALL_ILLEGAL_FUNC.
ENDTRY.
<b>Step#2</b>
I simple created the Function module Z_DS_BUSINESS
and put the code in source code which gives me error . what should i put in other tabs like"Import", Export", Tables" i kept blank
ABAP CODE give me error : The Dictionary structure or table "FIELD-SYMBOLS" is either not active. i have to remove include in the FM. WHY SO??
FUNCTION Z_DS_BUSINENSS
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_DATASOURCE) TYPE RSAOT_OLTPSOURCE
*" VALUE(I_CHABASNM) TYPE SBIWA_S_INTERFACE-CHABASNM
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT
*" I_T_FIELDS TYPE SBIWA_T_FIELDS
*" I_T_DATA
*" C_T_MESSAGES STRUCTURE BALMI OPTIONAL
*" EXCEPTIONS
*" RSAP_CUSTOMER_EXIT_ERROR
INCLUDE ZXRSAU02.
WRITE: / 'INSIDE THE Z_DS_MEASUREMENTS PROGRAM'.
TABLES: REIS_BUSENTITY_ATTR,
VIBDBE,
field-symbols:.<fs_REIS_BUSENTITY_ATTR> like REIS_BUSENTITY_ATTR.
DATA: BEGIN OF i_c_t_data OCCURS 0.
include structure REIS_BUSENTITY_ATTR.
DATA END OF i_c_t_data.
DATA: i_c_t_data_copy like i_c_t_data OCCURS 0 WITH HEADER LINE,
begin of i_vibdbe occurs 0,
INTRENO like vibdbe-INTRENO,
ZFACTREG like vibdbe-ZFACTREG,
end of i_vibdbe.
i_c_t_data_copy[] = i_c_t_data[] = c_t_data[].
sort i_c_t_data_copy by vibdbe.
Select INTRENO
into table i_VIBDBE from VIBDBE
for all entries in i_c_t_data_copy
where INTRENO = i_c_t_data_copy- INTRENO.
if sy-subrc = 0.
sort i_VIBDBE by INTRENO.
loop at i_c_t_data assigning <fs_REIS_BUSENTITY_ATTR>.
clear: i_VIBDBE.
read table i_VIBDBE with key INTRENO = <fs_REIS_BUSENTITY_ATTR>-INTRENO
BINARY SEARCH
transporting ZFACTREG .
if sy-subrc = 0.
<fs_REIS_BUSENTITY_ATTR>-ZZFACTORY = i_vibebe-ZFACTREG
endif.
null(I leave office until Monday morning, Europe time)
in include from customer-exit ZXRSAU01, etc.
CASE I_DATASOURCE.
WHEN '0CUSTOMER_ATTR'.
PERFORM 0customer_attr changing i_t_data...
ENDCASE.
In each perform, doing what you wrote ; select (needed fields) from complementary-database-table into an internal table with a for all entries. sort the table. LOOP and MODIFY on i_t_data.
In some case i had to insert lines of i_t_data to an internal table of DS_structure when entering subroutine and back at exit. (on 4.6C PI 2003 if i remember)
Some optimization done when reading small tables (T001 society and the same, these are filled once and not for each packet of data.
Your idea of creating different FM is of interest, but the cost of passing i_t_data between two programs (two function groups) may overcome the gain of performance. In a job only one DataSource is processed so only one routine is actually called.
Regards. -
CMOD exit_rsap_saplr_001 for transactional data ABAP CODE
Hi please confirm that you want to convey that i can write the actual code in CMOD exit_rsap_saplr_001 for transactional data?? if i put 20 data sources enhancement code in there is'nt that too bulky and will cause the failing all extractor if one code is wrong if you still suggest that i can go ahead with 20 similar codes as below . please see my code below which i have used for all 20 datasources with little modification
if you can recommend some changes in code to improve performance would be great
case i_datasource.
WHEN '0CUSTOMER_ATTR'.
loop at i_t_data into l_s_BIW_KNA1_S.
l_tabix = sy-tabix.
clear i_knvp.
select single * from KNVP into i_knvp where KUNNR = l_s_BIW_KNA1_S-KUNNR.
if sy-subrc = 0.
l_s_BIW_KNA1_S-ZZPARFN = i_knvp-PARVW.
l_s_BIW_KNA1_S-ZZCUSNOBP = i_knvp-KUNN2.
modify i_t_data from l_s_BIW_KNA1_S index l_tabix.
endif.
endloop.
endcase.
Thanks
PoonamCheck this simple code for Z...include into the FM EXIT_SAPLRSAP_001 where zcomp is new field added into the datasource 8zsales2.
data : l_s_/BIC/CE8ZSALES2 like /BIC/CE8ZSALES2,
l_tabix like sy-tabix.
case i_datasource.
when '8ZSALES2'.
loop at c_T_DATA into l_s_/BIC/CE8ZSALES2.
l_tabix = sy-tabix.
fill the new field
select comp_code from /BI0/MCOMP_CODE into l_s_/BIC/CE8ZSALES2-zcomp
where comp_code = '1000'.
if sy-subrc = 0.
*l_s_ZFIAA_IS001_TXT50 = ANLA_TXT50.
modify c_t_data from l_s_/BIC/CE8ZSALES2 index l_tabix.
endif.
endselect.
endloop.
endcase.
Edited by: Rohan Kumar on Jan 16, 2008 8:21 AM -
Hi ABAP Experts,
good day all,
iam working as BI consultant as per user requirement some of the fields are not there i enhanced to R/3 by using cmod . i have written some code every thing fien .but its very bad performance almost its taking more than 24 hrs taking . here i have written many SQL statement . can any one suggest me how to improve the performance of code.
Tables declaration for EMPLOYEE_ATTR
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.Hi Rama,
1st: improve the know-how for understanding whats going on in your source
2nd: know the slowest parts of your source (identify the "lowest hanging fruits" ) and start tune these
parts.
Tools:
Check this blog for using SE30 and ST05:
The ABAP Runtime Trace (SE30) - Quick and Easy
Unfortunatley, I'm not able to give you an advice in terms of code - up to now we are only guessing what may slow you down.
It may be good to have a senior ABAPer on your side to help you with the tools mentioned above.
Bye
yk -
Hi please confirm that you want to convey that i can write the actual code in CMOD exit_rsap_saplr_001 for transactional data?? if i put 20 data sources enhancement code in there is'nt that too bulky and will cause the failing all extractor if one code is wrong if you still suggest that i can go ahead with 20 similar codes as below . please see my code below which i have used for all 20 datasources with little modification
if you can recommend some changes in code to improve performance would be great
case i_datasource.
WHEN '0CUSTOMER_ATTR'.
loop at i_t_data into l_s_BIW_KNA1_S.
l_tabix = sy-tabix.
clear i_knvp.
select single * from KNVP into i_knvp where KUNNR = l_s_BIW_KNA1_S-KUNNR.
if sy-subrc = 0.
l_s_BIW_KNA1_S-ZZPARFN = i_knvp-PARVW.
l_s_BIW_KNA1_S-ZZCUSNOBP = i_knvp-KUNN2.
modify i_t_data from l_s_BIW_KNA1_S index l_tabix.
endif.
endloop.
endcase.
Thanks
PoonamHi,
As a performace improvement , you better to store all the required records from KNVP table into internal table as shown below.
and one more thing , there are different includes( and FM ) for MAster data and Transaction data enhancements respectively.
TYPES BEGIN OF TYPE_BIW_KNA1_S.
INCLUDE STRUCTURE BIW_KNA1_S.
TYPES END OF TYPE_BIW_KNA1_S.
TYPES BEGIN OF TYPE_KNVP.
TYPE: KUNNR LIKE KNVP-KUNNR,
PARVW LIKE KNVP-PARVW,
KUNN2 LIKE KNVP-KUNN2.
TYPES END OF TYPE_KNVP.
WHEN '0CUSTOMER_ATTR'.
DATA:
ITAB_BIW_KNA1_S TYPE STANDARD TABLE OF TYPE_BIW_KNA1_S
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
DATA:
ITAB_KNVP TYPE STANDARD TABLE OF TYPE_KNVP
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
ITAB_BIW_KNA1_S[] = I_T_DATA[].
SELECT KUNNR PARVW KUNN2 FROM KNVP INTO CORRESPONDING FIELDS OF TABLE ITAB_KNVP FOR ALL ENTRIES IN ITAB_BIW_KNA1_S
WHERE KUNNR = ITAB_BIW_KNA1_S-KUNNR.
LOOP AT ITAB_BIW_KNA1_S.
READ TABLE ITAB_KNVP WITH KEY KUNNR = ITAB_BIW_KNA1_S-KUNNR.
IF SY-SUBRC EQ 0.
ITAB_BIW_KNA1_S-ZZPARFN = ITAB_KNVP-PARVW.
ITAB_BIW_KNA1_S-ZZCUSNOBP = ITAB_KNVP-KUNN2.
MODIFY ITAB_BIW_KNA1_S.
ENDIF.
CLEAR ITAB_BIW_KNA1_S.
ENDLOOP.
I_T_DATA[] = ITAB_BIW_KNA1_S[].
With rgds,
Anil Kumar Sharma .P -
Need help regarding the few clarification in writing cmod
Hi All,
I need to write a cmod by creating a new project for that. The main purpose is to define variables in it which will be used in reporting(restrictions).
Now I need to enhance that structure with RSR00001 code since it dealys with declaring the variables.
But this enhancement code is being used in some other project as well, because of it I am unable to use it in my project..
Can you please explain me how can I overcome this situation.
Thanks,
vinay.Hi Vinay,
Write this code in CMOD :
data:
z_include type program,
Z_return.
when others.
* Select the include program using the variable
perform select_include using i_vnam
changing z_include
z_return.
check z_return = 0.
* Check that include program exists
perform check_include_program using z_include
changing z_return.
check z_return = 0.
* Process the appropriate variable by calling the generic form
* 'PROCESS_VARIABLE' in the include program just selected
perform process_variable in program (z_include)
tables e_t_range
i_t_var_range
using i_vnam
i_vartyp
i_iobjnm
i_s_cob_pro
i_s_rkb1d
i_periv
i_step
lv_zs_bsw_offset
changing e_meeht
e_mefac
e_waers
e_whfac
c_s_customer.
FORM select_include using p_var
changing p_include
p_error.
select single zinclude
into p_include
from zvariables
where zvarname = p_var.
p_error = sy-subrc.
ENDFORM.
form check_include_program using p_include
changing p_error.
data:
l_name type programm.
select single name
into l_name
from trdir
where name = p_include.
p_error = sy-subrc.
endform.
Then you can create a table having two column, variable value and its corresponding program.
You will then not need to disturb the CMOD Code.
-Vikram -
Explain Customer Exit (ABAP) Written in CMOD
Hi Experts,
Please explain what this Customer Exit (CMOD) is performing
Here var1 is the user entered expiry date and test1 is the newly created customer exit variable.
What happens if user enters 01.05.2008 to 31.05.2008
data: yrr1(4) type n,
mn(2) type n,
dy1(2) type n.
when 'test1'.
if i_step = 2. "after the popup
loop at i_t_var_range into loc_var_range
where vnam = 'var1'.
yrr1 = loc_var_range-low+0(4).
mn = loc_var_range-low+4(2).
dy1 = loc_var_range-low+6(2).
clear l_s_range.
concatenate yrr1 mn '01' into l_s_range-low.
concatenate yrr1 mn dy1 into l_s_range-high.
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
append l_s_range to e_t_range.
exit.
endloop.
endif.HI,
it will populate the below range for test1.
01.05.2008 to 01.05.2008.
based on the selection provided in var1, it takes the from value.
then it takes the first day of the month of the from value from the var1 to the from date in var1.
suppose you give in var1 25.05.2008 to 31.05.2008
then in test1 it will take 01.05.2008 to 25.05.2008
retgds,
Shashank -
How to find quickly what's wrong with the performance of a BW Query?
Hi All,
After a long time, I had to work on performance tuning of a query, Version BI 7.0 EHP 1, SP7.
Compression in done, BI Stats are running, showing that OLAP time is high almost 70%, compared to 20% DB Read time.
Aggregates cannot be created due to the nature of the cube, BIA is out of scope.
How to find quickly, step by step, what's wrong with a particular query.
Thanks in advance,
Best Regards,
- ShashiHi Sashi ,
1. OLAP time is more, you need to increase OLAP cache, you have different options for the query in RSRT t-code..
Select properties which makes to store the query result set in OLAP Cache for permanent.
Doc for the same :
http://www.sdn.sap.com/44A46FE1-6DC0-4F2C-A8CB-A1BB45DF0186/FinalDownload/DownloadId-ED38793C4C172FE2AFFDE727E36B3991/44A46FE1-6DC0-4F2C-A8CB-A1BB45DF0186/irj/scn/go/portal/prtroot/docs/library/uuid/f048c590-31a4-2c10-8599-bd01fabb93d4?QuickLink=index&overridelayout=true
2.Use only less no of Characteristics in the initial report. Place remaining in Free characteristics.
3.You need to check the query .It cmod code exist for any variable or your query have lots of navigational attributes then try to check for code efficiency .
4.If Front End time more then try to avoid the more characteristics in displaying the query result.
5.Use authorization objects on queries if possible .That will reduce data amount .
6.Use query read mode and global structures as when possible.
Some helpful links :
http://www.tli-usa.com/download/Expert_Tips_and_New_Techniques_for_Optimizing_Data_Load_and_Query_Performance__Part_Two_.pdf
how to increase the performance
Aggregates in SAP BW
bw statistics
What is the use of cube partition?
Create indices before or after compression
Regards,
Jaya Tiwari -
hi gurus
i have been trying to enhance a standard extractor in R3, but when i go to the cmod screen, and try to wrtie the Abap code the screen is greyed out. i cant type my code in. this is very weird.
i have already tried turning off the "in performance assistant" under help menu. didnt work. and i have also tried to "switch off assistant" under edit--> modification operations. option.
if any one has any other suggestion plz let me know
thanks...THANKS
-
HI gurus
please can u help in loading issues.i am extracting data from standard extractor in purchasing for 3 lakhs record it is taking 18 hrs..can u please suuguest me loading performance issues .
-KPHi,
Loading Performance:
a) Always load and activate the master data before you load the transaction data so that the SIDs don't have to be created at the loading of the transaction data.
b) Have the optimum packet size. If you have too small a packet size, the system writes messages to the monitor and those entries keep increasing over time and cause slow down. Try different packet sizes to arrive at the optimum number.
c) Fine tune your data model. Make use of the line item dimension where possible.
d) Make use of the load parallelization as much as you can.
e) Check your CMOD code. If you have direct reads, change them to read all the data into internal table first and then do a binary search.
f) Check code in your start routine, transfer rules and update rules. If you have BW Statistics cubes turned on, you can find out where most of the CPU time is spent and concentrate on that area first.
g) Work with the basis folks and make sure the database parameters are optimized. If you search on OSS based on the database you are using, it provides recommendations.
h) Set up your loads processes appropriately. Don't load all the data all the time unless you have to. (e.g) If your functionals say the historical fiscal years are not changed, then load only current FY and onwards.
i) Set up your jobs to run when there is not much activity. If the system resources are already strained, your processes will have to wait for resources.
j) For the initial loads only, always buffer the number ranges for SIDs and DIM ids
Hareesh -
I have created a quote report with narratives around the opportunity, opportunity-product, and account information. The report contains a pivot table.
I'm getting very hit or miss performance results on the report. Sometimes the report runs faster for all opportunities compared to when its prompted with an opty id from a web link.
Any thoughts? There doesn't seem to be one column that makes a difference.
Also this is not an analytical report as the quotes need to be generated same day.Hi Shaik,
Please remove all the join select queries and use 'for all entries' varaiant of the select query. Check whether you can create and use indexes in ur queries.
Thanks and Regards,
Saurabh Chhatre -
I have a performance issue with a query - it would be something like -
select col1,col2, sum(col3), get_val(col_4)
from table1
where
get_val(col_4) is not null
group by col1,col2, get_val(col_4)
I have simplified this but it is something similar. This works great - performance is great. Now I commented out the where clause as I needed to populate null values - and that's it the query does not retrieve the resultset - it keeps running forever. With the where clause it comes back in 60 seconds. There is only one row out of 560 rows that has null value for col_4 which i need to display.
Any help is appreciated.The only difference I notice between the two sqls is HASH(UNIQUE) -
with IS NOT NULL in where clause -
SELECT STATEMENT ALL_ROWS 1598 1 209
HASH(UNIQUE) 1598 1 209
HASH(GROUP BY) 1598 1 209
When is not null is removed from the where clause -
SELECT STATEMENT ALL_ROWS 1598 1 206
HASH(GROUP BY) 1598 1 206
I'm guessing that the index is being used in the first scenario and not in the second. Any idea/suggestion as to how to over come this?
Thanks
Maybe you are looking for
-
My iTunes is just not working! Please help!
About a week ago, my iTunes just stopped working. When I tried to open it, I got that stupid Windoze message that iTunes had encountered a problem and had to close. And now I can't get it to work. I completely uninstalled both iTunes and QT and did a
-
How to restore a used iphone with another iphone's backup?
Hi, My husband broke his iphone so I made him a deal: I get to buy the new 3G S, and he can have my 3G. Here's my problem. I restored my brand-new 3G S from my 3G's backup when I came home from purchasing it and all is great there. Now I'm trying to
-
Fee payments against specific programmes
Hi A slight variation on something we were looking at earlier! One of our schools is looking to introduce a new suite of programmes that do not have any specific modules attached but rather students can select as per their requirements. The intention
-
Hi Friends, Could any of you please send me some XI real time scenarios and processing steps. Thanks in advance Jeyaseelan.G
-
Transfer or data from R3 to BW
Hi, I have a prog in the R3 side which extracts data fron 3 tables and put them on the app. server. Then we FTP that to the BW side. But for two of the years the data that we get in the BW side is far more than what it should be. For those two years