‎2007 Jun 20 11:53 PM
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.
‎2007 Jun 20 11:57 PM
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.
‎2007 Jun 20 11:57 PM
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.
‎2007 Jun 21 12:10 AM
Hi Alvaro,
The logic what u told will get Multiple entries of BELNR's in REGUP table.
Thanks,
Gopi.
‎2007 Jun 21 12:15 AM
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.
‎2007 Jun 21 12:21 AM
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.
‎2007 Jun 21 12:31 AM
Sure -:) It will work -;) Just add BUKRS and all fields that match both tables...
Greetings,
Blag.
‎2007 Jun 21 12:06 AM
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>