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

record missed in a SQL

Former Member
0 Likes
507

hi experts

I run a SQL like :

SELECT UC_POD_EXT

UC_DATEFRO

UC_DATETO

/BIC/ZKWH_MR

/BIC/ZKWH_BILL

/BIC/ZBI_MRCON

FROM /BIC/AZFC_D9900 INTO TABLE LT_BILL

FOR ALL ENTRIES IN SOURCE_PACKAGE

WHERE UC_POD_EXT = SOURCE_PACKAGE-UC_POD_EXT.

SOURCE_PACKAGE only has 1 record, and this reocrd's UC_POD_EXT is 10032789420750421. and it return 31 records.

and I test another SQL like

SELECT UC_POD_EXT

UC_DATEFRO

UC_DATETO

/BIC/ZKWH_MR

/BIC/ZKWH_BILL

/BIC/ZBI_MRCON

FROM /BIC/AZFC_D9900 INTO

corresponding fields of TABLE LT_BILL

WHERE UC_POD_EXT = '10032789420750421'.

it return 34 reocrds

so some records missed in the first SQL, i don't know why.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
477

Please retrive all the key fields of table /BIC/AZFC_D9900, as this is because of FOR ALL ENTRIES CLAUSE (as mentioned by Neil), which will delete duplicate records from the fields you are selecting. Since now you'll retrieve all the key fields of the table /BIC/AZFC_D9900, you are assured of getting unique records.

Regards

Ranganath

hi experts

I run a SQL like :

SELECT UC_POD_EXT

UC_DATEFRO

UC_DATETO

/BIC/ZKWH_MR

/BIC/ZKWH_BILL

/BIC/ZBI_MRCON

FROM /BIC/AZFC_D9900 INTO TABLE LT_BILL

FOR ALL ENTRIES IN SOURCE_PACKAGE

WHERE UC_POD_EXT = SOURCE_PACKAGE-UC_POD_EXT.

SOURCE_PACKAGE only has 1 record, and this reocrd's UC_POD_EXT is 10032789420750421. and it return 31 records.

and I test another SQL like

SELECT UC_POD_EXT

UC_DATEFRO

UC_DATETO

/BIC/ZKWH_MR

/BIC/ZKWH_BILL

/BIC/ZBI_MRCON

FROM /BIC/AZFC_D9900 INTO

corresponding fields of TABLE LT_BILL

WHERE UC_POD_EXT = '10032789420750421'.

it return 34 reocrds

so some records missed in the first SQL, i don't know why.

3 REPLIES 3
Read only

former_member186741
Active Contributor
0 Likes
477

i BELIEVe this is BECAUSE 'FOR ALL ENTRIES' ONLY EVER RETURNS ONE row per output key. i.e no duplicates will appear in the output table. So I think you will find that some of the 34 returned by the secoond sql will have duplicate key entries

Read only

0 Likes
477

thanks for the prompt reply.

but my source package only has 1 record, so "for all entry" will return this record, that's exactly the same as the second SQL.

Read only

Former Member
0 Likes
478

Please retrive all the key fields of table /BIC/AZFC_D9900, as this is because of FOR ALL ENTRIES CLAUSE (as mentioned by Neil), which will delete duplicate records from the fields you are selecting. Since now you'll retrieve all the key fields of the table /BIC/AZFC_D9900, you are assured of getting unique records.

Regards

Ranganath