on ‎2024 Jun 28 11:53 AM
Hello experts,
Can you help me join these 3 tables?
SELECT ebeln
bsart
FROM ekko
INTO TABLE it_ekko
WHERE bsart = 'ZLSR'.
IF it_ekko IS NOT INITIAL.
SELECT ebeln,
ebelp,
matnr,
werks,
menge,
bwtty,
bwtar
FROM ekpo
FOR ALL ENTRIES IN @IT_ekko
WHERE ebeln = @IT_ekko-ebeln
INTO TABLE @IT_ekpo.
IF it_ekpo IS NOT INITIAL.
SELECT stprs,
matnr,
bwkey,
bwtar,
bwtty
FROM mbew
FOR ALL ENTRIES IN @IT_ekpo
WHERE matnr = @IT_ekpo-matnr
AND bwkey = @IT_ekpo-werks
INTO TABLE @IT_mbew.
IF sy-subrc = 0.
ENDIF.
ENDIF.
ENDIF.I've already tried this and it's not getting the right record.
SELECT c~stprs,
c~matnr,
c~bwkey,
c~bwtar,
c~bwtty
FROM ekko AS A
INNER JOIN ekpo AS b
ON a~ebeln = b~ebeln
INNER JOIN mbew AS c
ON c~matnr = b~matnr
AND c~bwkey = b~werks
WHERE a~bsart = 'ZLSR'
INTO TABLE @DATA(it_temp).With using the first code sample IT_MBEW gets 41 records while using the 2nd code sample, IT_TEMP gets 112 records.
Request clarification before answering.
You can add T001W so that your code will also other options of Customizing (as suggested by @KjetilKilhavn.
But also check for MM Customizing : Split Valuation, you can get multiple valuation per plant (e.g. new/used and a total record) and you don't provide enough fields in the join.
What exactly are you looking for in MBEW?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.