Skip to Content
avatar image
-1
Former Member

Problem with access structure from REF TO DATA object

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 07, 2017 at 09:43 AM

    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.
    
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 07, 2017 at 10:11 AM

    Hi Evgeniy,

    thank you for your fast replay! That works fine.

    Regards

    Alexander

    Add comment
    10|10000 characters needed characters exceeded