April 20, 2010 – 10:57 pm | 11 Comments

Dear Jane,
95% of this presentation is half mental.
Seriously! STOP playing games. Throw away those shrouds of insanity. Get out of that virtual ‘web’.
Ok, about your presentation, in few words – no reasoning. Just some facts …

Read the full story »
Bon Voyage

Business-Startups

Healthcare

MBA

Technology

Home » Technology

Accessing deep structures in ABAP

Submitted by Ameya Pimpalgaonkar on March 4, 2010 – 2:59 pm No Comment

It is always a challenging part to work with complex data types in ABAP. And one of these types is handling deep structures.  However it depends on how well we understand the structure design. We will see how to access deep structures programmatically with an example.

In our example we are using already existing table type RANGE_QMNUM_TAB.  We are declaring a structure x_deep2 which contains another structure x_deep1 which in turn contains a table type. You can use following program and also can modify according to your requirement.

TYPESBEGIN OF x_deep1,
       v_qmnum 
TYPE qmel-qmnum,
       RANGE_QMNUM_TAB 
TYPE RANGE_QMNUM_TAB,
       
END OF x_deep1.

TYPESBEGIN OF x_deep2,
       v_qmnum1 
TYPE qmel-qmnum,
       v_test 
TYPE x_deep1.
TYPESend of x_deep2.

DATA: it_qmnum TYPE RANGE_QMNUM_TAB,
      wa_qmnum 
TYPE RANGE_QMNUM,
      it_deep2 
TYPE TABLE OF x_deep2,
      wa_deep2 
TYPE x_deep2.

wa_qmnum-low = ‘XXXXXXXX’.
append wa_qmnum to it_qmnum.

wa_deep2-v_test-RANGE_QMNUM_TAB[] = it_qmnum[].
APPEND wa_deep2 to it_deep2.

I hope now it is clear that it is not as difficult as it looks in structure wise. Though it shows how to pass values to deep structure, I guess it helps all to write for getting values as well from deep structures.

 

Twitter del.icio.us Digg Facebook linked-in Yahoo Buzz StumbleUpon

Related Articles

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar blog.

eXTReMe Tracker