Untitled

mail@pastecode.io avatar
unknown
abap
2 years ago
2.3 kB
1
Indexable
Never

* END   - JESUSE2 · Inetum · ENJ - Defect #114382 - 12-09-2022

  SELECT a~flow_type, a~werks, b~matnr, b~arktx, b~kwmeng, b~vrkme, c~auart,
    a~vbeln, a~posnr, c~kunnr AS sold_to, d~name1 AS sold_to_name, c~vkorg, c~vtweg, c~spart,
    e~gbstk, b~abgru, a~banfn, a~bnfpo, f~menge AS menge_pr, f~meins AS meins_pr, f~loekz AS loekz_pr,
    a~ebeln, a~ebelp, g~menge AS menge_po, g~meins AS meins_po, g~loekz AS loekz_po, a~wf_status,
    a~msg1, a~creation_date, a~change_date, a~wi_id,
* BEGIN - JESUSE2 · Inetum · ENJ - Defect #114382 - 12-09-2022
    h~cmgst, c~vkgrp, i~edatu, i~wadat as so_gi_date, j~eindt as so_del_date,
    j~wadat as po_gi_date, j~mbdat, l~dispo, a~remark, b~zzordtxt
* END   - JESUSE2 · Inetum · ENJ - Defect #114382 - 12-09-2022
    INTO TABLE @DATA(lt_main_data)
  FROM zgl_resale_dashb AS a
    LEFT JOIN vbap AS b
    ON  a~vbeln = b~vbeln
    AND a~posnr = b~posnr
    LEFT JOIN vbak AS c
    ON b~vbeln = c~vbeln
    LEFT JOIN kna1 AS d
    ON c~kunnr = d~kunnr
    LEFT JOIN vbuk AS e
    ON b~vbeln = e~vbeln
    LEFT JOIN eban AS f
    ON a~banfn = f~banfn
    AND a~bnfpo = f~bnfpo
    LEFT JOIN ekpo AS g                                "#EC CI_BUFFJOIN
    ON f~ebeln = g~ebeln
    AND f~ebelp = g~ebelp
* BEGIN - JESUSE2 · Inetum · ENJ - Defect #114382 - 12-09-2022
    left join ekko as x
    on f~ebeln = x~ebeln
    left join vbuk as h
    on  a~vbeln eq h~vbeln
    left join vbep as i
    on  a~vbeln eq i~vbeln
    and a~posnr eq i~posnr
    left join eket as j
    on  f~ebeln eq j~ebeln
    and f~ebelp eq j~ebelp
    left join marc as l
    on  b~matnr eq l~matnr
    and b~werks eq l~werks
* END   - JESUSE2 · Inetum · ENJ - Defect #114382 - 12-09-2022
    WHERE a~werks IN @s_werks
      AND b~matnr IN @s_matnr
      AND c~kunnr IN @s_kunnr
      AND c~vkorg IN @s_vkorg
      AND c~vtweg IN @s_vtweg
      AND c~spart IN @s_spart
      AND a~creation_date IN @s_cred
      AND a~wf_status IN @s_stat
* BEGIN - JESUSE2 · Inetum · ENJ - Defect #114382 - 12-09-2022
      and bmeng   gt 0
* BEGIN - JESUSE2 · Inetum · ENJ - Defect #114382 - 07-11-2022
      and x~aedat in @s_zerdat " STO creation date
      and c~vkgrp in @s_vkgrp .  " Sales group
* END   - JESUSE2 · Inetum · ENJ - Defect #114382 - 07-11-2022
  .
* END   - JESUSE2 · Inetum · ENJ - Defect #114382 - 12-09-2022