Skip to Content
-1

Problem with access structure from REF TO DATA object

Sep 07, 2017 at 09:20 AM

29

avatar image
Former Member

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

issue.png (138.7 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Evgeniy Astafev Sep 07, 2017 at 09:43 AM
0

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.
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Sep 07, 2017 at 10:11 AM
0

Hi Evgeniy,

thank you for your fast replay! That works fine.

Regards

Alexander

Share
10 |10000 characters needed characters left characters exceeded