‎2008 Apr 30 10:34 AM
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
‎2008 Apr 30 10:42 AM
‎2008 Apr 30 10:45 AM
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.
‎2008 Apr 30 10:49 AM
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'.
‎2008 May 01 12:07 AM
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'.
‎2008 May 01 12:12 AM
‎2008 May 01 7:23 AM
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.