Dynamic type
Hi,
Is it necessary that I must have a value of variable say v_type which matches a DATA DICTIONARY type while creating object using following Syntax.
CREATE DATA TYPE (v_type).
Is it necessary that v_type should contain a value (TYPE) which has been created in DATA DICTIONARY? Cant I use v_type to hve a type declared in program globally?
Thanks 7 Regards,
Surya
Hello surya,
You can do it,below is a sample executable code which you can cut and paste.
Debug this to see how it works.
REPORT ZSAS_SDN .
Global type
TYPES: BEGIN OF GLOBAL_TYPE,
FIELD2(6) TYPE C,
FIELD1(8) TYPE C,
END OF GLOBAL_TYPE.
Creation of data object
DATA:TABNAME TYPE DD02L-TABNAME VALUE 'GLOBAL_TYPE',
VAR1 TYPE CHAR10 VALUE 'SUCCESS'.
data: it type ref to data.
FIELD-SYMBOLS: <FS> TYPE ANY,
<FS2> TYPE ANY.
create data of type "Global_type"
CREATE DATA It TYPE (TABNAME).
ASSIGN IT->* TO <FS>.
ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <FS> TO <FS2>.
<FS2> = VAR1.
WRITE <FS>.
WRITE 'AGG'.
award points if it helps!!
Regards
Sourabh
Similar Messages
-
Hello,
How can I improve the XQuery below in order to obtain a minimised return to escape from both errors ORA-19279 and ORA-01706?
XQUERY for $book in fn:collection("oradb:/HR/TB_XML")//article let $cont := $book/bdy where $cont [ora:contains(text(), "(near((The,power,Love),10, TRUE))") > 0] return $book
ERROR:
ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence
- got multi-item sequence
XQUERY for $book in fn:collection("oradb:/HR/TB_XML")//article let $cont := $book/bdy where $cont [ora:contains(., "(near((The,power,Love),10, TRUE))") > 0] return $book//bdy
/*ERROR:
ORA-01706: user function result value was too large
Regards,
Daianebelow query works for 1 iteration . but for multiple sets i am getting following error .
When you want to present repeating groups in relational format, you have to extract the sequence of items in the main XQuery expression.
Each item is then passed to the COLUMNS clause to be further shredded into columns.
This should work as expected :
select x.*
from abc t
, xmltable(
xmlnamespaces(
default 'urn:swift:xsd:fin.970.2011'
, 'urn:swift:xsd:mtmsg.2011' as "ns0"
, '/ns0:FinMessage/ns0:Block4/Document/MT970/F61a/F61'
passing t.col1
columns F61ValueDate Varchar(40) Path 'ValueDate'
, DebitCreditMark Varchar(40) Path 'DebitCreditMark'
, Amount Varchar(40) Path 'Amount'
, TransactionType Varchar(40) Path 'TransactionType'
, IdentificationCode Varchar(40) Path 'IdentificationCode'
, ReferenceForTheAccountOwner Varchar(40) Path 'ReferenceForTheAccountOwner'
, SupplementaryDetails Varchar(40) Path 'SupplementaryDetails'
) x ; -
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. -
Error Dynamic type conflict when assigning references in EHP4
Hi Experts,
We are facing problem while customizing application wizard in EHP4.
Based on our requirement, we need to create one more tab named "Notes" to add instructions for applicants while applying for Job. It contains only instruction. To achieve this, we have done below set up.
1. We have created new WD component (WD window), OTR Alias
2. Created one more additional steps in T77RCF_RM_STEP called "Notes" and maintained step 1 information
3. In table T77RCF_RM_SEQ, under Application wizard (employee), we have added notes in sequence 1.
Now our new tab "Notes" is reflecting in application wizard. But while cliking on send application, we are getting error "The following error text was processed in the system GEG : Dynamic type conflict when assigning references".
Error Details:-
u2022 The following error text was processed in the system GEG : Dynamic type conflict when assigning references
u2022 The error occurred on the application server sapgeg_GEG_59 and in the work process 0 .
u2022 The termination type was: RABAX_STATE
u2022 The ABAP call stack was:
Can anybody guide what we are doing wrong?
It would be great help.
Regards,
purnimaHi Rajasekhar,
Facing the same issue, can you please let me know how you solved the above issue.
Best Regards,
Laxman -
So I have the iphone 4 with the latests update ios7.
So I went on settings > general > accessibility > larger type.
And I clicked "on" for "larger dynamic type"
Now my font is so big I can't even see apps that I have and such
I want to turn it "off" but my screen orientation is locked! (I can't move my phone horizontally) I think if I can move my phone horizontally I'll be able to see the on/off button for larger dynamic type.
I tried sliding the bottom upwards to turn off screen lock orientation but it's not on my screen because my font is set to a really big size that the "screen orientation lock button" didn't make it to the screenTurning on Dynamic type and increasing it shold not have that effect.
Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps BEFORE doing the reset. -
Xml conversion of data refs with dynamic type
Hi Colleagues,
I have to create an XML from a TYPE REF TO DATA, where this data is created using a dynamic internal table. By dynamic internal table i mean that the internal table is created dynamically using the class method cl_alv_table_create=>create_dynamic_table.
Now the problem that i face is when i use the statement:
CALL TRANSFORMATION id
SOURCE jsag_data = im_context_b64
RESULT XML lv_xml
OPTIONS data_refs = 'embedded'
value_handling = 'move'.
to generate the XML i get a dump of type CX_XSLT_SERIALIZATION_ERROR saying "The ABAP data cannot be serialized."
I found a solution to avoid the dump by adding the additional option " TECHNICAL_TYPES = 'ignore' " to the CALL TRANSFORMATION statement, like
CALL TRANSFORMATION id
SOURCE jsag_data = im_context_b64
RESULT XML lv_xml
OPTIONS data_refs = 'embedded'
value_handling = 'move'
TECHNICAL_TYPES = 'ignore'.
But, using this addition the dynamic type ref to data part is totally ignored from the XML generation.
If I use a specific DDIC table type to create the data, we do not face this issue and the XML is generated as desired
Does anyone have a solution to this problem as it has become a sort of blockade for our development?
Thanks and Cheers,
Gaurav.Hello,
I reached same problem with dynamic data references, the only solution I got is to used global DDIC types (also for table types !!) when creating data which needs to be serialized.
The options technical_types = 'ignore' doesn't solve the problem - it just instructs the parser to skip data references without global ddic type. The options value_handling = 'move' is very helpful as XML serialization is very picky about values beeing serialized.
Here is summary of my observations:
- Global DDIC type has to be associated with data reference, otherwise only technical type is there and this is not supported (you can use OPTIONS TECHNICAL_TYPES = u2018IGNOREu2019 but this will just skip the data to be serialized to XML) u2026
- The above means that if you are serializing data reference to table then you have to have also global DDIC type for the table-type !! Unfortunatelly there is no default table type available for transparent tables u2026. They are treated as structures not as table-types u2026 thus:
- CREATE DATA lr_data TYPE <global_ddic_structure> - can be serialized
- CREATE DATA lr_data TYPE STANDARD TABLE OF <global_ddic_structure> - cannot be serialized
- CREATE DATA lr_data TYPE <global_ddic_table_type> - can be serialized
- !! Unfortunatelly !! CREATE DATA lr_data TYPE <type_pool_ddic_structure/ type_pool_table_type> - also cannot be serialized u2013 this is pitty u2026 this should be supported u2026. -
Hi ,
I executed the below query in database version 11.2.0.3.0, it throws the error like "ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence"
with PAYMENT_XML as (
select XMLTYPE(
'<Document>
<pain.002.001.02>
<GrpHdr>
<MsgId>CITIBANK/20091204-PSR/4274</MsgId>
<CreDtTm>2009-12-04T09:36:00</CreDtTm>
</GrpHdr>
<OrgnlGrpInfAndSts>
<OrgnlMsgId>10002</OrgnlMsgId>
<OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
<OrgnlNbOfTxs>20</OrgnlNbOfTxs>
<OrgnlCtrlSum>7000</OrgnlCtrlSum>
<GrpSts>PART</GrpSts>
<StsRsnInf>
<AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
</StsRsnInf>
</OrgnlGrpInfAndSts>
<OrgnlGrpInfAndSts>
<OrgnlMsgId>10001</OrgnlMsgId>
<OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>
<OrgnlNbOfTxs>202</OrgnlNbOfTxs>
<OrgnlCtrlSum>9000</OrgnlCtrlSum>
<GrpSts>PART</GrpSts>
<StsRsnInf>
<AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
<AddtlStsRsnInf>Formated</AddtlStsRsnInf>
</StsRsnInf>
</OrgnlGrpInfAndSts>
</pain.002.001.02>
</Document>') as OBJECT_VALUE1
from dual
select R.*
from PAYMENT_XML,
XMLTABLE(
'for $COMP in $COMPANY/Document/pain.002.001.02
for $DEPT at $DEPTIDX in $COMP/OrgnlGrpInfAndSts
return <RESULT>
<NAME>{fn:data($COMP/GrpHdr/MsgId)}</NAME>
$DEPT/OrgnlMsgId,
$DEPT/OrgnlNbOfTxs,
$DEPT/OrgnlCtrlSum,
$DEPT/GrpSts,
$DEPT/StsRsnInf/AddtlStsRsnInf
</RESULT>'
passing OBJECT_VALUE1 as "COMPANY"
columns
NAME VARCHAR(10) path 'NAME',
OrgnlMsgId VARCHAR2(24) path 'OrgnlMsgId',
ORGNLNBOFTXS VARCHAR2(24) path 'OrgnlNbOfTxs',
ORGNLCTRLSUM NUMBER path 'OrgnlCtrlSum',
GRPSTS VARCHAR2(24) path 'GrpSts',
ADDTLSTSRSNINF VARCHAR2(40) path 'AddtlStsRsnInf'
) r
Errors comes this part :
<StsRsnInf>
<AddtlStsRsnInf>ACK - FILE PARTIALLY SUCCESSFUL</AddtlStsRsnInf>
<AddtlStsRsnInf>Formated</AddtlStsRsnInf>
</StsRsnInf>
if i put the single statement for this xml element <AddtlStsRsnInf> it works fine if more than one element comes it raised the error.
i want the output like the below format : want to merge the element value with (, comma) delimiter with single coloumn value
NAME
ORGNLMSGID
ORGNLNBOFTXS
ORGNLCTRLSUM
GRPSTS
ADDTLSTSRSNINF
CITIBANK/2
10002
20
7,000
PART
ACK - FILE PARTIALLY SUCCESSFUL
CITIBANK/2
10001
202
9,000
PART
ACK - FILE PARTIALLY SUCCESSFUL, Formated
Thanks is advance for reply
Thanks,
ChidamTry with XQuery string-join() function :
ADDTLSTSRSNINF VARCHAR2(40) path 'string-join(AddtlStsRsnInf, ", ")' -
Can we dynamically type-cast an object reference passed to Object Clss to that specific class?
Here is what I want to do.
I am going to pass an object reference to a method, which has Object class as parameter to it, as shown below. Using getClass() or some other way, I want to dynamically typecast this reference to the original Class and call some method of this Class.
void test (Object ref1){
((ref1.getClass())ref1).writeLog();
By doing this, am I violating the basic Object Orineted rules?I mean, consider an hypothetical case (which is wrong
from OO point of view) that there are suppose 10
classes in my system. None of them related to each
other, all are independent classes. But each one has a
method called, writeLog(). Now I want to write one
method which will be called by each of these classes
(in some 11th class), which will have "Object" as a
parameter. Now using the actual reference I want to
call the corresponding writeLog() method.
1 - Point out to management that the design is now officially broken.
2 - Point out that if the design is not fixed then any solution that impliments the changes will cost more to maintain in the future and will likely lead to instabilities in the system (due to complexity.)
3 - Implement one of the suggested solutions and make sure that you put in a lot of error checking and logging in the hacked solution.
4 - Produce extensive documentation about the impact of changing any of the objects that you are relying on. Push it to anyone and everyone that might ever touch or even suggest changes to the code.
Doing all of the above allows you to live stress free when the next revision breaks because someone didn't understand the implications of your hacked solution. You will be able to find the problem quickly and point out that it had nothing to do with your code but rather because someone else did not follow the complete documentation that you produced. And then when they complain that your solution was a hack you can point out that you explained that previously as well. -
Dynamic Type Checking... Is this possible?
I want to do a dynamic check for objec types in a datastructure. Something very similar to instanceof but using dynamic type parameter.
Syntactically speaking...
Instead of writing several methods like
public boolean isOfTypeXYZ( )
return ( this instanceof XYZ);
public boolean isOfTypeABC()
return ( this instanceof ABC);
...I want one single method like
public isOfType ( Class a_type)
return (this ***isoftype**** a_type);
}Where isoftype can somehow dynamically figure out if the object is of given type (class)
For those who want to know why I'd need this kind of contrived behaviour let me give a simple example (similar to my real issue).
Suppose I have a swing GUI application which has several laid out components like Containers, JPanels, JToolBars, JMenuItems, JButtons, JToggleButtons, JRadioButtons etc.
Now starting from the JFrame in this containment hierarchy, I want to find all instances of JButtons or say all instances of JRadioButtons or say all instances of JMenuItem or all instances of JComponents ...
I do not want to write a special method for each possible type I might encounter.
I want a more generic method like
searchComponents( Class a_class) that I can invoke by just changing its argument to convey the type.
Unfortunately getClassName() will not work as that gives the most derived type of the object. I want something very much like instanceof wherein I can check for an intermediate super class as well. (eg. All RadioButtons are AbstractButton and should return true for either type).
I tried to search for this in the forums but couldn't find something close to this. (There are several discussions about dynamic type casting which are different).Is this what you want?
searchComponents( Class a_class) {
// browse components
if (a_class.isInstance(component)) {
// do something
} -
Dynamic type variable creation
I want to create a variable with a pre-defined TYPE, but the latter will only be known at runtime.
For instance:
Consider that I my DEFINITIONS1 include file is:
TYPES: BEGIN OF type1,
field1 TYPE i,
field2 TYPE i,
field3 TYPE i,
END OF type1,
BEGIN OF cust_type_A,
INCLUDE TYPE type1.
TYPES: erdat TYPE vbak-erdat,
END OF cust_type_A,
BEGIN OF cust_type_B,
INCLUDE TYPE type1.
TYPES: fkdat TYPE vbrk-fkdat,
END OF cust_type_B.
Than I have the following code (assume "letter" is a character parameter I receive, either 'A' or 'B'):
INCLUDE definitions1.
DATA: z TYPE REF to data.
FIELD-SYMBOLS: <fs> TYPE ANY.
DATA str type string.
CONCATENATE 'MY_CUST_TYPE_' letter INTO str.
CREATE DATA z TYPE (str).
* ASSIGN z->* TO <fs>.
Why is that that the CREATE DATA z TYPE (str) statement fails ?
How, then, I create a variable/field symbol from a specific type, which will only be known at runtime ?
Thanks
AvrahamCheck this code to create a dynamic type at run time using the RTTS - Run Time Type Services.
DATA: lo_struct TYPE REF TO cl_abap_structdescr,
lo_element TYPE REF TO cl_abap_elemdescr,
lo_new_type TYPE REF TO cl_abap_structdescr,
lo_data TYPE REF TO data,
lt_comp TYPE cl_abap_structdescr=>component_table,
lt_tot_comp TYPE cl_abap_structdescr=>component_table,
la_comp LIKE LINE OF lt_comp.
DATA: lc_num TYPE char10.
* field symbols to access the dynamic table
FIELD-SYMBOLS: <f_line> TYPE ANY,
<f_field> TYPE ANY.
PARAMETERS: p_a RADIOBUTTON GROUP rd1,
p_b RADIOBUTTON GROUP rd1.
START-OF-SELECTION.
DO 3 TIMES.
lc_num = sy-index.
CONDENSE lc_num.
* Element Description
lo_element ?= cl_abap_elemdescr=>describe_by_name( 'INT4' ).
* Field name
CONCATENATE 'FIELD' lc_num INTO la_comp-name.
* Field type
la_comp-type = cl_abap_elemdescr=>get_p(
p_length = lo_element->length
p_decimals = lo_element->decimals ).
* Filling the component table
APPEND la_comp TO lt_tot_comp.
CLEAR: la_comp.
ENDDO.
IF p_a = 'X'.
* Element Description
lo_element ?= cl_abap_elemdescr=>describe_by_name( 'ERDAT' ).
* Field name
la_comp-name = 'ERDAT'.
* Field type
la_comp-type = cl_abap_elemdescr=>get_p(
p_length = lo_element->length
p_decimals = lo_element->decimals ).
* Filling the component table
APPEND la_comp TO lt_tot_comp.
CLEAR: la_comp.
ELSEIF p_b = 'X'.
* Element Description
lo_element ?= cl_abap_elemdescr=>describe_by_name( 'FKDAT' ).
* Field name
la_comp-name = 'FKDAT'.
* Field type
la_comp-type = cl_abap_elemdescr=>get_p(
p_length = lo_element->length
p_decimals = lo_element->decimals ).
* Filling the component table
APPEND la_comp TO lt_tot_comp.
CLEAR: la_comp.
ENDIF.
* 3. Create a New Type
lo_new_type = cl_abap_structdescr=>create( lt_tot_comp ).
* 5. data to handle the new table type
CREATE DATA lo_data TYPE HANDLE lo_new_type.
* 6. New internal table in the fieldsymbols
ASSIGN lo_data->* TO <f_line>.
Regards,
Naimesh Patel -
Dynamic Type Support (or in app text size)
Hey Claudius! After perusing the reviews for you, a main request is gaining support for dynamic type. Or having the option to change text size in app. Some consumers are straining their eyes to see small text. After Changing my app to support Dynamic Type, consumers with eye issues greatly appreiciated the changes. It didnt take very long, should be easy (hopefully) to accomplish.Thanks(hopefully this helps) Redwave Studios
In iOS there a global setting called dynamic type; There are API's from apple to help you if you are confused. Dynamic Type is an accessbility feature for visually challenged.
-
Creating context node with dynamic type
When we are creating context node thru wizard, Dictionary type must be filled. I'm trying to create Context node manually.Did any one tried created Context node class with Dynamic type.
Hi Prasad,
I have a similar requirement.
Can you please share with me how did you create context node with dynamic table data?
Thanks
Vicky -
I have a context node called ERROR_MESSAGE, with a single attribute
called MSG of type BAPI_MSG.
I encounter an error stating "Dynamic type conflict when assigning references" at the
following point in my code:
lo_nd_error_message->bind_elements( error_msgs )
error_msgs is defined as follows:
Data: error_messages type standard table of bapi_msg.What is the Cardinality of your context node ERROR_MESSAGE? Make sure that it is 0...n or 1...n.
-
Dump while testing Function- Dynamic type conflict when assigning reference
Hi Gurus,
I have the following checked and activated-
- Function with 1 Ruleset
- The Ruleset containing couple of DBlookup expressions
- Value range
- Decision Table
- Decision tree,
- Procedure call
After I give test data while Simulating the function, I get this dump-
Short text
Dynamic type conflict when assigning references
What happened?
Error in the ABAP Application Program
The current ABAP program "CL_FDT_DB_LOOKUP==============CP" had to be
terminated because it has
come across a statement that unfortunately cannot be executed.
Have I missed something? We are on SAPKA70207.Hi Carsten,
I couldn't find an OSS note featuring-
"MOVE_CAST_ERROR" "CX_SY_MOVE_CAST_ERROR"
"CL_FDT_DB_LOOKUP==============CP" or "CL_FDT_DB_LOOKUP==============CM01K"
"BUILD_WHERE_CLAUSE_LIMIT"
Raised OSS note. -
Dynamic Type Conflect when assigning References error in portal
Hi Forum,
We have one ABAP Dynpro Application which runs fine but gives "Dynamic Type conflict when assigning References" error dump after integrating it with Netweaver portal 7 SP12 by creating Webdynpro ABAP iview.
Please help us to resolve this issue.
Thanks and Regards
Sudhirhi
refer this article :
How to Create Web Dynpro-Based iViews
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3e36d690-0201-0010-cd99-bfbb81bd33d9
refer the SAP online help :
Create a Web Dynpro iView
http://help.sap.com/saphelp_nw04/helpdata/en/2c/00584289e59041e10000000a1550b0/content.htm
regards,
amit -
RFx Q&A dump SRM 7- Dynamic type conflict when assigning references Q&A
Hello,
We are on SRM 7.0 SP05. When adding a question via the Q&A 'chat' functionality on a published RFx the EP shows the following error: 'Dynamic type conflict when assigning references Q&A'.
Could somebody test if this issue is also occuring on their system?
Anybody has a clue what's causing this?
Kind regards,
TimHello Jay,
Loggings show the following:
15:18:49 DIA 000 100 NLPURCOR AB 0 Run-time error "MOVE_CAST_ERROR" occurred
15:18:50 DIA 000 100 NLPURCOR AB 1 > Short dump "100324 151849 dmzsv719 b_SRM_00 " generated
Maybe you are looking for
-
Bank Transfer file: generate two outgoing files for one pmt method?
Hello Experts, Two files (header and item) are expected from the hungarian bank for each payement. It's possible to generate two outgoing files for one pmt method using DMEE tree? If yes, can you tell me how? If not, there is an other solution? Use a
-
Why no Polygon2d? Is GeneralPath the alternative?
In Java2D all the old shapes got new Shape versions with double precision - except for Polygon. Id like to have a Polygon that uses double precision. Im thinking that maybe they didnt update Polygon because GeneralPath should be its replacement in Ja
-
Overall release strategy in purchase requisition
hi, how do i configure overall release in case of purchase requisition. i have done item wise release in PR. but in case of overall release what field I should take in characteristics? is their required two seperate classes for item and overall rel
-
Groupwise Messenger Installatio Failed
Good day everybody, I have a problem about the installation of Groupwise Messenger on our server running sles 9. I dont know what do and I appreciate any help from you. Here is the summary of the installation: Summary Tree: ISP Context: o=suse System
-
Why won't my iphone change the orientation?!
It's stucked in the vertical mode. A bit boring watching videos like that....