on 01-28-2008 4:52 PM
Hi all,
sorry for the following question but...is it possible to create a new BOR (named ZOBJECT for my example) with a supertype, with a new method and after i would like that this method is inherited in the supertype.
Strange but a guy with whom i work told me that it was possible in previous versions of SAP.
Other question, i create a new BOR with supertype, i would like to add some controls for a method. If i redefine this method, i must rewrite all the code, i can't call the mother method of the supertype ?
Thanks for help.
Edited by: CECG on Jan 28, 2008 5:57 PM
is it possible to create a new BOR (named ZOBJECT for my example) with a supertype, with a new method and after i would like that this method is inherited in the supertype.
This is done in transaction SWO6 right? Once entries are made here all the elements of your new BOR bust be available in your supertype! Or am i missing something in the question!
Other question, i create a new BOR with supertype, i would like to add some controls for a method. If i redefine this method, i must rewrite all the code, i can't call the mother method of the supertype ?
Redefine option allows you to enter new code only. Alternatively instead of redefining the method you can create a new method and call the original method using the macro "SWC_CALL_METHOD" - you can insert all necessary controls before and after this method call.
Thanks,
Prasath N
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<is it possible to create a new BOR (named ZOBJECT for my example) with a supertype, with a new method and after i would like that this method is inherited in the supertype.
For this question, i will give you an example this morning.
<call the original method using the macro "SWC_CALL_METHOD"
Great that it was i was looking for.
When I redefine the method I get the original code in the method. After that I can edit it. Just press F6 on the method in your custom-object. After that go to the programlines --> SAP will ask you if it should implement a model --> confirm --> you have the orignal code at your disposal.
With SWC_CALL_METHOD you cannot redefine code in the origanl SAP-method, instead you just call the method within your own method. Indeed code before and after can be set at your own insight but the orignal code cannot be modified when you use SWC_CALL_METHOD.
By the way: still interested in the delegation issue.
Kind regards,
Joost van Poppel
Thanks for your answer.
I don't think that delegation is possible in the last SAP version. Maybe in 3.0 or 4.0 ?
Strange, if i want to redefine a method, sometimes original ABAP code is copied, sometimes no and sometimes not all code is copied.
For example, i created a new BOR from FIPP BOR. If i redefine the Completion method, the ABAP code is empty (because thsi is a dialog method perhaps ?). If i redefine the Post method, not all original code is copied.
Thanks.
>
> you can only delegate a subtype of a BOR to that BOR. So if you create a BOR you couldn't delegate it to a BOR.
That's correct - and anything else would be insane. Imagine the world we would end up with if I could delegate an object with 1 key field, 2 attributes and 2 methods to replace BUS2081!
>
> Is it possible to create a new class from BOR ? OO is more flexible but i would like to start from an existing BOR.
Yes it it possible.
I suggest you talk to an ABAP developer in your own organization - you are asking basic ABAP development questions and wasting the time of 300+ ABAP/Workflow developers. The speed at which you reply also suggests that you do not even attempt to try to solve any of the issues on your own. Please quit wasting my time.
Strange, if i want to redefine a method, sometimes original ABAP code is copied, sometimes no and sometimes not all code is copied
This is really strange! Anyone knows the reason behind this? I just tried in my system and as CECG said some methods retain the original code while some does not!
Thanks,
Prasath N
Are you sure you want to use OO? In your thread about program exits you say you have poor knowledge of OO. I know you have to start somewhere but when this means you have to ask everything. I think you start with some practice and try things yourself in stead of a scenario for a customer which probably has a deadline.
Regards,
Martin
Ok. I think when redefining a method it clears all the code in the method but retains all the parameters and properties of the method.
Hence when creating the implementation that portion of the code relevant to these parameters and properties are automatically generated.
Hope my understanding is correct.
Thanks,
Prasath N
No Martin, i'm not sure to use OO, it's just some questions in my mind, i try to understand some concepts. I hope this does not disturb your friend
For my question, can i convert the BOR FIPP to class automaticaly ? after, i know that i can develop this class manually.
Edited by: CECG on Jan 29, 2008 11:57 AM
>
> Please Kjetil if you are not happy it's not obligatory for you to read my thread, ok ? i'm ABAP developer, but i don't have the universal knowledge like you.
That is correct. I have universal knowledge. I never have to spend a minute researching anything, especially not before asking in SDN. I know everything. It is so nice to be me.
It must be nice to be you as well. Your time is obviously so valuable that it doesn't really matter how much time the rest of the world spends/wastes in order for you to save a minute.
It is not obligatory for you to read my responses either. However, if you - like me - try to read everything in this forum it is not a matter of choice. And the fact is that your endless laziness causes quite a few people to spend some minutes extra each day. Most of the people frequenting this forum have the courtesy to at least try to figure out how the suggestions can help, perhaps spending an hour or two, before saying "I'm lost, please tell me exactly what to do".
Unfortunately it is not possible to plonk anyone here as it was on Usenet.
Oh my God Kjetil, you are so nervous !!! i just ask the following question "Is it possible to create a new class from BOR ? OO is more flexible but i would like to start from an existing BOR." and you get on one's high horse.
I don't think that all my question are no sense and you know it's difficult to grasp all the SAP techniques.
Sincerely
Hi CECG,
- I tried to do this with a BO of my own "Z_WFCUSTOM". WHen i tried to delegate this to a supertype (e.g. BUS1001) I got an errormessage that the delegationtype is not allowed. So I think it is not possible. If it is, i would also be interested.
- If you want to redefine an existing method, just create a Z-BO and delegate it to your supertype. With this all the existing SAP-methods are displayed in your Z-BO. Position your cursor on the existing method and press the button Redefine (F6). The SAP-method is now copied with the existing content and modifiable in your Z-BO.
Kind regards,
Joost van Poppel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.