DATA: BEGIN OF itab OCCURS 0,
vkorg LIKE knvv-vkorg, "销售组织
vtweg LIKE knvv-vtweg, "分销渠道
spart LIKE knvv-spart, "产品线
kunnr LIKE kna1-kunnr, "客户编码
name1 LIKE kna1-name1, "客户名称1
name2 LIKE kna1-name2, "客户名称2
zterm LIKE knvv-zterm, "客户帐期
kdgrp LIKE knvv-kdgrp, "客户组
vwerk LIKE knvv-vwerk, "工厂
telf1 LIKE kna1-TELF1, "电话
telfx LIKE kna1-telfx, "传真
str_suppl3 LIKE adrc-str_suppl3, "客户地址二
stras LIKE kna1-stras, "客户地址一
regio LIKE kna1-regio, "地区 (州、省、县)
namev LIKE knvk-namev, "联系人
bzirk LIKE knvv-bzirk, "销售地区
sort2 LIKE adrc-sort2, "在途帐期
datum LIKE sy-datum, "客户账期-在途账期
END OF itab.
TYPES:BEGIN OF ty_itab ,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
name2 TYPE kna1-name2,
telf1 TYPE kna1-telf1,
telfx TYPE kna1-telfx,
stras TYPE kna1-stras,
regio TYPE kna1-regio,
END OF ty_itab.
DATA:w_repid LIKE sy-repid,
wa_variant LIKE disvariant, "显示变式结构
wa_layout TYPE slis_layout_alv, "alv的格式
wa_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE TABLE OF slis_fieldcat_alv,
gt_events TYPE slis_t_event,
gs_event LIKE LINE OF gt_events,
gt_fieldcat_list TYPE lvc_t_fcat,
gw_fieldcat TYPE lvc_s_fcat,
gt_sort TYPE lvc_t_sort,
gs_sort TYPE lvc_s_sort,
gt_event_exit TYPE slis_t_event_exit,
gs_layout TYPE lvc_s_layo.
DATA: l_repid LIKE sy-repid.
DEFINE fill_field_list.
APPEND gw_fieldcat TO gt_fieldcat_list.
CLEAR gw_fieldcat.
END-OF-DEFINITION.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: so_vkorg FOR knvv-vkorg."销售组织
SELECT-OPTIONS: so_vtweg FOR knvv-vtweg."分销渠道
SELECT-OPTIONS: so_spart FOR knvv-spart."产品线
SELECT-OPTIONS: so_kunnr FOR kna1-kunnr."客户编码
SELECT-OPTIONS: so_name1 FOR kna1-name1."客户名称
SELECTION-SCREEN END OF BLOCK b1.
END-OF-SELECTION.
IF itab[] IS NOT INITIAL.
PERFORM frm_display_data.
ELSE.
MESSAGE'NO SUITABLE DATA WAS SELECTED,PLEASE CHECK YOUR INPUT'TYPE'I'.
ENDIF.
FORM frm_get_data.
* SELECT kunnr name1 name2 telf1 telfx stras regio
* INTO CORRESPONDING FIELDS OF TABLE itab
* FROM kna1
* WHERE kunnr IN so_kunnr
* AND name1 IN so_name1.
SELECT
knvv~vkorg
knvv~vtweg
knvv~spart
kna1~kunnr
kna1~name1
kna1~name2
knvv~zterm
knvv~kdgrp
knvv~vwerk
kna1~TELF1
kna1~telfx
adrc~str_suppl3
kna1~stras
kna1~regio
knvk~namev
knvv~bzirk
adrc~sort2
INTO CORRESPONDING FIELDS OF TABLE itab
FROM kna1 INNER JOIN knvv ON kna1~kunnr = knvv~kunnr
INNER JOIN adrc ON kna1~adrnr = adrc~ADDRNUMBER
INNER JOIN knvk ON kna1~adrnr = knvk~adrnd
WHERE knvv~vkorg in so_vkorg and
knvv~vtweg in so_vtweg and
knvv~spart in so_spart and
kna1~kunnr in so_kunnr and
kna1~name1 in so_name1.
ENDFORM.
ABP_SD_客户主数据查询报表.rar
2016-10-17 22:45 上传
点击文件名下载附件
下载积分: 雨露 -1 滴5.15 KB, 下载次数: 15, 下载积分: 雨露 -1 滴