I need to call a function that has a table type as import parameter in a program. I thought about doing this with a selection screen but I can't use deep structures as parameters. When I 'TEST' that function module it shows me a thing where I can add multiple entries and submit everything in the end. Can I get something similar during the execution of a program?
edit: I have to offer a program that calls the function module create_skill_profile.
1

- 11,934
- 5
- 22
- 48

- 125
- 7
- 22
-
Yes, just program it. If you want a sensible answer, add more details about the function module and the actual requirements, please. – vwegert Aug 25 '16 at 10:52
-
You can use `SELECT-OPTIONS` for adding multiple values on a selection screen. – Jagger Aug 26 '16 at 11:08
-
Post your code in text form, your questions [is unreadable in current form](http://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors/303816#303816). – Suncatcher Oct 17 '16 at 15:31
2 Answers
You can call the function module RS_COMPLEX_OBJECT_EDIT
in your report for editing a complex structure. This is the same function module that is used for editing test data in the function module single test.
So, in your report, you could ask for the name of the desired type (if that has to be a dynamic one), and then, in start-of-selection, you can create a data object of this type and pass it to RS_COMPLEX_OBJECT_EDIT
to let the user fill it.
A serious limitation of RS_COMPLEX_OBJECT_EDIT
is that it can't handle sorted or hashed tables as input. So all the components of your complex structure, if they are of table kind, they have to be standard tables.

- 2,698
- 1
- 22
- 21
What I understand: You want to call a function module that requires a table as import parameter. The table's rows are filled from user input. The number of rows is dynamic.
Approaches: 1) use selection screen with predefined input fields and show/hide them dynamically via PAI (AT SELECTION-SCREEN (on xxx). LOOP AT SCREEN.) then build your table and call your function module on START-OF-SELECTION.
2) show editable ALV grid with table structure. Implement an application toolbar button or use SAVE button to let the user call your function module when he finished inserting his input.
I would defenitely prefer 2), although custom input validation is a bit tricky. But if the required user input is the same as ddic defined table structure the input validation happens automatically.

- 868
- 6
- 12