07-12-2009 4:36 PM
hi ALL,
I want to build FM that the export parameters is type deep structure ,
i.e.
i want to retrieve for every employee 1 line with the employee number and table with all employee
address
for example
employee number address <- the parameter address i want to get i one line
123 abcd
cccc
aaaa
employee number address
456 cddd
wwww
bbbb
....
i want to get the parameter adress in one nested line i.e if i have 10 employee i just
have 10 entries and when i double click on address i get the address of the employee (one or more).
i try to create in export parameter a table type with structure with fields:
1. employee type char 10
2. address like structure of address
and i do loop and append the address like wa_type-address-address but it's not working,
i still get table with lines that dependent on the user address
what I miss here?
Best Regards
Ricardo
07-12-2009 5:31 PM
Hi,
create in DDIC a TT (ZADDRESS_TT) with this line structure
ADDRESS TYPE CHAR128
.... any other field...
Then create a New TT (ZEMPLOYER_TT) with line structure
EmployerId TYPE INT4 <-- everything you prefer
Addresses TYPE ADDRESS_TT
Then in FM export use EMPLOYER_TT
Regards,
Ivan
07-12-2009 4:53 PM
Hi Ricardo,
I think you are missig table declaration of addres.
You should do like following:
TYPES:
ys_address type table of address,
BEGIN OF yt_address,
employee type c(10),
addres type address,
END OF yt_address.
or you can define directly addres type table of address inside begin yt_address.
Don't forget to create this correct structures with table type in Data Dictionary.
Regards,
Frisoni
07-12-2009 5:05 PM
hi Guilherme
thanks ,
but how i declare it in didc since i need to export the table .
best regards
ricardos
07-12-2009 5:49 PM
For information, instead of using DDIC to declare types of FM parameters, you may also use Type Groups (some would say it's also DDIC but it's easier to create as a source) or use Types in global classes. Of course, you may declare table types also this way.
07-12-2009 5:51 PM
Hi Ricardo,
you should declare a table type in DDIC for the address field, where you declare address field.
Then you declare a structure with employee field and the table declared before.
Regards,
Frisoni
07-12-2009 5:31 PM
Hi,
create in DDIC a TT (ZADDRESS_TT) with this line structure
ADDRESS TYPE CHAR128
.... any other field...
Then create a New TT (ZEMPLOYER_TT) with line structure
EmployerId TYPE INT4 <-- everything you prefer
Addresses TYPE ADDRESS_TT
Then in FM export use EMPLOYER_TT
Regards,
Ivan