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: 

2 internal tabels

Former Member
0 Kudos

Dear all,

i select from the EKPO the PO number, PO position, material and quantity and write this into a internal table.

Now i want to select form EKET the delivery date only for the materials which are in my first internal table.

Thats my declatrion


DATA: iekpo type standard table of ekpo,
      zekpo type ekpo,
      ieket type standard table of eket,
      zeket type eket,
      imenge like ekpo-menge,
      i_menge(6) type c,
      izaehler1 type n,
      ztest,
      i_beleg like eket-ebeln,
      i_pos like eket-ebelp.

FIELD-SYMBOLS: <fs_menge1> TYPE ANY.
FIELD-SYMBOLS: <fs_beleg1> TYPE ANY.
FIELD-SYMBOLS: <fs_pos1> TYPE ANY.

.
.
.

* fill table from IEKET delivery date
loop at iekpo into zekpo.
i_beleg = 'EBELN'.
i_pos = 'EBELP'.
ASSIGN COMPONENT i_beleg OF STRUCTURE zekpo TO <fs_beleg1>.
ASSIGN COMPONENT i_pos OF STRUCTURE zekpo TO <fs_pos1>.
SELECT ebeln ebelp eindt
FROM eket
INTO CORRESPONDING FIELDS OF TABLE ieket
WHERE ebeln = <fs_beleg1> AND
ebelp = <fs_pos1>.
endloop.

Now i get a short dump: "Data objects in Unicode programs cannot be converted" at the seleciton line at the "Select ebeln ..." line

What is my mistake there.

For sure there is a better way to do this but i am a ABAP newbie.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI ,

firstly u make the two internal table t_ekpo of some required field and then agian make a internal table t_eket with required field

1) now select required data from EKPO table .

2) after that data select from EKET for all entries in table EKPO based on ebeln and ebelp

syntax is below for (2)

if t_ekpo is not initial.

select * from eket into t_eket

for all entries in table t_ekpo

where ebeln = t_ekpo-ebeln

and ebelp = t_ekpo-ebelp.

endif.

Try this .........................

Hopes it works

Thanks

Shambhu

4 REPLIES 4

Former Member
0 Kudos

Hi ,

Initially select data from EKPO table and then use for all entries on EKET table and read table into final internal table.

Regards,

Vijay

MarcinPciak
Active Contributor
0 Kudos

Hi,

Try with FOR ALL ENTRIES, instead of querying DB each time in a loop.


SELECT ebeln ebelp eindt
FROM eket
INTO CORRESPONDING FIELDS OF TABLE ieket
FOR ALL ENTRIES IN iekpo
WHERE ebeln = iekpo-ebeln AND
ebelp = iekpo-ebelp.

Regards

Marcin

Former Member
0 Kudos

Hi,

Instead of selecting the data from EKET in the Loop of iekpo. You can use the FOR ALL ENTRIES statement.

SELECT ebeln ebelp eindt
FROM eket
INTO CORRESPONDING FIELDS OF TABLE ieket
FOR ALL ENTRIES in iekpo
WHERE ebeln = iekpo-ebeln AND
ebelp = iekpo-ebelp.

After getting the data in IEKET 

loop at iekpo into zekpo.
 " Read table IEKET usinh wbwln & ebelp to fetch the delivery date.
endloop.

This improves the performance of the program.

Former Member
0 Kudos

HI ,

firstly u make the two internal table t_ekpo of some required field and then agian make a internal table t_eket with required field

1) now select required data from EKPO table .

2) after that data select from EKET for all entries in table EKPO based on ebeln and ebelp

syntax is below for (2)

if t_ekpo is not initial.

select * from eket into t_eket

for all entries in table t_ekpo

where ebeln = t_ekpo-ebeln

and ebelp = t_ekpo-ebelp.

endif.

Try this .........................

Hopes it works

Thanks

Shambhu