cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with access structure from REF TO DATA object

Former Member
0 Kudos

Hello,

I have an issue with accessing a structure from REF TO DATA object, which I get as an export parameter (ER_ENTITYSET) from a method. The object is dynamic generated.

The requirement is to change a value in the structure TOCNIT.

The problem is to access the very complex consturction of this object.

I have attached a screenshot of my debugger view. Left of the view is my class implementation with the method. As you can see, I have tried a many possibilities, but I did not found the right way.

On the right side of the screenshot you can see the structure of ER_ENTITYSET.

Buy the way, the class does not provide any methods to get the data singly.

Do you have any suggestions?

Thanks and best regards.

Alexander

Accepted Solutions (1)

Accepted Solutions (1)

former_member210008
Active Participant

It looks like common table. So try something like this:

FIELD-SYMBOLS <table> type standard table.
ASSIGN er_entityset->* TO <table>.
LOOP AT <table> ASSIGNING FIELD-SYMBOL(<line>).
  CLEAR sy-subrc.
  WHILE sy-subrc = 0.
    ASSIGN COMPONENT sy-index OF STRUCTURE <line> TO FIELD-SYMBOL(<field>).
    CHECK sy-subrc = 0.
    WRITE:/ <field>. "<-- here is field value
  ENDWHILE.
ENDLOOP.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Evgeniy,

thank you for your fast replay! That works fine.

Regards

Alexander