欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SD信贷无法刷新

程序员文章站 2022-06-10 10:06:58
...

场景:
BDC录屏修改销售订单突然无法刷新信贷,原因未知,但是DEV,QAS和PRD相同的BDC,EDV/QAS是可以正常刷新的,PRD就是不行

处理方法:
换成BAPI修改销售订单

方法一,BAPI:BAPI_SALESORDER_CHANGE这是最常用的修改销售订单BAPI但是结果令人失望,不能刷新信贷,原因未知
*CLEAR LW_ORDER_HEADER_IN.
*
*LW_ORDER_HEADER_IN-PRICE_DATE = <FS_SALE>-NPRSDT.
*LW_ORDER_HEADER_INX-PRICE_DATE = ‘X’.
*LW_ORDER_HEADER_INX-UPDATEFLAG = ‘U’.
*LV_LOGIC_SWITCH-PRICING = ‘B’.
*LV_LOGIC_SWITCH-COND_HANDL = ‘X’.
*CALL FUNCTION ‘BAPI_SALESORDER_CHANGE’

  • EXPORTING
  • SALESDOCUMENT = <FS_SALE>-VBELN
  • ORDER_HEADER_IN = LW_ORDER_HEADER_IN
  • ORDER_HEADER_INX = LW_ORDER_HEADER_INX
    ** SIMULATION =
    ** BEHAVE_WHEN_ERROR = ’ ’
    ** INT_NUMBER_ASSIGNMENT = ’ ’
  • LOGIC_SWITCH = LV_LOGIC_SWITCH
    ** NO_STATUS_BUF_INIT = ’ ’
  • TABLES
  • RETURN = LT_RETURN
    ** ORDER_ITEM_IN =
    ** ORDER_ITEM_INX =
    ** PARTNERS =
    ** PARTNERCHANGES =
    ** PARTNERADDRESSES =
    ** ORDER_CFGS_REF =
    ** ORDER_CFGS_INST =
    ** ORDER_CFGS_PART_OF =
    ** ORDER_CFGS_VALUE =
    ** ORDER_CFGS_BLOB =
    ** ORDER_CFGS_VK =
    ** ORDER_CFGS_REFINST =
    ** SCHEDULE_LINES =
    ** SCHEDULE_LINESX =
    ** ORDER_TEXT =
    ** ORDER_KEYS =
    ** CONDITIONS_IN =
    ** CONDITIONS_INX =
    ** EXTENSIONIN =
    ** EXTENSIONEX =

方法二:BAPI:SD_SALESDOCUMENT_CHANGE可以正常刷新
DATA: lv_vbeln TYPE bapivbeln-vbeln,
ls_header_in TYPE bapisdhd1,
ls_header_inx TYPE bapisdhd1x.

DATA: lt_return TYPE STANDARD TABLE OF bapiret2,
ls_return LIKE LINE OF lt_return.

DATA: lv_message TYPE string,
lv_all_message TYPE string,
lv_flag TYPE c,
lv_num TYPE sy-tabix,
lv_success TYPE sy-tabix.

LOOP AT gt_sale ASSIGNING <fs_sale> WHERE sel = ‘X’.
CLEAR: ls_header_in,ls_header_inx.
lv_num = lv_num + 1.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input  = <fs_sale>-vbeln
  IMPORTING
    output = lv_vbeln.
ls_header_in-price_date = <fs_sale>-nprsdt.
ls_header_inx-price_date = abap_true.
ls_header_inx-updateflag = 'U'.

CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
  EXPORTING
    salesdocument    = lv_vbeln
    order_header_in  = ls_header_in
    order_header_inx = ls_header_inx
  TABLES
    return           = lt_return.
相关标签: 增强