UI基础一:简单的BOL查询
利用标准的BOL编辑工具,添加BOL对象,重写查询方法,实现简答的BOL查询
1.SE11创建查询对象结构:
2.SE11创建查询结果对象:
3.SE24新建处理类:
重写查询结果方法:
METHOD IF_GENIL_APPL_INTLAY~GET_DYNAMIC_QUERY_RESULT.
TYPES:BEGIN OF TY_ADM,
GUID_H TYPE CRMT_OBJECT_GUID, "销售订单
OBJECT_ID TYPE CRMT_OBJECT_ID_DB,
OBJECT_ID_H TYPE CRMT_OBJECT_ID_DB, "销售订单
ZZZTRACKRETURN TYPE ZTRACKRETURN, "销售订单-发回运单号
GUID_D TYPE CRMT_OBJECT_GUID, "维修工单
OBJECT_ID_D TYPE CRMT_OBJECT_ID_DB, "维修工单
END OF TY_ADM,
BEGIN OF TY_PARTNER,
GUID_HI TYPE CRMT_OBJECT_GUID,
GUID_SET TYPE CRMT_OBJECT_GUID,
PARTNER_NO TYPE CRMT_PARTNER_NO,
PARTNER TYPE BU_PARTNER,
BU_SORT1 TYPE BU_SORT1,
END OF TY_PARTNER,
BEGIN OF TY_ITEM,
HEADER TYPE CRMT_OBJECT_GUID, "销售订单
PRODUCT TYPE CRMT_PRODUCT_GUID_DB,
ORDERED_PROD TYPE CRMT_ORDERED_PROD_DB,
NUMBER_INT TYPE CRMT_ITEM_NO,
ITM_TYPE TYPE CRMT_ITEM_TYPE_DB,
QUANTITY TYPE CRMT_SCHEDLIN_QUAN,
END OF TY_ITEM,
BEGIN OF TY_RESU,
GUID_H TYPE CRMT_OBJECT_GUID,
OBJECT_ID TYPE CRMT_OBJECT_ID_DB,
CREATED_AT TYPE COMT_CREATED_AT_USR,
ZZZMODENO TYPE ZMODENO,
ZZCLIENT_TYPE TYPE ZADTEL000056,
PO_NUMBER_SOLD TYPE CRMT_PO_NUMBER_SOLD,
END OF TY_RESU. DATA: LT_SELECTION TYPE AXTT_TABLES_SEL_PARAM,
LS_SELECTION TYPE AXT_TABLES_SEL_PARAM,
RT_OBJECT_ID TYPE RANGE OF CRMT_OBJECT_ID,
RS_OBJECT_ID LIKE LINE OF RT_OBJECT_ID,
RT_ZZAFLD00001X TYPE RANGE OF ZADTEL00009Q,
RS_ZZAFLD00001X LIKE LINE OF RT_ZZAFLD00001X,
LV_DATE TYPE ZADTEL00009Q,
RT_ZZAFLD00001Y TYPE RANGE OF ZADTEL00009U,
RS_ZZAFLD00001Y LIKE LINE OF RT_ZZAFLD00001Y,
LV_TIME TYPE ZADTEL00009U,
LX_ROOT TYPE REF TO CX_ROOT. "#EC NEEDED
DATA:GT_ADM TYPE TABLE OF TY_ADM,
VT_ADM TYPE TABLE OF TY_ADM,
GW_ADM LIKE LINE OF GT_ADM,
GT_PARTNER TYPE TABLE OF TY_PARTNER,
LT_PARTNER TYPE TABLE OF TY_PARTNER,
GW_PARTNER LIKE LINE OF GT_PARTNER,
LS_PARTNER LIKE LINE OF LT_PARTNER,
GV_PARTNER TYPE BU_PARTNER_GUID,
GT_ITEM TYPE TABLE OF TY_ITEM,
VT_ITEM TYPE TABLE OF TY_ITEM,
GW_ITEM LIKE LINE OF GT_ITEM,
GT_PRTEXT TYPE TABLE OF COMM_PRSHTEXT,
GW_PRTEXT LIKE LINE OF GT_PRTEXT,
GV_INDEX TYPE I,
GT_PRICE TYPE TABLE OF CNCCRMPRSAP032,
GW_PRICE LIKE LINE OF GT_PRICE,
GV_TIMESTMP TYPE /SAPCND/TIMESTAMP_TO.. " DATA LS_SELECTION_PARAS TYPE GENILT_SELECTION_PARAMETER.
DATA LT_WHERE_CONDITION TYPE CRMT_REPORT_DYN_SQL_LINE_TA. DATA: LT_RESULT TYPE TABLE OF ZCRMS0031,
LT_RESU TYPE TABLE OF TY_RESU,
LS_RESU LIKE LINE OF LT_RESU,
GT_RESULT TYPE TABLE OF ZCRMS0031,
LS_RESULT TYPE ZCRMS0031. DATA: LV_MAXHIT TYPE INT4,
LV_NAME TYPE THEAD-TDNAME,
LV_STR1 TYPE STRING,
LV_STR2 TYPE STRING,
LV_OBJECT_KEY TYPE CRMT_BSP_OBJECTKEY,
LR_OBJECT TYPE REF TO IF_GENIL_CONT_ROOT_OBJECT. DEFINE SET_RESULT.
LOOP AT GT_RESULT INTO LS_RESULT.
LR_OBJECT = IV_ROOT_LIST->ADD_OBJECT( IV_OBJECT_NAME = 'ZODRESULT'
IS_OBJECT_KEY = LS_RESULT-OBJECT_ID ).
LV_OBJECT_KEY = LS_RESULT-OBJECT_ID.
LR_OBJECT->SET_KEY( LV_OBJECT_KEY ).
LR_OBJECT->SET_ATTRIBUTES( LS_RESULT ).
CLEAR LS_RESULT.
ENDLOOP.
END-OF-DEFINITION . * IF ZCL_CRM_BUFFER=>GT_RESULT IS NOT INITIAL.
* LT_RESULT = ZCL_CRM_BUFFER=>GT_RESULT .
* SET_RESULT.
*
* CLEAR ZCL_CRM_BUFFER=>GT_RESULT.
* EXIT.
* ENDIF. LT_SELECTION = IT_SELECTION_PARAMETERS.
* SORT LT_SELECTION BY ATTR_NAME.
LOOP AT LT_SELECTION INTO LS_SELECTION.
CASE LS_SELECTION-ATTR_NAME.
WHEN 'OBJECT_ID'.
MOVE-CORRESPONDING LS_SELECTION TO RS_OBJECT_ID.
INSERT RS_OBJECT_ID INTO TABLE RT_OBJECT_ID.
WHEN 'ZZAFLD00001X'.
MOVE-CORRESPONDING LS_SELECTION TO RS_ZZAFLD00001X.
INSERT RS_ZZAFLD00001X INTO TABLE RT_ZZAFLD00001X.
WHEN 'ZZAFLD00001Y'.
MOVE-CORRESPONDING LS_SELECTION TO RS_ZZAFLD00001Y.
INSERT RS_ZZAFLD00001Y INTO TABLE RT_ZZAFLD00001Y.
ENDCASE.
ENDLOOP. LV_MAXHIT = IS_QUERY_PARAMETERS-MAX_HITS. SELECT SINGLE PARTNER_GUID INTO GV_PARTNER
FROM BUT000 WHERE PARTNER = ''."'0000202525'. "取到销售订单抬头信息
SELECT A~GUID AS GUID_H
A~OBJECT_ID
A~PO_NUMBER_SOLD AS OBJECT_ID_H
A~ZZZTRACKRETURN
INTO CORRESPONDING FIELDS OF TABLE GT_ADM
FROM ZHSB_SALES_INDEX AS A
INNER JOIN CRMD_ORDERADM_I AS B
ON A~GUID = B~HEADER
WHERE A~OBJECT_ID IN RT_OBJECT_ID
AND B~ZZAFLD00001X IN RT_ZZAFLD00001X
AND B~ZZAFLD00001Y IN RT_ZZAFLD00001Y
* AND B~ZZAFLD00001X <> LV_DATE
AND A~PROCESS_TYPE = 'ZSO5'
AND A~SALES_ORG = 'O 50000231'."日期不为空 IF GT_ADM[] IS NOT INITIAL.
"合作伙伴过滤
SELECT A~GUID_HI" TYPE CRMT_OBJECT_GUID,
A~GUID_SET" TYPE CRMT_OBJECT_GUID,
B~PARTNER_NO" TYPE CRMT_PARTNER_NO,
INTO CORRESPONDING FIELDS OF TABLE GT_PARTNER
FROM CRMD_LINK AS A
INNER JOIN CRMD_PARTNER AS B
ON A~GUID_SET = B~GUID
AND B~PARTNER_NO = GV_PARTNER
FOR ALL ENTRIES IN GT_ADM
WHERE A~GUID_HI = GT_ADM-GUID_H
AND A~OBJTYPE_SET = ''. "付款方为202525
"取销售订单项目
SELECT A~HEADER" TYPE CRMT_OBJECT_GUID, "销售订单
A~PRODUCT " TYPE CRMT_PRODUCT_GUID_DB,
A~ORDERED_PROD" TYPE CRMT_ORDERED_PROD_DB,
A~NUMBER_INT " TYPE CRMT_ITEM_NO,
A~ITM_TYPE " TYPE CRMT_ITEM_TYPE_DB,
B~QUANTITY
INTO TABLE GT_ITEM
FROM CRMD_ORDERADM_I AS A
INNER JOIN CRMD_SCHEDLIN AS B
ON A~GUID = B~ITEM_GUID
AND B~EVENT_TYPE = 'ORDER'
FOR ALL ENTRIES IN GT_ADM
WHERE HEADER = GT_ADM-GUID_H.
"销售订单项目 物料文本
IF GT_ITEM[] IS NOT INITIAL.
VT_ITEM[] = GT_ITEM[].
SORT VT_ITEM BY PRODUCT.
DELETE ADJACENT DUPLICATES FROM VT_ITEM COMPARING PRODUCT.
SELECT * INTO TABLE GT_PRTEXT
FROM COMM_PRSHTEXT
FOR ALL ENTRIES IN VT_ITEM
WHERE PRODUCT_GUID = VT_ITEM-PRODUCT
AND LANGU = 'J'. CONCATENATE SY-DATUM SY-UZEIT INTO GV_TIMESTMP.
SELECT * INTO CORRESPONDING FIELDS OF TABLE GT_PRICE
FROM CNCCRMPRSAP032
FOR ALL ENTRIES IN VT_ITEM
WHERE PRODUCT = VT_ITEM-PRODUCT
AND SALES_ORG = 'O 50000231'
AND DIS_CHANNEL = ''
AND PRICE_GRP IN ('','','')
AND KSCHL = 'ZPR0'
AND TIMESTAMP_TO >= GV_TIMESTMP
AND TIMESTAMP_FROM < GV_TIMESTMP.
ENDIF.
"取维修工单抬头
VT_ADM[] = GT_ADM[].
DELETE VT_ADM WHERE OBJECT_ID_H IS INITIAL.
IF VT_ADM[] IS NOT INITIAL.
SELECT GUID AS GUID_H
OBJECT_ID
CREATED_AT
ZZZMODENO
ZZCLIENT_TYPE
PO_NUMBER_SOLD
INTO CORRESPONDING FIELDS OF TABLE LT_RESU
FROM ZHSB_ORDER_INDEX
FOR ALL ENTRIES IN VT_ADM
WHERE OBJECT_ID = VT_ADM-OBJECT_ID_H
AND PROCESS_TYPE = 'ZSV1'.
ENDIF. CHECK LT_RESU[] IS NOT INITIAL. IF LT_RESU[] IS NOT INITIAL.
SELECT A~GUID_HI" TYPE CRMT_OBJECT_GUID,
A~GUID_SET" TYPE CRMT_OBJECT_GUID,
B~PARTNER_NO" TYPE CRMT_PARTNER_NO,
C~PARTNER
C~BU_SORT1
INTO CORRESPONDING FIELDS OF TABLE LT_PARTNER
FROM CRMD_LINK AS A
INNER JOIN CRMD_PARTNER AS B
ON A~GUID_SET = B~GUID
AND B~PARTNER_FCT = 'ZHSI00SN'
INNER JOIN BUT000 AS C
ON B~PARTNER_NO = C~PARTNER_GUID
FOR ALL ENTRIES IN LT_RESU
WHERE A~GUID_HI = LT_RESU-GUID_H
AND A~OBJTYPE_SET = ''.
ENDIF.
ENDIF. LOOP AT GT_ADM INTO GW_ADM.
READ TABLE GT_PARTNER INTO GW_PARTNER WITH KEY GUID_HI = GW_ADM-GUID_H."过滤条件
IF SY-SUBRC = .
READ TABLE LT_RESU INTO LS_RESU WITH KEY OBJECT_ID = GW_ADM-OBJECT_ID_H.
IF SY-SUBRC = .
MOVE-CORRESPONDING LS_RESU TO LS_RESULT.
READ TABLE LT_PARTNER INTO LS_PARTNER WITH KEY GUID_HI = LS_RESU-GUID_H.
IF SY-SUBRC = .
LS_RESULT-BU_SORT1 = LS_PARTNER-BU_SORT1.
ENDIF.
LOOP AT GT_ITEM INTO GW_ITEM WHERE HEADER = GW_ADM-GUID_H."销售订单项目
LS_RESULT-ZZZTRACKRETURN = GW_ADM-ZZZTRACKRETURN."跟踪单号
* LS_RESULT-PRODUCT = GW_ITEM-PRODUCT."产品GUID
LS_RESULT-ORDERED_PROD = GW_ITEM-ORDERED_PROD.
LS_RESULT-PRODUCT_ID = GW_ITEM-ORDERED_PROD.
LS_RESULT-QUANTITY = GW_ITEM-QUANTITY. READ TABLE GT_PRTEXT INTO GW_PRTEXT WITH KEY PRODUCT_GUID = GW_ITEM-PRODUCT.
IF SY-SUBRC = .
LS_RESULT-SHORT_TEXT = GW_PRTEXT-SHORT_TEXT.
ENDIF. LOOP AT GT_PRICE INTO GW_PRICE WHERE PRODUCT = GW_ITEM-PRODUCT.
CASE GW_PRICE-PRICE_GRP.
WHEN ''."End User
LS_RESULT-SUBTOTAL3 = GW_PRICE-KBETR.
WHEN ''."Retailer
LS_RESULT-SUBTOTAL1 = GW_PRICE-KBETR.
WHEN ''."Distributor
LS_RESULT-SUBTOTAL2 = GW_PRICE-KBETR.
WHEN OTHERS.
ENDCASE.
ENDLOOP. APPEND LS_RESULT TO GT_RESULT. ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP. SET_RESULT."添加结果 ENDMETHOD.
4.编辑BOL类:
事务代码:GENIL_MODEL_EDITOR
输入组件:ZCRMOD 点击创建
点击查询结果对象,右键创建:
点击动态查询对象,右键新建:ZODSEARCH
实施类:ZCL_DOWNLOAD_ORDER_IL
5.SPRO新建组件集,添加组件到组件集
6.UI组件:
事务代码:BSP_WD_CMPWB
输入组件名称:ZPARTLIST创建,
运行时资源库,添加组件集
退出重新事务代码进入,右键视图,创建搜索页面。根据向导一直做完就可以了,然后配置页面,就OK了
UI基础一:简单的BOL查询的更多相关文章
- ASP.NET Core 使用 EF 框架查询数据 - ASP.NET Core 基础教程 - 简单教程,简单编程
原文:ASP.NET Core 使用 EF 框架查询数据 - ASP.NET Core 基础教程 - 简单教程,简单编程 ASP.NET Core 使用 EF 框架查询数据 上一章节我们学习了如何设置 ...
- 【云开发】10分钟零基础学会做一个快递查询微信小程序,快速掌握微信小程序开发技能(轮播图、API请求)
大家好,我叫小秃僧 这次分享的是10分钟零基础学会做一个快递查询微信小程序,快速掌握开发微信小程序技能. 这篇文章偏基础,特别适合还没有开发过微信小程序的童鞋,一些概念和逻辑我会讲细一点,尽可能用图说 ...
- 转发-UI基础教程 – 原生App切图的那些事儿
UI基础教程 – 原生App切图的那些事儿 转发:http://www.shejidaren.com/app-ui-cut-and-slice.html 移动APP切图是UI设计必须学会的一项技能,切 ...
- 【T-SQL基础】01.单表查询-几道sql查询题
概述: 本系列[T-SQL基础]主要是针对T-SQL基础的总结. [T-SQL基础]01.单表查询-几道sql查询题 [T-SQL基础]02.联接查询 [T-SQL基础]03.子查询 [T-SQL基础 ...
- iOS开发UI篇—Kvc简单介绍
ios开发UI篇—Kvc简单介绍 一.KVC简单介绍 KVC key valued coding 键值编码 KVC通过键值间接编码 补充: 与KVC相对的时KVO,即key valued observ ...
- Android UI基础之五大布局
Android UI基础之五大布局 Android的界面是有布局和组件协同完成的,布局好比是建筑里的框架,而组件则相当于建筑里的砖瓦.组件按照布局的要求依次排列,就组成了用户所看见的界面.Andro ...
- mysql数据库基础的简单操作指南
最近在学习mysql,本文是做的关于mysql学习的笔记,跟大家分享一下,希望对大家学习mysql知识有所助益.mysql现在几乎已经成了网站建设的主流数据库,很多php网站系统都采用了mysql数据 ...
- iOS开发UI基础—手写控件,frame,center和bounds属性
iOS开发UI基础—手写控件,frame,center和bounds属性 一.手写控件 1.手写控件的步骤 (1)使用相应的控件类创建控件对象 (2)设置该控件的各种属性 (3)添加控件到视图中 (4 ...
- Vc数据库编程基础MySql数据库的表查询功能
Vc数据库编程基础MySql数据库的表查询功能 一丶简介 不管是任何数据库.都会有查询功能.而且是很重要的功能.上一讲知识简单的讲解了表的查询所有. 那么这次我们需要掌握的则是. 1.使用select ...
随机推荐
- HBase与列存储
传统的行存储和(HBase)列存储的区别 1.为什么要按列存储 列式存储(Columnar or column-based)是相对于传统关系型数据库的行式存储(Row-basedstorage)来说的 ...
- Jenkins-job迁移
摘自:http://www.cnblogs.com/topplay/p/3899330.html Jenkins迁移job 说明:从一个Jenkins服务器A将现有job迁移到另外一个Jenkins服 ...
- Selenium Webdriver 自动化测试开发常见问题(C#版)
转一篇文章,有修改,出处http://www.7dtest.com/site/blog-2880-203.html 1:Selenium中对浏览器的操作 首先生成一个Web对象 IWebDriver ...
- windows 上让文件类型和程序关联的批处理程序。
文件关联工具 地址: https://github.com/wll8/assoc-tool 本工具可以用来为你的便携程序添加文件关联,比如 nodepad2.exe . vscode 或其他图片处理程 ...
- 51nod 1615 跳跃的杰克
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1615 题意: 思路:一开始是觉得一旦超过了终点,中间某个地方往相反地方跳 ...
- The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
关于出现这个·问题的原因貌似也是多种多样的? 在stack overflow上的帖子如下:https://stackoverflow.com/questions/43186315/tomcat-404 ...
- 力扣(LeetCode)7.整数反转
给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转. 示例 1: 输入: 123 输出: 321 示例 2: 输入: -123 输出: -321 示例 3: 输入: 120 输出: ...
- CSS sprite使用
CSS Sprites叫css精灵或者雪碧图,是一种网页图片应用处理方式. CSS Sprites其实就是把网页中一些背景图片整合到一张图片文件中,再利用CSS的“background-image”, ...
- 虚拟机镜像压缩(qcow2,raw)
●qcow2 格式的压缩首先,需要对虚拟机系统的剩余空间写零操作: $ dd if=/dev/zero of=/zero.dat 删除 zero.dat$ rm /zero.dat关闭虚拟机,进入虚拟 ...
- Codeforces 797A - k-Factorization
A. k-Factorization 题目链接:http://codeforces.com/problemset/problem/797/A time limit per test 2 seconds ...