0
votes

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. function module import1

function module code 12

function module code 23

2
Yes, just program it. If you want a sensible answer, add more details about the function module and the actual requirements, please. - vwegert
You can use SELECT-OPTIONS for adding multiple values on a selection screen. - Jagger
Post your code in text form, your questions is unreadable in current form. - Suncatcher

2 Answers

2
votes

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.

1
votes

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.