cancel
Showing results for 
Search instead for 
Did you mean: 

Error changing the cardinality for type I attribute

priyank_dev2
Participant
0 Kudos

Hi everyone,

Iam new to dynpro.Iam facing 2 issue while creating a simple application -

1)I have created a node with 2 attributes type I.Now when i try to change the Cardinality from 1..1 to 0..1 it is throwing an error.If i execute with 1..1 it is working fine.

Error description-ERROR: Error in INPUT_FIELD “L1″ of view “YDEV.MAIN”: Context binding of property VALUE cannot be resolved: Node MAIN.1.DISPLAY does not contain any elements (termination: RABAX_STATE)

2)It is not allowing to change the attribute type from I to C for cardinality 1...1.

Error: Type C cannot be instantiated.

Can you please help me to understand the reason for above 2 issues.

Regards,

P D

Accepted Solutions (0)

Answers (2)

Answers (2)

nishantbansal91
Active Contributor
0 Kudos

Hi Priyank Dev,

I had already faced this problem please Refer this Link

http://scn.sap.com/thread/3439399

Regards.

Nishant Bansal

ramakrishnappa
Active Contributor
0 Kudos

Hi Priyank,


Priyank Dev wrote:

1)I have created a node with 2 attributes type I.Now when i try to change the Cardinality from 1..1 to 0..1 it is throwing an error.If i execute with 1..1 it is working fine.

For Question 1:

Please refer the link for more information on cardinality : Context Node: Properties (SAP Library - Web Dynpro for ABAP)

For input fields on view layout it always needed an instance of context attribute otherwise the system throws short dump  related to cardinality.

i.e. if you choose

0..1 : When view gets initialized, no instance or zero instance of context node available

1...1 : When view get initialized, at least 1 instance is available, Hence no error


Priyank Dev wrote:

2)It is not allowing to change the attribute type from I to C for cardinality 1...1.

The data type of attributes is not depending on cardinality & data type c is not supported as data type for WDA context attribute

Here is the error text diagnosis :


The context attribute has a predefined (built-in) ABAP type which is generic. Therefore, it cannot be instantiated. Types that cannot be instantiated are

Types P, N, X, and C

because it is not possible to unequivocally assign a standard format (fixed length, fixed number of decimal places, ...) to these types

Generic types ANY, TABLE and so on

However, the built-in ABAP types I, D, T,  F, STRING, and XSTRING  can be instantiated.

Hope this clarifies your doubts.

Regards,

Rama

priyank_dev2
Participant
0 Kudos

Hi,

I read lot of docs relevant to Cardinality but still not getting clear view.Now If i have a selection screen(Either user may input values or executes the report with out giving any inputs).In this case the cardinality 0...1 is appropriate for the input field.

Thanks Nishant for your link.Seems we are in the same boat.But the concept is still not yet clear to me.

Could you please help me to understand -

a)Element/Node instance at run time - Since this should also be considered with no values in the input screen for cardinality 0..1?

b)Can you please brief me the node initialization at run time?..

Regards,

P D

ramakrishnappa
Active Contributor
0 Kudos

Hi Priyank,


If i have a selection screen(Either user may input values or executes the report with out giving any inputs).In this case the cardinality 0...1 is appropriate for the input field.

Say, suppose you have a view with 2 input fields viz First name & Last name and these are bound to attributes FIRST_NAME & LAST_NAME of context node INPUT.

Now, whether you have filled input fields or not, the input fields are already instantiated. Hence we need to set 1....1


Priyank Dev wrote:

b)Can you please brief me the node initialization at run time?..

To understand the instantiation of  context element/node..

Let us take an example,

  • We have a table with 2 records

               First Name               Last Name

               Rama                       krishnappa

               Priyank                     Dev         

  • Now, we need to put this data into node "MY_DATA" i.e. a node can have many elements in it. here 2 context elements
  • If you want to add one more record, we need to have instance of node, i.e. instance of context node at index 3 and add to the node

Hope this helps you.

Regards,

Rama

nishantbansal91
Active Contributor
0 Kudos

Hi Priyank Dev,

Same Here My concept also about cardinality didn't clear yet. This problem occurs for some attributes not for all attributes. Sometimes this problem may occur for the Table Also.

Regards,

Nishant Bansal.

nishantbansal91
Active Contributor
0 Kudos

Hi Ramakrishnaappa

if you have some document regarding cardinality please send this document to my email ID.

              nishantbansal90@gmail.com.

Regards.

Nishant Bansal.