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

Error Table

Former Member
0 Likes
851

During function calls, I will be importing error tables. What is the best way to import them? I am thinking I shold put them into a itab. What is the code to do that

Should I have something like

begin of itab 
error type string
end of itab

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
827

Hi Suresh,

It will work..if we use TYPE TABLE OF STRING.

Check this example..

data: itab type table of string.

data: wa type string.

wa = 'test'. append wa to itab.clear wa.

wa = 'test123'.append wa to itab.clear wa.

loop at itab into wa.

write: / wa.

endloop.

Thanks,

Naren

6 REPLIES 6
Read only

suresh_datti
Active Contributor
0 Likes
827

what you decalred will only be a work area.. use types ie

TYpes:begin of typ_itab

error type string

end of typ_itab

data itab type table of typ_itab.

~Suresh

Read only

Former Member
0 Likes
827

Would something like be ok?

data: error type table of string.

Read only

0 Likes
827

When you sue TYPE TABLE OF <something > .. this <something > should be a Table Type either in the Data Dictionary or in your Program..

~Suresh

Message was edited by:

Suresh Datti

after clarification by Naren in the post below.. thanks Naren

Read only

Former Member
0 Likes
827

Hi,

It Depends on the type of the importing parameter given in the function module..

Use the same type..Otherwise you might short dumps..

But for general string internal table.You can use

DATA: ITAB TYPE TABLE OF STRING.

Thanks,

Naren

Read only

Former Member
0 Likes
828

Hi Suresh,

It will work..if we use TYPE TABLE OF STRING.

Check this example..

data: itab type table of string.

data: wa type string.

wa = 'test'. append wa to itab.clear wa.

wa = 'test123'.append wa to itab.clear wa.

loop at itab into wa.

write: / wa.

endloop.

Thanks,

Naren

Read only

Former Member
0 Likes
827

Are these function modules that you wrote or are they standard ones? If they are standard ones, you have to use the table type that the function module expects. If it custom function modules, I would recommend designing similar to a BAPI'd RETURN table paramater which is of type BAPIRET2. Then your calling programs can define an internal table of the same type and process it. This will give you some standardization as well as flexibility of using messages.