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: 

duplicate entires because of shared rsnum(reservation number)

Former Member
0 Kudos

Hi,

We are fetching rsnum(reservation numbers) from the table EKET for the given PO(ebeln) number and PO item number(ebelp)

We get 3 rsnum

Now we fetch the item material data from table RESB for the given rsnum which we gave got from EKET.

But for each item material, PO number and PO item number, we get 2 entries and each record will have a different rsnum.

So we get duplicate entries based on the RSNUM.

The item materials(matnr) from table RESB share the RSNUM from EKET table which leads to duplicate entries when we fetch the data from table RESB..

How do we avoid this..Is there any field in RESB which matches with any field in EKET.

Thank You.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Link the tables RESB and EKET with the <b>EBELN and EBELP</b> fields and take RSNUM field and use

<b>Reward points for useful Answers</b>

Regards

Anji

5 REPLIES 5

Former Member
0 Kudos

Hi

Link the tables RESB and EKET with the <b>EBELN and EBELP</b> fields and take RSNUM field and use

<b>Reward points for useful Answers</b>

Regards

Anji

0 Kudos

Hi,

First we are fetching data from EKET table to get the RSNUM for the PO and PO item numbers.

Then we retrieve the item material data from RESB table for the given rsnum. and the rsnum is shared among the materials.

Here is the code snippet

SELECT rsnum

FROM eket

INTO TABLE fp_i_eket

FOR ALL ENTRIES IN fp_i_ekko_ekpo

WHERE ebeln = fp_i_ekko_ekpo-ebeln

AND ebelp = fp_i_ekko_ekpo-ebelp.

We get 3 rsnum and each rsnum have 2 entries each in the below select stmt

SELECT

rsnum "requirements

rspos " Item Number of Reservation / Dependent Requirements

matnr "Material number

werks "Plant

charg "Batch

bdmng "Requirements quantity "IM5185751

meins "Base unit of measure "IM5185751

*Begin of mod-012/MoD-015 " IM5185751

erfmg "Quanity in entry UOM

erfme "Entry unit of measure

  • End of mod-012/MOD-015 " IM5185751

baugr "Pegged Requirement

bwart "Movement type

stlty "BOM Category

stlnr "Bill of material

stlkn "BOM item node number

stpoz "Internal counter

ebeln "PO

ebelp "PO item

stlal "Alternative BOM

ebele "Im7627002

FROM resb

INTO TABLE fp_i_resb

FOR ALL ENTRIES IN fp_i_eket

WHERE

  • begin of mod-001

  • rsnum = fp_i_eket-rsnum and

werks IN s_plant.

Now in resb table we get duplicate entries..

Can you pls tell me where exactly we need to change the code..

Pls reply..

Former Member
0 Kudos

I suppose that u have already fetched data from EKET

now

While fetching data from RESB u can give

where

RSNUM eq EKET-RSNUM and

EBELN eq EKET-EBELN and

EBELP eq EKET-EBELP and

EBELE eq EKET-ETENR.

Rewards points if useful...

Get Back in case of query...

0 Kudos

Hi,

Its still showing 2 entries for each material when we fetch the data from RESB table. Ebeln ebelp and ebele are same for both the entries..

Is there any other field..Pls reply soon

Former Member
0 Kudos

i have another solution

after you have got data of EKPO

u can select data from RESB and EKET with a join as

RESB and EKPO hav MATNR WERKS and LGORT as common fields

select .....

into...

from RESB inner-join EKET

on

RESBRSNUM = EKETRSNUM and

RESBEBELN = EKETEBELN and

RESBEBELP = EKETEBELP and

RESBEBELE = EKETETENR

where

RESB~MATNR = fp_i_ekko_ekpo-MATNR and

RESB~werks = fp_i_ekko_ekpo-werks and

resb~LGORT = fp_i_ekko_ekpo-lgort and

RESB~werks in s_plant.

Reward points if useful...

Get Back in case of query