Code: Alles auswählen.
SELECT v_eq~zz_maschnum v_eq~typbz v_eq~zz_prodlinie v_eq~zz_prodtyp
v_eq~zz_baureihe v_eq~zz_baugroesse v_eq~eqktx v_eq~equnr
v_eq~tplnr v_eq~baujj v_eq~stort ifo~objnr ihpa~parnr
from v_equi as v_eq
JOIN iflot as ifo on ifo~tplnr = v_eq~tplnr
JOIN ihpa on ihpa~objnr = ifo~objnr
INTO CORRESPONDING FIELDS OF TABLE gt_collect
WHERE v_eq~equnr in so_sapnr
and v_eq~tplnr in so_saptp.
Code: Alles auswählen.
READ TABLE gt_ihpa INTO gs_ihpa with KEY objnr = <fs_collect>-objnr.
if sy-subrc = 0.
<fs_collect>-parnr = gs_ihpa-parnr.
ENDIF.
Code: Alles auswählen.
<fs_collect>-parnr = VALUE #( gt_ihpa [ objnr = <fs_collect>-objnr ]-parnr OPTIONAL ).
Folgende Benutzer bedankten sich beim Autor DeathAndPain für den Beitrag:
L0w-RiDer
Code: Alles auswählen.
SELECT v_eq~zz_maschnum v_eq~typbz v_eq~zz_prodlinie v_eq~zz_prodtyp
v_eq~zz_baureihe v_eq~zz_baugroesse v_eq~eqktx v_eq~equnr
v_eq~tplnr v_eq~baujj v_eq~stort ifo~objnr
from ( v_equi as v_eq INNER JOIN iflot as ifo on v_eq~tplnr = ifo~tplnr )
INTO CORRESPONDING FIELDS OF TABLE gt_collect
WHERE v_eq~equnr in so_sapnr
and v_eq~tplnr in so_saptp
select objnr parnr
from ihpa
INTO TABLE gt_ihpa
for ALL ENTRIES IN gt_collect
WHERE objnr = gt_collect-objnr.
loop at gt_collect ASSIGNING <fs_collect>.
READ TABLE gt_ihpa INTO gs_ihpa with KEY objnr = <fs_collect>-objnr.
if sy-subrc = 0.
<fs_collect>-parnr = gs_ihpa-parnr.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
define view zmaintenance_partner as select from v_equi as v_eq inner join to iflot as ifo on v_eq~tplnr = ifo~tplnr
association to ihpa as pa on pa.objnr = ifo.objnr {
v_eq.zz_maschnum,
v_eq.typbz,
v_eq.zz_prodlinie,
v_eq.zz_prodtyp,
v_eq.zz_baureihe,
v_eq.zz_baugroesse,
v_eq.eqktx,
v_eq.equnr,
v_eq.tplnr,
v_eq.baujj,
v_eq.stort,
ifo.objnr,
cast( pa.parnr as abap.char(10) ) as partner_no
}
Code: Alles auswählen.
SELECT kunnr vkgrp
from knvv
INTO TABLE gt_knvv
FOR ALL ENTRIES IN gt_collect
WHERE kunnr = gt_collect-parnr(10).
loop at gt_collect ASSIGNING <fs_collect>.
READ TABLE gt_knvv INTO gs_knvv with KEY kunnr = <fs_collect>-parnr.
if sy-subrc = 0.
<fs_collect>-kunnr = gs_knvv-kunnr.
<fs_collect>-vkgrp = gs_knvv-vkgrp.
else.
if <fs_collect>-parnr <> ''.
delete gt_collect.
endif.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
define view zmaintenance_sales_group as select from zmaintenance_partner as pa inner join to knvv as sg on sg.kunnr = pa.parnr {
pa.zz_maschnum,
pa.typbz,
pa.zz_prodlinie,
pa.zz_prodtyp,
pa.zz_baureihe,
pa.zz_baugroesse,
pa.eqktx,
pa.equnr,
pa.tplnr,
pa.baujj,
pa.stort,
pa.objnr,
sg.kunnr,
sg.vkgrp
}
Folgende Benutzer bedankten sich beim Autor DeathAndPain für den Beitrag:
L0w-RiDer