Hi Arun,
Of course you can pass an internal table to a Function Module. When you define the Function Module in SE37, define a TABLES parameter with the same structure as the internal table ( which should again be a dictionary structure).
In the program, when you call this function module, pass the internal table to the tables parameter you have defined for the function module.
Please note that:
1. Tables parameters are always passed by reference. so, you need to be very careful in their usage. Also, use as few tables parameters as necessary.
2. Whenever you pass a tables parameter, the system will automatically create a header line for the tables parameter which can be used in the Function Module logic.
3. However, the table header will not get passed automatically along with the table body (from the calling program). You have to pass it explicitly. For that, you need to define an exporting parameter of the line type of the table.
In my experience, it has never been necesasary to pass the table header to the function module. In general, the contents of the table header would be present as one of the lines in the internal table, right?
Hope this information helps.
Regards,
Anand Mandalika.
Add a comment