cancel
Showing results for 
Search instead for 
Did you mean: 

How to create deep structure dynamically using field symbol.

Former Member
0 Kudos

Hi All,

I've a requirement where I'm creating dynamic entity set whose names and structure will be derived from a table. So far, I'm successful in creating metadata of MPC class. But to send data back to service requires a structure, in this case a deep structure (Structure that may include multiple dynamic entries of Structure and Table).

I tried adding a structure inside structure but I don't understand field symbol completely. I made a R&D and found field symbol can add structures of same type or can append to a table. Can someone help on it.

My structure is:

ABC

| - A

| - B

| - C

| - D

| - E

| - F (Dynamic)

| - G (Dynamic)

| - (Table) (Dynamic)

Accepted Solutions (0)

Answers (2)

Answers (2)

horst_keller
Product and Topic Expert
Product and Topic Expert

Use RTTC.

Former Member
0 Kudos

Hi Horst, Thanks for reply. I read about RTTC but my main requirement is as follows:

I've a table that maintains structures and entity set and node for structure to be added.

I fetch details from table and had already created Metadata successfully in MPC class, but I'm unable to declare data for the same. I need to append structures on runtime (I don't know which structure will be appended with what name) it will create a service data to be sent in er_entity. Kindly help.

roberto_forti
Contributor

Hi Umang,

Field-symbols example:

DATA: gt_xpto TYPE STANDARD TABLE OF ty_xpto.
...
DATA: lo_xpto TYPE REF TO data.
...
GET REFERENCE OF gt_xpto INTO lo_xpto.
...
CALL FUNCTION 'Z_TEST_REF_DATA'
EXPORTING 
it_xpto = lo_xpto
...
* EXPORTING parameter (it_xpto) should be defined as TYPE REF TO data.

* Function Module code
...
assign it_xpto->* to lt_table.
...