何为单据别,例如下图,新增的时候开窗选择单据别:
新增单据别:
1、首先在azzi600 系统分类码维护作业里面新增新的系统分类码(在系统分类码24下新增),如图:
2、在azzi910 作业基本数据维护里,修改对应作业的默认单据性质,如下图:
3、在aooi199 单据别设置作业里面新增新的单据别,如下图:
4、在aooi200 单据别维护作业里面新增基本数据,注意单据别编号跟第3步新增的单据别编号一样,如下图:
5、注意,怎样查看参照表编号?在aooi100 组织基本数据维护作业里面查询,注意组织编号就是运营据点,如下图:
6、另外,比如如果是想直接使用axmt500的单据性质,可以现在azzi910把作业的单据性质改成axmt500,之后再在aooi200下查看想要使用的单据别编号,再到zooi199里面把作业编号新增下去,具体见下图:
代码上:
1、在开窗代码上:
#應用 a03 樣板自動產生(Version:3) ON ACTION controlp INFIELD xmmaucdocno #add-point:ON ACTION controlp INFIELD xmmaucdocno name="input.c.xmmaucdocno" #應用 a07 樣板自動產生(Version:3) #開窗i段 INITIALIZE g_qryparam.* TO NULL LET g_qryparam.state = 'i' LET g_qryparam.reqry = FALSE LET g_qryparam.default1 = g_xmmauc_m.xmmaucdocno #給予default值 #170621 by ljr SELECT ooef004 INTO l_ooef004 FROM ooef_t WHERE ooefent=g_enterprise AND ooef001=g_site #給予arg LET g_qryparam.arg1 = l_ooef004 #参照表编号 LET g_qryparam.arg2 = g_code #对应程序编号 CALL q_ooba002_1() #呼叫開窗 LET g_xmmauc_m.xmmaucdocno = g_qryparam.return1 DISPLAY g_xmmauc_m.xmmaucdocno TO xmmaucdocno # NEXT FIELD xmmaucdocno #返回原欄位
注意:
DEFINE l_ooef004 LIKE ooef_t.ooef004
#170621 by ljr
SELECT ooef004 INTO l_ooef004
FROM ooef_t
WHERE ooefent=g_enterprise AND ooef001=g_site
#給予arg
LET g_qryparam.arg1 = l_ooef004 #参照表编号
LET g_qryparam.arg2 = g_code #对应程序编号
CALL q_ooba002_1() #呼叫開窗
以上根据参照表编号和对应程序编号,获取到对应的单据别数据,进行开窗(参考axmt500的订单编号开窗,q_ooba002_1);
其次,还需要在调用s_aooi200_gen_docno 函数,对订单编号进行自动编号,在#add-point:單頭新增前 name="input.head.b_insert" 下增加代码:
IF p_cmd <> 'u' THEN CALL s_transaction_begin() #add-point:單頭新增前 name="input.head.b_insert" #170621 by ljr CALL s_aooi200_gen_docno(g_site,g_xmmauc_m.xmmaucdocno,g_xmmauc_m.xmmaucdocdt,g_prog) RETURNING l_success,g_xmmauc_m.xmmaucdocno IF NOT l_success THEN CALL s_transaction_end('N','0') INITIALIZE g_errparam TO NULL LET g_errparam.code = 'apm-00003' LET g_errparam.extend = g_xmmauc_m.xmmaucdocno LET g_errparam.popup = TRUE CALL cl_err() NEXT FIELD xmmaucdocno CONTINUE DIALOG END IF DISPLAY BY NAME g_xmmauc_m.xmmaucdocno #end add-point
注意:
CALL s_aooi200_gen_docno(g_site,g_xmmauc_m.xmmaucdocno,g_xmmauc_m.xmmaucdocdt,g_prog)
RETURNING l_success,g_xmmauc_m.xmmaucdocno