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

Values not populating..

former_member192432
Participant
0 Likes
872

Hi

In below code the values are not populating in gt_ekes table .

I checked gt_ekpo is having values for some values of EKES table eventhough the condition is not satisfying and sy-subrc becomes 4 afetr select from ekes statement . I am cheking Quality .

SELECT * FROM ekko INTO TABLE gt_ekko WHERE

ebeln IN ebeln AND

bstyp = 'F' AND

loekz = ' ' AND

aedat IN aedat AND

lifnr IN lifnr AND

ekorg IN ekorg AND

ekgrp IN ekgrp

%_HINTS

ORACLE '&SUBSTITUTE VALUES&'.

SELECT * FROM ekpo INTO TABLE gt_ekpo_all

FOR ALL ENTRIES IN gt_ekko WHERE

ebeln EQ gt_ekko-ebeln

AND loekz = ' '

AND matnr IN matnr

AND werks IN werks

AND bednr IN bednr.

gt_ekpo[] = gt_ekpo_all[].

DELETE gt_ekpo WHERE knttp NE ' '.

SELECT * FROM ekes INTO TABLE gt_ekes FOR ALL ENTRIES IN gt_ekpo

WHERE ebeln = gt_ekpo-ebeln AND

ebelp = gt_ekpo-ebelp AND

EBTYP IN ('OA','AB').

After above statement the values are not populating into gt_ekes .

Can any one tell me the reason .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
826

Hi,

I prefer an inner join with the table EKPO ( left ) using the secondary index 1 matnr join with EKKO with EBELN . Anymore you must control the result of first select EKKO before you second select EKPO .

SELECT * FROM ekko INTO TABLE gt_ekko WHERE

ebeln IN ebeln AND

bstyp = 'F' AND

loekz = ' ' AND

aedat IN aedat AND

lifnr IN lifnr AND

ekorg IN ekorg AND

ekgrp IN ekgrp

%_HINTS

ORACLE '&SUBSTITUTE VALUES&'.

if not gt_ekko is initial.

SELECT * FROM ekpo INTO TABLE gt_ekpo_all

FOR ALL ENTRIES IN gt_ekko WHERE

ebeln EQ gt_ekko-ebeln

AND loekz = ' '

AND matnr IN matnr

AND werks IN werks

AND bednr IN bednr.

endif.

And so on...

Regards.

4 REPLIES 4
Read only

Former Member
0 Likes
827

Hi,

I prefer an inner join with the table EKPO ( left ) using the secondary index 1 matnr join with EKKO with EBELN . Anymore you must control the result of first select EKKO before you second select EKPO .

SELECT * FROM ekko INTO TABLE gt_ekko WHERE

ebeln IN ebeln AND

bstyp = 'F' AND

loekz = ' ' AND

aedat IN aedat AND

lifnr IN lifnr AND

ekorg IN ekorg AND

ekgrp IN ekgrp

%_HINTS

ORACLE '&SUBSTITUTE VALUES&'.

if not gt_ekko is initial.

SELECT * FROM ekpo INTO TABLE gt_ekpo_all

FOR ALL ENTRIES IN gt_ekko WHERE

ebeln EQ gt_ekko-ebeln

AND loekz = ' '

AND matnr IN matnr

AND werks IN werks

AND bednr IN bednr.

endif.

And so on...

Regards.

Read only

Former Member
0 Likes
826

could you rephrase your problem,

use the debugger and check the number of entries in the internal tables after each step.

Use the SE16 to check the problematic step with one example.

Read only

Former Member
0 Likes
826
SELECT * FROM ekko INTO TABLE gt_ekko WHERE
ebeln IN ebeln AND
bstyp = 'F' AND
loekz = ' ' AND
aedat IN aedat AND
lifnr IN lifnr AND
ekorg IN ekorg AND
ekgrp IN ekgrp
%_HINTS
ORACLE '&SUBSTITUTE VALUES&'.

if gt_ekko is not initial . "add this
SELECT * FROM ekpo INTO TABLE gt_ekpo_all
FOR ALL ENTRIES IN gt_ekko WHERE
ebeln EQ gt_ekko-ebeln
AND loekz = ' '
AND matnr IN matnr
AND werks IN werks
AND bednr IN bednr.

endif. "add this
gt_ekpo] = gt_ekpo_all[.
DELETE gt_ekpo WHERE knttp NE ' '.

if gt_ekpo  is not initial . "add this i think the problem is here it might be initial

SELECT * FROM ekes 
INTO TABLE gt_ekes 
FOR ALL ENTRIES IN gt_ekpo
WHERE ebeln = gt_ekpo-ebeln AND
ebelp = gt_ekpo-ebelp AND
EBTYP IN ('OA','AB').

endif.

Nafran

Read only

Former Member
0 Likes
826

> DELETE gt_ekpo WHERE knttp NE ' '.

this is wrong, add it to the WHERE condition.

It will speed up the search, but it will reduce the result set and speed up the data transfer