Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

looping mechanism in a structure

Former Member
0 Kudos

experts,

if a structure( ex : zst1) contains a table type (ex : ztt1) ,

how to loop the table type into workarea.

thanks and regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

use nested Structure LOOPING for this.

check the link http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3364358411d1829f0000e829fbfe/content.htm

Regards,

Anirban

6 REPLIES 6

Former Member
0 Kudos

Hi,

use nested Structure LOOPING for this.

check the link http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3364358411d1829f0000e829fbfe/content.htm

Regards,

Anirban

Former Member
0 Kudos

Hi

Firstly create the table of same type as your table type .

Now pass your Workarea(Structure)-->table type to table created by u .

Now your table contains the data which you have in your table type .

Regards

Hitesh

former_member195383
Active Contributor
0 Kudos

declare another table itab of the same type as the included table in the structure..

now ...after data comes in to the structure zstr, write the following

itab [ ] = zstr-itabs [ ].

loop at itab into wa_itab.

:

:

:

endloop.

wa_itab is the work area of the type itab.

Edited by: Rudra Prasanna Mohapatra on Jul 24, 2008 7:43 AM

former_member181995
Active Contributor
0 Kudos

girija,

loop at itab into wa_itab."wa_itab is work area
endloop.

Amit.

former_member705122
Active Contributor
0 Kudos

Hi,

check this thread for looping Nested Internal Tables:

http://help.sap.com/saphelp_nw70/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/content.htm

Regards

Adil

Former Member
0 Kudos

two tables SPFLI and SFLIGHT.

retrieve the fields CARRID, CONNID, CITYFROM & CITYTO from Table SPFLI.

And the fields FLDATE PRICE SEATSMAX & SEATSOCC from SFLIGHT on the condition that SPFLI-CARRID = SFLIGHT-CARRID & SPFLI-CONNID = SFLIGHT-CONNID.

Now the LOOP.....ENDLOOP will be like this :

Loop at t_spfli into fs_spfli.
 
    write 😕 fs_spfli-carrid,
              fs_spfli-connid.
 
    Loop at t_sflight into fs_sflight where carrid = fs_spfli-carrid
                                                   and connid = fs_spfli-connid.
       write 😕 fs_sflight-fldate,
                  fs_sflight-price,
                  fs_sflight-seatsocc,
                  fs_sflight-seatsmax.
     Endloop.
 
Endloop.

Regards,

Nikunj shah