Skip to Content
0

How to create deep structure dynamically using field symbol.

May 08 at 08:23 AM

90

avatar image
Former Member

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)

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Horst Keller
May 08 at 09:40 AM
2

Use RTTC.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0
ROBERTO Forti Santos May 09 at 05:08 AM
0

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.
...
Share
10 |10000 characters needed characters left characters exceeded