Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

help to define deep structure in export parameter

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

_IvanFemia_
Active Contributor
0 Kudos

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

5 REPLIES 5

guilherme_frisoni
Contributor
0 Kudos

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

0 Kudos

hi Guilherme

thanks ,

but how i declare it in didc since i need to export the table .

best regards

ricardos

0 Kudos

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.

0 Kudos

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

_IvanFemia_
Active Contributor
0 Kudos

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