‎2007 Apr 18 8:08 PM
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
‎2007 Apr 18 8:21 PM
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
‎2007 Apr 18 8:11 PM
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
‎2007 Apr 18 8:12 PM
‎2007 Apr 18 8:18 PM
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
‎2007 Apr 18 8:16 PM
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
‎2007 Apr 18 8:21 PM
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
‎2007 Apr 19 12:45 AM
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.