Performance Issue on a Xraid (Raid 5) for video digitalization
Hello Everyone
I have a Mac Pro (2x3ghz + 8 Go Ram + Fiber channel card) directly linked to a Xraid via Fiber (there is no Xsan and no Xserve as controller).
The Xraid is composed of 8 X 750 Go HD and set up as Raid 5.
We are working in video production/editing and it is important for us to a good level of security on our data but also to be able to digitalize rushes directly on the Raid.
We are working essentially in HUD format with Panasonic Cams (HUD) and thus are working with VCR HUD format which is meant to require 100 mb/s data rate.
When trying to capture (Final cut studio 2) directly on the Raid, we have frames drop and when I run a little utility software to test the writing speed on the Raid it tells me that the rate is around 95-98 Mb/s which probably explains the frames dropping.
My question is : Is this normal to have such a low data rate in writing with the Xraid configuration ?
If yes is there a way to improve it by some means ?
Thanks in advance
Julien
How are your 8 drives configured? That's an unusual, and certainly sub-optimal, configuration.
RAID has three components that typically impact performance. One is the bus architecture (in this case a fiber channel/ATA hybrid), second is disk capacity (speed degrades as the array fills), and the third is the number of drives.
You can't do much about the bus architecture, other than trust that Apple have scaled it appropriately.
It's worth checking the disk space to see if that's impacting performance, but I suspect the drive configuration is going to be the issue.
Since you're running 8 drives I'm guessing you're running two 4-drive arrays.
The optimal performance for any array is achieved with the largest number of drives. Since the XServe RAID controllers are designed for 7 drives each, you're essentially running each array at 4/7ths of its potential.
Of course, you don't gain much by switching all the drives onto a single controller since now you're limited by the single fiber channel link to the host, although whether one link/7 drives is better or worse than 2 links/4 drives each is something that will have to be tested.
Your best solution may be to expand the array to 14 drives to boost the disk throughput.
Similar Messages
-
The best RAID level for video editing that has some form of redundancy?
I've been asked to help find the best solution for importing and editing large amounts of HDV (25 Mbit/s) video. However, those whom I am helping also want a level of redundancy that will allow a single drive to fail and their data to be preserved. So what I'm trying to figure out is the best RAID level (or levels) for their need. I'm fairly certain that either 0+1 or 10 is what I'm looking for, however the I/O performance differences between 0+1 and 10 aren't quite clear to me. If someone could explain that to me I would appreciate it. Additionally, if someone knows a better level than either 0+1 or 10 for the needs I described, please don't hesitate to let me know.
The difference between RAID 10 and RAID 0+1 is how the array is created.
RAID 0+1 creates a RAID from multiple RAID 0 arrays that are mirrored.
You can tolerate any number of drive failures in any one side of the mirror (that side of the mirror goes offline as soon as any one disk fails, so it doesn't matter how many other disks fail in the same array), but one drive failure on both parts of the mirror will trash your data.
RAID 10 creates a stripe of multiple RAID 1 mirrors.
In this setup you create RAID 1 mirror sets and stripe them together.
In this setup you can tolerate one disk failure in each element of the stripe.
For example if you have 6 drives you might create three mirrors of two drives each, and each mirror is then striped.
You can lose one drive in each mirror, but if you lose two drives in any mirror set, you're out of luck.
In both cases, though, you're not going to get the best usage out of the array since mirroring has a 50% overhead - meaning you're only going to get 50% of your total disk capacity as usable space.
With the XServe RAID, the RAID 5 performance is very good - good enough for your 25MB/sec throughput so I'd go with RAID 5 arrays, not RAID 0 or 1 on the XServe RAID itself.
Then, depending on your space requirements, you can either stripe or mirror them together for a RAID 50 or 51 array. In this way you gain the data redundancy of RAID 5 with better disk utilization than 10 or 0+1.
RAID 50 will give you the best performance (and the most usable space), RAID 51 will give you the best redundancy.
At the end of the day it's up to you to decide which format to use based on performance and usable space requirements. -
Performance issues with the Tuxedo MQ Adapter
We are experimenting some performance issues with the MQ Adapter. For example, we are seeing that the MQ Adapter takes from 10 to 100 ms in reading a single message from the queue and sending to the Tuxedo service. The Tuxedo service takes 80 ms in its execution so there is a considerable waste of time in the MQ adapter that we cannot explain.
Also, we have looked a lot of rollback transactions on the MQ adapter, for example we got 980 rollback transactions for 15736 transactions sent and only the MQ adapter is involved in the rollback. However, the operations are executed properly. The error we got is
135027.122.hqtux101!MQI_QMTESX01.7636.1.0: gtrid x0 x4ec1491f x25b59: LIBTUX_CAT:376: ERROR: tpabort: xa_rollback returned XA_RBROLLBACK.
I am looking for information at Oracle site, but I have not found nothing. Could you or someone from your team help me?Hi Todd,
We have 6 MQI adapters reading from 5 different queues, but in this case we are writing in only one queue.
Someone from Oracle told us that the XA_RBROLLBACK occurs because we have 6 MQ adapters that are reading from the same queues and when one adapter finds a message and try to get that message, it can occurs that other MQ Adapter gets it before. In this case, the MQ adapter rollbacks the transaction. Even when we got some XA_RBROLLBACK errors, we don´t lose message. Also, I read something about that when XA sends a xa_end call to MQ adapter, it actually does the rollback, so when the MQ adapter receives the xa_rollback call, it answers with XA_RBROLLBACK. Is that true?
However, I am more worried about the performance. We are putting a request message in a MQ queue and waiting for the reply. In some cases, it takes 150ms and in other cases it takes much more longer (more than 400ms). The average is 300ms. MQ adapter calls a service (txgralms0) which lasts 110ms in average.
This is our configuration:
"MQI_QMTESX01" SRVGRP="g03000" SRVID=3000
CLOPT="-- -C /tuxedo/qt/txqgral00/control/src/MQI_QMTESX01.cfg"
RQPERM=0600 REPLYQ=N RPPERM=0600 MIN=6 MAX=6 CONV=N
SYSTEM_ACCESS=FASTPATH
MAXGEN=1 GRACE=86400 RESTART=N
MINDISPATCHTHREADS=0 MAXDISPATCHTHREADS=1 THREADSTACKSIZE=0
SICACHEENTRIESMAX="500"
/tuxedo/qt/txqgral00/control/src/MQI_QMTESX01.cfg:
*SERVER
MINMSGLEVEL=0
MAXMSGLEVEL=0
DEFMAXMSGLEN=4096
TPESVCFAILDATA=Y
*QUEUE_MANAGER
LQMID=QMTESX01
NAME=QMTESX01
*SERVICE
NAME=txgralms0
FORMAT=MQSTR
TRAN=N
*QUEUE
LQMID=QMTESX01
MQNAME=QAT.Q.NACAR.TO.TUX.KGCRQ01
*QUEUE
LQMID=QMTESX01
MQNAME=QAT.Q.NACAR.TO.TUX.KGCPQ01
*QUEUE
LQMID=QMTESX01
MQNAME=QAT.Q.NACAR.TO.TUX.KPSAQ01
*QUEUE
LQMID=QMTESX01
MQNAME=QAT.Q.NACAR.TO.TUX.KPINQ01
*QUEUE
LQMID=QMTESX01
MQNAME=QAT.Q.NACAR.TO.TUX.KDECQ01
Thanks in advance,
Marling -
Performance issue with brand new intel iMac extreme
I am at a loss to explain a problem I've been having and I thought I might put it out to you guys.
In September I purchased a macbook Pro (2.4 ghz, 4 GB RAM) to use in video editing with Final Cut Pro, and for the most part I've been thrilled. I use 1TB LaCie external drives connected via FW800, and perform Multiclip editing with 4-5 video streams at a time and only on occasion have dropped frames during the editing process.
In December I determined that I needed to have an additional system, and thought a 2.8Ghz Intel iMac extreme would be an excellent choice, since for the same price I could get a little more power in the processor, more hard drive space and a bigger screen to work on. When we picked up the new system in the store (The Grove Apple Store in LA), we had them upgrade the memory to 4GB.
Since day one we have had performance issues, including problems playing streaming and DVD video, severe delays mounting and unmounting drives (firewire and USB) and application images, and freezing while doing even simple tasks like printing or checking email. These problems occur even while there are no external drives are connected. I have none of these issues with the Macbook Pro, which has virtually an identical set of programs installed, and both running the same version of Leopard.
I already took the original iMac back to the store, and they exchanged it, but did not have 4GB sets of RAM in stock so they took the RAM from the original machine and put it in the new one. They said if I continued to have problems then it was most likely the RAM and I should come back when they got more in stock. I DID have the same problems with the new machine, and took it back to the Apple Store and they swapped the memory. It seemed to improve the issue, but now I'm seeing the same severe performance issues again.
All tech support can do is tell me to do a PRAM reset, which seems to improve things very temporarily (but that may be my imagination) or have me restart, which at least has the ability to make the printing of documents capable.
What I'm wondering is if it is likely that the RAM is the issue and I just got another bad batch, or if the iMac has some weird glitch that isn't present in the macbook Pro...?? Or could I have possibly gotten 2 bad systems in a row? It's extremely frustrating, and I KNOW it shouldn't be this way! It's so bad I get better performance out of my single-core G5 tower! How do I get a good working system that operates like it should? Am I better off getting another Macbook Pro? I'd rather not for several reasons...
I have xbench on both the MBP and the iMac and can provide test numbers if they'll help, as well as any other info.
Thank you so much for reading my novella of a post and also for any insight you have!
Best,
TravisHi!
I got the same problem with my MacBook when it still was new in may 2006. It was supposed to be one of the faster Laptops around but it was soooo slow it drove me nuts. I can only advise to have a look if there is something hugging up your RAM and run some tests using these programs on your machine:
Xbench:
http://www.macupdate.com/info.php/id/10081
MenuMeters:
http://www.macupdate.com/info.php/id/10451
If they show any unusual results you might have your problem...
As to my problem with the MacBook: I did a complete re-install (writing the harddisk over with zeroes) and suddenly everything was just fine. (But be sure to back all your files before that, I learned this one the hard way.) I know it is just a standard answer, but it worked out for me this time...
Hope this helps in some ways.
Cheers,
Rene -
Performance issue with Adobe forms
Dear SAP Experts,
We have the following issue/requirement from our client. The client is on SAP ECC 6.0 - production environment.
The client is highlighting performance issue while accessing the adobe forms for HR and FI business process ( both static and interactive ).
Examples are
FI – Invoice Approvals
HR – Job Salary Change
The client is asking us to provide best practices surrounding:
1. How to improve the performance of the adobe forms while accessing in SAP.
2. Is there any other technology which we can use in SAP to replace the adobe forms which has better performance factor.
3. Are there solutions such as webdynpro floor plan manager, UI Fiori which can be alternately used?
Regards,
SakthiHello Priya,
Adobe forms are easy to develop and much more comfortable than SAP Scripts and Smartforms. Initially they are a bit difficult but once you have your hands on, they are the most simplest things in ABAP.
Performance in Adobe forms is a mix of both fine tuning the Layout as well as back end coding.
Performance in Adobe forms cannot be done overnight. A lot of care has to be taken during the initial stage of development.
As far as my experience is concerned, please consider the below points while developing SAP Adobe forms.
1) Avoid Scripting (Javascript/Formcalc) as much as possible inside the form. It drastically reduces the performance and makes the form to execute slower. If you still want to use scripting(which cannot be avoided for some requirements), use Formcalc since it is comparatively faster than JavaScript.
2) Try to avoid the coding inside the Form Interface. You can always handle the maximum coding in the Driver program and pass it to the form.
3) Use Form Caching.
For forms that have fixed layout, its a good way to increase the performance of form rendering. In the layout, go to Form Properties. Then Click on Defaults tab and select Allow Form Rendering To Be Cached On Server. Then Click OK.
For forms that have flowable or dynamic layout, render the forms on the client side because it improves performance.
Last but not the least, please go through the below post by Otto Gold which is worth a read at least once.
How to write a messy form -
SetAttribute causing performance issue.
Hi ,
I am using 11.1.1.4.0
Code:::
DCIteratorBinding itr=ADFUtil.findIterator(iterator);
RowSetIterator rsi=itr.getRowSetIterator();
Row currRow=rsi.getCurrentRow();
currRow.setAttribute(id,null);
If i call setAttribute multiple times(like 10-20 times) ,it causes severe performance issue .
Is there any reason for it ??
Should we avoid using setAttribute() ??If so then what we should use?
Any help is appreciated .
Thanks
Sazzusecase is user wld see a existing vacancy record and able to update it.
GEVacancyFromNotificationVO1() is a query based vo and getGETranVacancyVO1() is a updatable VO . Now using view criretia i am pulling the record in the updatable VO , this will have only 1 record at 1 time.
GEVacancyFromNotificationVO1() gets the details and set then in attributes of the updatable VO as this VO includes many trasient attributes which are required in my jsff . Basicallly this data are not saved in DB but required to show in the UI.
Anyways now the thing is setAttribute as called 20-30 times you see , the performance is slow and sometimes data is not set as well.
I used attributeListImp class to create a name value pair and create a new row for this VO using createAndInitRow() and that works super fast . That is requied for another use case and works perfectly ok . Only when i want to update a existing record i have to update the same row. cant create another row, so facing this performance issue and sometime data doesnt set properly . i get null in DCiterator binding when i fetch the data in bean class.
So my question is why does setAttribute of AttributeListImpl is much much faster than setAttribute of Row class.??
public void initializeFromNotification(String role, String emp) {
ViewObjectImpl notifyVO = this.getGEVacancyFromNotificationVO1();
ViewObjectImpl transVO = this.getGETranVacancyVO1();
ViewObjectImpl geLoginPersonIdVO = this.getGELoginPersonIdVO1();
ViewObjectImpl autoPopulatevo =
this.getGEAutopopulateHireSysforCopyVacanciesVO1();
ViewObjectImpl geNextApproverVO = this.getGENextApproverVO1();
ViewObjectImpl transHireVo = getGEHireSystemReqTeamTransVO1();
ViewObjectImpl gejobdesc = getGEJobDescTransVO1();
Row row = notifyVO.first();
if (row != null) {
//query the trx table
transVO.setApplyViewCriteriaName("VacancyNumberVC");
transVO.setNamedWhereClauseParam("p_vac_num",
row.getAttribute("VacancyNumber"));
transVO.executeQuery();
if (transVO.first() == null) {
return;
} else {
transVO.setCurrentRow(transVO.first());
Row currentRow = transVO.getCurrentRow();
List<String> transColumns =
Arrays.asList(currentRow.getAttributeNames());
//setting values from notification vo to transvacancy VO
String arr[] = row.getAttributeNames();
if (null != transVO.getCurrentRow()) {
// AttributeListImpl attrList = new AttributeListImpl();
for (String attr : arr) {
if (row.getAttribute(attr) != null) {
if (attr.equalsIgnoreCase("VacTrxId")) {
} else if (transColumns.contains(attr)) {
if (currentRow.getAttribute(attr) == null) {
currentRow.setAttribute(attr,
row.getAttribute(attr).toString());
if (role != null && role.startsWith("ORG_MGR")) {
transVO.getCurrentRow().setAttribute("userRole",
"INITIATOR_HM");
transVO.getCurrentRow().setAttribute("userRoleDisplay",
"Hiring Manager");
} else if (role != null && role.startsWith("HRM")) {
transVO.getCurrentRow().setAttribute("userRole",
"INITIATOR_HRM");
transVO.getCurrentRow().setAttribute("userRoleDisplay",
"HR Manager");
} else {
transVO.getCurrentRow().setAttribute("userRole",
"INITIATOR_RFO");
transVO.getCurrentRow().setAttribute("userRoleDisplay", "RFO");
transVO.getCurrentRow().setAttribute("EmpNumber", emp);
geLoginPersonIdVO.setNamedWhereClauseParam("sso", emp);
geLoginPersonIdVO.executeQuery();
transVO.getCurrentRow().setAttribute("userPersonId",
geLoginPersonIdVO.first().getAttribute(0)); -
Performance Issue in NWBC Material 6.1
We are facing a major performance issue on Development and QA env for Material NWBC in 6.1 during UAT with a limited users only. Initially we have observed that the memory space is 0% and 2% on Dev and Q environments.We have asked the infrastructure partner to take a corrective action and the memory was freed on the environments. But this did not help.
Then we doubted on http side of the Dev and Q system. No issue were found with the connection to BODS. As per the observation from the infra team there is no real bottleneck, from OS, SAP and DB2 side. Even the restart of all the components was also performed but still the performance issue exists.Please suggest.
Thanks,
SubhronathHi,
Did you trace the ABAP logs?..it indicates which area/methods of your application taking long time. you might want to do in ST12 trace and you may use tool like httpwatch or SAT trace to find out where exactly it's taking time or memory.
Once you do that, You may need to refer MDG performance tweak document to fine tune your performance issue.
SCN Link is here.
Did
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d06a297f-e11d-3110-83be-87f69a72c426?QuickLink=index&overridelayout=true&58987080851987
Thanks
Praveen -
Idle Session Performance issue
Hi,
Just want to know if there are session that are idle can create any kind of performance issue.
Regards,
VikasVikas Kohli wrote:
Hi,
Just want to know if there are session that are idle can create any kind of performance issue.
Can you get something for nothing?
Idle session does consume "some" resources.
Does any consumed resource impact performance?
By which metric at what value is considered any kind of performance issue? -
Cisco ASR 1002- performance issue due to access list
Hi,
We are planning to implement inbound access-list to block subnets from particular country. Since the subnets are not contiguous, we have about 16000 lines of acl entries.
I want to know, would there be any performance or latency issues after applying 16k lines of acl?
Is there a good document where I can read more about ACL limitations and performance issues on ASR.
This is for ASR1002, running IOS-XE 15.3(1)S1.
ThanksDisclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
Sorry, I don't know the answer to your questions, but I'm writing to mention a 7200 feature, that if supported on the ASR, might help in your situation. See http://www.cisco.com/c/en/us/support/docs/security/ios-firewall/23602-confaccesslists.html#turbo -
Performance Issue - 32 Bit Applications vs 64 Bit DB Server
Dear All,
My Current set up is as follows:
Operating System: Windows 2003 Standard Edition R2 64 Bit
Database: Oracle 10.2.0.1 64 Bit
Client Connectivity: Oracle 10.2.0.1 32 Bit
Application: Lotus Domino 7.0.2 FP3 32 Bit
In the above set up,
When Application try to fetch the records from DB through client, it takes so much of time as compared to when i run the same with (OS & DB in 32 bit).
kindly let me know how to do workaround on this, analysation have to be made to overcome this performance issue.
thanks & regards
suresh1. Check for available statistics.
2. Verify plans against 32 bit and 64 bit databases.
3. Analyze the sql trace for the session. -
Weblogic J2EE agent 2.2 performance issue
Hi All,
Are these known performance issues with J2EE Agent 2.2 for Weblogic 8sp5?
Is there a document that tells about performance tuning of J2EE Agent 2.2 for Weblogic server?
We are doing the load testing with AM 7.0 and Weblogic J2EE Agent. We found that AM7.0 with Apache Policy agent works fine in our load test. Our Application's performance without the J2EE agent is good. The moment we add J2EE Agent for weblogic to the equation, it goes south...
Any help will be appreciated,
Thanks,
VivekHi All,
Are these known performance issues with J2EE Agent 2.2 for Weblogic 8sp5?
Is there a document that tells about performance tuning of J2EE Agent 2.2 for Weblogic server?
We are doing the load testing with AM 7.0 and Weblogic J2EE Agent. We found that AM7.0 with Apache Policy agent works fine in our load test. Our Application's performance without the J2EE agent is good. The moment we add J2EE Agent for weblogic to the equation, it goes south...
Any help will be appreciated,
Thanks,
Vivek -
Performance Issue for BI system
Hello,
We are facing performance issues for BI System. Its a preproductive system and its performance is degrading badly everyday. I was checking system came to know program buffer hit ratio is increaasing everyday due to high Swaps. So asked to change the parameter abap/buffersize which was 300Mb to 500Mb. But still no major improvement is found in the system.
There is 16GB Ram available and Server is HP-UX and with Netweaver2004s with Oracle 10.2.0.4.0 installed in it.
The Main problem is while running a report or creating a query is taking way too long time.
Kindly help me.Hello SIva,
Thanks for your reply but i have checked ST02 and ST03 and also SM50 and its normal
we are having 9 dialog processes, 3 Background , 2 Update and 1 spool.
No one is using the system currently but in ST02 i can see the swaps are in red.
Buffer HitRatio % Alloc. KB Freesp. KB % Free Sp. Dir. Size FreeDirEnt % Free Dir Swaps DB Accs
Nametab (NTAB) 0
Table definition 99,60 6.798 20.000 29.532 153.221
Field definition 99,82 31.562 784 2,61 20.000 6.222 31,11 17.246 41.248
Short NTAB 99,94 3.625 2.446 81,53 5.000 2.801 56,02 0 2.254
Initial records 73,95 6.625 998 16,63 5.000 690 13,80 40.069 49.528
0
boldprogram 97,66 300.000 1.074 0,38 75.000 67.177 89,57 219.665 725.703bold
CUA 99,75 3.000 875 36,29 1.500 1.401 93,40 55.277 2.497
Screen 99,80 4.297 1.365 33,35 2.000 1.811 90,55 119 3.214
Calendar 100,00 488 361 75,52 200 42 21,00 0 158
OTR 100,00 4.096 3.313 100,00 2.000 2.000 100,00 0
0
Tables 0
Generic Key 99,17 29.297 1.450 5,23 5.000 350 7,00 2.219 3.085.633
Single record 99,43 10.000 1.907 19,41 500 344 68,80 39 467.978
0
Export/import 82,75 4.096 43 1,30 2.000 662 33,10 137.208
Exp./ Imp. SHM 89,83 4.096 438 13,22 2.000 1.482 74,10 0
SAP Memory Curr.Use % CurUse[KB] MaxUse[KB] In Mem[KB] OnDisk[KB] SAPCurCach HitRatio %
Roll area 2,22 5.832 22.856 131.072 131.072 IDs 96,61
Page area 1,08 2.832 24.144 65.536 196.608 Statement 79,00
Extended memory 22,90 958.464 1.929.216 4.186.112 0 0,00
Heap memory 0 0 1.473.767 0 0,00
Call Stati HitRatio % ABAP/4 Req ABAP Fails DBTotCalls AvTime[ms] DBRowsAff.
Select single 88,59 63.073.369 5.817.659 4.322.263 0 57.255.710
Select 72,68 284.080.387 0 13.718.442 0 32.199.124
Insert 0,00 151.955 5.458 166.159 0 323.725
Update 0,00 378.161 97.884 395.814 0 486.880
Delete 0,00 389.398 332.619 415.562 0 244.495
Edited by: Srikanth Sunkara on May 12, 2011 11:50 AM -
Performance Issue For Opening And Closing Balance In FBL1N/3N/5N
Dear experts,
I Am Having Requirement to Bring Opening And Closing Balance In FBL1N, FBL3N, FBL5N.
For This requirement I Used BADI : FI_ITEMS_CH_DATA~CHANGE_ITEMS, below is my Code For FBL1N, And I've Done the same For 3N/5N...With Related BAPI
* IF SY-TCODE = 'FBL1N'.
* LOOP AT ct_items INTO gs_items.
* CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
* EXPORTING
* date = gs_items-budat
* days = '01'
* months = '00'
* signum = '-'
* years = '00'
* IMPORTING
* calc_date = lv_date.
* CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
* EXPORTING
* companycode = gs_items-bukrs
* vendor = gs_items-konto
* keydate = lv_date
** BALANCESPGLI = ' '
** NOTEDITEMS = ' '
** IMPORTING
** RETURN =
* TABLES
* keybalance = lv_obal.
* CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
* EXPORTING
* companycode = gs_items-bukrs
* vendor = gs_items-konto
* keydate = gs_items-budat
** BALANCESPGLI = ' '
** NOTEDITEMS = ' '
** IMPORTING
** RETURN =
* TABLES
* keybalance = lv_cbal
* READ TABLE lv_cbal INTO gs_cbal INDEX 1.
* gs_items-cbal = gs_cbal-lc_bal.
* READ TABLE lv_obal INTO gs_obal INDEX 1.
* gs_items-obal = gs_obal-lc_bal.
* MODIFY ct_items FROM gs_items TRANSPORTING obal cbal.
* CLEAR: gs_items,gs_obal,gs_cbal.
* ENDLOOP.
* ENDIF.
So, Above Code Causing Me the Performance Issue, Kindly Suggest Me the Solution..
Regards,
uday.Hi Uday,
I am sending you the code i used for the creation a Zreport based on FBL5N. Please check if it can of any help.
*& Report ZFBL5N *
REPORT zfbl5n_new .
TABLES : bsid,knc1,lfc1.
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_bsid,
bukrs TYPE bsid-bukrs,
kunnr TYPE bsid-kunnr,
belnr TYPE bsid-belnr,
buzei TYPE bsid-buzei,
bldat TYPE bsid-bldat,
blart TYPE bsid-blart,
bschl TYPE bsid-bschl,
shkzg TYPE bsid-shkzg,
dmbtr TYPE bsid-dmbtr,
augdt TYPE bsid-augdt,
augbl TYPE bsid-augbl,
zuonr TYPE bsid-zuonr,
sgtxt TYPE bsid-sgtxt,
zfbdt TYPE bsid-zfbdt,
zterm TYPE bsid-zterm,
zbd1t TYPE bsid-zbd1t,
zbd2t TYPE bsid-zbd2t,
zbd3t TYPE bsid-zbd3t,
kkber TYPE bsid-kkber,
bstat TYPE bsid-bstat,
umskz TYPE bsid-umskz,
END OF ty_bsid.
TYPES: BEGIN OF ty_bsik,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsik-lifnr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
bldat TYPE bsik-bldat,
blart TYPE bsik-blart,
bschl TYPE bsik-bschl,
shkzg TYPE bsik-shkzg,
dmbtr TYPE bsik-dmbtr,
augdt TYPE bsik-augdt,
augbl TYPE bsik-augbl,
zuonr TYPE bsik-zuonr,
sgtxt TYPE bsik-sgtxt,
zfbdt TYPE bsik-zfbdt,
* KKBER TYPE bsik-kkber,
zterm TYPE bsik-zterm,
zbd1t TYPE bsik-zbd1t,
zbd2t TYPE bsik-zbd2t,
zbd3t TYPE bsik-zbd3t,
bstat TYPE bsid-bstat,
umskz TYPE bsid-umskz,
END OF ty_bsik.
TYPES: BEGIN OF ty_final,
belnr TYPE bsid-belnr,
* buzei TYPE bsak-buzei,
bldat TYPE bsid-bldat,
blart TYPE bsid-blart,
chq TYPE bsid-zuonr,
debit TYPE bsid-dmbtr,
credit TYPE bsid-dmbtr,
txt TYPE bsid-sgtxt,
date TYPE bsid-zfbdt,
kkber TYPE bsid-kkber,
zterm TYPE bsid-zterm,
augbl TYPE bsid-augbl,
augdt TYPE bsid-augdt,
flag TYPE c,
END OF ty_final.
TYPES : BEGIN OF gs_openbal,
bukrs TYPE bapi3007_2-comp_code,
kunnr TYPE bapi3007_2-customer,
dmbtr TYPE bapi3007_2-lc_amount,
END OF gs_openbal.
DATA: it_bsid TYPE STANDARD TABLE OF ty_bsid,
it_bsik TYPE STANDARD TABLE OF ty_bsik,
it_final TYPE STANDARD TABLE OF ty_final.
DATA: wa_bsid TYPE ty_bsid,
wa_bsik TYPE ty_bsik,
wa_final TYPE ty_final.
DATA: w_days TYPE t5a4a-dlydy,
w_month TYPE t5a4a-dlymo,
w_year TYPE t5a4a-dlyyr,
w_date TYPE p0001-begda,
w_name1 TYPE kna1-name1,
w_ort01 TYPE kna1-ort01,
w_lifnr TYPE kna1-lifnr,
w_dmbtr1 TYPE bsid-dmbtr,
w_dmbtr2 TYPE bsid-dmbtr,
w_dmbtr3 TYPE bsad-dmbtr,
w_dmbtr4 TYPE bsad-dmbtr,
w_opbal TYPE bsid-dmbtr,
w_credit TYPE bsik-dmbtr,
w_debit TYPE bsik-dmbtr,
w_clobal TYPE bsik-dmbtr,
w_credit1 TYPE bsik-dmbtr,
w_debit1 TYPE bsik-dmbtr,
w_clobal1 TYPE bsik-dmbtr.
DATA: ld_yrper LIKE rwcoom-fiscper,
kunnr LIKE kna1-kunnr,
x_norm TYPE c,
x_park,
x_apar,
x_merk,
ok_code(4),
wa_x001 LIKE x001,
return LIKE bapireturn,
line_count LIKE sy-loopc,
number_of_records TYPE i,
xindex LIKE sy-tabix,
open LIKE knc1-um01s,
temp(20),
close LIKE knc1-um01s,
gjahr LIKE bsid-gjahr,
period LIKE bkpf-monat,
f(1),
v_char(2),
closec(20),
openc(20),
debit LIKE bapi3007_2-lc_amount,
credit LIKE debit.
DATA : v_dmbtr LIKE bsid-dmbtr.
*DATA : tot_debit LIKE t_ar-debit,
* tot_credit LIKE t_ar-credit.
DATA : t_kna1 LIKE kna1 OCCURS 1 WITH HEADER LINE,
t_knb1 LIKE knb1 OCCURS 10 WITH HEADER LINE.
DATA ibsid LIKE bsid OCCURS 0 WITH HEADER LINE.
DATA ibsad LIKE bsad OCCURS 0 WITH HEADER LINE.
DATA ibsik LIKE bsik OCCURS 0 WITH HEADER LINE.
DATA ibsak LIKE bsak OCCURS 0 WITH HEADER LINE.
DATA : it_fieldcat_alv TYPE slis_t_fieldcat_alv,
wa_fieldcat_alv TYPE slis_fieldcat_alv,
is_layout_alv TYPE slis_layout_alv,
wa_layout_alv TYPE slis_layout_alv,
it_list_top_of_page TYPE slis_t_listheader,
it_events TYPE slis_t_event,
wa_events TYPE LINE OF slis_t_event.
DATA : BEGIN OF ibukrs OCCURS 0,
bukrs LIKE t001-bukrs,
END OF ibukrs.
DATA : BEGIN OF ikunnr1 OCCURS 0,
kunnr LIKE knc1-kunnr,
END OF ikunnr1.
DATA : BEGIN OF ikunnr OCCURS 0,
kunnr LIKE knc1-kunnr,
bukrs LIKE t001-bukrs,
lifnr LIKE lfc1-lifnr,
END OF ikunnr.
DATA: it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
DATA: r_bschl TYPE RANGE OF bschl,
wa_bschl LIKE LINE OF r_bschl.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_kunnr TYPE bsid-kunnr OBLIGATORY,
p_bukrs TYPE bsid-bukrs OBLIGATORY.
SELECT-OPTIONS: so_budat FOR bsid-budat .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS : p_normal AS CHECKBOX,
p_spl AS CHECKBOX,
p_vendor AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b2.
PERFORM get_data.
PERFORM process_data.
*PERFORM calculate_openbal. " Commented by anish
PERFORM calculate_open_bal.
PERFORM calculate_closing_bal.
PERFORM build_catalog_sort USING it_sort.
PERFORM reuse_alv_events_get .
PERFORM display_data.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM get_data .
SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
bstat umskz FROM bsid
INTO TABLE it_bsid
WHERE bukrs = p_bukrs
AND kunnr = p_kunnr
AND budat IN so_budat.
SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
bstat umskz FROM bsad
APPENDING TABLE it_bsid
WHERE bukrs = p_bukrs
AND kunnr = p_kunnr
AND budat IN so_budat.
SELECT SINGLE name1 ort01 lifnr FROM kna1
INTO (w_name1 , w_ort01 , w_lifnr)
WHERE kunnr = p_kunnr.
IF p_vendor IS NOT INITIAL.
SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
bstat umskz FROM bsik
APPENDING TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr = w_lifnr
AND budat IN so_budat.
SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
bstat umskz FROM bsak
APPENDING TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr = w_lifnr
AND budat IN so_budat.
ENDIF.
SORT it_bsid BY bschl.
DELETE it_bsid WHERE bschl = '04'.
DELETE it_bsid WHERE bschl = '07'.
DELETE it_bsid WHERE bschl = '17'.
DELETE it_bsid WHERE bschl = '34'.
DELETE it_bsid WHERE bschl = '27'.
DELETE it_bsid WHERE bschl = '37'.
SORT it_bsik BY bschl.
DELETE it_bsik WHERE bschl = '04'.
DELETE it_bsik WHERE bschl = '07'.
DELETE it_bsik WHERE bschl = '17'.
DELETE it_bsik WHERE bschl = '34'.
DELETE it_bsik WHERE bschl = '27'.
DELETE it_bsik WHERE bschl = '37'.
ENDFORM. " GET_DATA
*& Form PROCESS_DATA
* text
* --> p1 text
* <-- p2 text
FORM process_data .
DATA:okay TYPE c VALUE space.
w_month = '00'.
w_year = '00'.
SORT it_bsid BY bldat .
LOOP AT it_bsid INTO wa_bsid.
PERFORM check_item_ok USING p_normal
p_spl
p_vendor
* x_park
wa_bsid
CHANGING okay.
CHECK okay = 'X'.
wa_final-belnr = wa_bsid-belnr.
wa_final-bldat = wa_bsid-bldat.
wa_final-blart = wa_bsid-blart.
wa_final-txt = wa_bsid-sgtxt.
wa_final-kkber = wa_bsid-kkber.
wa_final-zterm = wa_bsid-zterm.
wa_final-augbl = wa_bsid-augbl.
wa_final-augdt = wa_bsid-augdt.
wa_final-flag = 'C'.
IF wa_bsid-blart = 'DZ'.
wa_final-chq = wa_bsid-zuonr.
ENDIF.
IF wa_bsid-shkzg = 'S'.
wa_final-debit = wa_bsid-dmbtr.
ELSEIF wa_bsid-shkzg = 'H'.
wa_final-credit = wa_bsid-dmbtr.
ENDIF.
w_credit = w_credit + wa_final-credit.
w_debit = w_debit + wa_final-debit.
****** Net due date
IF wa_bsid-zbd1t IS NOT INITIAL.
w_days = wa_bsid-zbd1t.
ELSEIF wa_bsid-zbd2t IS NOT INITIAL.
w_days = wa_bsid-zbd2t.
ELSEIF wa_bsid-zbd3t IS NOT INITIAL.
w_days = wa_bsid-zbd3t.
ENDIF.
IF w_days IS INITIAL.
wa_final-date = wa_bsid-zfbdt.
ELSE.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = wa_bsid-zfbdt
days = w_days
months = w_month
signum = '+'
years = w_year
IMPORTING
calc_date = w_date.
wa_final-date = w_date.
ENDIF.
APPEND wa_final TO it_final.
CLEAR: w_days , w_date , wa_final .
ENDLOOP.
IF it_bsik IS NOT INITIAL.
CLEAR: w_days , w_date.
SORT it_bsik BY bldat.
LOOP AT it_bsik INTO wa_bsik.
wa_final-belnr = wa_bsik-belnr.
wa_final-bldat = wa_bsik-bldat.
wa_final-blart = wa_bsik-blart.
wa_final-txt = wa_bsik-sgtxt.
* wa_final-kkber = wa_bsik-kkber.
wa_final-zterm = wa_bsik-zterm.
wa_final-augbl = wa_bsik-augbl.
wa_final-augdt = wa_bsik-augdt.
wa_final-flag = 'V'.
IF wa_bsik-blart = 'DZ'.
wa_final-chq = wa_bsik-zuonr.
ENDIF.
IF wa_bsik-shkzg = 'S'.
wa_final-debit = wa_bsik-dmbtr.
ELSEIF wa_bsik-shkzg = 'H'.
wa_final-credit = wa_bsik-dmbtr.
ENDIF.
w_credit1 = w_credit1 + wa_final-credit.
w_debit1 = w_debit1 + wa_final-debit.
******* Net Due date
IF wa_bsik-zbd1t IS NOT INITIAL.
w_days = wa_bsik-zbd1t.
ELSEIF wa_bsik-zbd2t IS NOT INITIAL.
w_days = wa_bsik-zbd2t.
ELSEIF wa_bsik-zbd3t IS NOT INITIAL.
w_days = wa_bsik-zbd3t.
ENDIF.
IF w_days IS INITIAL.
wa_final-date = wa_bsik-zfbdt.
ELSE.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = wa_bsik-zfbdt
days = w_days
months = w_month
signum = '+'
years = w_year
IMPORTING
calc_date = w_date.
ENDIF.
wa_final-date = w_date.
APPEND wa_final TO it_final.
CLEAR: wa_final.
ENDLOOP.
ENDIF.
ENDFORM. " PROCESS_DATA
*& Form DISPLAY_DATA
* text
* --> p1 text
* <-- p2 text
FORM display_data .
wa_fieldcat_alv-fieldname = 'BELNR'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-003.
wa_fieldcat_alv-outputlen = '11'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'BLDAT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-004.
wa_fieldcat_alv-outputlen = '13'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'BLART'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-005.
wa_fieldcat_alv-outputlen = '02'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'CHQ'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-006.
wa_fieldcat_alv-outputlen = '09'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'DEBIT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-007.
wa_fieldcat_alv-outputlen = '15'.
wa_fieldcat_alv-do_sum = 'X'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'CREDIT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-008.
wa_fieldcat_alv-outputlen = '15'.
wa_fieldcat_alv-do_sum = 'X'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'TXT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-009.
wa_fieldcat_alv-outputlen = '50'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'DATE'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-010.
wa_fieldcat_alv-outputlen = '12'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'KKBER'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-011.
wa_fieldcat_alv-outputlen = '04'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'ZTERM'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-012.
wa_fieldcat_alv-outputlen = '13'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'AUGBL'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-013.
wa_fieldcat_alv-outputlen = '15'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'AUGDT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-014.
wa_fieldcat_alv-outputlen = '17'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'FLAG'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-tech = 'X'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = wa_layout_alv
it_fieldcat = it_fieldcat_alv
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort
it_events = it_events
i_save = 'A'
TABLES
t_outtab = it_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.
* CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
* EXPORTING
* i_callback_program = sy-repid
* i_callback_top_of_page = 'TOP_OF_PAGE'
* is_layout = wa_layout_alv
* it_fieldcat = it_fieldcat_alv
* it_sort = it_sort
*** I_DEFAULT = 'X'
** i_save = 'A'
*** IT_EVENTS =
* TABLES
* t_outtab = it_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_DATA
*& Form TOP_OF_PAGE
* Header at top of page.
FORM top_of_page.
SKIP 1.
WRITE: AT 35 'Account Statement from' , so_budat-low , 'to' , so_budat-high.
SKIP 2.
WRITE: AT /5 'CUSTOMER:' , p_kunnr.
WRITE: AT 35 'Name:' , w_name1.
WRITE: AT /5 'Company:' , p_bukrs.
WRITE: AT 35 'City:' , w_ort01.
SKIP 1.
WRITE: AT /5 'Opening Balance as on' , so_budat-low , ' ' , w_opbal LEFT-JUSTIFIED.
SKIP 2.
ENDFORM. "TOP_OF_PAGE
*& Form END_OF_PAGE
* Footer at End of page.
FORM end_of_page.
SKIP 2.
IF so_budat-high IS NOT INITIAL.
WRITE: AT 5 'Closing Balance as on' , so_budat-high , ' ' , w_clobal LEFT-JUSTIFIED.
ELSE.
WRITE: AT 5 'Closing Balance ' , w_clobal LEFT-JUSTIFIED.
ENDIF.
ENDFORM. "end_of_page
*& Form CALCULATE_OPENBAL
* text
* --> p1 text
* <-- p2 text
FORM calculate_openbal .
DATA:v_gjahr TYPE bsid-gjahr.
DATA: v_period LIKE t009b-poper,v_monat LIKE t001-periv.
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat = so_budat-low
i_bukrs = p_bukrs
* I_PERIV = ' '
* I_GJAHR = 0000
* I_MONAT = 00
* X_XMO16 = ' '
IMPORTING
e_gjahr = v_gjahr
* e_monat = v_monat
e_poper = v_period.
IF sy-subrc NE 0.
ENDIF.
DATA: f_date LIKE sy-datum.
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = v_gjahr
i_monmit = 00
i_periv = 'V3'
i_poper = v_period
IMPORTING
e_date = f_date.
period = v_period - 1.
gjahr = v_gjahr.
DATA wa_kna1 LIKE kna1.
CALL FUNCTION 'READ_KNA1'
EXPORTING
xkunnr = p_kunnr
IMPORTING
xkna1 = wa_kna1
EXCEPTIONS
key_incomplete = 1
not_authorized = 2
not_found = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE w023(zwww).
CALL SCREEN 0010.
ENDIF.
MOVE-CORRESPONDING wa_kna1 TO t_kna1.
APPEND t_kna1.
SELECT kunnr FROM kna1 INTO TABLE ikunnr1
WHERE kunnr = p_kunnr.
SELECT bukrs FROM t001 INTO TABLE ibukrs
FOR ALL ENTRIES IN t_knb1
WHERE bukrs = t_knb1-bukrs.
LOOP AT ikunnr1.
LOOP AT ibukrs.
ikunnr-kunnr = ikunnr1-kunnr.
ikunnr-bukrs = ibukrs-bukrs.
READ TABLE t_kna1 WITH KEY kunnr = ikunnr1-kunnr.
ikunnr-lifnr = t_kna1-lifnr.
APPEND ikunnr.
ENDLOOP.
ENDLOOP.
DELETE ikunnr WHERE bukrs NE p_bukrs.
LOOP AT ikunnr.
CLEAR: knc1,lfc1,f.
IF NOT ( ikunnr-kunnr IS INITIAL ) AND NOT ( p_vendor IS INITIAL ).
SELECT SINGLE * FROM lfc1
WHERE gjahr = gjahr AND bukrs = ikunnr-bukrs
AND lifnr = ikunnr-lifnr.
ENDIF.
SELECT SINGLE * FROM knc1
WHERE gjahr = gjahr AND bukrs = p_bukrs
AND kunnr = p_kunnr.
IF sy-subrc = 0.
CASE period .
WHEN 12.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
knc1-um11s - knc1-um11h + knc1-um12s - knc1-um12h.
IF NOT ( lfc1 IS INITIAL ).
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
lfc1-um11s - lfc1-um11h + lfc1-um12s - lfc1-um12h.
ENDIF.
WHEN 11.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
knc1-um11s - knc1-um11h.
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
lfc1-um11s - lfc1-um11h.
ENDIF.
WHEN 10.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h .
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h.
ENDIF.
WHEN 9.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h .
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h.
ENDIF.
WHEN 8.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h.
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h .
ENDIF.
WHEN 7.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h .
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um -
Performance Issue in ABAP part as suggested by SE30 for the below coding
Dear Abapers,
The below coding was done by my seniors and having performance issue i.e in SE30 the abap part is consuming 98% of time.
Pl. help us to solve this situation.
With best regards,
S. Arunachalam.
the code is:
REPORT ZOBJLIST LINE-SIZE 320 NO STANDARD PAGE HEADING. "280 to 320
TABLES: MARA, MAKT, A916, KONP, MVKE, ZSAI_PARAM.
Input parameters *****************************************************
DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.
DATA T_CLASS LIKE SCLASS OCCURS 0 WITH HEADER LINE.
DATA T_CLOBJDAT LIKE CLOBJDAT OCCURS 0 WITH HEADER LINE.
DATA FLG_COLOR TYPE C.
DATA WRK_CLASS LIKE KLAH-CLASS.
DATA WRK_PERCENT TYPE I. " Progress percentage
DATA WRK_LINES LIKE SY-TABIX. " To store the no. of lines in int.table
DATA WRK_PROGRESSTEXT(72) . " Progress indicator text
DATA : BEGIN OF IT_MATNR OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
END OF IT_MATNR.
DATA : BEGIN OF IT_HEADER OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
CLART LIKE SCLASS-KLART,
CLASS LIKE SCLASS-CLASS,
BISMT LIKE MARA-BISMT, "Thanikai-17.05.2002
SCMNG(4) TYPE I, "Thanikai-03.10.2002
END OF IT_HEADER.
DATA : BEGIN OF IT_DETAILS OCCURS 0,
MATNR LIKE MARA-MATNR,
ZAEHL LIKE CLOBJDAT-ZAEHL,
ATNAM LIKE CLOBJDAT-ATNAM,
AUSP1 LIKE CLOBJDAT-AUSP1,
END OF IT_DETAILS.
DATA : BEGIN OF IT_DETAILS1 OCCURS 0,
MATNR LIKE MARA-MATNR,
ATNAM LIKE CLOBJDAT-ATNAM,
ZAEHL LIKE CLOBJDAT-ZAEHL,
END OF IT_DETAILS1.
DATA: IT_DETAILS2 LIKE IT_DETAILS1 OCCURS 0 WITH HEADER LINE.
DATA TMP_MATNR LIKE AUSP-OBJEK.
DATA WRK_FIELD(25).
DATA WRK_TABNAME(40). " Name of the int.table from wrk_fldname
DATA WRK_FIELDNAME(40). " Name of the fld name from wrk_fldname
DATA WRK_FLDNAME(40).
DATA T_CLOBJDAT_LINES LIKE SY-TABIX.
DATA WRK_LINES1 LIKE SY-TABIX.
DATA WRK_FIRST_TIME.
DATA TMP_STR.
DATA WRK_AUSP1 LIKE CLOBJDAT-AUSP1.
DATA: WRK_KBETR LIKE KONP-KBETR. "Thanikai-03.10.2002
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
*PARAMETERS:
SELECT-OPTIONS:
P_MATKL FOR MARA-MATKL DEFAULT 'DIAL' OBLIGATORY NO INTERVALS.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR MATCHCODE OBJECT MAT1.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: P_CLASS LIKE KLAH-CLASS,
P_KLART LIKE KLAH-KLART DEFAULT '001' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : REQ RADIOBUTTON GROUP RGRP ,
NREQ RADIOBUTTON GROUP RGRP .
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN.
IF NOT P_CLASS IS INITIAL.
WRK_CLASS = P_CLASS.
ELSE.
WRK_CLASS = SPACE.
ENDIF.
TOP-OF-PAGE.
IF SY-BATCH NE 'X'.
PERFORM PRINT_TOP.
ENDIF.
START-OF-SELECTION.
SET PF-STATUS '9000'.
SELECT * INTO TABLE IT_MARA
FROM MARA CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATKL IN P_MATKL
AND MATNR IN S_MATNR.
DESCRIBE TABLE IT_MARA LINES WRK_LINES.
MOVE 'Selecting Material Description' TO WRK_PROGRESSTEXT.
PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
LOOP AT IT_MARA.
SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATNR = IT_MARA-MATNR
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
IT_MATNR-MATNR = IT_MARA-MATNR.
IT_MATNR-MAKTX = MAKT-MAKTX.
IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
ENDIF.
APPEND IT_MATNR.
CLEAR IT_MATNR.
ENDLOOP.
CLEAR WRK_LINES.
DESCRIBE TABLE IT_MATNR LINES WRK_LINES.
MOVE 'Selecting Class / characteristics for the Material'
TO WRK_PROGRESSTEXT.
PERFORM SAPGUI USING WRK_PERCENT WRK_PROGRESSTEXT.
LOOP AT IT_MATNR.
CLEAR: TMP_MATNR, T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
REFRESH: T_CLASS, T_CLOBJDAT. "Thanikai-26.08.2002
TMP_MATNR = IT_MATNR-MATNR.
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
CLASS = WRK_CLASS
CLASSTEXT = 'X'
CLASSTYPE = '001'
CLINT = ' '
FEATURES = 'X'
LANGUAGE = SY-LANGU
OBJECT = TMP_MATNR
OBJECTTABLE = 'MARA'
KEY_DATE = SY-DATUM
INITIAL_CHARACT = 'X'
NO_VALUE_DESCRIPT = 'X'
CHANGE_SERVICE_CLF = 'X'
INHERITED_CHAR = ' '
TABLES
T_CLASS = T_CLASS
T_OBJECTDATA = T_CLOBJDAT
EXCEPTIONS
NO_CLASSIFICATION = 1
NO_CLASSTYPES = 2
INVALID_CLASS_TYPE = 3
OTHERS = 4.
IF SY-SUBRC = 0.
READ TABLE T_CLASS INDEX 1.
IT_HEADER-MATNR = IT_MATNR-MATNR.
IT_HEADER-MAKTX = IT_MATNR-MAKTX.
IT_HEADER-BISMT = IT_MATNR-BISMT."Thanikai-17.05.2002
IT_HEADER-CLART = T_CLASS-KLART.
IT_HEADER-CLASS = T_CLASS-CLASS.
PERFORM PKG_DLVY_UNIT.
APPEND IT_HEADER.
CLEAR: IT_HEADER.
Code Start by Thanikai on 16.08.2002
LOOP AT T_CLOBJDAT.
IT_DETAILS-MATNR = IT_MATNR-MATNR.
IT_DETAILS-ZAEHL = T_CLOBJDAT-ZAEHL.
IT_DETAILS-ATNAM = T_CLOBJDAT-ATNAM.
IT_DETAILS-AUSP1 = T_CLOBJDAT-AUSP1.
APPEND IT_DETAILS.
ENDLOOP.
CLEAR: IT_DETAILS.
LOOP AT T_CLOBJDAT.
IT_DETAILS1-MATNR = IT_MATNR-MATNR.
IT_DETAILS1-ATNAM = T_CLOBJDAT-ATNAM.
IT_DETAILS1-ZAEHL = T_CLOBJDAT-ZAEHL.
APPEND IT_DETAILS1.
ENDLOOP.
CLEAR: IT_DETAILS1.
DESCRIBE TABLE IT_DETAILS1 LINES T_CLOBJDAT_LINES.
IF WRK_FIRST_TIME NE 'X'.
WRK_LINES1 = T_CLOBJDAT_LINES.
WRK_FIRST_TIME = 'X'.
IT_DETAILS2[] = IT_DETAILS1[].
ELSE.
IF T_CLOBJDAT_LINES GT WRK_LINES1.
WRK_LINES1 = T_CLOBJDAT_LINES.
IT_DETAILS2[] = IT_DETAILS1[].
ENDIF.
ENDIF.
CLEAR: T_CLOBJDAT_LINES.
CLEAR: IT_DETAILS1. REFRESH: IT_DETAILS1.
ENDIF.
Code end by Thanikai on 16.08.2002
ENDLOOP.
CLEAR: WRK_LINES1, WRK_FIRST_TIME.
Print Details *********************************
PERFORM PRINT_DETAILS.
AT USER-COMMAND.
GET CURSOR FIELD WRK_FIELD.
SPLIT WRK_FIELD AT '-' INTO WRK_TABNAME WRK_FLDNAME.
IF NOT WRK_FLDNAME IS INITIAL.
CASE SY-UCOMM.
WHEN 'SORA'.
IF SY-LSIND > 0.
SY-LSIND = SY-LSIND - 1. "To print in the same window
ENDIF.
PERFORM PRINT_REPORT_ASCENDING.
WHEN 'SORD'.
IF SY-LSIND > 0.
SY-LSIND = SY-LSIND - 1. "To print in the same window
ENDIF.
PERFORM PRINT_REPORT_DESCENDING.
ENDCASE.
ELSE.
MESSAGE S000(38) WITH 'Selete Material Number / Description'.
ENDIF.
*& Form SAPGUI
text
-->P_WRK_PERCENT text *
-->P_WRK_PROGRESSTEXT text *
FORM SAPGUI USING P_WRK_PERCENT
P_WRK_PROGRESSTEXT.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = WRK_PERCENT
TEXT = WRK_PROGRESSTEXT
EXCEPTIONS
OTHERS = 1.
ENDFORM. " SAPGUI
*& Form PRINT_REPORT_ASCENDING
text
--> p1 text
<-- p2 text
FORM PRINT_REPORT_ASCENDING.
IF WRK_TABNAME = 'IT_HEADER'.
SORT IT_HEADER BY (WRK_FLDNAME).
PERFORM PRINT_TOP.
PERFORM PRINT_DETAILS.
ENDIF.
ENDFORM. " PRINT_REPORT_ASCENDING
*& Form PRINT_DETAILS
text
--> p1 text
<-- p2 text
WRK_AUSP1 width chged below from (7)to(9) by Nagaraj/MKRK 24.11.05
FORM PRINT_DETAILS.
SORT IT_HEADER BY MATNR.
IF SY-BATCH EQ 'X'.
PERFORM PRINT_TOP.
ENDIF.
IF REQ = 'X'.
LOOP AT IT_HEADER.
IF FLG_COLOR = 'X'.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
CLEAR FLG_COLOR.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
FLG_COLOR = 'X'.
ENDIF.
WRITE :/ SY-VLINE NO-GAP,
(18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
SY-VLINE NO-GAP,
(40) IT_HEADER-MAKTX NO-GAP,
SY-VLINE NO-GAP,
(18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
SY-VLINE NO-GAP.
Code started by Thanikai on 16.08.2002
LOOP AT IT_DETAILS2.
CLEAR: TMP_STR, WRK_AUSP1.
IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM
AND ZAEHL = IT_DETAILS2-ZAEHL.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ELSE.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ENDIF.
ENDLOOP.
WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
IF SY-LINNO > 25.
IF SY-BATCH EQ 'X'.
NEW-PAGE.
PERFORM PRINT_TOP.
ENDIF.
ENDIF.
Code end by Thanikai on 16.08.2002..
ENDLOOP.
ELSEIF NREQ = 'X'.
LOOP AT IT_HEADER.
IF FLG_COLOR = 'X'.
FORMAT COLOR COL_NORMAL INTENSIFIED ON.
CLEAR FLG_COLOR.
ELSE.
FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
FLG_COLOR = 'X'.
ENDIF.
WRITE :/ SY-VLINE NO-GAP,
(18) IT_HEADER-MATNR COLOR COL_KEY NO-GAP,
SY-VLINE NO-GAP,
(18) IT_HEADER-BISMT NO-GAP, "Thanikai-17.05.2002
SY-VLINE NO-GAP.
Code started by Thanikai on 16.08.2002
LOOP AT IT_DETAILS2.
CLEAR: TMP_STR, WRK_AUSP1.
IF IT_DETAILS2-ATNAM EQ 'CALIBRE'.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM
AND ZAEHL = IT_DETAILS2-ZAEHL.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ELSE.
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR
AND ATNAM = IT_DETAILS2-ATNAM.
TMP_STR = 'X'.
WRK_AUSP1 = IT_DETAILS-AUSP1.
EXIT.
ENDLOOP.
IF TMP_STR EQ 'X'.
WRITE : (9)WRK_AUSP1 NO-GAP, SY-VLINE NO-GAP.
ELSE.
WRITE : ' ', SY-VLINE NO-GAP.
ENDIF.
ENDIF.
ENDLOOP.
WRITE : (8) IT_HEADER-SCMNG NO-GAP, SY-VLINE NO-GAP.
IF SY-LINNO > 25.
IF SY-BATCH EQ 'X'.
NEW-PAGE.
PERFORM PRINT_TOP.
ENDIF.
ENDIF.
Code end by Thanikai on 16.08.2002
ENDLOOP.
ENDIF.
ULINE.
ENDFORM. " PRINT_DETAILS
*& Form PRINT_REPORT_DESCENDING
text
--> p1 text
<-- p2 text
FORM PRINT_REPORT_DESCENDING.
IF WRK_TABNAME = 'IT_HEADER'.
SORT IT_HEADER BY (WRK_FLDNAME) DESCENDING.
PERFORM PRINT_TOP.
PERFORM PRINT_DETAILS.
ENDIF.
ENDFORM. " PRINT_REPORT_DESCENDING
*& Form PRINT_TOP
text
--> p1 text
<-- p2 text
IT_DETAILS2-ATNAM width chged below from 7 to 9. Nagaraj/MKRK 24.11.05
FORM PRINT_TOP.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
ULINE.
IF REQ = 'X'.
READ TABLE IT_HEADER INDEX 1.
WRITE :/ SY-VLINE NO-GAP,(17) 'Material No' ,SY-VLINE NO-GAP.
SET LEFT SCROLL-BOUNDARY.
WRITE :(39) ' Material Description', SY-VLINE NO-GAP,
(17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
Comments made by Thanikai on 16.08.2002
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
LOOP AT IT_DETAILS2.
WRITE : (9) IT_DETAILS1-ATNAM NO-GAP,SY-VLINE NO-GAP.
WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
ENDLOOP.
WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
ELSEIF NREQ = 'X'.
READ TABLE IT_HEADER INDEX 1.
WRITE :/ SY-VLINE NO-GAP, (17) 'Material No' ,SY-VLINE NO-GAP,
(17) ' Old Matl. Number', SY-VLINE NO-GAP. "Thanikai-17.05.2002
Comments made by Thanikai on 16.08.2002
LOOP AT IT_DETAILS WHERE MATNR = IT_HEADER-MATNR.
LOOP AT IT_DETAILS2.
WRITE : (9) IT_DETAILS-ATNAM NO-GAP,SY-VLINE NO-GAP.
WRITE : (9) IT_DETAILS2-ATNAM NO-GAP,SY-VLINE NO-GAP.
ENDLOOP.
WRITE : (8) 'Pkg.Unit' NO-GAP, SY-VLINE NO-GAP.
ENDIF.
ULINE.
FORMAT RESET.
ENDFORM. " PRINT_TOP
*& Form PKG_DLVY_UNIT
text
--> p1 text
<-- p2 text
FORM PKG_DLVY_UNIT.
SELECT SINGLE KONP~KBETR INTO WRK_KBETR
FROM ( A916 INNER JOIN KONP
ON KONP~MANDT = SY-MANDT
AND KONPKNUMH = A916KNUMH
AND KONP~KOPOS = '01' ) CLIENT SPECIFIED
WHERE A916~MANDT = SY-MANDT
AND A916~KAPPL = 'V'
AND A916~KSCHL = 'PR00'
AND A916~VKORG = 'WTCH'
AND A916~VTWEG = '01'
AND A916~SPART = '01'
AND A916~MATNR = IT_MATNR-MATNR
AND A916~DATBI >= SY-DATUM
AND A916~DATAB <= SY-DATUM.
IF SY-SUBRC EQ 0.
SELECT SINGLE * FROM ZSAI_PARAM CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND PMFID = 'ZPKG_PRICE'
AND PMVL1 = '01'.
IF SY-SUBRC EQ 0.
IF WRK_KBETR BETWEEN 1 AND ZSAI_PARAM-PMVL2.
SELECT SINGLE * FROM MVKE CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATNR = IT_MATNR-MATNR
AND VKORG = 'WTCH'
AND VTWEG = '01'.
IF SY-SUBRC EQ 0.
IF MVKE-SCMNG GE 1.
IT_HEADER-SCMNG = MVKE-SCMNG.
ELSE.
In the absence of delivery unit for a material,
delivery unit is considered as one.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
If the price for a material is either below 1 or above 2499, then
the delivery unit is considered as one.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
IT_HEADER-SCMNG = 1.
ENDIF.
ELSE.
In the absence of price for a material, delivery unit is
considered as one.
IT_HEADER-SCMNG = 1.
ENDIF.
CLEAR: WRK_KBETR.
ENDFORM. " PKG_DLVY_UNITThe first point would be to change the following:
LOOP AT IT_MARA.
SELECT SINGLE * FROM MAKT CLIENT SPECIFIED
WHERE MANDT = SY-MANDT
AND MATNR = IT_MARA-MATNR
AND SPRAS = 'E'.
IF SY-SUBRC = 0.
IT_MATNR-MATNR = IT_MARA-MATNR.
IT_MATNR-MAKTX = MAKT-MAKTX.
IT_MATNR-BISMT = IT_MARA-BISMT. "Thanikai-17.05.2002
ENDIF.
APPEND IT_MATNR.
CLEAR IT_MATNR.
ENDLOOP.
I would sort IT_MARA by matnr then select for all entries into new table IT_matnr and only read when you are actuallygoing to use it for your final table.
This however will not make much difference to your problem. I suggest you put more of the code into subroutines and look at the se30 output as tyo which subroutines are actually taking most of the time. Please post the results and the subroutines which take the longest. -
Hi Friends
I am having performance issue for this function-module(HR_TIM_REPORT_ABSENCE_DATA) and one my client got over 8 thousend employees . This function-module taking forever to read the data. is there any other function-module to read the absences data IT2001 .
I did use like this .if i take out this F.M 'HR_TIM_REPORT_ABSENCE_DATA_INI' its not working other Function-module.please Suggest me .
call function 'HR_TIM_REPORT_ABSENCE_DATA_INI'
exporting "Publishing to global memory
option_string = option_s "string of sel org fields
trig_string = trig_s "string of req data
alemp_flag = sw_alemp "all employee req
infot_flag = space "split per IT neccessary
sel_modus = sw_apa
importing
org_num = fdpos_lines "number of sel org fields
tables
fieldtab = fdtab "all org fields
field_sel = fieldnametab_m. "sel org fields
To Read all infotypes from Absences type.
RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA.
central function unit to provide internal tables: abse orgs empl
call function 'HR_TIM_REPORT_ABSENCE_DATA'
exporting
pernr = pernr-pernr
begda = pn-begda
endda = pn-endda
IMPORTING
SUBRC = SUBRC_RTA
tables
absences = absences_01
org_fields = orgs
emp_fields = empl
REFTAB =
APLTAB =
awart_sel_p = awart_s[]
awart_sel_a = awart_s[]
abstp_sel = abstp_s[]
i0000 = p0000
i0001 = p0001
i0002 = p0002
i0007 = p0007
i2001 = p2001
i2002 = p2002
i2003 = p2003.
Thanks & Regards
Reddyguessing will not help you much, check with SE30 to get a better insight
SE30
The ABAP Runtime Trace (SE30) - Quick and Easy
what is the total time, what are the Top 10 in the hitlist.
Siegfried
Maybe you are looking for
-
ITunes 9, Snow Leopard, Won't store User settings
I recently installed snow leopard and last night I loaded iTunes 9. All went well with the install and when I log on all is ok. When my wife logs on under her own account and launches iTunes, it asks to confirm the license agreement, then says it can
-
How can i update my ipod touch 4th Gen. to 5.0?
actually my itunes downloads the software but it will become error once it's already done. My itunes is updated to the newest version, i tried it many times but the same problem occurs
-
Popup in pruchase order while saving
Hi Gurus, I have checked in forum but didn't find any solution for my requirement, kindly help for resolving the issue, reqmt: I need a pop-up while saving the purchase order with some information text and two options (Yes/No), if i click on Yes syst
-
How can I redeem my prepaid card if it keeps telling my it is the wrong code when I know it is the correct code?
-
Help with making a flash movie...go to frame and looping
How do I make it so that in my flash movie when it gets to a certain frame in the movie it skis to another frame? Where and what is the action script? like when it gets to frame 150 i want it to go back to frame 1 so it can be animation for like a an