Type conflict during dynamic method call.
While executing the following program I get the error "Type conflict during dynamic method call.":
DATA: container_r TYPE REF TO object,
grid_r TYPE REF TO object,
itab_saplane TYPE TABLE OF saplane.
* IMPORTANT NOTE: class names must be in UPPER CASE
DATA: str_cnt TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
str_gui TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
meth_name TYPE STRING VALUE 'SET_TABLE_FOR_FIRST_DISPLAY'.
TYPE-POOLS abap.
DATA: ptab TYPE abap_parmbind_tab,
wa_ptab LIKE LINE OF ptab,
ref TYPE REF TO data.
CREATE OBJECT container_r TYPE (str_cnt)
EXPORTING container_name = 'CUSTOM_CONTROL1'. " Name of the custom control area (UC!)
* Construct parameter itab
GET REFERENCE OF container_r INTO ref.
wa_ptab-name = 'I_PARENT'. " Must be upper-case
wa_ptab-value = ref.
INSERT wa_ptab INTO TABLE ptab.
* EXPORTING i_parent = container_r.
CREATE OBJECT grid_r TYPE (str_gui)
PARAMETER-TABLE ptab.
SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE itab_saplane.
* Cannot call set_table_for_first_display directly...
CALL METHOD grid_r->(meth_name)
EXPORTING I_STRUCTURE_NAME = 'SAPLANE' " Type of the rows in the internal table (UC!)
CHANGING IT_OUTTAB = itab_saplane. " The internal table itself
CALL SCREEN 100.
Any help would be appreciated!
Hi ...
Apologies ... for confusion ... actually both are required ...
the type 'E' as well as CL_GUI_CONTAINER.
The below code worked for me ...
check out how I cast it to the parent class type ...
DATA : lv_container TYPE seoclsname VALUE 'CL_GUI_CUSTOM_CONTAINER',
lv_control TYPE seoclsname VALUE 'CL_GUI_ALV_GRID',
lv_method TYPE string VALUE 'SET_TABLE_FOR_FIRST_DISPLAY',
lt_par_tab TYPE abap_parmbind_tab,
ls_param LIKE LINE OF lt_par_tab,
lref_cont TYPE REF TO cl_gui_container,
lv_data TYPE REF TO data.
CREATE OBJECT lref_container
TYPE
(lv_container)
EXPORTING
container_name = 'ALV_AREA'.
ls_param-name = 'I_PARENT'.
ls_param-kind = 'E'.
lref_cont ?= lref_container.
GET REFERENCE OF lref_cont INTO lv_data.
ls_param-value = lv_data.
INSERT ls_param INTO TABLE lt_par_tab.
** Now create ALV Control.
CREATE OBJECT lref_alv_ctrl
TYPE
(lv_control)
PARAMETER-TABLE
lt_par_tab.
** Set table for 1st display
DATA : lv.
lv = lref_alv_ctrl->mc_fc_print.
CALL METHOD lref_alv_ctrl->(lv_method)
EXPORTING
i_structure_name = 'T001'
CHANGING
it_outtab = lt_company.
Cheers
Edited by: Varun Verma on Aug 12, 2008 4:19 PM
Similar Messages
-
Hi All,
I get a short dump while generating a proxy in the backend.I give the package and the prefix and end up with a short dump.
Does any one know why this mught come up
"Dynamic type conflict during the assignment of references."
background: I imported a WSDl provided by legacy into PI and created service interfaces and then trying to generate a proxy class while i get this error.
Thanks.Hi Shyamsundar,
I will explain a problem that I usually see in some developments:
XSD originally: XSD transformed:
Root -> Root
Tag 1 type int -> Tag 1 type int
Tag2 type string -> Tag2 type string
Tag3 type any - Tag3 type string
Normally the tag3 should have a XML inside. Then the ABAPers have to construct the tag3 with a CDATA structure (CDATA is used to put in an XML tag more XML tags inside like a text and no to be interpreted).
Later in SAP PI you can extract the cdata with an XSL, you can find some examples in the SCN.
I don’t like to convert the whole XML in only one string tag, because this makes difficult the develop for the ABAPers, although the work inside the PI is very easy because with an XSL you can extract the whole message easily. (You can find some examples in the SCN)
Regards. -
Type conflict error for method of a class
Hi all,
I am getting a type conflict error in method Read of class CL_SWF_REP_ITEM2OBJECT, the error text is
"A type conflict occurred when the program tried to passan actual parameter to the formal parameter 'EX_WI2OBJ_WIHDR' of the method 'READ' of the class'CL_SWF_REP_ITEM2OBJECT'."
I am calling this method from the FM SAP_WAPI_WORKITEMS_TO_OBJECT. I have checked the type and other things and they all seem fine. Funny enough, all the culprits in question are sap standard objects.
Also the same methods and FM work fine for 4.7 and release 640 of Ecc6.0, however doesnt work for release 700 of ECC6.0
kindly guideHi,
If the method is:
'Instance Method' use -> to refer to the method of the class
If the method is :
'Static Method' use => assignment to refer to the method.
Could you specify the class and method details so that if the error can ba analyzed.
Regards,
George -
Dynamic method calls in bounded task flows?
Hi!
I have the following scenario:
We are developing a framework in which we would include modules as ADF libraries (as JAR files) with bounded task flows. This framework contains a bean class with bindings for some UI components in framework which I enable or disable (depends on user action). That is the main reason bean class should be present in framework application.
I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component.
How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods? That is dynamic method calls for bean.
I'm using JDeveloper 11.1.2.1.0
Thanks for your help
Regards, MarkoHi,
I explained this; +"I have a bounded task flow in every module which needs to call a method in bean with UI component's bindings that would enable or disable that component. How can I achieve that? To pass bean as a parameter into bounded task flow and then call its methods?"+ a couple of times already (not sure if it was all for you) and don't think I change my position here. I also explained how to use a ValueExpression to lookp a managed bean containing component bindings (should be in requestscope).
Frank -
Working with class based exception and dynamic method calls
Hi Gurus,
we just changed out ERP from EHP6 to EHP7.
Since we did so we are facing an issue with an Z-Report we are using quite often.
This reports looks up Workitems and executes the according methods so that we can go into debugging if we were facing any problems or errors.
since the EHP Upgrade this statement has problems:
data: lt_parmbind type abap_parmbind_tab, lt_excpbind type abap_excpbind_tab, lo_runtime type ref to object. call method lo_runtime->(iv_cls_method) parameter-table lt_parmbind exception-table lt_excpbind.this CALL METHOD Statement has Problem with the Exception Table. We are quite often getting DYN_CALL_METH_EXCP_NOT_FOUND short dumps with Exception "CX_SY_DYN_CALL_EXCP_NOT_FOUND".
The system has problems handling the content of lt_excpbind. if i clear this table the CALL METHOD statement works fine.
AS an example we are trying to call /IDXGC/CL_PD_PROCESS_STEPS-->CREATE_DATA. This method has 2 exceptions
/IDXGC/CX_PROCESS_ERROR
Process Layer Exception
CX_BO_TEMPORARY
Temporary Business Exception
The Content of LT_EXCPBIND is
INDEX
NAME
VALUE
2
/IDXGC/CX_PROCESS_ERROR
1
2
CX_BO_TEMPORARY
2
From my point of view the Problem ist, that they are marked as "class based". I think so because if you looked up the SAP Help for the EXCEPTION-TABLE Statement it is written that is statement only works for none-classbased exception.
I think that restriction is quiet clear. But what i am wondering about is.. that restriction also exists for EHP6. And in EHP6 it work. Does anyone know why? Or how i can change me CALL METHOD Statement that i will work again?
Best Regards
UdoClass-based exceptions must be caught using try/catch statement.
Calling dynamically a method catchable exceptions are:
CX_SY_DYN_CALL_EXCP_NOT_FOUND
CX_SY_DYN_CALL_ILLEGAL_CLASS
CX_SY_DYN_CALL_ILLEGAL_METHOD
CX_SY_DYN_CALL_PARAM_MISSING
CX_SY_DYN_CALL_PARAM_NOT_FOUND
CX_SY_REF_IS_INITIAL
Anyway catching cx_root (as shown by Matthias) will catch everything is catchable. -
Dynamic Method call with CHANGING
Hi,
I have the following method call:
CALL METHOD o_salv->DISPLAY_SALV
CHANGING
it_data = it_ekko.
I would like to make this dynamic so that I can call it multiple times from my program with the came set of code.
I have this working for other Method calls, but the use the same parameters on both sides such as:
CALL METHOD o_main->get_date
IMPORTING
it_ekko = it_ekko.
being coded as such:
CALL METHOD o_main->(v_method)
PARAMETER-TABLE
ptab.
Can someone please give me some guidance on how to code the top example dynamically when the 2 variables are different?
Hope that makes sense...thanks for your help!
AndyHello Bjorn
I would suggest the following approach:
(1) Collect all your GUI control instances in an itab whose line type is TYPE REF TO cl_gui_control.
(2) Define your "free" method:
LOOP AT mt_gui_controls INTO lo_gui_control.
* See if gui control was text editor
TRY.
lo_textedit ?= lo_gui_control.
CATCH cx_sy_move_cast_error INTO lo_error.
ENDTRY.
IF ( lo_error IS NOT BOUND ).
lo_textedit->free.
* ... your coding
CONTINUE.
ENDIF.
* See if gui control was tree
TRY.
lo_tree ?= lo_gui_control.
CATCH cx_sy_move_cast_error INTO lo_error.
ENDTRY.
ENDLOOP.
The FREE methods are redefined in the subclasses. However, you could try to call lo_gui_control->free directly because I am not sure if the coding of the superclass or subclass is called (I cannot test this at the moment).
Regards
Uwe -
Input data during dynamic vi call
Hi guys. Is it possible to input data during a dynamic VI call?
For eg, i have a car.vi When i call this vi dynamically, i want to also input the value turn left or turn right. How do i acheive this in LV?hi there
use a invoke node on the VIs reference and call the "Set control value" method to set values of controls during execution of the dynamic VI. Use "Get control value" to retrieve values from indicators.
another possible solution would be the usage of a so called LV2 style global a.k.a. FGV (functional global variable). this needs more drawing but is much more efficient and powerful.
DO NOT use simple global variables.
Best regards
chris
CL(A)Dly bending G-Force with LabVIEW
famous last words: "oh my god, it is full of stars!" -
How to refresh table column during button method call ?
Hi,
I have one table on my screen in which there are 5 rows.
One of the column of this table is Status with initial value Not Completed.
Now when I press submit button my 5 processes are started in for loop one by one.
After completion of 1st process, I am updating 1st row status with Completed and vise a versa.
But change is reflected on table after by method call over means if my submit action take 5 minutes to finish all 5 process than after 5 minutes, I can see all rows with status Completed while I want it to reflect as soon as I set its status.
How can I do this ?
regards,
devang.. or break up the method in 5 methods (for each process a separate method) and with you button you call the first method. then when at the end of the method you call a javascript which updates the first column to completed and the js calls the second method (with queue of client event and serverListener) ... and so on and so on.
Really not so cool idea but I think it's achievable:) -
Hello Gurus,
is there any possibility to write something like this in ABAP ??
CALL METHOD zz_but050=>get_but050
EXPORTING
IF X = 1. i_var_partner1 = l_var_partner1 ENDIF.
IF X = 2. i_var_partner2 = l_var_partner2 ENDIF.
IMPORTING
e_tab_but050 = l_tab_but050
EXCEPTIONS
keine_daten = 1.
Best regards,
Ioan Constantin.Yes there is. The simplest would be
data: lv_partner type ...
IF X = 1. lv_partner = l_var_partner1 ENDIF.
IF X = 2. lv_partner = l_var_partner2 ENDIF.
CALL METHOD zz_but050=>get_but050
EXPORTING
i_var_partner1 = lv_partner
IMPORTING
e_tab_but050 = l_tab_but050
EXCEPTIONS
keine_daten = 1.
Or you can use dynamic form of CALL METHOD where you pass your parameters by means of PARAMETER-TABLE addition. Please refer [CALL METHOD|http://help.sap.com/abapdocu_70/en/ABAPCALL_METHOD_SHORTREF.htm] -> dynamic form.
Regards
Marcin -
During asynchronous method call, Firefox doesn't allow to navigate elsewhere
Hi,
I am using Jdeveloper 11.1.1.5.0 and my application is based on ADF and Webcenter Portal.
Here is the scenario: My application has a home page which contains different regions. The page loads all the regions instead of one which is running with separate thread and taking long time. Now during the execution of long running task, if user wants to navigate to another page by clicking on a command link or goLink then it works on google chrome and IE but doesn't work with Firefox. In case of firefox once it seems to redirecting to desired url for a while but then it redirects back to same page. Surprisingly, It works perfectly once the execution of long running task is finished. So it seems problem with firefox's handling of asynchronous requests. I tried FacesContext.getCurrentInstance().getExternalContext().redirect(url) and setting the URL as destination for goLink to navigate. Below is the code for goLink and commandLink:
<af:goLink id="pt_g22" text="#{node.title}" destination="#{contextroot}/faces/test.jsp" styleClass="#{node.selected ? 'ln_active' : ''}"/>
<af:commandLink id="pt_c21" text="#{node.title}" action="pprnav" clientComponent="#{node.attributes['Target'] == '_popup' ? true : false}" styleClass="#{node.selected ? 'ln_active' : ''}" actionListener="#{MyBean.navigateToHere}" partialSubmit="true">
in commandLink's actionListener method i am just having : FacesContext.getCurrentInstance().getExternalContext().redirect(url)
Also, if i use navigationContext.processAction and action="pprnav" with commandLink then it works in FF as well but i want full page redirection instead of PPR
Any help or suggestion is appreciated.
Many Thanks,
JeetuJose, your fix to problem 1 allows all access from the outside, assuming you applied the extended list to the outside interface. Try to be more restrictive than an '...ip any any' rule for outside_in connections. For instance, this is what I have for incoming VOIP (access list and nat rules):
access list rule:
access-list outside_access_in extended permit udp any object server range 9000 9049 log errors
nat rule:
nat (inside,outside) source static server interface service voip-range voip-range
- 'server' is a network object *
- 'voip-range' is a service group range
I'd assume you can do something similar here in combination with my earlier comment:
access-list incoming extended permit tcp any any eq 5900
Can you explain your forwarding methodology a little more? I'm by no means an expert on forwarding, but the way I read what you're trying to do is that you have an inbound VNC request coming in on 5900 and you want the firewall to figure out which host the request should go to. Or is it vice-versa, the inbound VNC request can be on port 6001-6004 ? -
Ignoring Optional parameter during OLE method calling
Hi guys,
I got a problem:
Application.Workbooks.OpenXML(Filename, Stylesheets, LoadOption) here's a defination from Microsoft help.
Stylesheets and LoadOption are optional parameters.
ABAP calling:
CALL METHOD OF workbooks 'OpenXML'
EXPORTING #1 = filename
#2 = '3'
#3 = 2 .
How can ignore parameter #2(Stylesheets) in the calling statement? I found no documentation about calling functions ignoring some optional parameters. Normaly there's posibility to explicitely define passing parameter, for example:
Application.Workbooks.OpenXML _
Filename:="customers.xml", _
LoadOption:=xlXmlLoadImportToList
With kind regards
Long.UP
-
Heavy load during web method call
Hello everyone!
I have a web service with couple web methods. Those methods are calling quite often (average is about one call of each method per 10 seconds) by .NET client application. After few days of working I checked in JBoss Web Console statistics of calling of those methods. One of them has got average time of call equals about *300 milliseconds* but maximum call time is over *70 minutes*! I also noticed that when call of this method is very long my CPU is almost 100% load for all call time.
Maybe someone has got similar problem? My quest is that maybe garbage collector turn on when call was so long.
I'm using:
1) Java 1.5_0_15
2) JBoss 4.2.3
3) -XX:+UseConcMarkSweepGC -XX:+UseParNewGC options for garbage colletor
Regards,
PiterThis web method is getting some data from database. Each of call gets from database more or less same amount of data and made some basic processing on this data. So each call should last more or less same long. This 70 minute call is the maximum. Couple times in logs I get call which last couple minutes (3-4 minutes).
-
Dynamic method call needs reflection class?
Hi,
First of all, this is my first post so go easy on me ;)
I would like to have something like this in Java:
String name = "number1";
int temp = name + getme();
the integer temp should now be the result of the method "number1getme()".
By changing the value of 'name' I could get the value of number2, number3 etc. etc.
Hope you understand and can help.
Yours Sincerely,
GrandiJoosIf you really want to do it this way, you will indeed need to use reflection. Have you considered other options, such as storing values in a Map or creating one getme() method that takes a name argument?Map<String, Integer> temps = new HashMap<String, Integer>();
.. fill the map with temperatures
String name="number1";
int temp = temps.get(name);orString name="number1";
public int getme(String name) {
int result = ...;
if(name.equals("number1")) {
result = <some temp here>;
return result;
} -
Type conflict at call of a method
HI Guru's,
My name is Sreekar, i am working on FS-RI Workflow. i want to trigger a workflow when status change in standard screen after pressing save button my workflow will trigger.my abap code is follows.
TYPES: BEGIN OF TY_LT_CONTAINER,
VTGNR TYPE /MSG/RVTG-VTGNR,
STATUS TYPE /MSG/RVTG-STATUS,
END OF TY_LT_CONTAINER.
Data: lt_container TYPE TABLE OF ty_lt_container,
WA_CONTAINER TYPE TY_LT_CONTAINER,
ls_container type TABLE OF SWCONT,
wa_ls_container type SWCONT,
ls_new_status TYPE SWR_WISTAT,
ls_wi_id TYPE SWR_STRUCT-WORKITEMID,
lv_sy-subrc TYPE sy-subrc.
* WA_CONTAINER TYPE Lt_CONTAINER.
if Zstatus NE /MSG/RZ_VTGPER-STATUS.
BREAK-POINT.
* WA_ls_container-ELEMENT = 'Treaty'.
* WA_ls_CONTAINER-VALUE = /MSG/RZ_VTGPER-VTGNR.
WA_ls_container-ELEMENT = /MSG/RZ_VTGPER-VTGNR.
WA_ls_CONTAINER-VALUE = /MSG/RZ_VTGPER-STATUS.
APPEND WA_ls_CONTAINER TO Ls_CONTAINER.
* wa_ls_container-element =
* CLEAR WA_CONTAINER.
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
TASK = 'WS90000026'
LANGUAGE = SY-LANGU
DO_COMMIT = 'X'
USER = SY-UNAME
* START_ASYNCHRONOUS = ' '
* DESIRED_START_DATE =
* DESIRED_START_TIME =
* DESIRED_START_ZONLO = SY-ZONLO
* IFS_XML_CONTAINER =
IMPORTING
* RETURN_CODE = lv_sy-subrc
WORKITEM_ID = ls_wi_id
NEW_STATUS = ls_new_status
TABLES
INPUT_CONTAINER = ls_container.
* MESSAGE_LINES =
* MESSAGE_STRUCT =
* AGENTS =
IF SY-SUBRC NE 0.
MESSAGE ID 'AT' TYPE 'E' NUMBER '104'. " workflow not trigger
ELSE.
MESSAGE ID 'AT' TYPE 'E' NUMBER '103'. " workflow triggered
endif.
endif.
this is my coding. when i am calling my standard screen with transaction code and i changed the status and after when i press save button i am getting dump
type conflict at call of a method.
Error analysis:
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "SAP_WAPI_START_WORKFLOW" "(FUNCTION)", nor was it propagated by a
RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
The call of the method "IF_SWF_CNT_CONVERSION_SERVICE~IMPORT_FROM_SIMPLE_CONTAI
NER" of the class "CL_SWF_CNT_CONVERSION_SERVICE" is incorrect. It was tried
to transfer a non-compatible variable to the formal parameter "VALUES".
Please help me to get out from this issue.Hi Sreekar,
The table ls_container should be of type SWR_CONT & not SWCONT.
ls_container type TABLE OF SWCONT, " Change this to
ls_container type TABLE OF SWR_CONT, "This is the correct type
Best regards,
Prashant Patil -
SC BRF WF Dynamic type conflict when assigning references
I have activated the process controlled workflow framework and
activated the SAP provided SC BC set. When I try to create shoppping
cart(while save or check) I get the following short dump.
The URL
https://usil0c20.ca.com:8343/sap/bc/webdynpro/sapsrm/wda_l_fpm_gaf was
not called due to an error.
Note
The following error text was processed in the system CS2 : Dynamic type
conflict when assigning references
The error occurred on the application server usil0c20_CS2_00 and in the
work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: INIT_BRF_TRACE of program /SAPSRM/CL_WF_BRF_MSG=========CP
Method: CONSTRUCTOR of program /SAPSRM/CL_WF_BRF_MSG=========CP
Method: INITIALIZE_BRF_MSG of program /SAPSRM/CL_WF_BRF_MSG=========CP
Method: /SAPSRM/IF_WF_RULE_CONNECTOR~EVALUATE of
program /SAPSRM/CL_WF_BRF_CONNECTOR===CP
Method: /SAPSRM/IF_WF_RULE_CONNECTOR~EVALUATE of
program /SAPSRM/CL_WF_SCHEME_PROVIDER=CP
Method: GET_SCHEME of program /SAPSRM/CL_WF_SCHEME_PROVIDER=CP
Method: GET_PROCESS_SCHEME of program /SAPSRM/CL_WF_CONFIGURATION===CP
Method: CREATE_PROCESS_LEVEL_SEQUENCE of
program /SAPSRM/CL_WF_CONFIGURATION===CP
Method: CREATE_PROCESS_INSTANCE of
program /SAPSRM/CL_WF_PROCESS_MANAGER=CP
Method: CREATE_PROCESS_FORECAST of
program /SAPSRM/CL_WF_APV_FACADE======CHi,
The dump either happens because the BRF Object SRM_WF is missing in the system or
in the object SRM_WF at BRF the correct trace class /SAPSRM/CL_WF_BRF_TRACE is not used on it.
thus please check.
Thanks,
Melina
Maybe you are looking for
-
Problem with HP Color laserjet CP1515n !
Dear anyone, My HP Color laserjet CP1515n is running wilde, because it prints every single page with black stripes on the margin. I have tryed to start the cleaning mode several times, but it does over and over again... Please, hase anybody any exper
-
Can't get Photoshop to fit my laptop screen
I have the Creative Cloud and use Photoshop in two environments: my studio work space where I'm on a 27" iMac and my mobile work space where I'm on a 13" MacBook Air. Things work and look fine on my iMac but on my MacBook Air I am not able to drag Ph
-
pics from my iphone and ipad show up on photostream, but not pics downloaded from my camera. all attempts to move or share with photostream do not work.
-
Help Please! Offline Clips!
Ok here's my problem. I am using a clip of green screen footage that I have keyed out with two different backgrounds that I want to eventually layer on top of each other. Basically, it is the same clip on top of itself but with two different backgrou
-
Use time capsule for iTunes library
I would like to use my new time capsule as the location for my iTunes library. How do I go about doing that? Currently my iTunes library is on my MacBook Pro.