OracleConnectionCacheImpl minimum connection limit error
We're using Oracle's JDBC for JDeveloper 9.0.3 API as our Database Layer, pooling connections and our methodology allows the user to set the min/max connections within the API's cache method (setMinLimit, setMaxLimit).
The problem is that when we try to set the minimal connection limit beyond eleven it throws an error message, and doens't connect to the Oracle instance. When we set this number to ten, it works fine.
Is there a maximal amount of minimal connections that the pooled JDBC driver can perform?
Any ideas?
Regards,
Leonardo Eloy
Check if there is another JCo connection configured with the same IP and User. I have found in the past that even though there are two connections configured because they have the same ip and user they are put into one pool with the lowest max pool of the two connections.
Similar Messages
-
Ace - connection reset (Error 101)
Hi, I have a problem with a Cisco ACE, after approximately an hour being in production, for all new connections
it gives the message: connection reset. The message on any web browser is: connection reset (Error 101)
It blocks any backend server (Apache).I get same error also when I try to connect direcly to the backend address.
This error saturates the connections on the servers (in the log of the DB I found error connection reset)
Without ACE all work fine, it's not a load traffic issue.
It seems like once opened a connection the ace does not close it anymore!
But the graphical snmp servers do not report the increase in connections, what is mistake ?
The balancer manages two physical servers and is configured in stickyness mode
Please find attached the configuration
logging enable
logging timestamp
logging trap 4
logging buffered 3
logging host 172.16.0.2 udp/514 format emblem
access-list ANY line 8 extended permit icmp any any
access-list ANY line 16 extended permit ip any any
probe http HTTP_PROBE1
request method get url /index.php
expect status 200 206
expect status 300 307
expect status 400 417
probe tcp PROBE_TCP
interval 30
rserver host 03a.it
ip address 172.16.0.1
conn-limit max 50000 min 40000
inservice
rserver host 03b.it
ip address 172.16.0.2
conn-limit max 50000 min 40000
inservice
serverfarm host FARM_WEB
predictor leastconns
probe HTTP_PROBE1
rserver 03a.it
inservice
rserver 03b.it
inservice
parameter-map type http HTTP_PARAMETER_MAP
persistence-rebalance
sticky http-cookie session StickyGroup1
timeout 3600
serverfarm FARM_WEB
class-map type management match-all ICMP-ALLOW_CLASS
2 match protocol icmp source-address x.x.x.x
class-map match-all L4-WEB-IP
2 match virtual-address x.x.x.x tcp eq www
class-map type management match-all REMOTE_ACCESS
2 match protocol ssh any
policy-map type management first-match REMOTE_MGMT_ALLOW_POLICY
class REMOTE_ACCESS
permit
policy-map type loadbalance http first-match WEB_L7_POLICY
class class-default
sticky-serverfarm StickyGroup1
insert-http x-forward header-value "%is"
policy-map multi-match WEB-to-vIPs
class L4-WEB-IP
loadbalance vip inservice
loadbalance policy WEB_L7_POLICY
loadbalance vip icmp-reply active
nat dynamic 1 vlan 2541
appl-parameter http advanced-options HTTP_PARAMETER_MAP
interface vlan 125
ip address
access-group input ANY
service-policy input REMOTE_MGMT_ALLOW_POLICY
service-policy input WEB-to-vIPs
no shutdown
interface vlan 254
ip address
access-group input ANY
nat-pool
service-policy input REMOTE_MGMT_ALLOW_POLICY
no shutdown
At the moment this happens, the simultaneous connections (command: show conn) on the server are around 350
the CPU load is 2%
sticky database has approximately 24000 records.
Log level is set to 4. But no error report.
Do you need more info to resolve the problem?
Thank you
Best Regards
N.Hello Nicolas,
I wonder if you can include these values:
parameter-map type http HTTP_PARAMETER_MAP
case-insensitive
persistence-rebalance
set header-maxparse-length 65535
set content-maxparse-length 65535
length-exceed continue
parsing non-strict
I also noticed a lot of errors which might be caused also due to these denied under the #show resource usage all which may indicate you are reaching the license limits, but you should discuss it with your Cisco SE, please see below:
Allocation
Resource Current Peak Min Max Denied
Context: vrack254
conc-connections 4 1267 60000 60000 0
mgmt-connections 2 28 748 748 0
proxy-connections 0 1255 7864 7864 0
xlates 0 0 7864 7864 0
bandwidth 572 3824781 3740624 127490624 1416859
throughput 96 3712886 3740624 3740624 1416859
mgmt-traffic rate 476 111895 0 123750000 0
connection rate 1 1729 4500 4500 0
ssl-connections rate 0 0 224 224 0
mac-miss rate 0 15 16 16 4
inspect-conn rate 0 0 1800 1800 0
http-comp rate 0 0 5898240 5898240 0
to-cp-ipcp rate 0 11 36 36 0
acl-memory 8216 10568 744800 744800 0
sticky 22978 22978 31456 31456 0
regexp 19 23 7864 7864 0
syslog buffer 30720 30720 30720 30720 0
syslog rate 0 6 750 750 0
Can you upload the specific error which you are getting also?
Jorge -
I am working on upgrading an application that has been in use for many years. The application is written in VB6 and I have been tasked with upgrading the current application to Crystal Reports for Visual Studio. I am using Crystal Reports for VS Version 13.0.12.1494. The system's database is a Sybase SQL Anywhere 16 database with an ODBC connection using integrated login. Each of the reports has the database connection set up from within the report. There is only once database server, so each of the reports are pointing to the same DB. The database server is currently installed as a "Personal Server" with a limit of 10 connections.
I have implemented the CR viewer as part of a COM-callable wrapper that exposes a COM interface for VB6 to interact with. Inside of my viewer component is a Winform that embeds the Crystal's Report viewer. The COM interface basically maps the basic Crystal apis to methods that the VB6 can call (i.e., Load Report, Set Field Text, Update SQL Query, etc). This architecture is working as designed and the reports are displaying correctly and responding correctly to changes in queries, etc.
The issue is that after I open 9 reports, the tenth one will respond with an error indicating that the database connection limit has been reached. The database connections used by the reports aren't released until after the application is closed. The application is designed for a secure environment that prohibits the non-administrative user from accessing the systems desktop, so asking the user tor restart the application after 10 reports isn't a viable option.
I have checked and database connection pooling is turned off for the SQL Anywhere 16 driver.
I have been digging on this for a few days and have tried adding code in the FormClosed event to close and dispose of the Report Document as follows:
ReportDocument reportDoc= (ReportDocument) crystalReportViewer1.ReportSource;
reportDoc.Close();
reportDoc.Dispose();
GC.Collect(); // Force garbage collection on disposed items
I have also tried the following (as well as maybe 20 or so other permutations) trying to fix the issue with no success.
ReportDocument reportDoc= (ReportDocument) crystalReportViewer1.ReportSource;
foreach (Table table in reportDoc.Database.Tables)
table.Dispose();
crystalReportViewer1.ReportSource = null;
reportDoc.Database.Dispose();
reportDoc.Close();
reportDoc.Dispose();
reportDoc = (ReportDocument)crystalReportViewer1.ReportSource;
GC.Collect(); // Force garabe collection on disposed items
Any ideas or suggestions would be greatly appreciated. I have been pulling my hair out on this one!Hi Ludek,
Thanks so much for the quick reply. Unfortunately I did not have time to work on the reporting project Friday afternoon, but did a quick test this morning with some interesting results. I'm hoping if I describe what I'm doing, you can show me the error of my ways. This is really my first major undertaking with Crystal Reports.
If I simply load the report, then close and dispose, I don't hit the limit of 10 files. Note that I do not logon manually in my code as the logon parameters are all defined within the reports themselves. The logon happens when you actually view the report. Loading the report doesn't seem to actually log in to the DB.
What I did was create a very simple form with a single button that creates the WinForm class which contains the Crystal Viewer. It then loads the report, sets the ReportSource property on the CrystalReportsViewer object contained in the WInForm and shows the report. The report does show correctly, until the 10 reports limit is reached.
The relevant code is shown below. More than I wanted to post, but i want to be as complete and unambiguous as possible.
This code displays the same behavior as my earlier post (after 10 reports we are unable to create another connection to the DB).
// Initial Form that simply has a button
public partial class SlectReport : form
public SelectReport()
InitializeComponent();
private void button1_Click(object sender, EventArgs e)
ReportDocument rd = new ReportDocument();
ReportForm report = new ReportForm();
try
rd.Load(@"Test.rpt");
report.ReportSource = rd;
report.Show();
catch (Exception ex)
MessageBox.Show(ex.Message);
// The WinForm containing the Crystal Reports Viewer
public partial class ReportForm : Form
public ReportForm()
InitializeComponent();
private void Form1_Load(object sender, EventArgs e)
this.crystalReportViewer1.RefreshReport();
this.FormClosed += new FormClosedEventHandler(ReportForm_FormClosed);
void ReportForm_FormClosed(object sender, FormClosedEventArgs e)
ReportDocument rd;
rd = (ReportDocument)crystalReportViewer1.ReportSource;
rd.Close();
rd.Dispose();
public object ReportSource
set { crystalReportViewer1.ReportSource = value; }
Again, any guidance would be greatly appreciated. -
MacBook Pro sees wireless networks but cannot join any. Connection timeout error
I have a MacBook Pro here that sees all wireless networks but cannot join any. It gives a connection timeout error with every one.
Internet access via ethernet cable works just fine.It's not uncommon for you to "see" a great many networks, dozens even, yet you not be able to connect to any of them even if they are "open" (no lock icon). There may be a number of reasons for that, such as they're too weak for a reliable connection, or the router may limit connections to only specified devices.
There is only one way to achieve a reliable network connection, and that's for you to connect to your own wireless router. Even that doesn't work if its signal is too weak or if there are many competing wireless networks in your area.
If it's your own AirPort Base Station you're trying to use but can't, the latter could be the reason. The only way to mitigate the effects of wireless interference is to use 802.11n and 5 GHz whenever practicable. Even today you may only find one or two 5 GHz networks being used in an otherwise "crowded" area. -
Windows 7 - What Constitutes a Connection Under the 20 Connection Limit?
Background
Currently testing some enterprise software the company I work for designs, and our current scope of support allows for installations on Windows 7. We have multiple services running on the 'server' and we're communicating with clients on various IP ports,
as well as running a webpage through IIS. At the very minimum we have two connections from a client system at any time over two different ports, this can grow depending on what's being run as part of the client.
Environment
The environment consists of the following:
Windows 7 'Server' running a local instance of SQL Express, also hosting ASP.NET webpage.
Windows 7/Vista/XP Clients connecting over IP to 2-4 different ports
Question
There's a host of threads and documentation on the 20 connection limit within Windows 7, but really no clear answer as to what constitutes a 'connection'. Some Microsoft documentation says TCP connections, some say SMB connections, and a half dozen form
posts claim one or the other. I did a quick test last night with a client simulation tool which pushed two connections to the server for each client, and connected 25 clients (total of 50 connections) and was not refused subsequent connections.
What exactly removes an available connection from the pool of 20?
Unlimited connections from a single IP address? (each computer removes an available connection from the limit)
Per TCP connection? (each connection to a port removes an available connection from the limit)
Per Windows User? (each connection from a Windows user removes an available connection from the limit)
Or is the 20 connection limit strictly applied to SMB?
I also see the following in the EULA for Windows 7 Professional:
Device Connections. You may allow up to 20 other devices to access software installed on the licensed computer to use only File Services, Print Services, Internet Information Services and Internet Connection Sharing and Telephony Services.
Does this indicate the 20 connection limit only applies to IIS, ICS, File/Print Sharing?
Greatly appreciate the time taken to answer this.
Cheers,
James.Hi James,
The 20 connection limit applies to File and Printer sharing.
Limit the Number of Users of a Shared Folder
http://technet.microsoft.com/en-us/library/cc753521.aspx#BKMK_interface
Windows 7 incoming connection limit
http://social.technet.microsoft.com/Forums/en/w7itpronetworking/thread/854f3e27-10e5-4629-bb77-007cc5e42b41
Regarding TCP, IIS connection limit, it is hard to confirm. Since Vista SP2 the limitation have been removed from TCPIP.SYS, and has been configured through a registry key. Windows7
should follow that same behavior. You can also consult in IIS forum.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\]
Value: TcpNumConnections
Type: DWORD
More information
http://blogs.msdn.com/b/david.wang/archive/2006/04/12/howto-maximize-the-number-of-concurrent-connections-to-iis6.aspx
Best Regards,
Niki
Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
Hi,
Will the WAE or CM show an error message if the connection limit is reached on a WAE?
Thanks,
MikeWhen the WAE/WAVE device reached max connection limit - any new connections will go into pass through due to overload
Existing connections will be still be optimized.
Thanks
Eric
If this answers your questions please mark as answered with a 5. -
TNS-01181: Internal registration connection limit reached
Hi all,
I am currently working on sun solaris box.
My Listener log is showing this error:
TNS-01181: Internal registration connection limit reached
Even database is working fine:-
Only one Perticular application is not able to connect
with OCI error from application .
Plz help ASAP
Regards:-
DeafulterHi,
what is the version of the database?
Try to set MAX_REG_CONNECTIONS_<listener>=1000 in listener.ora
e.g.: max_reg_connections_listener = 1000
Hope this helps,
Andrey -
Problem: Failed to open the connection. Error Code 0x800002F4 (-2147482892)
Problem: Failed to open the connection. Error Code 0x800002F4 (-2147482892)
This is on two (2) separate machines. These are NEW INSTALLATION development work stations (laptops). One is Vista (Visual Studio 2008 / Crystal Reports 2008), and the other is Windows XP Pro (Visual Studio 2003 / Crystal Reports XI R1).
I am using EXISTING CODE (established over several years), and EXISTING REPORTS (established over several years). Old development station was XP Pro, as above, and still exists, and still works fine.
I can open the report in Crystal, and see the results just fine. Data for the report is obtained via ODBC.
Can someone identity the actual error by the Error Code above, and advise. Thanks You in Advance.Ok, so let's start at step 1:
SP 1 just released and I'd recommend applying that. The SO is available from here:
https://smpdl.sap-ag.de/~sapidp/012002523100010503722008E/cr2008_sp1.exe
For future reference, msm matching the above SP is here:
https://smpdl.sap-ag.de/~sapidp/012002523100011715292008E/cr121_mm.zip
and msi is here:
https://smpdl.sap-ag.de/~sapidp/012002523100011722132008E/cr121_redist_install.zip
Step 2: a few questions:
a) I am not sure what CR SDK you are using; RDC, .NET? I suspect that you are using the CR assemblies for .NET, but do confirm.
b) what is the database you are connecting to?
c) is this a web or a win app?
Step 3: As the error can mean any number of things (to me it's just means something went wrong during the attempt to connect to the database...), the solution may vary, however the troubleshooting steps remain quite consistent:
1) Do make sure the report is indeed working in the CR 2008 designer (e.g.; make sure "saved data" is not enabled.
2) Try a simple new windows app with one of your reports. See if you have a report with no subreports and use it
3) If that works, use a report with subreports
4) If the above does not work in (1) above, create a new report to the same ODBC connection, do not code any database connection - let the report prompt for the logon parameter (PWD)
5) Run the new report in your new app, enter the PWD when prompted
6) If this works, add your database logon code
7) If that works, add your original report (again, preferably with no subreports)
8) If that fails, ensure that the subreport and main report use the same database connection type (ODBC)
9) If it works, see if you can determine the difference between your old app and the new app.
Ludek -
Configure Synchronization Connections An error has occurred while accessing the SQL Server database
Hi,
i am getting following error message
Central Administration --> Synchronization Connections
An error has occurred while accessing the SQL Server database or the SharePoint Server Search service.
If this is the first time you have seen this message, try again later. If this problem persists, contact your administrator.
Central Administration --> Manage Profile Service: User Profile Service Application --> Manage User Properties
Error
An unexpected error has occurred.
Troubleshoot issues with Microsoft SharePoint Foundation.
Correlation ID: 3bce5a11-f2dc-4788
Please tell how to fix it.
iffiEvent ID 5555 -> i have change the Timer jobs recycling time AM to PM
for User profile page not display number of count in the page first check services , connection ,
IISRESET /NOFORCE / timer services restart
Deepesh Yevle MCTS -
Too many connections - limit of 150 reached
We ran into a situation where a program (written in PHP, running under Apache) was spawned via crontab every 30 seconds for test purposes. It connected to the database but did not disconnect.
Net result: Once the program had been started 150 times, the database refused any more connections. No valid users could connect. I couldn't even connect from the oracle privileged account.
Item 1: The process will be modified to explicitly close its connection when done, rather than trusting the job to default behavior of PHP. So, hopefully, we will not run into this a second time.
Item 2: But if we do have this problem again, I need to know how to intervene when the connection limit has been reached. I was not able to connect myself and therefore could not query v$process or related tables to gather any information. I could kill the various (useless) listener processes at the unix command line, but it still took time for Oracle to sense the dead process and mop up. How to accomplish this quickly?
Item 3: I can probably set up the rogue process to login as a different user and then set a resource profile for that user including timeouts. Any suggestions on values for that resource profile?
Item 4: Is there a way to reserve a listener connection for a privileged account such as the DBA?
Thanks for any guidance.
-- Chris CurzonChrisCurzonDBA wrote:
Thanks for the friendly reply.
What worried me was that I had to wait for the useless connections to clear, before I could connect and see what the sessions were. Yes, Oracle had to roll back any uncommitted work, and there's no way to speed that up, but I wanted to see that processes from inside of Oracle (connected) not from outside.
Is it possible to configure the listener to "reserve" one connection for a privileged account? No.
It is not the listener's responsibility. In fact, it is not even the listener's responsibility to maintain existing connections. Once the listener services the connection request, it is totally out of the picture. You can even kill the listener, and any existing connections will continue on. It's like being introduced to someone at a party. Once you are introduced to someone (by The Listener), you carry on your conversation with that person directly, not through the person (The Listener) who introduced you.
>
-- Chris -
Why do i keep getting the "internet connection timeout" error message?
i have been upgrading a few standard itunes albums to itunes plus versions through my 3g mobile broadband connection, while not exactly a fast process, it was working fine until i started to get a backlog of 3 or 4 albums which were waiting in a queue to be downloaded, now every time i do the "check for downloads" option i get the "internet connection timed out" error message...this has been going on for 2 days! am i right in suspecting the backlog of albums is too much for my 3g mobile broadband connection? this is really doing my head in, if any of you techies could help me, it'd be much appreciated...?
yes i have recently updated to itunes 8.2.1, but i am starting to think its apple's servers (i tried to download at my brothers house...different computer and connection...same connection timeout error), because it will still let me download an album, but not necessarily all of the tracks. when i questioned itunes customer services about the seemingly hit and miss state of affairs with downloading, they told me to wait 3 weeks before trying to download the tracks that were giving me the grief (2 tracks from an arctic monkeys album)...which kinda indicates they know there is a problem and are trying to fix it, why else would they say wait 3 wks??? they gave me 5 free music tracks too, which is handy.
-
Connection Failed Error while Importing tables in 11.1.1.6 on Windows 7
Hi,
Can you please help me in resolving the connection failed error while importing the tables from the database.
I am using OBI 11.1.1.6 on Windows 7
You help is highly appreciated. I have followed all the below blogs but still i was not able to resolve the issue.
http://123obi.com/2011/03/error-the-connection-has-failed-in-obiee-11g/
http://obieedeveloper.blogspot.in/2012/03/connection-failed-error-in-obiee-11-g.html
http://iadviseblog.wordpress.com/2011/05/29/obiee-11g-error-in-importing-metadata/
http://www.obieefans.com/%E2%80%9Cthe-connection-has-failed%E2%80%9D-error-in-obiee-11g-admin-tool/
Thanks in Advance
SivaIt would be nice if you put your issues instead of asking to look those many urls.
try using tns entry in connection pool or follow this thread
Connection failed in OBIEE 11g -
Can't connect via Airport -- "connection timeout" error, instead
I've got a MacBook Pro here, which was successfully connected online via Airport, under OS X 10.4.11.
Then I upgraded to Leopard (10.5), and the machine would no longer connect automatically to the router.
OK, I tried manually configuring the wireless connection, but no luck. So, I brought in an old iBook G4 running the same OS (10.5), and successfully linked it to the router, wirelessly, via Airport.
Copying the procedure that worked with the iBook -- to the MBPro -- did not help. Still getting a "connection timeout" error message.
So I performed a fresh install of 10.5 -- and I even DLed the Software Updates, including two that were supposed to improve Airport functionality -- and tried again. No luck.
Any suggestions?
TIA.John,
I had the same problem when I upgraded from Tiger to Leopard in January. My memory is already rusty but try the following:
1. Go to System Preferences > Network pane. On the left pane, click on AirPort. In the right pane lower right, click Advanced button. Then on the AirPort tab, click on the name of your network and then the minus sign to remove it from the list.
2. Click Apply and quit System Preferences.
3. Put the computer to sleep.
4. Wake the computer.
5. Go back in to Network preferences, AirPort tab. Click the plus sign to add your network. Fill in the Network Name, choose the type of Security by clicking on the pop-down bar, enter password/code/phrase and click Add. NOTE: Do not connect to the network at this time.
6. Click Apply and Quit the Network Preferences.
7. On the Menu row, click the Airport icon and select your network. (IF your network does not show, choose Join Other Network. Fill in the Network Name, choose the type of Security by clicking on the pop-down bar, enter password/code/phrase and click Join.)
8. Verify connectivity
9. Put the computer to sleep.
10. Wake the computer.
11. Verify connectivity
HTH -
How to solve Error in http connection. Error -1
urlMidlet2===http://localhost:8080/testProj?userId=20&selMPBL=23&svMPBL=IPOD+Touch+Screen+e!1!Tue+Jan+06+00:00:00+UTC+2009!Tue+Jan+06+00:00:00+UTC+2009!Sat+Jan+31+00:00:00+UTC+2009!Mp3+Player!IPOD!Rejected!12
[j2mepolish] Generic/DefaultColorPhone: !1!2!1222!13333
[j2mepolish] Generic/DefaultColorPhone: Protocol for this connection is http
[j2mepolish] Generic/DefaultColorPhone: This object is connected to localhost host
[j2mepolish] Generic/DefaultColorPhone: HTTP Port in use is 8080
[j2mepolish] Generic/DefaultColorPhone: respCode=====-1
[j2mepolish] Generic/DefaultColorPhone: Error in opening HTTP Connection. Error#-1
Why is this error coming? How to solve it?
Thanks in advance.
Edited by: J2me_Beginner on Jun 7, 2009 9:38 PMI am making a form using an interface. When Activate the Form, I got this error:
Invalid HTTP connection: ADS
Message no. FPRUN000
But I do not know how to solve or config ADS. Any one know how to slove this error ?
Thanks a lot. -
Time limit error no matter what optimization I do...
Hello Experts,
I am trying to optimize the code below since it always results in time limi error when we transport
it to production server. I have tried eliminating some select inside the loop and using for all entries
but it still gets the error. Anyway, below is the code and I hoe you can help me out on this one guys.
Thank you and take care!
LOOP AT lt_vbap ASSIGNING <wa_vbap>.
IF <wa_vbap>-auart EQ 'ZUCI' OR
<wa_vbap>-auart EQ 'ZURV' OR
<wa_vbap>-auart EQ 'ZUPR'.
Check if a delivery document has been created
CLEAR wa_vbill. "used wa_vbfa-vbeln instead of wa_vbill
*Start of modification - AVH - 04/11/07
*/ Used read table instead of fetching records from database every loop
SELECT SINGLE vbeln
FROM vbfa
INTO wa_vbill
WHERE vbelv = <wa_vbap>-vbeln
AND ( ( vbtyp_n EQ 'J' AND vbtyp_v = 'C' )
OR ( vbtyp_n EQ 'T' AND vbtyp_v = 'H' ) ).
CLEAR wa_vbfa.
READ TABLE lt_vbfa INTO wa_vbfa WITH KEY vbelv = <wa_vbap>-vbeln
vbtyp_n = 'J'
vbtyp_v = 'C'
BINARY SEARCH
TRANSPORTING vbeln.
IF sy-subrc <> 0.
READ TABLE lt_vbfa INTO wa_vbfa WITH KEY vbelv = <wa_vbap>-vbeln
vbtyp_n = 'T'
vbtyp_v = 'H'
BINARY SEARCH
TRANSPORTING vbeln.
ENDIF.
*End of modification - AVH - 04/11/07
IF sy-subrc <> 0.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ELSE.
Check if within selection parameters
CLEAR wa_likp.
*Start of modification - AVH - 04/11/07
READ TABLE lt_likp INTO wa_likp WITH KEY vbeln = wa_vbill.
READ TABLE lt_likp INTO wa_likp WITH KEY vbeln = wa_vbfa-vbeln.
*End of modification - AVH - 04/11/07
*Start of modification - AVH - 04/11/07
*/ Used wa_vbfa instead of variable wa_vbill
IF sy-subrc <> 0.
SELECT SINGLE *
FROM likp
INTO wa_likp
WHERE vbeln = wa_vbill.
SELECT SINGLE *
FROM likp
INTO wa_likp
WHERE vbeln = wa_vbfa-vbeln.
*End of modification - AVH - 04/11/07
APPEND wa_likp TO lt_likp.
ENDIF.
IF NOT wa_likp-wadat_ist IN s_erdat.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
ENDIF.
ELSE.
Check if this has already been billed
CLEAR wa_vbill. "Used wa_vbfa instead of wa_vbill
*Start of modification - AVH - 04/11/07
*/ Used read table instead of fetching records from database every loop
SELECT SINGLE vbeln
FROM vbfa
INTO wa_vbill
WHERE vbelv = <wa_vbap>-vbeln
AND ( ( vbtyp_n EQ 'M' AND vbtyp_v = 'C' )
OR ( vbtyp_n EQ 'O' AND vbtyp_v = 'H' ) ).
CLEAR wa_vbfa.
READ TABLE lt_vbfa INTO wa_vbfa WITH KEY vbelv = <wa_vbap>-vbeln
vbtyp_n = 'M'
vbtyp_v = 'C'
BINARY SEARCH
TRANSPORTING vbeln.
IF sy-subrc <> 0.
READ TABLE lt_vbfa INTO wa_vbfa WITH KEY vbelv = <wa_vbap>-vbeln
vbtyp_n = 'O'
vbtyp_v = 'H'
BINARY SEARCH
TRANSPORTING vbeln.
ENDIF.
*End of modification - AVH - 04/11/07
IF sy-subrc <> 0.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ELSE.
Check if within selection parameters
CLEAR wa_vbrk.
*Start of modification - AVH - 04/11/07
*/ Used wa_vbfa instead of variable wa_vbill.
READ TABLE lt_vbrk INTO wa_vbrk WITH KEY vbeln = wa_vbill.
READ TABLE lt_vbrk INTO wa_vbrk WITH KEY vbeln = wa_vbfa-vbeln.
IF sy-subrc <> 0.
SELECT SINGLE vbeln fkdat
FROM vbrk
INTO wa_vbrk
WHERE vbeln = wa_vbill.
APPEND wa_vbrk TO lt_vbrk.
SELECT SINGLE vbeln fkdat
FROM vbrk
INTO wa_vbrk
WHERE vbeln = wa_vbfa-vbeln.
APPEND wa_vbrk TO lt_vbrk.
ENDIF.
*End of modification
IF NOT wa_vbrk-fkdat IN s_erdat.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
ENDIF.
ENDIF.
Get Material Type and Division
IF <wa_vbap>-spart IS NOT INITIAL.
SELECT SINGLE mtart
FROM mara
INTO lv_mtart
WHERE matnr = <wa_vbap>-matnr.
ELSE.
SELECT SINGLE mtart spart
FROM mara
INTO (lv_mtart,<wa_vbap>-spart)
WHERE matnr = <wa_vbap>-matnr.
ENDIF.
If material division is same as parameter division
IF <wa_vbap>-spart = p_spart.
If material is subsidiary-owned
IF <wa_vbap>-spart in lr_spart.
If customer is the same as that of parameter division
IF <wa_vbap>-kunnr NE lr_kunnr OR <wa_vbap>-auart EQ 'ZUDO' OR <wa_vbap>-auart EQ 'ZUS3'.
If item is a free good, tag order type as 'ZUPR' to treat
the item the same way as 'ZUPR'
IF <wa_vbap>-pstyv = 'TANN' OR
<wa_vbap>-pstyv = 'ZKNF' OR
<wa_vbap>-pstyv = 'ZKNN' OR
<wa_vbap>-pstyv = 'ZFLO' OR
<wa_vbap>-pstyv = 'ZKBF' OR
<wa_vbap>-pstyv = 'ZKLN' OR
<wa_vbap>-pstyv = 'ZREN'.
lv_auart = <wa_vbap>-auart.
IF lv_auart EQ 'ZUPR'.
CLEAR <wa_vbap>-pstyv.
ENDIF.
<wa_vbap>-auart = 'ZUPR'.
CLEAR: lv_mtart.
ENDIF.
Set Cost of Goods Sold Account
<wa_vbap>-cogshkont = '0050000010'.
CASE <wa_vbap>-auart.
WHEN 'ZUDO' OR 'ZUPR' OR 'ZUCI'.
IF p_rtrns EQ 'X'.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
WHEN 'ZURD'.
IF p_issue EQ 'X'.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
WHEN OTHERS.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDCASE.
CASE <wa_vbap>-auart.
WHEN 'ZUPR'.
CASE lv_mtart.
WHEN 'ZUL4'.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
WHEN OTHERS.
Check if division is defined in mapping table
READ TABLE lt_ulsub INTO wa_ulsub
WITH KEY spart = <wa_vbap>-spart.
IF sy-subrc = 0.
<wa_vbap>-kostl = wa_ulsub-kostlp.
<wa_vbap>-bukrs = wa_ulsub-bukrsp.
<wa_vbap>-type = 'TP'.
Set Cost of Goods Sold Account
IF lv_auart = 'ZUPR'.
<wa_vbap>-cogshkont = '0050000006'.
ENDIF.
ELSE.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
ENDCASE.
WHEN 'ZUCI' OR 'ZUDO' OR 'ZURD' OR 'ZUS3'.
Get cost center from header text
PERFORM get_cost_center USING <wa_vbap>-vbeln
CHANGING <wa_vbap>-kostl.
* Change by LGTE 11-02-2006
Check if Medvale sales
IF <wa_vbap>-auart EQ 'ZUCI' AND <wa_vbap>-kostl IS INITIAL.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
Check if UL Cost Center
ELSEIF <wa_vbap>-kostl NE gv_ul_kostl.
IF <wa_vbap>-kostl NE gv_ul_kostl.
* End change.
Get material division and check if subsidiary product
SELECT SINGLE spart FROM mara INTO <wa_vbap>-spart
WHERE matnr = <wa_vbap>-matnr.
READ TABLE lt_ulsub INTO wa_ulsub
WITH KEY spart = <wa_vbap>-spart.
IF sy-subrc = 0.
Get requestor's company code from cost center data
SELECT SINGLE bukrs
FROM csks
INTO <wa_vbap>-bukrs
WHERE kokrs = lc_kokrs
AND kostl = <wa_vbap>-kostl
AND datbi GE sy-datum
AND datab LE sy-datum.
IF sy-subrc = 0.
For donations, only include if a subsidiary company is donating
IF <wa_vbap>-auart EQ 'ZUDO' OR <wa_vbap>-auart EQ 'ZUS3'.
IF NOT <wa_vbap>-kunnr IN lr_kunnrnt.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
CHECK <wa_vbap>-kunnr IN lr_kunnrnt.
ENDIF.
For ZUCI, if the company code of the costcenter is UL, do not include
IF <wa_vbap>-bukrs EQ gc_ul_bukrs.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
IF <wa_vbap>-bukrs = wa_ulsub-bukrsp.
<wa_vbap>-type = 'RV'.
ELSE.
<wa_vbap>-type = 'RV'.
ENDIF.
ELSE.
Check if customer defined in table ZFI_DONATIONS
SELECT SINGLE kunnr FROM zfi_donations INTO <wa_vbap>-kostl
WHERE kunnr = <wa_vbap>-kostl.
IF sy-subrc <> 0.
lv_error = 'X'.
CONCATENATE 'Cost center/Customer' <wa_vbap>-kostl
'does not exist. Please check Sales Order'
<wa_vbap>-vbeln
INTO lt_disp-message SEPARATED BY space.
lt_disp-type = 'E'.
<wa_vbap>-del_ind = 'X'.
APPEND lt_disp.
CONTINUE.
ELSE.
<wa_vbap>-type = 'RV'.
ENDIF.
ENDIF.
ELSE.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
ELSE.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
WHEN OTHERS.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDCASE.
ELSE.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
ELSE.
<wa_vbap>-del_ind = 'X'.
CONTINUE.
ENDIF.
Get company code description
SELECT SINGLE butxt
FROM t001
INTO <wa_vbap>-butxt
WHERE bukrs = <wa_vbap>-bukrs.
IF sy-subrc <> 0.
SELECT SINGLE name1
FROM kna1
INTO <wa_vbap>-butxt
WHERE kunnr = <wa_vbap>-kostl.
ENDIF.
Change by LGTE on 11-02-2006
Get Transaction Type
CASE <wa_vbap>-auart.
WHEN 'ZUPR'. "UL Promo/Samples
IF <wa_vbap>-pstyv = 'TANN' OR
<wa_vbap>-pstyv = 'ZKNF' OR
<wa_vbap>-pstyv = 'ZKNN' OR
<wa_vbap>-pstyv = 'ZFLO' OR
<wa_vbap>-pstyv = 'ZKBF' OR
<wa_vbap>-pstyv = 'ZKLN' OR
<wa_vbap>-pstyv = 'ZREN'.
<wa_vbap>-ltext = 'Free Goods'.
ELSE.
<wa_vbap>-ltext = 'Product Samples'.
ENDIF.
WHEN 'ZUDO'. "Donations - R/3
<wa_vbap>-ltext = 'Donations - R/3'.
WHEN 'ZUCI'. "Donations - ZUCI
<wa_vbap>-ltext = 'Donations - ZUCI'.
WHEN 'ZURD' OR 'ZUS3'. "UL Returns - Donation
<wa_vbap>-ltext = 'UL Returns - Donation'.
ENDCASE.
Get cost center description
SELECT SINGLE ltext FROM cskt INTO <wa_vbap>-ltext
WHERE spras = sy-langu
AND kokrs = lc_kokrs
AND kostl = <wa_vbap>-kostl
AND datbi GE sy-datum.
End of change.
Get material description
SELECT SINGLE maktx
FROM makt
INTO <wa_vbap>-maktx
WHERE matnr = <wa_vbap>-matnr
AND spras = sy-langu.
Get division from material master
SELECT SINGLE spart FROM mara INTO <wa_vbap>-spart
WHERE matnr = <wa_vbap>-matnr.
Get division description
SELECT SINGLE vtext
FROM tspat
INTO <wa_vbap>-vtext
WHERE spras = sy-langu
AND spart = <wa_vbap>-spart.
Get Valuation Class
SELECT SINGLE bklas
FROM mbew
INTO lv_bklas
WHERE matnr = <wa_vbap>-matnr.
Determine G/L of FG Based on Valuation Class
READ TABLE lt_val_cls INTO wa_val_cls WITH TABLE KEY bklas = lv_bklas.
<wa_vbap>-fghkont = wa_val_cls-hkont.
Determine Cost Center of Cogs Account
READ TABLE lt_ulsub INTO wa_ulsub WITH TABLE KEY spart = <wa_vbap>-spart.
<wa_vbap>-cogskostl = wa_ulsub-kostlp.
ENDLOOP. "ENDLOOPHi,
Hopefully it can help you:
1. Try remove all SELECT statement within LOOP, replace with select all data before LOOP using For ALL ENTRIES.
2. Try use READ TABLE using BINARY SEARCH. Don't forget to SORT the table according your Search Key.
If it still couldn;t help, try run your report in background.
Regards,
Maybe you are looking for
-
I am trying to install updates on my iphone 4s (OS7)
I am trying to install these updates, and it keeps telling me that it can not install, retry later. I also have 2 songs in my Itunes store that also have not finished completing downloading... so it seems to be jammed. I've rebooted... not sure what
-
How to get the actual data of a file held in IWDResource object?
Hello, I am uploading a csv/excel file and writing it to the server using the FuleUpload UI and IWDResource Interface. I need to make some things on the data before I write it: 1. count the number of columns are in the csv/excel file in each line. 2.
-
IPhone (4s) no longer will sync with my PC (MS Outlook)
About 2-weeks ago my iPhone stopped syncing with my PC running MS Outlook. It has worked fine for about 1-year.
-
Patch NW04s SPS11 Container Information broadcsting error
Hi, When iam working with inforamtion broadcsting in portal iam getting this error. "Java system error: call FM RSRD_X_GET_PORTAL_INFO_PROXY to ProgId VMT01EPM on with SSO notauthorized: Authentication" please anyone can throw a light on this... Edit
-
FI_GL_4 and FBL3N mismatch
Hi We have a GL Balance report in BI which is based on FI_GL_4. It gives 0DEB_CRE_LC for GL's for a posting period range which is used for prompt variable. Problem is that when we try to match it with FBL3N in R/3 then for some GL's its not matching.