cancel
Showing results for 
Search instead for 
Did you mean: 

string handling

Former Member
0 Kudos

i am using one of the fields of the table as string. if i use the same table as import parameter in the function module it is giving error as the table must be a flat srtucture. can any solve this problem

thanks

suresh

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi suresh,

Create a table type in ABAP/4 Dictionary with zcontact as row type and then use it in importing params as reference type with type spec. "Type".

I personally believe this is a good approach. So please consider it if it is viable for you..

Sri

Former Member
0 Kudos

Please change string to CHAR500 in database table ZCONTACT or just call the function in loop and pass

zcontact ( Stucture not table) as an importing parameter.

In addition to error you get in FM you will also not be able to define an internal table of type ZCONTACT in the calling program .

Cheers

Former Member
0 Kudos

Hi suresh,

If it is only 500 Char all the time that you require then try considering a data element with char 500 as length (there are some data elements available in the system for sure like EDICHAR500 or try finding more in SE12).

Also it would be useful if you can tell us how you have defined your FM interface parameter for this...

Is it an importing parameter? if so, is it referring to a table type of the given structure? please give param name, Type spec. and reference type from the interface as it is.

As long as you specify a table type it should not give any syntax errors as far as I am concerned.

Sri

Former Member
0 Kudos

hi

my database table name is zcontact. in the function module the import parameter is

parameter name : li_contact(internal table)

type spec : like

associated type : zcontact.

if i am using type spec as type it is not accepting. if i give type spec as like it is giving error as zcontact must be a flat structure.this is my problem. please look into it.

thanks

suresh

Former Member
0 Kudos

Hi,

Use table type after "Type" in the import params of the fm interface. If you are already using a table type as reference then please copy and paste your importing param name type here.

Sri

athavanraja
Active Contributor
0 Kudos

In the <b>type spec</b> use type not like.

if you use <variable> <b>like</b> <table with string field> you will get that erro.

instead use

<variable> <b>type</b> <table with string field>

Regards

Raja

Former Member
0 Kudos

Check the type of the table used in the FM. Use this to construct the table you export to the FM.

Former Member
0 Kudos

You cannot use a structure which contains the STRING data type. Use a character field with some specified length. CHAR255 could be a choice.

Regards,

Ravi

Note :Please reward points if this helps you.

Former Member
0 Kudos

i want a char which holds 500 characters. i have to store this value in the data base. i used Type , but it is giving the same error.

regards

suresh

athavanraja
Active Contributor
0 Kudos

if you have used a structure for <table with string field> you should not have problem (i have tested before posting the answer). are you sure you are not using table type?

Regards

Raja

athavanraja
Active Contributor
0 Kudos

Hi Suresh,

Please close your other thread

please reward helpful answers and if the question is answered, mark them as answered.

Regards

Raja

Former Member
0 Kudos

EMAIL_ADDRESS CHAR 30

FIRST_NAME CHAR 30

LAST_NAME CHAR 30

PHONE_NUMBER CHAR 10

COMMENTS STRING 0

i am using the above table in my function module. the customer will enter the the above details and press save button then i have store the above details in the database. the comments field should be 500char length. i have to save the deatils using the function module.

regards

suresh