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

Problem in using a structure with a field of data type 'RAW STRING'

Former Member
0 Likes
2,683

Friends

I have written a ZBAPI that imports a structure which has 5 fields. I have defined this in the IMPORT tab of Tr.Code <SE37>. One of the field of this structure is of data type 'RAW STRING'.

When I try to activate this BAPI, I get an error message as follows:

Function Module ZBAPI_ADD_CONFIG_DNA

"ZDAMPER_CON_DNA" Must be a flat structure. You cannot use internal table

strings, references, or structures as components.

Where ZDAMPER_CON_DNA is the table name that I am using.

FOR TESTING PURPOSE, WHEN I CHANGE THE DATA TYPE FROM 'RAW STRING' TO JUST A CHAR OF LENGHT 5, IT WORKS FINE.

Here is the source code of the simple BAPI that i am trying to activate.

FUNCTION ZBAPI_ADD_CONFIG_DNA.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(CONFIG_DNA_DATA) TYPE ZCONFIG_DNA_STRUCTURE

*" EXPORTING

*" VALUE(MESSAGE) TYPE ZRETURNMESSAGE

*"----


tables: ZDAMPER_CON_DNA.

ZDAMPER_CON_DNA-CONFIG_ID = CONFIG_DNA_DATA-CONFIG_ID.

ZDAMPER_CON_DNA-STRING_NAME = CONFIG_DNA_DATA-STRING_NAME.

ZDAMPER_CON_DNA-STRING_FORMAT = CONFIG_DNA_DATA-STRING_FORMAT.

ZDAMPER_CON_DNA-STRING_VALUE = CONFIG_DNA_DATA-STRING_VALUE.

ZDAMPER_CON_DNA-OBJECT_NAME = CONFIG_DNA_DATA-OBJECT_NAME.

INSERT ZDAMPER_CON_DNA.

MESSAGE-SUBRC = sy-subrc.

if sy-subrc = 0.

MESSAGE-RETURNMESSAGE = 'SuccessfullyInserted'.

else.

MESSAGE-RETURNMESSAGE = 'Insert Failed'.

endif.

=============

ANY KIND OF FEED BACK WILL BE HIGHLY APPRECIATED.

THANKS

RAM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,695

Hi ram,

there is no data element exists with the name RAW STRING ,

but check one of these names..

Data element Short text

C2S_RAWSTRING C2-Server: Data Element of Type Rawstring

N2_RAWSTRING Byte String of Variable Length

QISRDRAW_STRING Data in Format RAW Character String

RCF_RAWSTRING Rawstring

RPAP_TEMPLATE_RAWSTRING Blob of Template File

RSRAWSTRING Raw String

RSRD_RAWSTRING Binary Content in the Broadcasting Framework

SWH_RAWSTRING Workflow: Data Type RAWSTRING

WDR_RAWSTRING Byte Sequence of Variable Length

<REMOVED BY MODERATOR>

venkat.

Edited by: Alvaro Tejada Galindo on Mar 7, 2008 5:15 PM

Friends

I have written a ZBAPI that imports a structure which has 5 fields. I have defined this in the IMPORT tab of Tr.Code <SE37>. One of the field of this structure is of data type 'RAW STRING'.

When I try to activate this BAPI, I get an error message as follows:

Function Module ZBAPI_ADD_CONFIG_DNA

"ZDAMPER_CON_DNA" Must be a flat structure. You cannot use internal table

strings, references, or structures as components.

Where ZDAMPER_CON_DNA is the table name that I am using.

FOR TESTING PURPOSE, WHEN I CHANGE THE DATA TYPE FROM 'RAW STRING' TO JUST A CHAR OF LENGHT 5, IT WORKS FINE.

Here is the source code of the simple BAPI that i am trying to activate.

FUNCTION ZBAPI_ADD_CONFIG_DNA.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(CONFIG_DNA_DATA) TYPE ZCONFIG_DNA_STRUCTURE

*" EXPORTING

*" VALUE(MESSAGE) TYPE ZRETURNMESSAGE

*"----


tables: ZDAMPER_CON_DNA.

ZDAMPER_CON_DNA-CONFIG_ID = CONFIG_DNA_DATA-CONFIG_ID.

ZDAMPER_CON_DNA-STRING_NAME = CONFIG_DNA_DATA-STRING_NAME.

ZDAMPER_CON_DNA-STRING_FORMAT = CONFIG_DNA_DATA-STRING_FORMAT.

ZDAMPER_CON_DNA-STRING_VALUE = CONFIG_DNA_DATA-STRING_VALUE.

ZDAMPER_CON_DNA-OBJECT_NAME = CONFIG_DNA_DATA-OBJECT_NAME.

INSERT ZDAMPER_CON_DNA.

MESSAGE-SUBRC = sy-subrc.

if sy-subrc = 0.

MESSAGE-RETURNMESSAGE = 'SuccessfullyInserted'.

else.

MESSAGE-RETURNMESSAGE = 'Insert Failed'.

endif.

=============

ANY KIND OF FEED BACK WILL BE HIGHLY APPRECIATED.

THANKS

RAM

4 REPLIES 4
Read only

Former Member
0 Likes
1,696

Hi ram,

there is no data element exists with the name RAW STRING ,

but check one of these names..

Data element Short text

C2S_RAWSTRING C2-Server: Data Element of Type Rawstring

N2_RAWSTRING Byte String of Variable Length

QISRDRAW_STRING Data in Format RAW Character String

RCF_RAWSTRING Rawstring

RPAP_TEMPLATE_RAWSTRING Blob of Template File

RSRAWSTRING Raw String

RSRD_RAWSTRING Binary Content in the Broadcasting Framework

SWH_RAWSTRING Workflow: Data Type RAWSTRING

WDR_RAWSTRING Byte Sequence of Variable Length

<REMOVED BY MODERATOR>

venkat.

Edited by: Alvaro Tejada Galindo on Mar 7, 2008 5:15 PM

Read only

0 Likes
1,695

I am sorry. The actual data element type is 'RAWSTRING' that I selected from the available drop down list.

I didn't find the listing that you are suggesting. However, I will see If I can manually enter them and try.

Thanks for the suggestions and I will keep you posted

Tks

Ram

Read only

0 Likes
1,695

you can either change the importing parameter ot tables parameter and split the structure and have that many import parameters

Read only

Former Member
0 Likes
1,695

Actually, using a type VARILRAW solved this issue. Thanks to everyone for their kind response. I appreciate it a lot.