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

program to update po item condition

Former Member
0 Likes
300

Can someone provide help on how to improve on this select:

SELECT

b~EBELN

b~EBELP

b~matnr

b~ematn

b~meins

a~aedat

b~werks

c~name1

netpr

iNTO TABLE GT_EKPO

FROM EKPO AS B INNER JOIN EKKO AS A ON AEBELN eq bEBELN

inner join t001w as c on bwerks eq cwerks

for all entries in gt_mard

WHERE a~aedat in s_aedat

and a~reswk eq p_werks "supplying site = DC

and a~ebeln in s_ebeln

and a~loekz eq space

and a~ekgrp in s_ekgrp

and b~matnr eq gt_mard-matnr

and b~werks in s_werks

and b~loekz eq space.

Rgds.

Can someone provide help on how to improve on this select:

SELECT

b~EBELN

b~EBELP

b~matnr

b~ematn

b~meins

a~aedat

b~werks

c~name1

netpr

iNTO TABLE GT_EKPO

FROM EKPO AS B INNER JOIN EKKO AS A ON AEBELN eq bEBELN

inner join t001w as c on bwerks eq cwerks

for all entries in gt_mard

WHERE a~aedat in s_aedat

and a~reswk eq p_werks "supplying site = DC

and a~ebeln in s_ebeln

and a~loekz eq space

and a~ekgrp in s_ekgrp

and b~matnr eq gt_mard-matnr

and b~werks in s_werks

and b~loekz eq space.

Rgds.

1 REPLY 1
Read only

Former Member
0 Likes
267

First point : For reading Plant text. i suggest you do a separate select and then read. dont pull this into this join.

Change the join like this.

MARD select should have already taken care of filtering by s_werks and s_matnr. So this need not be used again...

SELECT

ekko~EBELN

ekpo~EBELP

ekpo~matnr

ekpo~ematn

ekpo~meins

ekko~aedat

ekpo~werks

ekpo~netpr

iNTO TABLE GT_EKPO

FROM EKPO

INNER JOIN EKKO

ON EKKOEBELN eq EKPOEBELN

for all entries in gt_mard

WHERE ekko~aedat in s_aedat

and ekko~reswk eq p_werks

and ekko~ebeln in s_ebeln

and ekko~loekz eq space

and ekko~ekgrp in s_ekgrp

and ekpo~matnr eq gt_mard-matnr

and ekpo~werks eq gt_mard-matnr

and ekpo~loekz eq space.

Always better to use the smaller table for comparison , like use EKKO for comparison as the primary table and EKPO as secondary...

Reward if helps...