日积月累
-
关于ABAP中的Literal
2009-11-09
下面是从我的开发环境中的帮助文件中找出的:
Text field literals are character strings included in single inverted commas ('). They have the data type c in the length of the included characters, including trailing blanks. There is no empty text field literals: The text field literal '' is identical to the text field literal ' ' of length 1.
注意我标记为红色的地方,和最后一句话的意思无法统一。按照我的理解,前面应该漏了doesn't.
还是help.sap.com上的说明比较清楚(注意黑体部分):
Character literals are sequences of alphanumeric characters in the source code of an ABAP program enclosed in single quotation marks or backquotes.
Character literals enclosed in quotation marks have the predefined ABAP type C and are described as text field literals.
Literals enclosed in backquotes have the ABAP type STRING and are described as string literals. The field length is defined by the number of characters. With text field literals trailing blanks are ignored while in string literals they are taken into account.
Character literals can be up to 255 characters long. A text field literal is always at least one character long (entering ' is the equivalent of ‘). A string literal can also be empty (entering ` is the empty string with length zero ´).
allows you to enter several character literals and link them using the & character. If a character literal contains a quotation mark or backquote, you must repeat it to enable the system to recognize the contents as a character literal and not as the end of the literal.If you want to enter a character literal in the ABAP Editor that is longer than a single editor line, ABAP syntax
总结一句:表示一个空格的字符,请使用` `。
-
SAP的Online Help里面已经有了比较清楚的讲述,below are 2 key issues:
About the TOP program:This contains the FUNCTION-POOL statement (equivalent for a function group of the REPORT or PROGRAMstatement) and global data declarations for the entire function group.
What happens when you use "CALL FUNCTION" statement? When you run an ABAP program, the system starts a new internal session. The internal session has a memory area that contains the ABAP program and its associated data. When you call a function module, an instance of its function group plus its data, is loaded into the memory area of the internal session. An ABAP program can load several instances by calling function modules from different function groups.相关链接:
-
关于DDIC_TYPE_INCONSISTENCY类DUMP的说明
2009-04-01
具体内容参考notes 1167784
根因是Dictionary Object是在传输时立刻生效的,对应的Runtime Object接着激活,期间有个时间差,如果这个时间运行相关的程序就会出现这个Dump。
上面说的是正常情况,其他错误情况可能是:
1、include对象已经删除,但是对应的RTO仍然存在。
2、custom include删除字段后,需要用SE14做表调整。
3、include对象与Switch Framework的设置不一致。
使用程序RSNTABCONSISTENCY 可以检查DUMP里面提示的对象,如果是表或结构,可以使用SE11里面的菜单"Utilities" -> "Runtime Object" -> "Recursive",检查出不一致的对象。如果在SE11中找不到,使用FM DD_SHOW_NAMETAB查询相关信息。
-
考虑双字节的截取字符串处理
2008-12-24
系统的标准Function Module:TEXT_SPLIT
以前不知道有,自己写的一个,没有考虑Unicode的情况。
*&---------------------------------------------------------------------* *& Form substring *&---------------------------------------------------------------------* * 考虑中文的字符串截取程序 * 如果直接截取包含半个汉字,将删除最后的半个汉字 *----------------------------------------------------------------------* * -->P_TEXT text * -->P_POS text * -->P_LEN text * -->P_RESULT text *----------------------------------------------------------------------* FORM substring USING p_text p_pos TYPE i p_len TYPE i CHANGING p_result p_result_len. DATA: l_last_ascii TYPE x VALUE '7F', l_result(255) TYPE c, l_last_char TYPE x, l_last_char_index TYPE i. p_result = p_text+p_pos(p_len). l_last_char_index = STRLEN( p_result ) - 1. WRITE p_result+l_last_char_index(1) TO l_last_char. IF l_last_char > l_last_ascii. p_result = p_result(l_last_char_index). p_result_len = STRLEN( p_result ). ENDIF. ENDFORM. "substring -
在ABAP程序中调用逻辑数据库
2008-12-13
使用函数: LDB_PROCESS
关键参数:
ldbname:逻辑数据库名称
callback:逻辑数据库的NODE对应的处理函数
selections:调用逻辑数据库的输入条件
相关帮助:
Structure of Logical Databases
Calling a Logical Database Using a Function Module
Independent Calls and the Database Program
遗憾的是在测试逻辑数据库PNM的时候,没有解决在一个程序中多次调用的问题。


