2007 Nov 19 2:43 PM
Hi all,
i coded a report in system A with some fine working public method calls.
Now we transported the coding to system B. but here the mothod is protected.
Why can this happen and what can i do to make it public?
Thank you!!
Best regards
Stefan
2007 Nov 19 7:32 PM
Hello Stefan
Assuming that you are talking about methods of SAP standard classes the only explanation I have is that the systems A and B have different support package levels which exactly affect the methods you are calling.
To exclude this possibility you should make a <b>REMOTE comparison</b> (<i>version management</i>) of the public and protected sections of the affected classes.
Regards
Uwe
Hello Stefan
Assuming that you are talking about methods of SAP standard classes the only explanation I have is that the systems A and B have different support package levels which exactly affect the methods you are calling.
To exclude this possibility you should make a <b>REMOTE comparison</b> (<i>version management</i>) of the public and protected sections of the affected classes.
Regards
Uwe
2007 Nov 19 7:32 PM
Hello Stefan
Assuming that you are talking about methods of SAP standard classes the only explanation I have is that the systems A and B have different support package levels which exactly affect the methods you are calling.
To exclude this possibility you should make a <b>REMOTE comparison</b> (<i>version management</i>) of the public and protected sections of the affected classes.
Regards
Uwe
2007 Nov 20 6:44 AM
Hallo Uwe,
Thanks for your answer.
Yes, i use the standard methods like GET_DETAIL in IF_REBD_RENTAL_OBJECT. I tried the remote-Comparison, but i can only see, that the Interface coding is different. But what can i do to make it public method or how can i get the data i need out of the Object?
Here is a little peace of coding. here's the problem (I think you know this piece )
DATA: gs_detail TYPE rebd_rental_object,
go_rental_object TYPE REF TO CL_REBD_RENTAL_OBJECT_RU.
go_rental_object ?= IO_OBJECT.
gs_detail = go_rental_object->ms_detail.Thank you
Stefan
2007 Nov 20 10:19 AM
Before a solution can be offered, the nature of the problem needs to be identified. As Uwe said, it appears that you have different versions of the class in your different systems.
If the method is public in system A, and protected in system B, then A and B must be at different releases. <b>What version and support packages are you on in both A and B?</b>
If B is at higher release, then you need to reconsider how you are using a the class. Perhaps there is a different method to be used now? If A is at a higher release than B, then you need to upgrade B to the same release as A.
rgds Matt
2007 Nov 20 10:25 AM
Hallo,
Yes we have different Packages, System B with the protected one is higher Package but same Release.
But no new method to use. No Methos that returns the Details or sets my data.
Is it usual, that sap changes such things with package upgrades?
Regards
Stefan
2007 Nov 20 10:44 AM
SAP can change anything with a new package. But they don't usually change the functionality much.
The code that you have posted is not using a method. It is accessing the attribute "ms_detail" directly. Try using
gs_detail = go_rental_object->get_detail().instead.
Not having access to your systems, I can't tell precisely, but I suspect that the difference is that SAP have tightened up their coding, so that you can only access attributes via the GET_* and SET_* methods, which is, after all, better oo programming practice.
rgds, matt
2007 Nov 20 10:52 AM
Hi,
Still doesn't work with your code.
it doesn't realize the method call. it mention that there is an existing data ms_detail. (was that correct english?)
in my other Programm i have the same problem with the method call:
data go_rental_object TYPE REF TO if_rebd_rental_object.
go_specific ?= go_rental_object. " narrowing cast
call METHOD go_specific->SET_SNUNR
EXPORTING ID_SNUNR = p_SNUNR.System A is public method, System B protected
Best regards
stefan
2007 Nov 20 10:57 AM
How is method GET_DETAIL defined in A and in B. How is attribute ms_detail defined in A and in B.
It may be that the only resolution to your problem is to bring A and B to the same support level.
rgd, matt
2007 Nov 20 11:03 AM
The definitions are the same. It's just transported to System B.
No other solution than upgrade System A?
okay thank you for your help
2007 Nov 20 12:59 PM
Got some new information.
The Methods in Class CL_REBD_RENTAL_OBJECT_RU are all Public.
The Aliases in System A are public. in System B they are Protected.
example: IF_REBD_RENTAL_OBJECT~SET_SNUNR
Can i use the class-method without usind the alias?
2007 Nov 20 1:09 PM
That might work. Try something like
... = go_rental_object->if_rebd_rental_object~get_detail( ).
matt
2007 Nov 20 1:26 PM
GREAT!
Thank you!!
It works fine again.
I called the Method (secon problem) like this:
go_specific->if_rebd_rental_object~set_snunr( p_SNUNR ).And it works finem, too
Many thanks again
Stefan
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |