hello everyone we will continue the topic exception class and in the previous videos we finished with the Practical part we created two exception class one exception class without messages of message class one exception class with message of message class and yes whenever we created our own ACC ception class by default the super class is CX uncore static uncore check and I told you whenever we are going for CX uncore static underscore check it will do the check at the compile time also as well as at the run time also and I showed you the Practical
when I raised the exception and I I have not catched the exception I got a warning at the compile time also and yes definitely it will be a check at the run time also now what I will do rather than going for CX uncore static check I will show you the demo through CX uncore Dynamic check so that you can understand that CX uncore Dynamic check will not be checked at the compile time it is only only at the run time so major motto of this video is to understand the difference between CX static check
and CX Dynamic check so what I will do I will create a exception class I will go to sc24 transaction code and I will create a exception class suppose this is our third exception class I will go for create now rather than CX static check I will go for CX uncore Dynamic check now I will give that short description suppose exception class for order dets I can go by any way with messages of message class or without messages of message class suppose I will use with messages of message class I will go for local object
now I will simply go for text and suppose I will go for message text I will go use the same to same message class message number suppose I will go for 0 0 now I will go for now another exception ID same to same I'm doing and I will use the message text 01 I will go for a attribute you can see we have same to same attributes here suppose I will go for a attribute albore order instant attribute public and suppose the type of the attribute is the data element of order number I will
pass I will pass that attribute so our exception class is ready but in this exception class rather than CX unor static check I used CX Dynamic check now what I will do I will make a copy of this program I will create a program then in that program I will use this exception class I will not make a copy whatever is required I will simply do the copy paste so this is our third program so I will write I will keep that I will click on to create button demo on accept section class I will
go for type as executable I will go for Save now in this program I will again take same to same input order number and I will open the previous program in another session because it is same to same so I will simply do the copy paste you can copy from the first program or second program it is totally your wish suppose this is our input I will simply activate now I will go for try and Cat block so I will write try now I I will simply write if pcore o Rd is inti if we
are not passing the value now I will go for exception class I will raise that exception I will go to pattern button I will go to ABAB object patterns now I will go for rate is exception and this is our exception class but the super class of this is CX uncore Dynamic check I'm going for now I will simply uncomment exporting suppose I will pass that text ID this is our text ID this is our class name and this is the attribute of the same now now we raise the exception suppose I'm commenting this catch
we raised the exception but we have not handled the exception I'm doing syntax check or compilation check have you seen there is no warning yes there is no warning that you have not handled this particular exception just simple simple if the same thing I did in the first program this is our first program or second program in which we have CX unor static check if I will go for this program in this program if you raised the exception and if you have not handled the exception suppose if I'm commenting this system will simply simply do
me give me a warning that you have not caught the exception because in this case your exception class whatever you created the super class is CX uncore static check so it will do the check at the compile time also it will do the check at the run time also because runtime also it will throw the runtime error because we have not handled the exception but in this particular program in this program you have used this is our program this is our program in this program our super class is CX uncore Dynamic check so it will
not do the it will not check the handling at the compile time it will only only check the handling at the run time so this is the main main difference between the CX uncore static check and CX uncore Dynamic check and we understand that difference tactically generally in 99.99% scenarios you will always always go for CX uncore static check now the question into everyone mind in which scenarios we should go for CX unor Dynamic check the simple understanding dynamic means it should only only check at the run time just take a simple example you are
going for division of two numbers and whatever suppose you are dividing first number by second number and you are going for second number input as zero whenever you will divide the first number by zero that is not a defined result so whenever you are going for arithmetic operations at that time we will go for CX underscore Dynamic check else we always always go for CX underscore static check because CX static check it will tell us at the comp file time itself that you have not handled this particular exception and yes ultimately it will go for
runtime also if you have not handled runtime it will throw you the error but CX uncore Dynamic check it will not do any compilation check it's always always at the run time so what is the summary of this particular video in this video I showed you the Practical difference how CX static check and CX Dynamic check is there so we created a exception class and we used the super class as CX unor Dynamic check I raised the exception but when I raised the exception and I have not handled so during the compile time it is
not giving us that you have not handled the exception but it is not the case with CX uncore static check if you have CX uncore static check as the super class if you are raising and you are not handling it will give you the error it will give you the warning sorry the warning that you have not CAU that particular exception now generally always always you will go for CX uncore static check but but yes if you have arithmetic operation like division of two numbers and at that time it is user mistake that they are
passing the second input as zero and whenever you will divide the first input by second input and division by zero is nothing it is infinity that is not defined so in those scenarios we can go for CX uncore Dynamic check because that is only only at check the checking at the run time so that's it it's all about the exception class so that's it in this video thank you