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: 

internal table

Former Member
0 Kudos
116

Hi All,

I want to use an internal table as a component of another internal table.How can i do this.

Naveen

1 ACCEPTED SOLUTION

Former Member
0 Kudos
76

tables: kna1, adrc.

  • To get Client Personal Details

DATA: BEGIN OF client_personal_details OCCURS 0,

kunnr LIKE kna1-kunnr,

name1 LIKE kna1-name1,

adrnr LIKE kna1-adrnr,

END OF client_personal_details.

  • To get Client Address Details

DATA: BEGIN OF client_address OCCURS 0,

street LIKE adrc-street,

city1 LIKE adrc-city1,

END OF client_address.

  • To get Client Communication Details

DATA: BEGIN OF client_communication OCCURS 0,

fax_number LIKE adrc-fax_number,

tel_number LIKE adrc-tel_number,

END OF client_communication.

  • Structure to Get the Client Details as in XML format

DATA: BEGIN OF client OCCURS 0,

personal_details LIKE TABLE OF client_personal_details,

address LIKE TABLE OF client_address,

communication LIKE TABLE OF client_communication,

END OF client.

chetan

8 REPLIES 8

Former Member
0 Kudos
76

Hi

Kindly check the following code:

* To get Client Personal Details
  DATA: BEGIN OF client_personal_details OCCURS 0,
          kunnr LIKE kna1-kunnr,
          name1 LIKE kna1-name1,
          adrnr LIKE kna1-adrnr,
         END OF client_personal_details.

* To get Client Address Details
  DATA: BEGIN OF client_address OCCURS 0,
          street LIKE adrc-street,
          city1  LIKE adrc-city1,
        END OF client_address.

* To get Client Communication Details
  DATA: BEGIN OF client_communication OCCURS 0,
          fax_number LIKE adrc-fax_number,
          tel_number LIKE adrc-tel_number,
        END OF client_communication.

* Structure to Get the Client Details as in XML format
  DATA: BEGIN OF client OCCURS 0,
          personal_details LIKE TABLE OF client_personal_details,
          address LIKE TABLE OF client_address,
          communication LIKE TABLE OF client_communication,
        END OF client.

http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/frameset.htm

Kindly goto the above link: Check the section - 
             The ABAP Programming language -> 
             Processing large volume of data -> 
             Formatting data -> 
             Refining data using internal Tables.

Kindly assign points if the answer is helpful.

Best regards,

Thangesh

Former Member
0 Kudos
77

tables: kna1, adrc.

  • To get Client Personal Details

DATA: BEGIN OF client_personal_details OCCURS 0,

kunnr LIKE kna1-kunnr,

name1 LIKE kna1-name1,

adrnr LIKE kna1-adrnr,

END OF client_personal_details.

  • To get Client Address Details

DATA: BEGIN OF client_address OCCURS 0,

street LIKE adrc-street,

city1 LIKE adrc-city1,

END OF client_address.

  • To get Client Communication Details

DATA: BEGIN OF client_communication OCCURS 0,

fax_number LIKE adrc-fax_number,

tel_number LIKE adrc-tel_number,

END OF client_communication.

  • Structure to Get the Client Details as in XML format

DATA: BEGIN OF client OCCURS 0,

personal_details LIKE TABLE OF client_personal_details,

address LIKE TABLE OF client_address,

communication LIKE TABLE OF client_communication,

END OF client.

chetan

Former Member
0 Kudos
76

Hi Naveen,

Check this thread.. It has ur answer..

cheers,

Prashanth

P.S Please mark helpful answers

0 Kudos
76

hi,

Do this way ..

 data :begin of itab1 occurs 0,
        matnr like mara-matnr,
        maktx like makt-maktx,
         begin of itab2,
            vbeln like vbap-vbeln,
         end of itab2,    
     end of itab1.

Regards,

Santosh

Former Member
0 Kudos
76

hi,

DATA : BEGIN OF it_mat OCCURS 0,

kdmat TYPE matnr_ku,

INCLUDE STRUCTURE zmat.

DATA : END OF it_mat.

Former Member
0 Kudos
76

Use this……..

REPORT Z001_INTERNAL00 .

TYPES : BEGIN OF IT1,

F1,

F2,

END OF IT1.

DATA:BEGIN OF ITAB1 OCCURS 0,

A LIKE MARA-MATNR,

END OF ITAB1,

F3 TYPE IT1-F1 OCCURS 0 with header line,

F4 type IT1-F2 OCCURS 0 with header line.

DATA:BEGIN OF ITAB OCCURS 0,

F5 LIKE F3,

F6 LIKE F4,

END OF ITAB.

http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9eaa35c111d1829f0000e829fbfe/frameset.htm

thanks

Former Member
0 Kudos
76

data:begin of t_itab1,

matnr like mara-matnr,

maktx like makt-maktx,

end of t_itab1.

data:begin of t_itab2 occurs 0,

werks like marc-werks,

include structure t_itab1,

end of t_itab2.

0 Kudos
76

This is nt working......Its resulting in a syntax error....