Application Development and Automation 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: 
Read only

internal tables

Former Member
0 Likes
450

i have 2 internal tables it1,it2 in which 2 fields matnr,werks are repeating.then how ihave to declare it1,it2?

i.e it1 has matnr,werks,maktx and it2 has matnr,werks,ebeln,ebelp,meins.

4 REPLIES 4
Read only

Former Member
0 Likes
430

HI,

data: begin of it1 occurs 0,
matnr like mara-matnr,
werks like mara-werks,
maktx like makt-maktx,
end of it1.

data: begin of it2 occurs 0,
matnr like marc-matnr,
werks like marc-werks,
ebeln like ekko-ebeln,
ebelp like ekpo-ebelp,
meins like ekpo-meins,
end of it2.


data: begin of it_final occurs 0,
matnr like mara-matnr,
werks like mara-werks,
maktx like makt-maktx,
ebeln like ekko-ebeln,
ebelp like ekpo-ebelp,
meins like ekpo-meins,
end of it_final.

Regards,

S.Nehru.

Read only

Former Member
0 Likes
430

HI

data: begin of it1 occurs 0,

matnr like mara-matnr,

werks like mara-werks,

maktx like makt-maktx,

end of it1.

data: begin of it2 occurs 0,

matnr like marc-matnr,

werks like marc-werks,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

meins like ekpo-meins,

end of it2.

data: begin of it_collection occurs 0,

matnr like mara-matnr,

werks like mara-werks,

maktx like makt-maktx,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

meins like ekpo-meins,

end of it_collection.

Plz Rewards points if useful,

Regards,

Ganesh.

Read only

Former Member
0 Likes
430

hai,

Declare two Different structure with corresponding fields

or put matnr werks in single structure and include it in the both structures

and declare internal table type of corresponding structure

data: begin of x_it1 ,

matnr like mara-matnr,

werks like mara-werks,

maktx like makt-maktx,

end of x_it1.

data: begin of x_it2 ,

matnr like marc-matnr,

werks like marc-werks,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

meins like ekpo-meins,

end of x_it2.

data: it1 type standard table of x_it1_type with header line,

it2 type standard table of x_it2 with header line.

thanks & Regards

Sarath p

Edited by: sarath p on Apr 17, 2008 9:01 AM

Read only

prasanth_kasturi
Active Contributor
0 Likes
430

i did not understand your problem

as the internal tables are different your way to access the fields in the internal tables will be different

it1 has matnr,werks,maktx and it2 has matnr,werks,ebeln,ebelp,meins

declare like this.

data : begin of it1 occurs 0,

matnr like mara-matnr,

werks type WERKS_D,

maktx type maktx,

end of it1.

data: begin of it2 occurs 0,

matnr like marc-matnr,

werks like marc-werks,

ebeln like ekko-ebeln,

ebelp like ekpo-ebelp,

meins like ekpo-meins,

end of it2.

when you acess the fields from first table you write as it1-matnr

and from second as it2-matnr so both are different