Client Copy后的号码段重复
Client Copy后,因為號碼段(Number Range)在緩沖區還有舊值,容易導致更新失敗,運行時錯誤:SAPSQL_ARRAY_INSERT_DUPREC。
下面程序可以清空緩沖區,使得NUMBER_GET_NEXT取數的時候根據表NRIV的值來取。
*&---------------------------------------------------------------------*
*& Report Z_BARRY_TEST
*&
*&---------------------------------------------------------------------*
*&?重置NUMBER RANGE緩沖區
*&---------------------------------------------------------------------*
REPORT?z_barry_test.
TABLES:?noselect,bnriv?.
DATA:?opcode?TYPE x,
reset_mode?TYPE x.
PARAMETERS:?client LIKE?noselect-client DEFAULT?sy-mandt,
object?LIKE?noselect-object,
subobj?LIKE?noselect-subobject,
rangnr?LIKE?noselect-nrrangenr,
toyear?LIKE?noselect-toyear,
global?LIKE?noselect-norsetglob?AS CHECKBOX DEFAULT?'X'.
AT SELECTION-SCREEN OUTPUT.
%_client_%_app_%-text?=?'MANDT'.
%_object_%_app_%-text?=?'對象'.
%_subobj_%_app_%-text?=?'子對象'.
%_rangnr_%_app_%-text?=?'范圍'.
%_toyear_%_app_%-text?=?'年'.
%_global_%_app_%-text?=?'針對所有應用服務器,不打勾的話只針對當前服務器'.
START-OF-SELECTION.
noselect-client?=?client.
noselect-object?=?object.
noselect-subobject?=?subobj.
noselect-nrrangenr?=?rangnr.
noselect-toyear?=?toyear.
noselect-norsetglob?=?global.
MOVE-CORRESPONDING?noselect?TO?bnriv.
IF?global?=?''.
reset_mode?=?1.
ELSE.
reset_mode?=?2.
ENDIF.
opcode?=?3.
CALL?'ThNoCall'?ID?'OPCODE'?FIELD?opcode
ID?'BNRIV'?FIELD?noselect
ID?'RESETMODE'?FIELD?reset_mode.
MESSAGE?s000(oo)?WITH?'重置完畢'.
總結
以上是生活随笔為你收集整理的Client Copy后的号码段重复的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SAP中用json数据格式调用http接
- 下一篇: SAP CS模块拓展项目实施建议书