‎2013 Jan 17 2:34 PM
Hi ,
Is there any standard thumb rule for FM interface parameters i.e. TYPE or LIKE for structure, table type , data element, database table in import, export, tables tab. Which will create internal table with header line?
Even I am comfortably working with the function modules now as of now. But things are going by trail and error method if TYPE is not worked LIKE keyword using etc.
Regards,
Praveen Chitturi.
‎2013 Jan 17 2:42 PM
Hi Chitturi,
If i understood well your question, all you're asking is when to use TYPE or LIKE right?
here's the answer :
Use the LIKE addition whenever your declaration is directly linked to a data object. Examples of this include auxiliary variable in procedures that must have the same type as interface parameters or their components. This keeps your program valid even if the data object changes.
In all other case, use TYPE
Best Regards,
Maxime
‎2013 Jan 17 2:54 PM
Hi Max,
1. Thank you for reply and you are correct, My doubt is about like or type in Interface parameters .
As you said LIKE is for only dobj's like auxilary variables -----> what this means whether structure type or table type or database structure or type group data type.
2. Also for creating internal table referring to structure will it create internal table with header line or with out header?
3. For declaring internal table which data type should I use i.e. Can I refer structure/database table/table type?
Regards,
Praveen Chitturi.
‎2013 Jan 17 3:02 PM
Hi Praveen,
1. LIKE can be used to refer to something you have already declared using DATA statement or it exists in SE11. LIKE addition describes the line type of a table object that is visible at that point in the program
2. It will create an internal table without header line(unless specified explicitly)
3. You can use any of the types you have listed. There is no such restriction.
‎2013 Jan 17 3:09 PM
Hi chitturi,
The TYPE addition is used to refer to an independent data type and the LIKE addition to refer to a data object of the corresponding type. So according to these facts, i'd say (i have not tried so i might be wrong) :
1. Structure, table, database structure or type group data type should use TYPE except if they directly depends or needs to be the exact same as an other Structure, table ... etc. In these cases, you use LIKE.
2. I unfortunately have no idea if it is going to create an internal table with or without an header line, just give it a try and give me some feedback
3. I guess you should use TYPE except (as i said just before) if you want your internal table to have the same data type as a database table or table type. I am not sure if you can refer an internal table to a structure. Just give it a try too
Sorry for being kind of vague but i hope this might help you!
Best Regards,
Maxime
‎2013 Jan 18 3:36 AM
Hi max,
I will note down one by one by going in trail and error method.
Thank you,
Praveen Chitturi
‎2013 Jan 17 2:42 PM
Hi,
I'm not sure to understand.
CALL FUNCTION 'toto'
CHANGING toto = it_toto[].
it_toto_bis type table of .. .with header line ...
it_toto_bis[] = toto
and you could play with header line
But don't forget, header line is bad, it's the dark force
Fred