cancel
Showing results for 
Search instead for 
Did you mean: 

Can a context attribute datatype be a dictionary structure?

ged_hurst
Participant
0 Kudos

Hi everyone,

can a context attribute datatype be a dictionary structure?

I would like to create a node whose attributes, namely user, is a custom dictionary datatype made up of two fields: firstname and lastname.

I know I can create a context node with two attributes, firstname and lastname, but I would like to create just one attribute with a complex dictionary datatype which I have already created.

This is syntactically possible. However, how can I assign values to these attributes?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

former_member199125
Active Contributor
0 Kudos

Hi..

yes, dictionary structure can be datatype .

and about user name combination of first name and last name, there is a data type called cname is combination of first name and last name in infotype p0002.

you can assign values to attibute in normal way using set_attribute method.

Regards

Srinivas

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Yes you can create attribute of any dictionary type. just try once you will get idea.

Wile creating node-in node properties you wil find Dictionary structure - there you can give any table or stucture, and select

fields from that table or struct.

Cheers,

Kris.

ged_hurst
Participant
0 Kudos

Hi,

as I said before, I already knew that is possible and I did it.

However, how can I set the value for such an attribute ?

Specifically, I've coded the following/


  ls_item_ref-label_name = 'Created by: '.
  ls_item_ref-value_path = 'PO_HEADER.CREATED_BY'.     
  APPEND ls_item_ref TO lt_items_ref.

but created_by is a structure made up of Firstname, Lastname and Fullname.

How can I refer to, let's say, Fullname?

If I code something like this:


  ls_item_ref-value_path = 'PO_HEADER.CREATED_BY.FULLNAME'.     

it dumps, since FULLNAME is not an attribute, it's a component of the structure which is the data type of the attribute.

Any idea?

ged_hurst
Participant
0 Kudos

HI,

I probably forgot to mention that my question is related to FPM - IDR (Identification Region).

In fact I'm trying to add an item dynamically to IDR:


  DATA:
      lt_items_ref TYPE if_fpm_idr=>t_items_ref,
      ls_item_ref  TYPE if_fpm_idr=>s_items_ref,
  lo_idr ?= lo_fpm->get_service( cl_fpm_service_manager=>gc_key_idr ).
  ls_item_ref-label_name = 'Created by: '.
  ls_item_ref-value_path = 'PO_HEADER.CREATED_BY'.     
  APPEND ls_item_ref TO lt_items_ref.

and this is dumping since CREATED_BY is not a simple attribute, but a structure. How can I access its components?

ged_hurst
Participant
0 Kudos

Not answered so far, found a workaround.