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: 

For All Entries

Former Member
0 Kudos

Hi Guys,

I need every record of REGUP into my Final Internal table based on condition where BELBR of BKPF equals to REGUP-BELNR

(I need Dupicates also if there are in REGUP Of BELNR.) This is my Requirement.Does the below logic i mean For All Entries satisfies the above Requirement?

SELECT *

INTO TABLE il_REGUP

FROM REGUP

FOR ALL ENTRIES IN il_BKPF_header

WHERE BELNR EQ il_BKPF_header-BELNR.

Thanks,

Gopi.

9 REPLIES 9

Former Member
0 Kudos

Yes it will.

Because FOR ALL ENTRIES do not remove duplicate entries on the basis of the single field BELNR, it will compare the whole record.

reward points if useful

Former Member
0 Kudos

Hi Gopi,

This query will work and you will get all the records.

just add one more condition to the query.

<b>if NOT il_BKPF_header[] is initial.</b>

SELECT *

INTO TABLE il_REGUP

FROM REGUP

FOR ALL ENTRIES IN il_BKPF_header

WHERE BELNR EQ il_BKPF_header-BELNR.

<b>ENDIF.</b>

Reward points if useful.

Regards,

Atish

0 Kudos

Hi Guys,

Thanks for your response.When i am running this one its taking so much of time its already 10 mins still it didnot get completed .

Can you suggest why its like that?

Thanks,

Gopi.

0 Kudos

Hi gopi,

1. You have not given the whole key of REGUP in where clause.

2. There may be lots of entry in your BKPF internal table

3. You are selecting all the fields from REGUP.

These all can be the parameters for the program taking long time.

Regards,

Atish

0 Kudos

Hi Atish,

I Didn't get ur 1st point.Can u explain me?

I will agree with ur 2nd and 3rd points.

The program started 20mins back still its running.I dont know why its like that but this logic worked for RBKP .

Thanks,

Gopi.

0 Kudos

Hi Gopi,

If you look at the REGUP table it has around 10-12 keys out of which you have only provided one (BELNR). The performance of the select improves only if you have all the keys or at least most of them in the where clause of the query.

Reward points if useful.

Regards,

Atish

0 Kudos

Hi Atish,

I wrote the logic like this

SELECT *

INTO TABLE il_REGUP

FROM REGUP

FOR ALL ENTRIES IN il_BKPF_header

WHERE ( BELNR EQ il_BKPF_header-BELNR and GJAHR EQ il_BKPF_header-GJAHR and BUKRS EQ il_BKPF_header-BUKRS ).

I think this will increase the performance.But what my problem is i have to dump the data from REGUP table based on daily Date Becoz this program is a delta Program.REGUP tables doesn't have Created date and Changed date so thats why i am 1st dumping the data into BKPF table based on Date and Based on that Interna Table i have to get all the records of REGUP which are changed or Created.Si i wrote Logic like this .Can you Give me any suggestion's whether what i am doing is correct or not?

Thanks,

Gopi.

former_member194669
Active Contributor
0 Kudos

Check REGUP for BUDAT & BLDAT

aRs

0 Kudos

Hi aRs,

Check BUDAT and BLDAT for what?U mean created date and Updated date. If is so they are not created date and Updated date?or For keeping in Where condition of? select statement?

Thanks,

Gopi.