比较有意思的比较内表的小函数
包 ? ? ? :CT
函數(shù)組:CTVB?
函數(shù)模塊:CTVB_COMPARE_TABLES ?
CALL?FUNCTION?‘CTVB_COMPARE_TABLES’
EXPORTING
table_old = t_old
table_new = t_new
key_length =?22
IMPORTING
table_del = t_result
* table_mod =?
* table_add
no_changes = g_flag.
這個函數(shù)模塊比較兩個內(nèi)表,將被刪除、增加和修改的內(nèi)表行分別分組輸出。
輸入?yún)?shù):
TABLE_OLD :舊表
TABLE_NEW :新表
KEY_LENGTH :鍵長度,指定內(nèi)表中的前若干個字節(jié)(在 Unicode 系統(tǒng)中為字符,因此指定長度內(nèi)不能存在數(shù)值類型的字段)為主鍵,做為內(nèi)表行是否為增加的判斷條件。
IF_SORTED :排序標記,如果已排序,在比較時可以提高效率。
輸出參數(shù):
TABLE_DEL :被刪除的行
TABLE_ADD :被增加的行
TABLE_MOD :被修改的行
NO_CHANGES :表沒有被修改的標記,如果這個標記為 “X”,就不必去讀前面三個內(nèi)表了。
t_result?如果不為空,就是想要的內(nèi)表,可以對它進行處理。
g_flag如果為’X’,兩個內(nèi)表數(shù)據(jù)相同。
另外,像兩個內(nèi)表的新增數(shù)據(jù)和修改數(shù)據(jù)都可以在返回參數(shù)TABLE_ADD和TABLE_MOD得到。
里面還有很多其他的,沒研究,可以去試試
例子
DATA:
??????l_it_makt??LIKE?STANDARD?TABLE?OF?makt?,
??????l_it_makt1??LIKE?STANDARD?TABLE?OF?makt?,
??????l_it_makt3??LIKE?STANDARD?TABLE?OF?makt?,??
??????l_it_makt4??LIKE?STANDARD?TABLE?OF?makt?,
??????l_it_makt5??LIKE?STANDARD?TABLE?OF?makt?,
??????l_it_makt2??LIKE?STANDARD?TABLE?OF?makt?.
SELECT?*?FROM?makt?INTO?TABLE?l_it_makt.
SELECT?*?FROM?makt?INTO?TABLE?l_it_makt1.
DELETE?l_it_makt1??WHERE?matnr?=?'000000000500000003'.
CALL?FUNCTION?'CTVB_COMPARE_TABLES'
??EXPORTING
????table_old????????=?l_it_makt
????table_new????????=?l_it_makt1
????key_length???????=?21 ? ??" client 3位 ?+ ? ? 物料號18位
*???IF_SORTED????????=
?IMPORTING
???TABLE_DEL????????=?l_it_makt2
???TABLE_ADD????????=?l_it_makt3
???table_mod????????=?l_it_makt4
*???NO_CHANGES???????=?l_it_spfl5
??????????.
IF?1?=?2.
ENDIF.
函數(shù)模塊:BUS1088_DATABASE_UPDATE?
BUS1088_DATABASE_UPDATE is a standard SAP function module available within R/3 SAP systems depending on your version and release level.
?Below are the pattern details for this FM showing its interface including any import, export parameters etc and for your convenience any standard documentation available. All this information and more can be viewed if you enter the function module name BUS1088_DATABASE_UPDATE into the relevant SAP transaction such as SE37 or SE80.?
Within the comments section below there is also an opportunity for you to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BUS1088_DATABASE_UPDATE or its description.
Pattern for FM BUS1088_DATABASE_UPDATE - BUS1088 DATABASE UPDATE Associated Function Group: CTVB?
Released Date: Not Released
CALL FUNCTION 'BUS1088_DATABASE_UPDATE' "
* EXPORTING
* ? it_aennr = ? ? ? ? ? ? ? ? ?" tt_rctae
* ? it_cabn = ? ? ? ? ? ? ? ? ? " tt_cabn ? ? ? Characteristic
* ? it_cabnt = ? ? ? ? ? ? ? ? ?" tt_cabnt ? ? ?Characteristic Descriptions
* ? it_cabnz = ? ? ? ? ? ? ? ? ?" tt_cabnz
* ? it_cawn = ? ? ? ? ? ? ? ? ? " tt_cawn ? ? ? Values
* ? it_cawnt = ? ? ? ? ? ? ? ? ?" tt_cawnt ? ? ?Value Descriptions
* ? it_tcme = ? ? ? ? ? ? ? ? ? " tt_tcme ? ? ? Class Types
* ? it_atinn_delete = ? ? ? ? ? " tt_atinn_range
* ? dep_changed = ? ? ? ? ? ? ? " flag
? ? . ?" ?BUS1088_DATABASE_UPDATE
轉(zhuǎn)載于:https://www.cnblogs.com/senlinmu110/archive/2013/01/29/3802083.html
總結(jié)
以上是生活随笔為你收集整理的比较有意思的比较内表的小函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle用户管理的完全恢复5:控制文
- 下一篇: POJ-3621 Sightseeing