abap

ABAP 常用函数、系统变量

你离开我真会死。 提交于 2020-01-16 00:56:32
常用的系统变量如下: 1. SY-PAGNO当前页号 2. SY-DATUM当前时间 3. SY-LINSZ当前报表宽度 4. SY-LINCT当前报表长度 5. SPACE空字符 6. SY-SUBRC执行状态为0,表示成功. 使用SELECT语句选择查询: SY-SUBRC = 0: 至少有一行数据,当ENDSELECT语句执行完,SY-DBCNT中保存着记录的个数。 SY-SUBRC = 4: 没有数据。 SY-SUBRC = 8: 只有使用“SELECT SINGLE FOR UPDATE”时才会有, 表示: WHERE条件指定的记录不止一行,结果是没有记录被选中。 使用INSERT语句,向表中插入一行,必须注意INSERT的顺序与表中字段的顺序一致: SY-SUBRC = 0: 插入成功,SY-DBCNT包含了插入的行数,0或1。 SY-SUBRC = 4: 由于有相同的KEY存在,所以插入失败。 使用LOOP语句来遍历一个内表: SY-SUBRC = 0: 循环至少被执行一次。 SY-SUBRC = 4: 循环没有被执行,可能是没有数据,也可能是没有符合条件的记录。 使用DELETE语句来删除一条记录: SY-SUBRC = 0: 找到一行并删除之,如果该表有不唯一主键,也就是有多条重复的记录,则只删除第一条记录。 SY-SUBRC = 4: 没有找到符合条件的记录

ABAP 点击A按钮隐藏C输入 点击B按钮显示C输出

时光怂恿深爱的人放手 提交于 2020-01-16 00:16:06
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME. PARAMETERS : P_C TYPE CHAR10 MODIF ID M1, RB_A RADIOBUTTON GROUP G1 USER-COMMAND, RB_B RADIOBUTTON GROUP G1. SELECTION-SCREEN: END OF BLOCK B1. AT SELECTION-SCREEN OUTPUT. IF RB_A = 'X'. LOOP AT SCREEN. IF SCREEN-GROUP1 = 'M1'. SCREEN-ACTIVE = '0'. ENDIF. MODIFY SCREEN. ENDLOOP. ELSEIF RB_B = 'X'. LOOP AT SCREEN. IF SCREEN-GROUP1 = 'M1'. SCREEN-ACTIVE = '1'. ENDIF. MODIFY SCREEN. ENDLOOP. ENDIF. 来源: https://www.cnblogs.com/hejie-code/p/12199157.html

SAP Where-used list Standard programs

▼魔方 西西 提交于 2020-01-15 06:48:05
问题 I'm searching the use of a SAP table. I want to know where the table S083 is used in SAP standard programs. I've searched trough the Where-used list. But I only got the self-created programs and not the SAP standard programs. Anyone know how to search for table use in SAP standard programs? 回答1: In order to be able to use the where-used functionality for SAP standard coding, the system administrator has to run the program SAPRSEUB in order to generate the indices for the programs. This

Difference of two sets of values

∥☆過路亽.° 提交于 2020-01-15 01:53:56
问题 I have a set of values: "foo", "bar", "blue". I have a table which looks like this: ID | my_col ----------- 1 | foo 2 | bar I want the set values minus all available my_col values. [foo, bar, blue] minus [foo, bar] The result should be "blue". How to do this in ABAP? 回答1: Here you are... REPORT YYY. TYPES string_table TYPE HASHED TABLE OF string WITH UNIQUE KEY TABLE_LINE. DATA(gt_set1) = VALUE string_table( ( `foo` ) ( `bar` ) ( `blue` ) ). DATA(gt_set2) = VALUE string_table( ( `foo` ) (

SAP ABAP CDS view里的注解在ABAP后台是如何被解析的?

孤街浪徒 提交于 2020-01-14 08:02:43
我们在ABAP Development Tool里编写SAP CDS view,为视图维护这些以@开头的注解,同Java Spring里广泛应用的annotation一样,都是一种为development object维护元数据的方式。 如上图所示,我维护了五个不同的注解,一旦保存,这个cds view的源代码被发送到ABAP后台,通过CL_DD_DDL_HANDLER解析,DDL此处是Data Definition Language的缩写。 这个类的ANNOTATIONS字段包含了一个内表M_ENTRIES,里面的内容即代表五个被解析出来的注解。 cds view所有支持的annotation都在这个ABAP接口定义的常量里了: if_dd_ddl_annotations 比如下图的if_dd_ddl_annotations=>AbapCatalog_sqlViewName就代表我在CDS view源代码里申明的注解:@AbapCatalog.sqlViewName: ‘znaming’ 而ABAP Development Tool里采用文本方式编辑的ABAP CDS view,如何被ABAP后端解析的呢?通过这个CL_DD_DDL_HANDLER~GET_OBJDEF_FROM_SRC方法里的第163行parse_cds解析。 这个方法是在kernel端实现的

How is the GENERATED_ID created in a custom oData Service to feed an Analytical Table?

时光总嘲笑我的痴心妄想 提交于 2020-01-14 06:12:16
问题 In a custom oData Service I need an Entity that will feed an analytical Table in sapui5. The table should show the sum of the VBELN positions. The Entity collects already the VBELN positions and all the needed supplementary attributes and the data can be displayed in sapui5 in a Responsive Table. Now this Table has been changed to an analytical table and the annotations for aggregation, dimensions and measures were done in the DEFINE method of the MPC_EXT class. In SEGW a mapping was done

SAP AET fields的自定义行为

只愿长相守 提交于 2020-01-13 20:51:28
If the customer specific logic is too complex to be covered by the embedded formula in calculated field editor in AET, for example there are some ABAP coding involvled, we can try custom behavior logic provided by AET: (1) Create a new entry in table AXT_BEHAVIOR (2) Your custom behavior could be implemented in class ZCL_AXT_CUSTOM_BEHAVIOR, which inherites from class CL_AXT_ABST_BEHAVIOR_HDLR. Source code for ZCL_AXT_CUSTOM_BEHAVIOR: class ZCL_AXT_CUSTOM_BEHAVIOR definition public inheriting from CL_AXT_ABST_BEHAVIOR_HDLR final create public shared memory enabled . public section. methods IF

Looking for Non-Printable characters inside internal table ABAP

谁都会走 提交于 2020-01-13 19:27:31
问题 I have an internal table this is written to file and then pulled into the BW as a datasource. Occasionally a non printable character makes it into the file output and breaks the import process into the BW. Below is a sample of my code. Since the itab is not type c or string I am unable to use the find/replace regex on it. Has anyone else had to solve this type of problem before? FORM eliminate_non_print_char TABLES p_shiptab STRUCTURE shiptab. LOOP AT p_shiptab INTO wa_shiptab. FIND REGEX '[^

SAP ABAP性能优化 - 调优工具 SM50 | ST05 | SAT

旧巷老猫 提交于 2020-01-13 10:00:08
更多内容关注公众号:SAP Technical 各位可以关注我的公众号:SAP Technical SAP系统提供了许多性能调优的工具,在本篇博客中,我将介绍下最常用的三种工具也即SM50, ST05, SAT. 1.工具概况 SM50 / SM66 通过这两个T-code, 可以查看当前SAP AS实例上面的工作进程,当某一工作进程长时间处于running的状态时,可以直接跳转到相应的程序位置进行查看和分析。 ST05 ST05是最常见的一个performance trance的工具,可以进行SQL、Buffer、Enqueue、RFC 、HTTP等多种类型的追踪, 通常我们使用ST05踪程序运行过程中的DB访问情况。 SAT SAT是SE30的新版本,是非常好用的一种ABAP性能分析工具,可以按照不同的类型统计程序的运行状况,这也是我本人较为喜欢使用的一个T-code。 2.工具的使用方法 2.1 SM50 / SM66 工作进程监视器 为了避免其他无关进程的干扰,通常在使用SM50 / SM66时,我们首先会过滤出与自己相关的process - 然后,在SM50中,找到并选中相关的目标程序的process,通过Administration >> Program >> Debugging即可跳转到相关的程序位置。 通过SM50中的debug跳转找到的位置,说明SAP AS

一段万能的ABAP报表,能读取Netweaver上任意数据库表的内容

半腔热情 提交于 2020-01-13 01:22:01
*&---------------------------------------------------------------------* *& Report ZGENERATE_ACCESS *&---------------------------------------------------------------------* * 2016-12-04 16:48PM - perhaps this report is done by Wuji? at airplane * from Frankfort to Beijing *&---------------------------------------------------------------------* REPORT ZGENERIC_ACCESS. PARAMETERS: name TYPE tadir-obj_name OBLIGATORY DEFAULT 'SFLIGHT'. DATA: dyn_table TYPE REF TO DATA. TRY. CREATE DATA dyn_table TYPE TABLE OF (name). FIELD-SYMBOLS: <table> TYPE ANY TABLE. ASSIGN dyn_table->* TO <table>. ASSERT sy