abap

How do I use substring in OpenSQL ABAP WHERE clause?

允我心安 提交于 2019-12-11 16:47:22
问题 My expression in OpenSQL is: SELECT * FROM J_1BNFLIN AS B WHERE SUBSTRING(REFKEY , 1 , 10 ) The substring portion of the where clause is not working. What am I doing wrong? 回答1: You can use LIKE in the WHERE condition. For example: DATA: gv_refkey TYPE j_1bnflin-refkey. gv_refkey = '123%'. SELECT * INTO TABLE ... FROM j_1bnflin WHERE refkey LIKE gv_refkey. This will select all entries where the field refkey starts with '123' (pls. note a % is used as wildcard) 来源: https://stackoverflow.com

ABAP SELECT 到内表的两种方式

馋奶兔 提交于 2019-12-11 16:26:09
ABAP SELECT到内表的两种方式: 1. SELECT * APPENDING CORRESPONDING FIELDS OF TABLE A FROM B 每次取出数据会追加到内表A 2. SELECT * INTO CORRESPONDING FIELDS OF TABLE A FROM B 每次取到数据会先清空内表A再存进去 来源: CSDN 作者: Frank.Ma 链接: https://blog.csdn.net/anji0207/article/details/103493282

ABAP 内表 排序

廉价感情. 提交于 2019-12-11 15:45:31
将内表 it_ebtable字段按照升序和降序进行排列 SORT it_ebtable BY budat ASCENDING belnr DESCENDING.(将内表 it_ebtable 中 budat字段按照升序排列 并且 belnr按照降序进行排列 ) 来源: CSDN 作者: 粨毐不侵 链接: https://blog.csdn.net/yujiaji/article/details/103492335

Implement CGLIB in ABAP

こ雲淡風輕ζ 提交于 2019-12-11 12:36:31
What is cglib?A Byte Code Generation Library which is high level API to generate and transform Java byte code. It is used in various scenarios such as AOP, testing, data access frameworks to generate dynamic proxy objects and intercept field access. See one example in unit test. In line 17, a new dynamic proxy class is generated as mock. In line 19, we tell the proxy, "if get(0) is called on this mock class, then return mocked data "hello, world". As a result, in line 23 "result: hello, world" will be printed out. In debugger you can find that the variable in line 17 is mocked by CGLIB: Its

ABAP里SELECT的用法汇总(转)

这一生的挚爱 提交于 2019-12-11 11:33:34
通常使用Open SQL的数据查询语句SELECT将数据库条目选择到内存。 一.SELECT语句: 1)SELECT用于确定读取数据表中的哪些字段; 2)FROM子句用于确定从哪些内表或者视图中读取数据; 3)INTO用于确定将数据读取到程序内的哪些数据对象; 4)WHERE用于限定选择条件; SELECT select_clause FROM from_clause INTO into_clause WHERE where_clause. 在传统的ABAP语言中,如果使用TABLES语句声明表工作区,则可省略INTO子句(此方法已经被ABAP Object禁用) 除以上4种外还有: GROUP BY:用于将一组数据条目压缩为一个单行作为选择最终结果; HAVING:用于限定ORDER BY子句子数据目组的选择条件; ORDER BY:用于限定行排序; SELECT整体语法结构: SELECT <result> FROM <source> INTO <target> [WHERE <condition>] [GROUP BY <fields>] [HAVING <cond>] [ORDER BY <fields>]. 二.选择单行数据: 如果只需要选取一个结果数据行,系统在数据库种找到第一个符合条件的数据条目时,就停止查询。单行选择需要在SELECT中使用SINGLE关键字

How to find a standard text within a sapscript / smartform

本小妞迷上赌 提交于 2019-12-11 11:32:29
问题 I need to track down where within a large number of custom sapscripts and smartforms a specific standard text (SO10) is being used. Apart from the equivalent of "check the code for each print script", I've not found a workable solution online. Any suggestions? 回答1: After posting, I found a partial solution. The code below will search for a standard text within sapscripts, but not smartforms. PARAMETERS: p_sttxt LIKE stxh-tdname. DATA: BEGIN OF t_stxh OCCURS 0, tdname LIKE stxh-tdname, tdspras

Convert database query result to json/yaml/xml with ABAP

。_饼干妹妹 提交于 2019-12-11 09:02:44
问题 Is there a way to convert a database query result to json/yaml/xml with ABAP? I am new to SAP software development. 回答1: DATA: lt_flight TYPE STANDARD TABLE OF sflight, lrf_descr TYPE REF TO cl_abap_typedescr, lv_json TYPE string. SELECT * FROM sflight INTO TABLE lt_flight. * serialize table lt_flight into JSON, skipping initial fields and converting ABAP field names into camelCase lv_json = /ui2/cl_json=>serialize( data = lt_flight compress = abap_true pretty_name = /ui2/cl_json=>pretty_mode

Retrieving Object names and Transfer requests for an entire package programmatically

我的未来我决定 提交于 2019-12-11 08:29:49
问题 I have two separate system (development and testing) and I need to check that for all my objects (programs and all includes) the version in development matches that in dev. I can do this manually by going to SE80 -> Utilities -> Version Management for each object but for hundreds/thousands of objects this is extremely time consuming. Is there a way to retrieve the object name and TR programatically so that they could be output to a table or spreadsheet? EDIT. (Vwgert it seems to me like this

ABAP in Eclipse prerequisites?

坚强是说给别人听的谎言 提交于 2019-12-11 08:18:06
问题 What do i need for setting up a connection to a local database in Eclipse to start developing in ABAP? I already installed the plugin for ABAP but i can't connect to a database. Any suggestions? 回答1: ABAP Development Tools (ADT) is an add-on to Eclipse to develop in ABAP, but it's only the frontend software, it requires another software, the "backend" (also called the ABAP-based system). Did someone give you the credentials to an existing ABAP-based system, or did you install your own free

Check if Report uses hierarchical ALV or not

笑着哭i 提交于 2019-12-11 07:57:48
问题 I found a way to export a hierarchical ALV like this: ABAP: Report via GUI has 18 columns, via RFC 6 (hierarchical ALV) Unfortunately I don't know in advanced if the report uses hierarchical ALV or not. If I apply the code of above answer to the report RFSKPL00 , then I get an exception in cl_salv_bs_runtime_info=>get_data() here: if t_data_line is requested. import t_data_line to t_data_line from memory id cl_salv_bs_runtime_info=>c_memid_data_line. if sy-subrc ne 0. raise exception type cx