‎2021 Feb 11 2:16 PM
Hi,
I have a function module which should receive back information about customers. There could be many customers therefore the export Parameter has to be a table.
The Problem is that for each customer we will also receive a list of invoices i.e. invoice number and invoice date.
The table for the Export Parameter should be able to handle more than one customer and for each customer more than one invoice.
All help greatly appreciated
‎2021 Feb 11 2:27 PM
Have you considered creating a table type based on a deep structure?
And of course use that last table type to type the export parameter
‎2021 Feb 11 2:23 PM
Can you not just have the function module return two tables? One for the customers, and one with the invoices, having also the customer as a key field?
Something like tables of these?
TYPES:
BEGIN OF customer,
customer_number type customer_number_type,
customer_name type string,
END OF customer.
TYPES:
BEGIN OF invoice,
customer_number type customer_number_type,
invoice_number type invoice_number_type,
invoice_date type dats,
END OF invoice.
‎2021 Feb 11 2:46 PM
Thank you for your answer. I don't think we can do that because it is an RFC so we call another System and it has to be able to come back as table in table 😞
‎2021 Feb 11 2:59 PM
Ok, yes you can do that and I see pvnierop has already explained how...
‎2021 Feb 11 2:27 PM
Have you considered creating a table type based on a deep structure?
And of course use that last table type to type the export parameter
‎2021 Feb 11 2:47 PM
Yes I think this is what I have to do. Do you know if there are any such demo Function Modules in SAP?
‎2021 Feb 11 2:52 PM
By the way, if you're going to use it as table-parameter, then you don't need step 3. Just use the deep structure there.
Not really sure if there are demo FM's. But if you want to know how to make a deep structure, there are more than a few tutorials on the www 😉
‎2021 Feb 11 2:41 PM
‎2021 Feb 11 2:50 PM
Thank you for your answer. I was getting error messages trying to create this so i thought it is not possible in SAP. I will keep trying and close the question then if this possible. Sorry for the hassle. 😞
‎2021 Feb 11 3:07 PM
Thank you all for your help and apologies for the stupid question