ABAP OO: How to implement a Destructor
Hello.
I implemented a ABAP-OO-Class, which supports (above others) the following methods:
NEW -> Create new Object in DB
DELETE -> Delete Object from DB
In case the method DELETE is called i want to 'destroy' the object instance of this class. Currently i worked around this problem by CLEARing all instance attributes.
Is there a way to implement a DESTRUCTOR, which really destroys the object?
MIKE
HI Mike,
Check these Links out
<b>METHOD DESTRUCTOR
Re: Any possibility to implement a destructor in abap-objects
Regards,
Santosh
Similar Messages
-
How to implement this calendar function in ABAP code
Hi everyone,
Our requirement is : Give a date (e.g. YYYY.MM.DD, 1983.12.26), then we need to know which weekday it is. Is there a existing FM for this fuction? or how to implement it in ABAP?
Thanks a lot for any hint
Best regards
DeyangHi Deyang Liu,
Could you please check these the below links they would give you some idea ....[SAP Calendar Control|http://help.sap.com/printdocu/core/print46b/en/data/en/pdf/BCCICALENDAR/SAP_KALENDER.pdf]
[Calendar functions |http://help.sap.com/saphelp_nw04/Helpdata/EN/2a/fa00f6493111d182b70000e829fbfe/content.htm]
[SAP Functions|http://abap4.tripod.com/SAP_Functions.html]
[Determine calendar |http://help.sap.com/saphelp_nw04/helpdata/en/2a/fa00e9493111d182b70000e829fbfe/content.htm]
Regards,
S.Manu -
How to implement Strategy pattern in ABAP Objects?
Hello,
I have a problem where I need to implement different algorithms, depending on the type of input. Example: I have to calculate a Present Value, sometimes with payments in advance, sometimes payment in arrear.
From documentation and to enhance my ABAP Objects skills, I would like to implement the strategy pattern. It sounds the right solution for the problem.
Hence I need some help in implementing this pattern in OO. I have some basic OO skills, but still learning.
Has somebody already implemented this pattern in ABAP OO and can give me some input. Or is there any documentation how to implement it?
Thanks and regards,
TapioKeshav has already outlined required logic, so let me fulfill his answer with a snippet
An Interface
INTERFACE lif_payment.
METHODS pay CHANGING c_val TYPE p.
ENDINTERFACE.
Payment implementations
CLASS lcl_payment_1 DEFINITION.
PUBLIC SECTION.
INTERFACES lif_payment.
ALIASES pay for lif_payment~pay.
ENDCLASS.
CLASS lcl_payment_2 DEFINITION.
PUBLIC SECTION.
INTERFACES lif_payment.
ALIASES pay for lif_payment~pay.
ENDCLASS.
CLASS lcl_payment_1 IMPLEMENTATION.
METHOD pay.
"do something with c_val i.e.
c_val = c_val - 10.
ENDMETHOD.
ENDCLASS.
CLASS lcl_payment_2 IMPLEMENTATION.
METHOD pay.
"do something else with c_val i.e.
c_val = c_val + 10.
ENDMETHOD.
Main class which uses strategy pattern
CLASS lcl_main DEFINITION.
PUBLIC SECTION.
"during main object creation you pass which payment you want to use for this object
METHODS constructor IMPORTING ir_payment TYPE REF TO lif_payment.
"later on you can change this dynamicaly
METHODS set_payment IMPORTING ir_payment TYPE REF TO lif_payment.
METHODS show_payment_val.
METHODS pay.
PRIVATE SECTION.
DATA payment_value TYPE p.
"reference to your interface whcih you will be working with
"polimorphically
DATA mr_payment TYPE REF TO lif_payment.
ENDCLASS.
CLASS lcl_main IMPLEMENTATION.
METHOD constructor.
IF ir_payment IS BOUND.
me->mr_payment = ir_payment.
ENDIF.
ENDMETHOD.
METHOD set_payment.
IF ir_payment IS BOUND.
me->mr_payment = ir_payment.
ENDIF.
ENDMETHOD.
METHOD show_payment_val.
WRITE /: 'Payment value is now ', me->payment_value.
ENDMETHOD.
"hide fact that you are using composition to access pay method
METHOD pay.
mr_payment->pay( CHANGING c_val = payment_value ).
ENDMETHOD. ENDCLASS.
Client application
PARAMETERS pa_pay TYPE c. "1 - first payment, 2 - second
DATA gr_main TYPE REF TO lcl_main.
DATA gr_payment TYPE REF TO lif_payment.
START-OF-SELECTION.
"client application (which uses stategy pattern)
CASE pa_pay.
WHEN 1.
"create first type of payment
CREATE OBJECT gr_payment TYPE lcl_payment_1.
WHEN 2.
"create second type of payment
CREATE OBJECT gr_payment TYPE lcl_payment_2.
ENDCASE.
"pass payment type to main object
CREATE OBJECT gr_main
EXPORTING
ir_payment = gr_payment.
gr_main->show_payment_val( ).
"now client doesn't know which object it is working with
gr_main->pay( ).
gr_main->show_payment_val( ).
"you can also use set_payment method to set payment type dynamically
"client would see no change
if pa_pay = 1.
"now create different payment to set it dynamically
CREATE OBJECT gr_payment TYPE lcl_payment_2.
gr_main->set_payment( gr_payment ).
gr_main->pay( ).
gr_main->show_payment_val( ).
endif.
Regads
Marcin -
How to Implement Sort, Filter funtinality in Normal web dynpro ABAP Table
Hello,
How to Implement Sort, Filter funtinality in Normal web dynpro ABAP Table ?
Thankshi,
Check out this link for sorting in Table.
Sorting option in WebDynPro ABAP UI Table
steps to follow :
->Have the data in internal table (itab).
->Now use sort command for the particular column which ever you want to sort.
e.g sort itab descending by <Column>.
->Now you can bind the internal table with the Context Node which is binded to Table.
I hope it helps.
Thanx. -
How to implement BSP in wed dynpro abap
Hi experts how to implement BSP application into
web dynpro abap, Plz send the application procedure in detail....how to implement BSP application into
web dynpro abap
If i understand your question correctly, you want to use BSP application inside your web dynpro ABAP application,
There are some ways to do:
if you want to simply navigate to BSP application from WDA application then you can use Exit Plugs
http://help.sap.com/saphelp_nw04s/helpdata/en/45/1bc575ba064574e10000000a114a6b/content.htm
If you want to navigate between BSP and WDA application you have to use Suspend and Resume Plugs
http://help.sap.com/saphelp_nw04s/helpdata/en/45/19bf8c16f25d7ae10000000a11466f/content.htm
Abhi -
How to implement html in ABAP ?
Hello i want o know how to implement html code in sap ?
Is there any procedure for which if yes please do share with me.
Points will be rewarded for the helpful answer.
Thkshi Balu,
what ever Mr. Nikhil said is suitable to ur requirement..
Webdynpro for ABAP & BSP concepts serve u. At the end they both will generate a
URL ...
When we run this url ...
required screen is called and what ever we entered in screen saved in ssap backend tables..
hopes u got ur ans...
Go through WEBDYNPRO FOR ABAP & BSP DOCs..
Regards..
Raju Mummidi. -
How to implement multiple Value Helps within the same Application ??
Dear Experts,
I want to implement multiple value helps in the same view.For that I have declared exporting parameters of type 'wdy_key_value_table.' within the component controller for each of the value helps.While I do activate and test the application I get the following error :
The following error text was processed in the system HE6 : A row with the same key already exists.
The error occurred on the application server hsdnt24s11_HE6_00 and in the work process 4 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: VALUESET_BSART of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
Method: IF_PO_VIEW1~VALUESET_BSART of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
Method: WDDOINIT of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/9VSHJWRNR0EZPKFT3ZKC==CP
Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
Method: INIT of program CL_WDR_CONTROLLER=============CP
Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP
I dont know how to implement multiple value helps.Need your help on this.
Regards,
Mamai.Hi
Hint is : A row with the same key already exists it means , It is assigning the same value/Key to row and you are calling it at WDDOINIT so it giving error at the time of initialization .
Better way to do the coding at some event in view OR if not possible than just execute the first value help in wddoinit later clear all the value before gettig the other Value help. Code it at WdDoModify View to get its run time behaviour.
BR
Satish Kumar -
How to implement scroll in a list of data in a carac. RF terminal?
Hi,
Does anyone know how to implement some sort of scroll box in a SAPConsole context, to appear in a caracter based RF terminal?
Thanks,
BrunoI'm pretty sure there is nothing like that. That is more of a GUI function. You can probably to something, like paging up and down. Of course you would have to handle this in your ABAP code. For example, say your screen is 20X16. Meaning that you have 16 lines to work with. Say that your list has 32 lines. When presenting to the user for the first time, your screen would have the first 16 lines display, if the user would press some FCODE, then you would refresh the screen with the next 16 lines. Make sense? Exactly what is your requirement.
Regards,
Rich Heilman -
How to implement fuzzy search in Query variables
Dear Experts,
Fuzzy search is eazy implemented in the abap , but I do not know how to implement fuzzy search in Query variables
our company have a report,with input variable of customer code, the user want to input 3 bits as fuzzy search. for example,
the customer code have 10 bit, she want to only input 3 bits before-- EAE *
and hope the results will be displayed. if you have any solution , please advise.
ManyTthanks.
Best Regards.
Steveclosed
-
How to implement a conversion rule in KC7R (External Data transfer-Tool)
Hi,
I am familiar with programming conversion rules in ABAP in the LSMW and IS-U Migration workbench.
Unfortunately we have to work with EDT (transaction KCLJ).
I need to implement a simple conversion rule: migration file has the external BP number BPEXT and I must retrieve the internalone (PARTNER) for the migration program.
So I must implement a short ABAP code (select single * from BUT000 ...).
Now I see that in KC7R you can use constants and conversion rules. There are also "General Ruels" and "conversion routines".
Can someone explain how to implement this simple ABAP conversion rule in KC7R giving a short example?
This would be great.
EDT is the workst of all SAP Standard Migration Tools I have seen.....
Kind regards,
ThomasThomas,
Coud you please share your findings as I am now in a similar to your original post.
ie I too would like to know how to code convesions for use within the transfer rules used by KCLJ.
Kind Regards,
Hiten Mistry. -
How to implement the security notes in Java System.
Hi All,
For the ABAP systems we use RSECNOTE to implement the security notes, but how do we do that in Java systems?
Any reference or guidance will be of great help.
Thanks,
Akash.RSECNOTE is for ABAP only, and I dont think there is any equivalent for Java.
For Java , security note will guide you on how to implement.
It could be manual changes or via SDM or JSPM.
Regards,
Pinkle -
How to implement User Exit in APO?
Hello All,
I am not sure how to use user exits. I was wondering if anyone can help me understand how to implement any user exit? Is there any T.Code where you do that? or ABAP coding is required? Also how different is BAdi from User exits?
Any advice is welcome.
Thanks,
SanjuHi Sanju,
Check this link.
http://www.sap-img.com/abap/difference-between-badi-and-user-exits.htm
BADI or user exit, I don't think it is a choice between the two. Both serve the same purpose, add some custom logic to the standard logic. It depends on your requirement, the point when the user exit or BADI is called, information that is available to you in that user exit/BADI and information that you can change in that user exit/BADI. There is no difference in implementing the User Exit in APO or R/3.
Regards,
Siva. -
How to implement OSS notes : 207260
Hi All,
Can anybody please let me know how to impement oss note : 207260.
I need to implement Note : 207260 which is settlement rule for incorrect last used period.In this note its saying to run ZMIGCOBR to repair incorrect settlement rule for incorrect objects. But in this notes its not given any such program.
Please let me know how to implement OSS notes since i never done this before.
Thanks in advance.
Regards,
VishalCheck the below point:
SAP R/3 Document : Using Transaction SNOTE
Implementing OSS Notes Using the new Transaction Code SNOTE
In this document we will see how to implement an OSS note using the SNOTE
transaction code.
The transaction code SNOTE is used to implement OSS Notes. With the SNOTE
transaction, it is no longer necessary to register ABAP objects such as report function
modules etc. manually. But data dictionary objects such as screens, tables need to
be modified manually by registering them in OSS system.
In order to use the transaction code SNOTE, the relevant transport which implement
this transaction in the system need to be transported. Please refer to the SNOTE
guide available at http://service.sap.com
Execute the Transaction code SNOTE
One of the first steps to do is to upload the note into your system.
Follow Goto à SAP Note Download
You can also use the SAP Note upload if the note has been saved in your local
machine
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
In the following box that you get, enter the note number. We will take Note 388732
as an example
and click on the Execute icon. You will get the note number displayed in the list of the
OSS notes
In the above screen, we have two notes listed.
By double clicking on or on the note number you can display the OSS note.
You can also check the Status of the note by clicking on the Check SAP Note icon
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
Select the note and click on Check SAP Note icon. In this case we have selected
note number 388732.
If the note is not implemented as part of some support pack as per the support pack
level of your system, you should get the following pop up box.
Select the note number that you want to implement and goto Edit à Select/deselect
node
To implement the OSS note click on the Implement OSS Note icon
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
You will get a confirmation box like the following
Click on Yes
Click on the Continue icon
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
You will be prompted to enter a change request number.
Click on the Create Request icon
Enter a brief description of for the note and click on the continue icon
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
A change Request number is created for the change that you are making
Click on the continue icon
The system will display the objects that are going to be modified during the process
of note application.
In our case, Report LTXW0F10 and RTXWCHK1 are going to be modified.
Click on the Continue icon
For while the system will show the note in IN PROCESS status
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
After a while, select the note and click on the Check SAP Note icon on the application
toolbar
But still the Status of the note is displayed under In Process category.
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
You can also check the status of the note by checking the meaning of the icon next
to the note number.
To check the legend, follow Utilities à Color Legend
As you can see from the legends box, means Implemented Correctly.
Since the note is implemented, you can change the status of the note from In
Process to Completed manually.
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
Select the note and click on the Set Processing Status icon
In the Pop up box that you get, select the Completed radio button
And click on the Continue icon
SAP R/3 Document : Using Transaction SNOTE
http://www.sappoint.com
The note number is removed from the list
ü You can also check the logs of the activities performed during the OSS note
implementation by clicking on the Logs icon on the application toolbar. The log
information will contain all the steps that were performed from the point of
downloading the note will its implementation is completed.
ü If there are any pre-requisite notes for the note that is being applied, the
system will prompt you to load those notes too into the system. Depending on
their applicability to your system, the system will prompt you accordingly to
apply the pre-requisite notes.
ü You can register the manually implemented SAP notes by executing the report
SCWN_REGISTER_NOTES.
ü SNOTE cannot change or modify data dictionary objects. If there is a note
which requires changes to be made to a structure or a screen then SNOTE will
not help. Such objects have to be registered and modified manually.
http://www.sappoint.com/basis/snote.pdf
Regards,
Prakash. -
Hi
If a organization have 200 to 300 daily complains of there IT equipment/Software/Network e.t.c.
How to Implement BW in IT Service Desk/IT Help Desk /IT Complain Surveillance Dept/IT Customer Support Dept?
Is there any standard DataSources/InfoObjects/DSOs/InfoCubes etc. available in SAP BI Content?Imran,
The point I think was to ensure that you knew exactly what was required. A customer service desk can have many interpretations from a BI perspective.
You could have :
1. Operational reports - calls attended per shift , Average number of calls per person , Seasonality in the calls coming in etc
2. Analytic views - Utilization of resources , Average call time and trending , customer satisfaction , average wait time
3. Strategic - Call volumes corresponding to campaigns etc , Employee churn and related call times
Based on these you would then have to construct your models which would be populated by data from the MySQL instance for you to report.
Else if you have BWA you could have data discovery instead or if you have HANA - you could do even more and if you have a HANA sidecar - you technically dont need BW. The possibilities are virtually endless - it depends on how you want to drive it and how the end user ( client ) sees value in the same. -
How to implement implicit and explicit enhancement points
Hi,
Can anybody please provide some technical aspects of enhancement spots. I have gone through several sap sites and help poratl but have not get much technical things (how to implement or related t codes). please do not provide link to read theories.
Rgds
sudhanshuHi,
Refer to this link...
http://help.sap.com/saphelp_nw2004s/helpdata/en/5f/103a4280da9923e10000000a155106/content.htm
Maybe you are looking for
-
Report for Open Inboin Deliveries
Hi I would like to have report for Open Inbound Deliveries. for which NO GRN is made Pl update ASAP Manoj
-
How to use the CASE Expression in Where Cluase?
Hi All, I'm trying to use the CASE Expression in the Where Clause at some trigger on the Form? I've tried this Code: Declare N Number; begin SELECT COUNT(E.EMP_SID) INTO N FROM EMPLOYEES E, RANKS R WHERE CASE WHEN R.qualification_sid =
-
My lock AND home button are broken, how do I turn it on?
I won't go to the Apple store. My warrentee ran out and I don't want to buy another one.
-
Hi, Maybe I'm missing something here but it appears that you cannot 'add' folders or photos to the Touch, it's all or nothing! For example: I'd already put a photo folder on the Touch and wanted to add some more. It placed to the new folder on the To
-
How do you display an iMovie on a smart tv
How do I display an iMovie on a smart tv?