通过BAPI_PRICES_CONDITONS函数,可以实现定价条件的创建/修改/删除等操作,下列通过一个小例子说明如何使用这个函数,例子中没有写关于等级价的创建,其实都一样 ,如果存在等数量级价,更新lt_bapicondit-scalebasin = 'C',把相应的等级条件写入lt_bapicondqs表中,价值登记一样,不过等级类型要对照。
用到的操作码有:003 删除:信息包含删除的对象
004 修改 :所有应寄出凭证列表
009 原始的:关于处理的第一个信息 参见 domain MSGFN .
REPORT ztestc .
tables:konh .
data: lt_bapicondct type bapicondct occurs 0 , "
wa_bapicondct type bapicondct ,
lt_bapicondhd type bapicondhd occurs 0 , "
wa_bapicondhd type bapicondhd ,
lt_bapicondit type bapicondit occurs 0 ,
wa_bapicondit type bapicondit ,
lt_bapicondqs type bapicondqs occurs 0 ,
wa_bapicondqs type bapicondqs ,
lt_bapicondvs type bapicondvs occurs 0 ,
wa_bapicondvs type bapicondvs .
data: lt_bapiret2 type bapiret2 occurs 0 .
data: ret type bapiret2 .
data: lt_bapiknumhs type bapiknumhs occurs 0 .
data: lt_mem_initial type cnd_mem_initial occurs 0 .
data: h_varkey(100),
h_cond_unit type meins .
selection-screen begin of block bk1 with frame title text_001 .
parameters: i_kschl like a951-kschl, "条件类型
i_matnr like mvke-matnr,