Gc and class unloading
Question:
Does the gc mechanism collect unreferenced objects only, or does it also unload classes that serve as blueprint for those unreferenced objects?
Does anybody know any reference answering this question?
The problem is that if I load all the classes that I might need unloaded in the future using my custom classloader, and follow the nullifying references/nuking classloader technique, I'll have to nullify all the unloadable objects based on several different classes each time I want to reload one class.
So I'll need to serialize all those objects, and than reload all the classes loaded/unloaded by the custom classloader, than recreate all the objects from their serialized version.
And if I create a seperate custom classloader object for each potentially unloadable class, the memory will be crowded.
So what can I do to reload a class without unloading all the classes loaded by the custom classloader?
Similar Messages
-
PermGen not full but full GC triggerred and classes unloaded
We have a recurring problem where a full GC gets triggered that is quite long (7 seconds). By observation, it seems that a great deal of the full GC time is spent unloading "sun.reflect.GeneratedSerializationConstructorAccessor" classes. However, we have PermSize set to 64 meg and it seems that only 9 megs are actually in use. All the other GCs for the day (about 8.5 hours till the problem) are fairly short (0.10 to 0.35 seconds)
Any hints as to what is triggering this long GC and how I can avoid it? I know stopping class garbage collection could help, but I am not finding enough information on the risks of doing this. Plus I thought the PermGeneration contained the classes, not the tenured generation.
Thanks.
-- 2
Details
Solaris 2.8, dual CPU UltraSparc IIIi with 1MB cache each
8 GB RAM
Java 1.5.0_06
Runtime args:
-Xms1280m -Xmx1280m -server -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+DisableExplicitGC -XX:+PrintGCApplicationStoppedTime -XX:PermSize=64m
"jmap -h" result (sometime after Full GC):
Server compiler detected.
JVM version is 1.5.0_06-b05
using thread-local object allocation.
Parallel GC with 2 thread(s)
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 1342177280 (1280.0MB)
NewSize = 2228224 (2.125MB)
MaxNewSize = 4294901760 (4095.9375MB)
OldSize = 1441792 (1.375MB)
NewRatio = 2
SurvivorRatio = 32
PermSize = 67108864 (64.0MB)
MaxPermSize = 67108864 (64.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 106496000 (101.5625MB)
used = 24655256 (23.513084411621094MB)
free = 81840744 (78.0494155883789MB)
23.151344651442308% used
From Space:
capacity = 196608 (0.1875MB)
used = 134808 (0.12856292724609375MB)
free = 61800 (0.05893707275390625MB)
68.56689453125% used
To Space:
capacity = 14483456 (13.8125MB)
used = 0 (0.0MB)
free = 14483456 (13.8125MB)
0.0% used
PS Old Generation
capacity = 894828544 (853.375MB)
used = 627750416 (598.6694488525391MB)
free = 267078128 (254.70555114746094MB)
70.15315059060075% used
PS Perm Generation
capacity = 67108864 (64.0MB)
used = 9422208 (8.9857177734375MB)
free = 57686656 (55.0142822265625MB)
Verbose GC:
987745K->852246K(1032576K), 0.1995592 secs]
Total time for which application threads were stopped: 0.2016224 seconds
24998.391: [GC [PSYoungGen: 153190K->6928K(149952K)] 996182K->859364K(1023808K), 0.1852391 secs]
Total time for which application threads were stopped: 0.1872944 seconds
25102.514: [GC [PSYoungGen: 149904K->6384K(156864K)] 1002340K->865912K(1030720K), 0.1630581 secs]
25102.677: [Full GC[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor7]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor14]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor12]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor10]
[Unloading class sun.reflect.GeneratedMethodAccessor1]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor8]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor6]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor4]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor2]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor11]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor24]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor21]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor13]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor16]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor9]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor3]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor23]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor1]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor22]
[Unloading class sun.reflect.GeneratedSerializationConstructorAccessor5]
[PSYoungGen: 6384K->0K(156864K)] [PSOldGen: 859528K->375378K(873856K)] 865912K->375378K(1030720K) [PSPermGen: 9192K->9192K(65536K)], 7.0877752 secs]
Total time for which application threads were stopped: 7.2531067 seconds
25210.000: [GC [PSYoungGen: 142016K->5680K(146688K)] 517394K->381058K(1020544K), 0.0708419 secs][Unloading class sun.reflect.GeneratedSerializationConstructorAccessor5 ]
[PSYoungGen: 6384K->0K(156864K)] [PSOldGen: 859528K->375378K(873856K)] 865912K->375378K(1030720K) [PSPermGen: 9192K->9192K(65536K)], 7.0877752 secs]Despite the messages about unloading classes, it is unlikely that class unloading
is taking up any significant amount of the 7 seconds. The last line quoted above
shows the old generation (PSOldGen) had 859528K used before GC and
375378K used after GC. Reclaiming the ~470MB in the old gen took the
majority of the time.
This GC is caused by the fact that your old gen became nearly full, or at least
full enough that the JVM decided that the next young generation GC would
fill up the old generation.
Since you are using 1.5.0_06 you can try using the parallel compacting collector
to do these Full GCs in parallel. It should reduce the time somewhat if you have 2
cpus, and even more if you have 4 or more cpus (or hardware threads).
To enable it, add the option -XX:+UseParallelOldGC.
If that does not meet your needs or if you have strict limits on GC pause times,
then you should try using the concurrent collector. See section
5.4,The Concurrent Low Pause Collector, in the 5.0 tuning guide at
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html -
GC performance and Class Loading/Unloading
We have EP 6.0, SP11 on Solaris with JDK 1.4.8_02. We are running Web Dynpro version of MSS/ESS and Adobe Document Services. This is a Java stack only Web AS.
We are experiencing very uneven performance on the Portal. Usually, when the Portal grinds to a halt, the server log shows GC entries or Class unloading entries for the entire time the Portal stops working.
I am thinking about setting the GC parameters to the same size to try and eliminate sudden GC interruptions. Also, what parameter can I set to allow as many classes to be loaded at startup and stay in memory for as long as possible?
Thanks,
Rob BartlettHi Robert
Also, if the host running the WebAS is a multi processor machine, then setting the flags
-XX:+UseConcMarkSweepGC and
-XX:+UseParNewGC
will help reduce the pause time during the GC collection in old generation and the young genereation respectively, as the GC will happen using multiple threads
I can suggest you to check if the GC performs a minor collection or major collection by enabling the flags
-verbose:gc
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails. Based on this, try to tune the young or old generation.
Regards
Madhu -
Class unloading doesn't work as described in this forum !!!
Hi,
to the problem of dynamic class unloading many people in this forum wrote:
- write your own class loader
- load the class to be unloaded later
- set all instances of your own class loader to null
- if the work is done set all instances of the loaded classes to null
- call the garbage collector and the classes will be removed
I constructed a simple test for the problem:
- the test class
public class Impl {
public String getVersion () {
return "1";
- instanciating the test class
- printing the value of getVersion() to the screen
- changing the return value of getVersion() and recompiling it (the test application is still runnig)
- unload try (see below)
- instanciating the test class
- printing the value of getVersion() to the screen
Back to the tipps above. Why doing this? The theory says a class loader stores every loaded class for
suppressing unnecessary reloads. In reality the classes are NOT stored in the own class loader but in
the parent of it. If no parameter is given to a class loader's constructor the parent of a class loader
is the system classloader.
Let's have a look at the source code of java.lang.ClassLoader.loadClass(...):
protected synchronized Class loadClass(String name, boolean resolve)
throws ClassNotFoundException
// First, check if the class has already been loaded
Class c = findLoadedClass(name);
if (c == null) {
try {
if (parent != null) {
### here the loadClass() of the parent is called and the
### loaded class is stored within the parent
c = parent.loadClass(name, false);
} else {
c = findBootstrapClass(name);
} catch (ClassNotFoundException e) {
// If still not found, then call findClass in order
// to find the class.
c = findClass(name);
if (resolve) {
resolveClass(c);
return c;
My Idea was: Give a null to the class loader's constructor so the classes cannot be stored within a parent.
Here my test class loader (it is build as it is described within javadoc of java.lang.ClassLoader
except the constructor):
import java.io.*;
public class MyClassLoader extends ClassLoader {
public MyClassLoader () {
super ( null );
public Class findClass ( String name ) {
byte[] b = loadClassData ( name );
return defineClass ( name, b, 0, b.length );
private byte[] loadClassData ( String name ) {
byte[] ret = null;
try {
InputStream in = new FileInputStream ( name + ".class" );
ret = new byte[in.available ()];
in.read ( ret );
} catch ( Exception e ) {
e.printStackTrace ();
return ret;
The loading of the class works fine
ClassLoader cl = new MyClassLoader ();
Class c = cl.loadClass ( "Impl" );
Object i = c.newInstance ();
Impl impl = (Impl)i;
The class "Impl" was found and instanciated. But the cast "Impl impl = (Impl)i;" causes a
"java.lang.ClassCastException: Impl"
May second idea was deleting all instances of the class to unload from the class loader via reflection.
A strange way I know but if this is the only way I will do it. But this doesn't work too.
After deleting the class from the class loader and all its parents the class is still anywhere in the depth
of the VM.
Can anybody help me with this problem?
Thanks in advance,
Axel.<pre>
I made a similar and simpler program and it worked:
import java.net.URLClassLoader;
import java.net.URL;
public class DynamicExtension {
public static void main(String args[]) throws Exception {
URL[] ua = new URL[] { new URL("file://c:\\TEMP\\") };
URLClassLoader ucl = new URLClassLoader(ua);
MyLoadable l =
(MyLoadable) ucl.loadClass("LoadableObject").newInstance();
l.printVersion();
Thread.currentThread().sleep(10000);
//you have ten seconds to replace the old version of the LoadableObject.class file
//so yo?d better had compiled the new one before executing this
ucl = new URLClassLoader(ua);
l = (MyLoadable) ucl.loadClass("LoadableObject").newInstance();
l.printVersion();
ucl = null;
l = null;
System.gc();
public class LoadableObject implements MyLoadable {
public void printVersion() {
System.out.println("version 1");
protected void finalize() {
System.out.println("finalizing " + this);
public interface MyLoadable { void printVersion(); }
C:\Java\TIJ2\Test>java DynamicExtension
version 1
version 2
finalizing LoadableObject@1bd03e
finalizing LoadableObject@4abc9
The ClassCastException was due to the fact that one class was loaded by the system class loader, the one that appers as Impl impl = (Impl), and the other by MyClassLoader. That mean that they are different for the VM because they are in different namespaces: The namespace for MyClassLoader is the set of classes loaded by itself and those returned to it by his parent class loader as a result of a request to MyClassLoader?s parent class loader to load a class.
Setting null for the parent of MyClassLoader was in fact the cause of the problem, because that caused a call to a native method called findBoostrapClass. I guess this method looks for the classes in the bootstrap classpath where MyClassLoader shouldn?t be. This causes MyClassLoader loaded the class itself. If MyClassLoader had had the system class loader as its parent the result had been that only one classloader would have loaded the class. This is what happens in the example above so no ClassCastException is thrown.
In the source code for ClassLoader
there is the following:
* The classes loaded by this class loader. The only purpose of this
* table is to keep the classes from being GC'ed until the loader
* is GC'ed.
private Vector classes = new Vector(); /*
and:
* Called by the VM to record every loaded class with this loader.
void addClass(Class c) {
classes.addElement(c);
I would like to have seen findLoadedClass checking the already loaded classes in this Vector, but this method is native. Anyway, as the code for loadClass shows, the parent or bootstrap classloader is checked if findLoadedClass doesn?t find the class; Can we guess that findLoadedClass only checks the clases loaded by the classloader, not its parent?
By the way, could an example like this be made in c++?
</pre> -
What is the field and Table for "Batch Class" and "Class Type" in QM.
Hi All,
What is the field and Table for "Batch Class" and "Class Type" in QM.
Thanks,Hi,
For batch class the class type value is '023' . This you can find from KLAH table and the fileld for class type is KLART..
And also all the data related to batch class are found in tables INOB, KLAH,KKSK and for the characeteristics of batch materials you can refer AUSP table.
In INOB table, for batch class, you need to give 023 in KLART field and value MCH1 in OBTAB filed.
Please check this and let me know if this you need any more details? -
How to find classtype and class for a material.
Hi,
How to find classtype and class for a material.
which table contains this data.
Thanks
KiranHi Kiran,
Check below sample code. Use this BAPI which will give all info about the class for the material.
DATA: l_objectkey_imp TYPE bapi1003_key-object
VALUE IS INITIAL.
CONSTANTS: lc_objecttable_imp TYPE bapi1003_key-objecttable
VALUE 'MARA',
lc_classtype_imp TYPE bapi1003_key-classtype
VALUE '001',
lc_freight_class TYPE bapi1003_alloc_list-classnum
VALUE 'FREIGHT_CLASS',
lc_e TYPE bapiret2-type VALUE 'E',
lc_p(1) TYPE c VALUE 'P',
lc_m(1) TYPE c VALUE 'M'.
SORT i_deliverydata BY vbeln posnr matnr.
CLEAR wa_deliverydata.
LOOP AT i_deliverydata INTO wa_deliverydata.
REFRESH: i_alloclist[],
i_return[].
CLEAR: l_objectkey_imp.
l_objectkey_imp = wa_deliverydata-matnr.
*Get classes and characteristics
CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
EXPORTING
objectkey_imp = l_objectkey_imp
objecttable_imp = lc_objecttable_imp
classtype_imp = lc_classtype_imp
* READ_VALUATIONS =
keydate = sy-datum
language = sy-langu
TABLES
alloclist = i_alloclist
* ALLOCVALUESCHAR =
* ALLOCVALUESCURR =
* ALLOCVALUESNUM =
return = i_return
Thanks,
Vinod. -
Loading .jar and .class in MX7
I have a cfx tag that includes a .class and .jar file. I
could do this on the old MX server but in MX7 the option is not in
the cfide/administrator.
I copied the .jar and .class files into the
c:\cfusionmx7\runtime\lib\ directory and then added them to the
bottom of the jvm.config file with the following entry. (note: The
.jar file is called MYNEWFILE.jar)
java.class.path={application.home}/servers/lib,{application.home}/../lib/macromedia_driver s.jar,{application.home}/lib/cfmx_mbean.jar,{application.home}/lib,{application.home}/lib/ MYNEWFILE.jar,{application.home}/../wwwroot/WEB-INF/lib/
I then rebooted the server. I also have a ".class" file that
goes with this. I have no idea where to put that thing. The cfx
(which I mapped in the administrator).
I get the standard 500 error saying:
HTTP 500 - Internal server error
Internet Explorer
even though I have debugging going to my laptop.
Here is the output of the exception.log
"Error","jrpp-0","07/05/07","16:04:14",,"com/allaire/cfx/CustomTag
The specific sequence of files included or processed is:
C:\Inetpub\wwwroot\Pauly\example.cfm "
java.lang.NoClassDefFoundError: com/allaire/cfx/CustomTag
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown
Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:77)
at
jrunx.util.JRunURLClassLoader.loadClass(JRunURLClassLoader.java:69)
at
coldfusion.bootstrap.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:207)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at coldfusion.tagext.CfxTag.doStartTag(CfxTag.java:88)
at
coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:1908)
at
cfexample2ecfm2026642798.runPage(C:\Inetpub\wwwroot\Pauly\example.cfm:3)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:343)
at
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:50)
at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
at
coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:105)
at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:349)
at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:457)
at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:295)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
"Information","Thread-10","07/05/07","16:14:10",,"Address
already in use: JVM_Bind"
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at
coldfusion.server.jrun4.metrics.CfstatServer.run(CfstatServer.java:64)
Any help would be greatly appreciated, as I've been working
on this for a while. I couldn't find a solution in the forums so I
thought I would post. Thanks!
Pauly>> java.lang.NoClassDefFoundError:
com/allaire/cfx/CustomTag
Is the CFX.jar in the classpath?
> The option is not in the cfide/administrator.
What option? The administrator has several options for custom
jars, tags, et.
- Extensions -> Custom Tag Paths
- Extensions -> CFX Tags
CF will also look in these directories automatically
- {cf_webroot}/WEB-INF/classes (for classes)
- {cf_webroot}/WEB-INF/lib (for jars) -
Batch Management and Class and Characteristics Assignment
Dear Team,
Recently We Configured Batch Management in SD, and Batch is determining in Sales order, delivery and Billing. Its working fine.
Issue-1: While posting stock (Quality server) with moment type 561, production date entered manually but system not calculating Expiry date automatically, i maintained Total shelf Time and Min. Rem. Shelf time.
Issue-2: In sales order I want determine batch as FIFO Method, in present system it will consider LIFO method,
I come to know to over come this Issues i need to maintain some Characteristics and Class, Please help me out in creating of characteristics and class and other process,
Thanking you in advance,
Sudheer.UDear Team,
Recently We Configured Batch Management in SD, and Batch is determining in Sales order, delivery and Billing. Its working fine.
Issue-1: While posting stock (Quality server) with moment type 561, production date entered manually but system not calculating Expiry date automatically, i maintained Total shelf Time and Min. Rem. Shelf time.
Issue-2: In sales order I want determine batch as FIFO Method, in present system it will consider LIFO method,
I come to know to over come this Issues i need to maintain some Characteristics and Class, Please help me out in creating of characteristics and class and other process,
Thanking you in advance,
Sudheer.U -
Difference Between Business Object And Class Object
Hi all,
Can any one tel me the difference between business object and class Object....
Thanks...
..AshishHello Ashish
A business object is a sematic term whereas a class (object) is a technical term.
Business objects are all important objects within R/3 e.g. sales order, customer, invoice, etc.
The business objects are defined in the BOR (transaction SWO1). The have so-called "methods" like
BusinessObject.Create
BusinessObject.GetDetail
BusinessObject.Change
which are implemented (usually) by BAPIs, e.g.:
Business Object = User
User.Create => BAPI_USER_CREATE1
User.GetDetail => BAPI_USER_GET_DETAIL
CONCLUSION: Business Object >< Class (Object)
Regards
Uwe -
To view database Java Source and Class code in SQL Developer - Do this...
I've wanted something like this for a while.. Hope this helps someone else...
Make a master detail report...
1. Click the reports tab.
2. Right click on "user defined reports" and select "add report"
3. Type "Java Source Object and Class Code" into the name field.
4. Make sure "Style" is set to "Table".
5. Paste this code into the "SQL" window.
select OBJECT_NAME, OBJECT_TYPE, to_char(created,'DD-MON-YYYY HH24:MI:SS') Created, to_char(LAST_DDL_TIME,'DD-MON-YYYY HH24:MI:SS') "Last DDL", STATUS
from user_objects
where object_type in ('JAVA SOURCE')
order by object_name6. Click "Add child"
7. Make sure "Style" is set to "Code" in the child.
8. Paste the following code into the SQL window of the child.
select text from user_source where name = :OBJECT_NAME order by line9. Click Apply..
10. Enjoy...
no semicolons after the sql....
Message was edited by:
slugoMark,
Thanks Check this out people can now subscribe to the public reports out no the exchange.
http://krisrice.blogspot.com/2007/10/marks-post-on-forums-got-me-to-do.html
-kris -
How to get ATINN value based on material number and Class Type ?
I have below SELECT stmt code which gives the correct value of atwrt based on materil no and ATINN.
However in quality system, it is failing because in quality system "atinn" value is not 0000000381. It is different.
So how can I get ATINN(Internal characteristic) value based on material number and Class Type?
-Obtain the batch characterstic value for the Material******************
SELECT atwrt
UP TO 1 ROWS
INTO v_charvalue
FROM ausp
WHERE objek = mcha-matnr
AND atinn = '0000000381' " 'US80_FRENCH_ON_LABEL'
AND klart = '001'.
THANKS N ADVANCE.Hi SAm,
use the Below function module to get the Atinn for Atwrt for thr Class and MAterial combination..
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
EXPORTING
classtype = '023' "Class type
object = w_object "Material number with Leading zeros
no_value_descript = 'X' "Default X
objecttable = 'MCH1' "Table name Mara or MCH1 or MARC
TABLES
t_class = t_class "It return the Batch class available for the above combination
t_objectdata = t_char "Return Batch characteristics(ATWRT) and their value ATINN in this table
EXCEPTIONS
no_classification = 1
no_classtypes = 2
invalid_class_type = 3
OTHERS = 4.
Regards,
Prabhudas -
From which table I can find the "Class type" and "Class" of the material?
From which table I can find the "Class type" and "Class" of the material?
Thanks in advance for the answers....Hi,
try following table
KSSK Material number to class
KLAS Class description
KSML Characteristic name
CABN/CABNT Characteristic name description
CAWN/CAWNT Characteristic name
[http://www.sap-img.com/materials/classification-view-of-material-master.htm]
[http://wiki.sdn.sap.com/wiki/display/ERPLO/FrequentlyUsedTables]
Regards
kailas Ugale -
Why java file name and class name are equal
could u explain why java file name and class name are equal in java
The relevant section of the JLS (?7.6):
When packages are stored in a file system (?7.2.1), the host system may choose to enforce the restriction that it is a compile-time error if a type is not found in a file under a name composed of the type name plus an extension (such as .java or .jav) if either of the following is true:
* The type is referred to by code in other compilation units of the package in which the type is declared.
* The type is declared public (and therefore is potentially accessible from code in other packages).
This restriction implies that there must be at most one such type per compilation unit. This restriction makes it easy for a compiler for the Java programming language or an implementation of the Java virtual machine to find a named class within a package; for example, the source code for a public type wet.sprocket.Toad would be found in a file Toad.java in the directory wet/sprocket, and the corresponding object code would be found in the file Toad.class in the same directory.
When packages are stored in a database (?7.2.2), the host system must not impose such restrictions. In practice, many programmers choose to put each class or interface type in its own compilation unit, whether or not it is public or is referred to by code in other compilation units. -
Any hints for preloading and classes?
Hi all on forum.
I have made a class that loads a website (pretty ordinary..)
but since all of the site is generated as Childobjects and
class-code, I was trying to make a preloader, but it wont
work.Seems that the class loads first and then generates the whole
site before the first frame is loaded (where my loader is)..
so any hints?use a preloader swf that loads your main swf.
-
Building Tree hierarchy Using nested loops and class cl_gui_column_tree
Hello gurus,
I want to create a tree report using custom container and class cl_gui_column_tree. I have read and understood the standard demo report which SAP has provided i.e. SAPCOLUMN_TREE_CONTROL_DEMO. But in this report all the levels nodes are created as constants and hardcoded. I want to create hierarchy using nested loops. For this i took one example of a hierarchy of VBAK-VBELN->VBAP-POSNR Like One sales order has many line items and each line item can have number of line items in billing plan.
I have done some coding for it.
FORM build_tree USING node_table TYPE treev_ntab
item_table TYPE zitem_table. " i created the zitem_table table type of mtreeitm in SE11.
DATA: node TYPE treev_node,
item TYPE mtreeitm.
node-node_key = root.
CLEAR node-relatkey.
CLEAR node-relatship.
node-hidden = ' '.
node-disabled = ' '.
CLEAR node-n_image.
CLEAR node-exp_image.
node-isfolder = 'X'.
node-expander = 'X'.
APPEND node TO node_table.
item-node_key = root.
item-item_name = colm1.
item-class = cl_gui_column_tree=>item_class_text.
item-text = 'Root'.
APPEND item TO item_table.
item-node_key = root.
item-item_name = colm2.
item-class = cl_gui_column_tree=>item_class_text.
item-text = 'Amount'.
APPEND item TO item_table.
LOOP AT it_vbeln INTO wa_vbeln.
node-node_key = wa_vbeln-vbeln.
node-relatkey = root.
node-relatship = cl_gui_column_tree=>relat_last_child.
node-hidden = ' '.
node-disabled = ' '.
CLEAR node-n_image.
CLEAR node-exp_image.
node-isfolder = 'X'.
node-expander = 'X'.
APPEND node TO node_table.
item-node_key = wa_vbeln-vbeln.
item-item_name = colm1.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_vbeln-vbeln.
APPEND item TO item_table.
item-node_key = wa_vbeln-vbeln.
item-item_name = colm2.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_vbeln-netwr.
APPEND item TO item_table.
LOOP AT it_posnr INTO wa_posnr.
node-node_key = wa_posnr-posnr.
node-relatkey = wa_vbeln-vbeln.
node-relatship = cl_gui_column_tree=>relat_last_child.
node-hidden = ' '.
node-disabled = ' '.
CLEAR node-n_image.
CLEAR node-exp_image.
node-isfolder = ' '.
node-expander = ' '.
APPEND node TO node_table.
item-node_key = wa_posnr-posnr.
item-item_name = colm1.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_posnr-posnr.
APPEND item TO item_table.
item-node_key = wa_posnr-posnr.
item-item_name = colm2.
item-class = cl_gui_column_tree=>item_class_text.
item-text = wa_posnr-netpr.
APPEND item TO item_table.
ENDLOOP.
ENDLOOP.
ENDFORM.
Now this program compiles fine and runs till there is only one level. That is root->vbeln. But when i add one more loop of it_posnr it gives me runtime error of message type 'X'. The problem i found was uniqueness of item-item_name as all the sales order have posnr = 0010. What could be done? I tried giving item_name unique hierarchy level using counters just like stufe field in prps eg. 10.10.10, 10.10.20,10.20.10,10.20.20,20.10.10 etc.. etc.. but still i am getting runtime error when i add one more hierarchy using nested loop. Plz guide.
Edited by: Yayati6260 on Jul 14, 2011 7:25 AMHello all,
Thanks the issue is solved. The node key was not getting a unique identification as nodekey. I resolved the issue by generating unique identification for each level. Thanks all,
Regards
Yayati Ekbote
Maybe you are looking for
-
Mega Stick 511 (1GB) - Large files are deleted!
Hi there! My problem is that when trying to store large files in my Mega Stick, they magically dissapear! For example: I copy a large '.avi' file (let's say 700Mb). Then, while travelling I listen to some music. Finally, when I plug the Mega Stick
-
Hi people, I need your help. My scenario is XML to file and both are using file adapter, but i want to read the xml file. XML file Example <?xml version="1.0" encoding="UTF-8" ?> - <Interface_XXX> <FIELD1>2023967</FIELD1> <FIELD2>00
-
APO DP - descriptive characteristics used in consumption groups
I am using APO DP V5. I need to use descriptive characteristics in consumption groups ( for use in release of DP to SNP). Do these descriptive characteristics have to be planning characteristics of the planning object structure, or can they also be n
-
Is there an easy way to put a border around a chart/graph (ie. a bar graph)? Right now I am resorted to inserting 4 horizontal lines, rotating 2 of them to create a border. There's gotta be an easier way. When I have the chart selected, and I try to
-
Collections will not add PDF files in Organizer
I have Acrobat 8.0 with the 8.1.3 update running on Windows XP Home on a Dell Inspiron E1505 laptop. As of Tuesday morning the 21st all of the PDF files in my Collections disappeared. I tried adding the files again but nothing happens. I ran a rep