Skip to Content
0
Jun 28, 2016 at 11:34 AM

Need Small query Help.

18 Views

hi,

I have one ZZ field in Purchase order header And also At line level.

In selection Screen i had put ZZ field if i Enter the ZZ field, The records Which are Available At header or Rows will be come into

Internal table.

Some times header is having some value like 'project1'.

If i give in the selection Screen Header part Satisfies but Or part is picking unnecessary data. Because there is No Row level Data.

How could i get , Data will be Available in both the fields some times. Some times only at header, Some times only at row level.

How could i get the Exact data.The below one is my query.

SELECT a~ebeln

a~bsart

a~wkurs

a~lifnr

a~aedat

a~zzprojectnumber AS hzzprojectnumber

a~zzprojectname AS hzzprojectname

b~zzprojectnumber AS izzprojectnumber

b~zzprojectname AS izzprojectname

a~waers

a~knumv

a~ekgrp

b~ebelp

b~menge

b~netpr

b~matnr

b~meins

b~banfn

b~bnfpo

b~werks

b~loekz

b~peinh

b~knttp "Adding On 28-05-2016.

b~txz01 INTO CORRESPONDING FIELDS OF TABLE it_final[]

FROM ekko AS a

INNER JOIN ekpo AS b ON b~ebeln = a~ebeln

* INNER JOIN EKKN AS D ON D~EBELN = A~EBELN " NEW LINE

WHERE ( a~ebeln IN s_ebeln

AND a~bsart IN s_bsart

AND a~ekgrp IN s_ekgrp "Added On 06-06-2016

AND a~lifnr IN s_lifnr

AND a~aedat IN s_date

* AND a~zzprojectnumber IN s_prjnum

* OR b~zzprojectnumber IN s_prjnum "Addin On 28-06-2016

AND b~matnr IN s_matnr

AND b~banfn IN s_banfn

AND b~bnfpo IN s_bnfpo

AND b~werks IN s_werks

AND a~zzprojectnumber IN s_prjnum )

OR ( b~zzprojectnumber in s_prjnum ). "Addin On 28-06-2016