Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table type SXMSMGUIDT declaring error

Former Member
0 Likes
584

Hi,

I'm trying to declare an internal table of type SXMSMGUIDT and insert one row into it. However when I try to do so it's giving me an error.

Here is my code:

data: i_message_guid type STANDARD TABLE OF SXMSMGUIDT.
  
i_message_guid-SXMSMGUID = '123'.

The type of "I_MESSAGE_GUID" cannot be converted to the type of "'123'".

I even tried to declare a work area and append the work area to the internal table but no luck. Does anyone know what I have done wrong with the declaration?

Thanks, Warren

6 REPLIES 6
Read only

Sm1tje
Active Contributor
0 Likes
559

How does this type look like?

Read only

Former Member
0 Likes
559

Hi,

You can declara the work area

data: i_message_guid type STANDARD TABLE OF SXMSMGUIDT.

data: w_message_guid like line of i_message_guid.

then you can add your text to this work area and append it to the internal table.

I think it is helpful for you.

Read only

0 Likes
559

This kind of depends on the type. I recon, that this type consists NOT of a structure, but of one single field only. This means you can not just declare the workarea and name the field.

It is probably something like this:

w_message_guid = '123' and not

w_message_guid-SXMSMGUID = '123'.

Read only

0 Likes
559

I already tried this and got an error:

The type of "W_MESSAGE_GUID" cannot be converted to the type of "'123'".

data: i_message_guid type STANDARD TABLE OF SXMSMGUIDT.

data: w_message_guid like line of i_message_guid.

w_message_guid = '123'.

Read only

0 Likes
559

No that does not work.

Read only

0 Likes
559

Warren,

the type SXMSMGUIDT is already a table type (hence my first question, what is the type, is it a line type or a table type):

 DATA: i_message_guid TYPE sxmsmguidt,
      wa_message_guid TYPE sxmsmguid.

wa_message_guid = '123'.
APPEND wa_message_guid TO i_message_guid.

This will work.