- 浏览: 231668 次
- 性别:
- 来自: 大连
文章分类
最新评论
-
evangxli:
niitallen 写道为啥我就显示不出来数据呢,在smart ...
ALV & SMARTFORMS 并分页 -
niitallen:
为啥我就显示不出来数据呢,在smartforms中~~
ALV & SMARTFORMS 并分页 -
binjoo:
insufficient privileges -
695165987:
用逗号分割,是改变那个参数。
SAP Function module - GUI_DOWNLOAD -
shamusoft:
希望你成功
四月咯
今天碰到一个小问题,当我验证SELECT执行是否成功时,使用select endselect就可以,而用select single就不可以。
S_PLT是屏幕screen的字段
起因,条件,使用SELECT SINGLE,当判断条件为SY-SUBRC = 4时,条件成立,执行不成功,会一直执行if条件中的代码,即MESSAGE E027(ZPPMRP) WITH S_PLT.
而使用select endselect时候,当判断条件为SY-SUBRC <> 0时,则执行成功,即此时的SY-SUBRC = 0。
备注:按照下面的解释,当
SELECT sets SY-SUBRC to 0 if at least one line was read, otherwise to 4, or possibly 8 in SELECT SINGLE FOR UPDATE.
即,当SY-SUBRC = 0时,至少有一行数据;
其他情况为SY-SUBRC = 4;
另外当SY-SUBRC =8时,只有在SELECT SINGLE FOR UPDATE的时候,这个我也解释不好。
Haha, I had this information so thought of sharing with you all.
Values of SY-SUBRC on different ABAP statements
'sy-subrc' is a return code, set by the following ABAP statements.
As a rule, if SY-SUBRC = 0, the statement was executed successfully.
AT SELECTION-SCREEN. * DO 1 TIMES. SELECT SINGLE NAME1 FROM T001W INTO PLT_NAME WHERE T001W~WERKS = S_PLT. IF SY-SUBRC = 4. MESSAGE E027(ZPPMRP) WITH S_PLT. ENDIF. * ENDDO. *ENDSELECT.
S_PLT是屏幕screen的字段
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 . SELECTION-SCREEN BEGIN OF LINE. PARAMETERS : P_PLT AS CHECKBOX DEFAULT 'X'. "P_PLANT SELECTION-SCREEN COMMENT (19) TEXT-C01. SELECT-OPTIONS : S_PLT FOR T001W-WERKS OBLIGATORY NO-EXTENSION NO INTERVALS. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN END OF BLOCK BLOCK1.
起因,条件,使用SELECT SINGLE,当判断条件为SY-SUBRC = 4时,条件成立,执行不成功,会一直执行if条件中的代码,即MESSAGE E027(ZPPMRP) WITH S_PLT.
而使用select endselect时候,当判断条件为SY-SUBRC <> 0时,则执行成功,即此时的SY-SUBRC = 0。
备注:按照下面的解释,当
SELECT sets SY-SUBRC to 0 if at least one line was read, otherwise to 4, or possibly 8 in SELECT SINGLE FOR UPDATE.
即,当SY-SUBRC = 0时,至少有一行数据;
其他情况为SY-SUBRC = 4;
另外当SY-SUBRC =8时,只有在SELECT SINGLE FOR UPDATE的时候,这个我也解释不好。
Haha, I had this information so thought of sharing with you all.
Values of SY-SUBRC on different ABAP statements
'sy-subrc' is a return code, set by the following ABAP statements.
As a rule, if SY-SUBRC = 0, the statement was executed successfully.
ASSIGN sets SY-SUBRC to 0 if the field symbol assignment was possible, otherwise to 4. AUTHORITY-CHECK sets SY-SUBRC to 0 if the user has the required authorization, otherwise to 4, 8, 12, 16, 24, 28, 32, or 36 depending on the cause of the authorization failure. CALL DIALOG with USING sets SY-SUBRC to 0 if the processing is successful, otherwise to a value other than 0. CALL FUNCTION sets SY-SUBRC in accordance with the defined exception handling. CALL METHOD sets SY-SUBRC in accordance with the defined exception handling. CALL SELECTION-SCREEN sets SY-SUBRC to 0 if the user chooses Enter or Execute, and 4 if the user chooses Cancel. CALL TRANSACTION with USING sets SY-SUBRC to 0 if the processing is successful, otherwise to a value other than 0. CATCH SYSTEM-EXCEPTIONS sets SY-SUBRC after the ENDCATCH statement if a system exception occurs. The value is set in the program. COMMIT WORK sets SY-SUBRC to 0. COMMIT WORK AND WAIT sets SY-SUBRC to 0 if the update is successful, otherwise to a value other than 0. COMMUNICATION INIT DESTINATION ... RETURNCODE sets SY-SUBRC as specified. CONCATENATE sets SY-SUBRC to 0 if the result fits into the target variable, otherwise to 4. CREATE OBJECT sets SY-SUBRC if the exceptions of the instance constructor are handled in the program. CREATE OBJECT in OLE2 sets SY-SUBRC to 0 if an external object could be created, otherwise to 1, 2, or 3, depending on the cause. DELETE sets SY-SUBRC to 0 if the operation is successful, otherwise to 4 or another value other than 0, depending on the cause. DEMAND ... MESSAGES INTO sets SY-SUBRC to 0 if the message table is empty, otherwise to a value other than 0. DESCRIBE LIST sets SY-SUBRC to 0 if the line or list exists, otherwise to 4 or 8. EXEC SQL - ENDEXEC sets SY-SUBRC to 0 in nearly all cases. It does, however, set SYSUBRC to 4 if no entry is read in a FETCH statement. FETCH sets SY-SUBRC to 0 if at least one line was read, otherwise to 4. GENERATE SUBROUTINE POOL sets SY-SUBRC to 0 if the generation was successful, otherwise to 8. GET CURSOR sets SY-SUBRC to 0 if the cursor is correctly positioned, otherwise to 4. GET PARAMETER sets SY-SUBRC to 0 if a corresponding value exists in SAP memory, otherwise to 4. IMPORT sets SY-SUBRC to 0 if the import is successful, otherwise to 4. INSERT sets SY-SUBRC to 0 if the operation is successful, otherwise to 4. LOAD REPORT sets SY-SUBRC to 0 if the operation is successful, otherwise to 4 or 8 depending on the cause of the error. LOOP sets SY-SUBRC to 0 if there is at least one pass through the extract. Otherwise, it is set to a value other than 0. LOOP AT sets SY-SUBRC to 0 if there is at least one loop pass through the internal table, otherwise to 4. MODIFY sets SY-SUBRC to 0 if the operation is successful, otherwise to 4. MODIFY LINE sets SY-SUBRC to 0 if a line in the list was changed, otherwise it sets it to a value other than 0. MODIFY sets SY-SUBRC to 0 if the operation is successful, otherwise to 4. OLE2 Automation, executed successfully, otherwise 1, 2, 3, or 4, depending on the cause of the error. OPEN DATASET sets SY-SUBRC to 0 if the file could be opened, otherwise to 8. Open SQL statements set SY-SUBRC to 0 if the operation is successful, otherwise to a value other than 0. OVERLAY sets SY-SUBRC to 0 if at least one character is overlaid, otherwise to 4. READ DATASET sets SY-SUBRC to 0 if the read operation was successful, otherwise to 4 or 8, depending on the cause of the error. READ LINE sets SY-SUBRC to 0 if a list line exists, otherwise to a value other than 0. READ TABLE sets SY-SUBRC to 0 if table lines are found, otherwise to 2, 4, or 8, depending on the context and cause of the error. REPLACE sets SY-SUBRC to 0 if the search string was replaced, otherwise to a value other than 0. SCROLL sets SY-SUBRC to 0 if the scrolling within the list was successful, otherwise to 4 or 8, depending on the cause. SEARCH sets SY-SUBRC to 0 if the search string was found, otherwise to 4. SELECT sets SY-SUBRC to 0 if at least one line was read, otherwise to 4, or possibly 8 in SELECT SINGLE FOR UPDATE. SET COUNTRY sets SY-SUBRC if the country code exists in table T005X, otherwise to 4. SET BIT sets SY-SUBRC to 0 if the bit could be set, otherwise to a value other than 0. SET TITLEBAR sets SY-SUBRC to 0 if the title exists, otherwise to 4. SHIFT ... UP TO sets SY-SUBRC to 0 if the position could be found within the string, otherwise to 4. SPLIT sets SY-SUBRC to 0 if the sizes of the target fields are adequate, otherwise to 4. UPDATE sets SY-SUBRC to 0 if the operation is successful, otherwise to 4. WRITE ... TO sets SY-SUBRC to 0 if the assignment is successful, otherwise to 4.
发表评论
-
SAP 常用的库存表
2018-11-24 09:58 4879根据库存类型的不同,库存信息保存在不同的表中 ... -
SE16N变更为编辑模式
2018-09-19 10:27 2247SAP中直接修改表、视图的Tcode有SE16N和SM30。 ... -
SAP 示例
2018-07-11 13:08 1252经常会用到一些SAP自带的小程序, 无TCODE, 或者是 ... -
ABAP Test Cockpit (ATC) - About the TCode
2014-11-28 09:24 2801ABAP测试驾驶舱这个翻译很牵强,姑且叫做ABAPer 的诊 ... -
SAP SmartForms 字符处理
2014-05-14 14:44 2071格式化数字等,在smartforms显示输出的格式。 ... -
adf
2013-09-10 17:07 0*&------------------------ ... -
SAP Code 增强
2013-09-23 14:06 1387REPORT Z_FIND_BADI. *&- ... -
NND 搞Eclipse
2013-08-19 09:56 856NND,为了HANA, 我还得 ... -
SAP SE38 增强
2013-08-19 09:57 1470最近很多人在搞SE38增强,没事就在系统里面挂一个test ... -
SAP内存/ABAP内存/共享内存区别(深入浅出)
2013-03-06 11:30 3053转:http://www.zhsap.com/?fr ... -
ABAP 写入内存:ABAP memory中的Export和Import
2013-03-06 10:22 3592转:cnblogs(没有具体地址,抱歉哈!) 上图是SA ... -
SAP ABAP 格式化输出
2011-07-05 16:58 25931。从字段NUMBER输出到字段STRING,输出到屏幕不同位 ... -
SAP 计算时间-MTIME
2011-05-10 18:48 1458计算时间字段的值,例如Structure EMG_FILEIN ... -
sap submit and return
2011-04-13 19:47 3071转自: Barry 白 SUBMIT的几种情况 1 ... -
Call Transaction - using
2011-03-29 08:57 2364Call transaction 的时候,我们会用到using ... -
BDC技术
2010-11-02 08:35 1378BDC技术 写的很清晰~! ... -
ABAP性能优化
2010-11-02 08:34 1664ABAP性能优化 1.使用二分法查询,提高查询内表数据速度 ... -
SAP BAPI的简单实现步骤
2010-11-02 08:32 4595ABAP中有关BAPI的介绍 1.BAPI – busines ... -
SAP:ABAP基础篇--字符串截取
2010-10-28 18:15 12197Zhuan 的哦! 1. 数字类型(numeric types ... -
查找SAP系统可操作的用户出口
2010-10-13 10:04 1169转——Jack Wu http://blog.csdn.net ...
相关推荐
1. 循环选择:使用SELECT / ENDSELECT语句块逐行读取数据,例如: SELECT [DISTINCT] <result>...<statement block> ENDSELECT. 2. 选择至内表:一次性将所有匹配的记录加载到内表,如: SELECT ... INTO|...
- **7.3 SELECT-ENDSELECT 循环 VS 数组选择**:循环处理内部表时,使用 **SELECT-ENDSELECT** 结合循环结构可以简化代码。 ```abap SELECT * FROM T006 INTO X006_WA. LOOP AT X006 INTO X006_WA. ENDLOOP. ``...
Endselect. ``` - **优化后**: ```abap Select * from zflight where airln = 'LF' and fligh = '222'. Endselect. ``` 2. **最大值计算**:避免使用循环来寻找最大值,直接利用SQL的聚合函数。 - **原始...
End Select End Sub Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single) End Sub Private Sub txtBookId_GotFocus() txtBookId.BackColor = vbBlue txtBookId.ForeColor = vbYellow End ...
SY-SUBRC = 0: 至少有一行数据,当ENDSELECT语句执行完,SY-DBCNT中保存着记录的个数。 SY-SUBRC = 4: 没有数据。 SY-SUBRC = 8: 只有使用“SELECT SINGLE FOR UPDATE”时才会有, 表示: WHERE条件指定的记录不止...
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim LClickCount As Long ' Randomize If Button = 1 Then WaveDropStone X, Y, 2, 256 Else LClickCount = Rnd...
SELECT COUNT(singles) FROM team_stats WHERE singles > 0; -- 计算singles大于0的记录数 ``` ##### SUM - **功能**: 返回指定列的总和。 - **语法**: ```sql SELECT SUM(column_name) FROM table_name [WHERE...
Endselect. 9. 选择至内表 ABAP 也可以选择数据至内表,基本语法为: Select * from spfli into table ta_spfli. 10. 指定查询条件 ABAP 提供了多种指定查询条件的方式,包括: * 比较运算符:= < > <> <= >= ...
--set和select的区别 大部分情况用set就可以,set不能将返回多个值获取到,相对严禁 select可以将获取返回的多个结果的最后一条,相对灵活 --事务 begin transaction //开启一个事务 declare @sum int = 0 //...
select type,sum(case vender when 'A' then pcs else 0 end),sum(case vender when 'C' then pcs else 0 end),sum(case vender when 'B' then pcs else 0 end) FROM tablename group by type 显示结果: type ...
select type,sum(case vender when 'A' then pcs else 0 end),sum(case vender when 'C' then pcs else 0 end),sum(case vender when 'B' then pcs else 0 end) FROM tablename group by type 显示结果: type ...
更新`test`表中的`issingle`字段,`UPDATE a SET Issingle = CASE c.tag WHEN '1' THEN 1 ELSE 0 END FROM test a INNER JOIN (SELECT person, isnull((SELECT TOP 1 person FROM test a WHERE a.friend=b.person), ...
single_button = tk.Button(root, text="Single Select", command=on_single_select) single_button.pack() multi_button = tk.Button(root, text="Multi Select", command=on_multi_select) multi_button.pack() ...
- **格式**: `ALTER DATABASE 数据库名 SET SINGLE_USER WITH ROLLBACK IMMEDIATE;` - **然后执行**: ```sql ALTER DATABASE 数据库名 SET OFFLINE WITH ROLLBACK IMMEDIATE; ``` #### 13. 附加数据库 - **格式...
VB提供了两种选择结构:If-Then-Else-End If语句和Select-Case-End Select语句。 **2.1 If-Then-Else-End If 语句** 这是双分支结构,当条件满足时执行一组语句,否则执行另一组语句。格式如下: ```vb If <条件>...
尽量减少子查询和嵌套SELECT...ENDSELECT的使用,因为它们会增加执行次数。在索引字段上避免使用NOT, 等不等操作符,而是使用>或<。避免前导百分号的LIKE操作,因为它无法利用索引。对于OR连接的索引字段,考虑使用...
Private Sub Grid1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 2 Then PopupMenu student End If End Sub Private Sub Grid1_RowColChange(ByVal Row As Long, ByVal ...
黑暗主题轻主题安装添加依赖项: npm i @freakycoder/react-native-single-selectnpx pod-install // After Install the ` react-native-spinkit `对等依赖您需要安装此依赖项" react-native-spinkit " : " ^1.5.1 ...
在Excel与VBA编程中,掌握常用的代码片段能够极大地提高工作效率和编程的便捷性。首先,我们来看一下如何声明变量。在VBA中,声明变量的语法与...记得在实际编程时根据需要添加`Sub`和`End Sub`来封装成完整的子程序。