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

hash table and function module input

Former Member
0 Likes
1,017

Hi ABAP Expert,

Please advise what happening if i am passing the intertal table (hashtable) become input of function module (table).

so insite the function module is this table still hashtable type or just normal internal table ?

Thank you and Regards

Fernand

3 REPLIES 3
Read only

Former Member
0 Likes
602

HI,

I presume the internal table remains the same as what you declare in the IMPORT/EXPORT/TABLES - Associated Type.

Read only

MarcinPciak
Active Contributor
0 Likes
602

Typing of such parameter should be either generic (i.e ANY TABLE) or fully specified (HASHED/SORTED/STANDARD TABLE). In both cases when you pass i.e. HASHED table to that formal parameter the dynamic type will be inherited by the actual paremeter.

This means that inside the function module you will not be able to use HASHED table "banned" statement i.e. not appending to this table. The system must be fully convinced about the type of passed parameter to allow certain access. Without that knowledge it won't pass you through the syntax checker or will trigger runtime error.

I.e


"1) parameter is typed
CHANGING
   C_TAB type ANY TABLE


"here you can't use STANDARD/SORTED table specific statements as the dynamic type of param might be HASHED TABLE
append ... to c_tab.  "error during runtime

"2) parameter is typed
CHANGING
   C_TAB type HASHED TABLE

"here system explicitly knows that dynamic type is the same as static one so you can append to this table too
append ... to c_tab.  "syntax error before runtime

So the anwser to your question

so insite the function module is this table still hashtable type or just normal internal table ?

is...

During syntax check system takes static type of table and shouts if table related operation is not allowed for this kind.

During runtime system takes dynamic type of the table and checks whether particular statement is allowed for this kind of table, if not triggers an exception.

Regards

Marcin

Read only

Former Member
0 Likes
602

Hi Fernand Lesmana,

IT table are of 4 types 1.standard table 2. hashed table 3. sorted table 4. index table.

so, In ur program if u r passing hased table to FM then in the FM it should be hashed table otherwise u will get runtine error as

CALL_FUNCTION_CONFLICT_TAB_TYP

i.e, if the FM import parameter is of type standard table then u will get the type conflict error.

Hope this will help u.