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

REGUP table?

Former Member
0 Likes
859

Hi Guys,

I am having BKPF Internal table.I have to get the data from REGUP based on BKPF-BELNR.Can anybody tell me how to get the data based on BELNR of BKPF table.Plz Reply.

Thanks,

Gopi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
784


CHECK NOT T_BKPF[] IS INITIAL.

SELECT *
INTO TABLE T_REGUP
FROM REGUP
FOR ALL ENTRIES IN T_BKPF
WHERE BELNR EQ T_BKPF-BELNR.

Greetings,

Blag.

6 REPLIES 6
Read only

Former Member
0 Likes
785


CHECK NOT T_BKPF[] IS INITIAL.

SELECT *
INTO TABLE T_REGUP
FROM REGUP
FOR ALL ENTRIES IN T_BKPF
WHERE BELNR EQ T_BKPF-BELNR.

Greetings,

Blag.

Read only

0 Likes
784

Hi Alvaro,

The logic what u told will get Multiple entries of BELNR's in REGUP table.

Thanks,

Gopi.

Read only

0 Likes
784

Of course, when you use FOR ALL ENTRIES, you take all BELNR records from your BKPF Internal table and use all of them to gather info from REGUP....

If you got duplicated entries, simply do...


SORT T_REGUP BY BELNR.
DELETE ADJACENT DUPLICATES FROM T_REGUP.

If you only need one record...do this....


READ TABLE T_BKPF INDEX 1.
*Or use WITH KEY....

SELECT *
INTO TABLE T_REGUP
FROM REGUP
WHERE BELNR EQ T_BKPF-BELNR.

Greetings,

Blag.

Read only

0 Likes
784

Hi Alvaro,

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.) This is my Requirement.Does Your logic i mean For All Entries satisfied the above Requirement?

Thanks,

Gopi.

Read only

0 Likes
784

Sure -:) It will work -;) Just add BUKRS and all fields that match both tables...

Greetings,

Blag.

Read only

Former Member
0 Likes
784

You can join the two tables with the same values in the following fields in both tables.

BUKRS - Company Code

BELNR - Acct.doc.number

GJAHR - Fiscal year

<b>Points are always welcome!</b>