on 08-10-2010 11:18 AM
Hi ,
I want to instantiate a external class in a view, how to achieve that ?...
For say ...
Need to call/instantiate function /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS (public)
of class /SAPSRM/CL_PDO_BO_SC in the view of Webdynpro component /SAPSRM/WDC_DODC_SC_I_DES in SRM 7.0
Any help will be highly appreciated.
Thanks.
Thanks for all the information i received.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
CALL FUNCTION to call Function Module.
CREATE OBJECT to instantiate class.
CALL METHOD to call method of a class.
/SAPSRM/WDC_DODC_SC_I_DES is a standard SRM web dynpro component, use Modification free enhancement to call a method in view controller.
http://help.sap.com/saphelp_nw70/helpdata/EN/c5/f4b9422e0fb911e10000000a1550b0/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
As mentioned in the last reply you have to create the enhancement for your view where you want to call the class method if this is a standard WDA component.
And you can always call any global class method or RFC in your WDA application by creating the object of the respective class and you can directly call the FM in you component or view method..
Thanks
Pradeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can create enhancement for component /SAPSRM/WDC_DODC_SC_I_DES by clicking on enhancement button on toolbar ,
take class object as attribute in your view and in appropriate methode use create object to create the object of your class and call your method
Edited by: Akash on Aug 10, 2010 1:01 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you send here the error you are getting
or do this
goto attribute tab of you view and declare a variable of type your class whos method you want to call , then go to you method where u want to create object ,go to pattern , choose abap object pattern give class name , method and in instance field give the variable you declared in attribute tab of the view
Edited by: Akash on Aug 10, 2010 2:43 PM
Hi Akash,
created a variable in attribute tab :
lv_partner type ref to /SAPSRM/CL_PDO_BO_SC.
try to calling a class by abap object pattern :
Instance : lv_partner
Class : SAPSRM/CL_PDO_BO_SC
Method /SAPSRM/IF_PDO_DO_PARTNER_BASE~UPDATE_ITEM_PARTNERS
getting syntax error that lv_partner not expected.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.