ABAP源程序---发票校验明细表
生活随笔
收集整理的這篇文章主要介紹了
ABAP源程序---发票校验明细表
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
ABAP源程序---發(fā)票校驗(yàn)明細(xì)表
6 ]??S# q, W; s. s4 O
4 U6 q& l1 Z7 R8 h& r
*&---------------------------------------------------------------------* 4 Y& A& W3 D, F# a$ i% p
*& Report ZSDRP26 * # O# G5 o. i" J. h( L
*& 發(fā)票校驗(yàn)明細(xì)表 *
*&---------------------------------------------------------------------* 7 ]9 Z/ N; l4 j
*& Author: Xavier Xue * : R4 M% `) E5 b9 j
*& * 2 C' L8 p+ @, c1 f; k& A1 O
*&---------------------------------------------------------------------*
REPORT zsdrp26 .
) R" V??H; b: Q' [/ P( l- }
TABLES: rbkp,
rseg,
ekko, - ^, T; x9 G( I9 Z) r
ekpo,
bkpf. ; W, T* j! O8 b) I0 O' e0 |
. C& E8 ^1 U0 k& `( A
*&---------------------------------------------------------------------*
*& 聲明變量和內(nèi)表
*&---------------------------------------------------------------------*
DATA: BEGIN OF header OCCURS 0, $ s7 c6 B' p# J) D( b$ s
belnr LIKE rbkp-belnr, "發(fā)票校驗(yàn)憑證 % b3 t1 `6 b- Z$ G/ U7 D: c
gjahr LIKE rbkp-gjahr, "年度 / h, A1 ~# S. m??U- B# H, S; H! K
vgart LIKE rbkp-vgart, "交易類(lèi)型 % O) e# g4 d. k" C2 r
bldat LIKE rbkp-bldat, "憑證中的憑證日期 1 m0 f2 L: ^9 O
budat LIKE rbkp-budat, "記帳日期 1 X2 a1 q/ r/ E7 l6 a+ P, u
rmwwr LIKE rbkp-rmwwr, "總發(fā)數(shù)量
waers LIKE rbkp-waers, "貨幣 + G9 f( g5 V6 c& o" L' Z6 J
zuonr LIKE rbkp-zuonr, " / n9 e% l8 }- H6 |& \
s_belnr like bkpf-belnr, "會(huì)計(jì)憑證
* stblg LIKE rbkp-stblg, "沖銷(xiāo)憑證編號(hào) $ n) C8 W# E/ L??z: O
* stjah LIKE rbkp-stjah, "可逆憑證的會(huì)計(jì)年度 ??K4 x- F& ^# C: v) ^! W% ?- `* n
END OF header, : }' S$ Y) Q" g- p
6 T) R" G0 a0 g$ u/ k5 ~1 Z- `
BEGIN OF item OCCURS 0,
belnr LIKE rseg-belnr, "發(fā)票校驗(yàn)憑證
gjahr LIKE rseg-gjahr, "會(huì)度年度 : D& H3 P; v, P??a/ }0 N% h
s_belnr like bkpf-belnr, "會(huì)計(jì)憑證 $ c1 f+ F9 Y: Z) r
bldat LIKE rbkp-bldat, / Z6 y9 x* t7 b; F5 }( u0 N1 \- U
budat LIKE rbkp-budat, ??B: p/ S: l( a* y& \: [4 i??v9 t9 P
rmwwr LIKE rbkp-rmwwr, % b6 u. F+ T3 X8 j
waers LIKE rbkp-waers,
zuonr LIKE rbkp-zuonr, 5 p4 X+ H. Z+ ]% t' H# c
buzei LIKE rseg-buzei, "發(fā)票憑證中的憑證項(xiàng)目 ! o9 c% Q9 D1 |3 E$ X' }, V: Z
ebeln LIKE rseg-ebeln, "采購(gòu)訂單憑證
ebelp LIKE rseg-ebelp, "采購(gòu)訂單項(xiàng)目號(hào) ! X1 b??z- D) ?4 k- T. _/ Q
wrbtr LIKE rseg-wrbtr, "金額 6 X- r9 y- ~5 R( n2 [, a# N
shkzg LIKE rseg-shkzg, "借/貸方
menge LIKE rseg-menge, "數(shù)量 ) ^??a??]0 g; x0 {4 Y2 H: ?6 U
bstme LIKE rseg-bstme, "單位 $ A# ^5 h* |" K: `+ W+ Y- C; y
matnr LIKE ekpo-matnr, "物料編號(hào)
txz01 LIKE ekpo-txz01, "物料描述
text(16) TYPE c, "規(guī)格 ??L( n- o# Y/ S: i. I8 k- ^
END OF item, ( O8 L( O% \) [$ R
( h0 X5 M& X3 X7 F9 `4 f% f
BEGIN OF ekpo_data OCCURS 0, & v% N' ~+ `. `' g7 L
ebeln LIKE ekpo-ebeln, + R0 `' [3 d??r; v+ m* {
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr, : Q( s1 x; n3 j" v, U# X5 d8 J
txz01 LIKE ekpo-txz01,
END OF ekpo_data. % F3 V# D. c5 Z0 {$ M, x' v) h
TYPE-POOLS:slis.
" q3 j7 q* l& n4 b. @$ J
DATA: i_events TYPE slis_t_event WITH HEADER LINE, , o* W2 B# b% U6 F1 k) U4 o; {
i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: w_layout TYPE slis_layout_alv, 2 e& P' t3 o5 k
g_repid LIKE sy-repid. & n/ o# Y7 P* U, I! O; R
*&---------------------------------------------------------------------* 9 p& E??[9 ^, B! Y
*& 定義選擇屏幕 3 h% S* {% y8 Y# f8 Z/ q4 Q/ L??X8 C
*&---------------------------------------------------------------------* 8 W: g! H- t??b% E4 {+ w/ a; g
SelectION-SCREEN BEGIN OF BLOCK block0 WITH FRAME TITLE text-000. 5 T% |0 o3 q. n' k, z2 w" E
Select-OPTIONS: s_belnr FOR rseg-belnr, "發(fā)票校驗(yàn)憑證號(hào)
s_budat FOR rbkp-budat, "記帳日期 ! u+ n1 b! ~0 b$ m( V. E
s_bldat FOR rbkp-bldat, "憑證日期
s_bukrs FOR rbkp-bukrs, "分公司代碼 " c2 Z3 A??T: V& @4 \/ o
s_ekgrp FOR ekko-ekgrp, "采購(gòu)組(辦事處)
s_lifnr FOR rbkp-lifnr. "供應(yīng)商 0 Z! }" E" J3 C6 ?1 m1 Y
SelectION-SCREEN END OF BLOCK block0. . b" s" W5 n2 n) s
*&---------------------------------------------------------------------*
*& 執(zhí)行程序事件
*&---------------------------------------------------------------------* : }% b3 O1 F5 S% B
INITIALIZATION.
g_repid = sy-repid.
START-OF-SelectION.
PERFORM get_header_data. * t" W0 `' @9 ~2 W$ ~
PERFORM get_item_data.
: V- l2 \: m4 f; R??l( _/ ]+ P
END-OF-SelectION. ; Q* H% Q8 U3 f& D) o# y- I
PERFORM sub_init_fieldcat.
PERFORM sub_init_layout. ( ~+ p% i: C/ X
PERFORM sub_listado.
3 `( i! q$ D- q3 i; o
*&---------------------------------------------------------------------*
*& FORM: get_header_data. 讀取抬頭數(shù)據(jù) 9 P/ \7 i% t, W9 i$ b; [" n& L- a* Z
*&---------------------------------------------------------------------* ! d! G0 P' q0 L' t! d; O, ^$ l1 u
FORM: get_header_data.
data: l_awkey like bkpf-awkey.
Select belnr
gjahr 0 M- f2 B: _+ C/ x# h: p' v$ p
vgart 3 t/ R) G) s2 \2 p& Y# ~
bldat " K! F/ U! j5 `??V/ e& W& L* E% n
budat
rmwwr 8 ~! z% Q# E6 t. x. R
waers 7 \6 @* g& p- r3 K4 K
zuonr
FROM rbkp ; x4 X4 E* b! i6 b( a3 J
INTO CORRESPONDING FIELDS OF TABLE header
Where belnr IN s_belnr 6 i* a6 n0 v/ v2 P
AND budat IN s_budat
AND bldat IN s_bldat 8 B* h- t7 q0 L/ x" o
AND bukrs IN s_bukrs 5 W. A' I- j& ^' h- @; b
AND lifnr IN s_lifnr. 5 d9 T( `* H; W
( o* b4 ~+ p5 {$ [??K0 G# X2 N7 g
loop at header.
clear l_awkey.
concatenate header-belnr header-gjahr into l_awkey. ( R7 \: r- r6 t( l
select single belnr from bkpf ! @* }* x* E) m! E6 j. w
into header-s_belnr
where awkey = l_awkey.
. ~, _( l- v' R8 A; I! W9 J4 w6 L7 T; ]
modify header.
endloop. ??O# V6 B- e. z6 r; H# n
ENDFORM. 6 `" h% ^$ v3 K5 O4 R" B; w
*&---------------------------------------------------------------------*
*& FORM: get_item_data. 讀取行項(xiàng)目數(shù)據(jù) ! l2 [9 C1 [) L
*&---------------------------------------------------------------------*
FORM: get_item_data.
CHECK header[] IS NOT INITIAL. 1 E0 L* S" }8 `7 P( {
& ~- o* k" }! a* N8 ^
Select belnr
gjahr
buzei 2 ^/ f7 G1 L$ P3 R1 K- o' i) r
ebeln # P/ v1 s2 v3 W( Y- b) k
ebelp & H! U1 R6 v6 Q5 o??q??}
wrbtr , F2 Y5 j+ v/ T1 @
shkzg & j, Q% @% ~: V5 q4 R2 M! C, ?
menge 8 a; i0 Y+ k# [5 a6 Y/ p) m6 \
bstme + j+ R/ x% M$ N" j
FROM rseg $ C8 V% n3 A: _/ m9 a5 {; N# |
INTO CORRESPONDING FIELDS OF TABLE item ??N+ O2 R6 b8 @+ J! R* Z
FOR ALL ENTRIES IN header
Where belnr = header-belnr ) V* @" K5 b$ |) Q$ @& x
AND gjahr = header-gjahr.
. W; }??\" l2 A7 t. J5 V( }
Select ekpo~ebeln
ekpo~ebelp
ekpo~matnr 7 E5 j; F+ ~??d7 V( N
ekpo~txz01 - }" Q- d# q7 ]??t) Q
FROM ekko INNER JOIN ekpo ON ekko~ebeln = ekpo~ebeln + e7 q7 w/ o/ H3 _* b1 O8 P
INTO CORRESPONDING FIELDS OF TABLE EKPO_DATA
FOR ALL ENTRIES IN item
Where ekpo~ebeln = item-ebeln
AND ekko~ekgrp IN s_ekgrp. - Q0 g+ Y: x% q$ I
3 v: S6 O4 |/ V9 R0 k. w
LOOP AT item. , \, u??|, p: V( x3 z
READ TABLE header WITH KEY belnr = item-belnr 0 C3 {3 `( L! v/ w
gjahr = item-gjahr. ' u. X# R; \; j??~7 Q; ]
item-bldat = header-bldat. * H% b( |) A. ~0 j, U3 r
item-budat = header-budat.
item-rmwwr = header-rmwwr.
item-waers = header-waers.
item-zuonr = header-zuonr. / t/ v; M; U7 m+ P, G/ w' S
item-s_belnr = header-s_belnr. , \; J! g! w& k??]5 _
! j+ {: U' e' p& R1 d4 V7 C. e% Q
IF item-shkzg = 'H'. % z1 E: V% j/ Z) v8 L
item-rmwwr = 0 - item-rmwwr. 7 y) f9 [* Q: h+ ]??b
item-wrbtr = 0 - item-wrbtr.
item-menge = 0 - item-menge. % O2 ]: k5 V2 X9 y! ~/ s; B, J
ENDIF.
PERFORM frm_read_item_text USING item-ebeln item-ebelp item-text.
READ TABLE ekpo_data WITH KEY ebeln = item-ebeln 1 e/ G% d2 e: ]$ o+ g
ebelp = item-ebelp. $ K. X& r, r# R+ _
IF sy-subrc = 0. 8 \8 P3 r& [+ e, D$ Z
item-matnr = ekpo_data-matnr. 8 p: B! _# v2 P
item-txz01 = ekpo_data-txz01. ; m7 I4 q??H% f" ?8 z
MODIFY item. ??R' D, f2 @+ `# x; {??z
ELSE. # D7 b3 Z1 a; v' {
Delete item.
ENDIF.
ENDLOOP.
FREE ekpo_data. + a) Z# l3 @, z' Y$ }. N, i
FREE header. 9 ~, H8 k1 K0 S9 b5 Q) I3 Y- S
ENDFORM.
% c+ {9 s* w( V/ C! s0 H" @7 K$ m
*&---------------------------------------------------------------------* 0 D5 D( {5 `+ v7 o( n$ j
*& FORM:get_wdlgt
*&---------------------------------------------------------------------* - L6 C3 n! O3 t- g/ Z; e
*FORM get_wdlgt using l_ebeln l_ebelp. 7 p0 w1 ]3 o) Y. z% j/ m
*批次信息需要追蹤到交貨中,從交貨單的行項(xiàng)目中獲得物料號(hào),批次號(hào),然后再 & h+ U, t: e0 A- R
*根據(jù)這兩個(gè)數(shù)據(jù)從批次表中取得數(shù)據(jù),然后將根據(jù)數(shù)據(jù)內(nèi)容組合成規(guī)格數(shù)據(jù)
* 1 K5 d7 _9 T: z! X( C0 I0 D
*ENDFORM.
6 ]??S# q, W; s. s4 O
4 U6 q& l1 Z7 R8 h& r
*&---------------------------------------------------------------------* 4 Y& A& W3 D, F# a$ i% p
*& Report ZSDRP26 * # O# G5 o. i" J. h( L
*& 發(fā)票校驗(yàn)明細(xì)表 *
*&---------------------------------------------------------------------* 7 ]9 Z/ N; l4 j
*& Author: Xavier Xue * : R4 M% `) E5 b9 j
*& * 2 C' L8 p+ @, c1 f; k& A1 O
*&---------------------------------------------------------------------*
REPORT zsdrp26 .
) R" V??H; b: Q' [/ P( l- }
TABLES: rbkp,
rseg,
ekko, - ^, T; x9 G( I9 Z) r
ekpo,
bkpf. ; W, T* j! O8 b) I0 O' e0 |
. C& E8 ^1 U0 k& `( A
*&---------------------------------------------------------------------*
*& 聲明變量和內(nèi)表
*&---------------------------------------------------------------------*
DATA: BEGIN OF header OCCURS 0, $ s7 c6 B' p# J) D( b$ s
belnr LIKE rbkp-belnr, "發(fā)票校驗(yàn)憑證 % b3 t1 `6 b- Z$ G/ U7 D: c
gjahr LIKE rbkp-gjahr, "年度 / h, A1 ~# S. m??U- B# H, S; H! K
vgart LIKE rbkp-vgart, "交易類(lèi)型 % O) e# g4 d. k" C2 r
bldat LIKE rbkp-bldat, "憑證中的憑證日期 1 m0 f2 L: ^9 O
budat LIKE rbkp-budat, "記帳日期 1 X2 a1 q/ r/ E7 l6 a+ P, u
rmwwr LIKE rbkp-rmwwr, "總發(fā)數(shù)量
waers LIKE rbkp-waers, "貨幣 + G9 f( g5 V6 c& o" L' Z6 J
zuonr LIKE rbkp-zuonr, " / n9 e% l8 }- H6 |& \
s_belnr like bkpf-belnr, "會(huì)計(jì)憑證
* stblg LIKE rbkp-stblg, "沖銷(xiāo)憑證編號(hào) $ n) C8 W# E/ L??z: O
* stjah LIKE rbkp-stjah, "可逆憑證的會(huì)計(jì)年度 ??K4 x- F& ^# C: v) ^! W% ?- `* n
END OF header, : }' S$ Y) Q" g- p
6 T) R" G0 a0 g$ u/ k5 ~1 Z- `
BEGIN OF item OCCURS 0,
belnr LIKE rseg-belnr, "發(fā)票校驗(yàn)憑證
gjahr LIKE rseg-gjahr, "會(huì)度年度 : D& H3 P; v, P??a/ }0 N% h
s_belnr like bkpf-belnr, "會(huì)計(jì)憑證 $ c1 f+ F9 Y: Z) r
bldat LIKE rbkp-bldat, / Z6 y9 x* t7 b; F5 }( u0 N1 \- U
budat LIKE rbkp-budat, ??B: p/ S: l( a* y& \: [4 i??v9 t9 P
rmwwr LIKE rbkp-rmwwr, % b6 u. F+ T3 X8 j
waers LIKE rbkp-waers,
zuonr LIKE rbkp-zuonr, 5 p4 X+ H. Z+ ]% t' H# c
buzei LIKE rseg-buzei, "發(fā)票憑證中的憑證項(xiàng)目 ! o9 c% Q9 D1 |3 E$ X' }, V: Z
ebeln LIKE rseg-ebeln, "采購(gòu)訂單憑證
ebelp LIKE rseg-ebelp, "采購(gòu)訂單項(xiàng)目號(hào) ! X1 b??z- D) ?4 k- T. _/ Q
wrbtr LIKE rseg-wrbtr, "金額 6 X- r9 y- ~5 R( n2 [, a# N
shkzg LIKE rseg-shkzg, "借/貸方
menge LIKE rseg-menge, "數(shù)量 ) ^??a??]0 g; x0 {4 Y2 H: ?6 U
bstme LIKE rseg-bstme, "單位 $ A# ^5 h* |" K: `+ W+ Y- C; y
matnr LIKE ekpo-matnr, "物料編號(hào)
txz01 LIKE ekpo-txz01, "物料描述
text(16) TYPE c, "規(guī)格 ??L( n- o# Y/ S: i. I8 k- ^
END OF item, ( O8 L( O% \) [$ R
( h0 X5 M& X3 X7 F9 `4 f% f
BEGIN OF ekpo_data OCCURS 0, & v% N' ~+ `. `' g7 L
ebeln LIKE ekpo-ebeln, + R0 `' [3 d??r; v+ m* {
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr, : Q( s1 x; n3 j" v, U# X5 d8 J
txz01 LIKE ekpo-txz01,
END OF ekpo_data. % F3 V# D. c5 Z0 {$ M, x' v) h
TYPE-POOLS:slis.
" q3 j7 q* l& n4 b. @$ J
DATA: i_events TYPE slis_t_event WITH HEADER LINE, , o* W2 B# b% U6 F1 k) U4 o; {
i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA: w_layout TYPE slis_layout_alv, 2 e& P' t3 o5 k
g_repid LIKE sy-repid. & n/ o# Y7 P* U, I! O; R
*&---------------------------------------------------------------------* 9 p& E??[9 ^, B! Y
*& 定義選擇屏幕 3 h% S* {% y8 Y# f8 Z/ q4 Q/ L??X8 C
*&---------------------------------------------------------------------* 8 W: g! H- t??b% E4 {+ w/ a; g
SelectION-SCREEN BEGIN OF BLOCK block0 WITH FRAME TITLE text-000. 5 T% |0 o3 q. n' k, z2 w" E
Select-OPTIONS: s_belnr FOR rseg-belnr, "發(fā)票校驗(yàn)憑證號(hào)
s_budat FOR rbkp-budat, "記帳日期 ! u+ n1 b! ~0 b$ m( V. E
s_bldat FOR rbkp-bldat, "憑證日期
s_bukrs FOR rbkp-bukrs, "分公司代碼 " c2 Z3 A??T: V& @4 \/ o
s_ekgrp FOR ekko-ekgrp, "采購(gòu)組(辦事處)
s_lifnr FOR rbkp-lifnr. "供應(yīng)商 0 Z! }" E" J3 C6 ?1 m1 Y
SelectION-SCREEN END OF BLOCK block0. . b" s" W5 n2 n) s
*&---------------------------------------------------------------------*
*& 執(zhí)行程序事件
*&---------------------------------------------------------------------* : }% b3 O1 F5 S% B
INITIALIZATION.
g_repid = sy-repid.
START-OF-SelectION.
PERFORM get_header_data. * t" W0 `' @9 ~2 W$ ~
PERFORM get_item_data.
: V- l2 \: m4 f; R??l( _/ ]+ P
END-OF-SelectION. ; Q* H% Q8 U3 f& D) o# y- I
PERFORM sub_init_fieldcat.
PERFORM sub_init_layout. ( ~+ p% i: C/ X
PERFORM sub_listado.
3 `( i! q$ D- q3 i; o
*&---------------------------------------------------------------------*
*& FORM: get_header_data. 讀取抬頭數(shù)據(jù) 9 P/ \7 i% t, W9 i$ b; [" n& L- a* Z
*&---------------------------------------------------------------------* ! d! G0 P' q0 L' t! d; O, ^$ l1 u
FORM: get_header_data.
data: l_awkey like bkpf-awkey.
Select belnr
gjahr 0 M- f2 B: _+ C/ x# h: p' v$ p
vgart 3 t/ R) G) s2 \2 p& Y# ~
bldat " K! F/ U! j5 `??V/ e& W& L* E% n
budat
rmwwr 8 ~! z% Q# E6 t. x. R
waers 7 \6 @* g& p- r3 K4 K
zuonr
FROM rbkp ; x4 X4 E* b! i6 b( a3 J
INTO CORRESPONDING FIELDS OF TABLE header
Where belnr IN s_belnr 6 i* a6 n0 v/ v2 P
AND budat IN s_budat
AND bldat IN s_bldat 8 B* h- t7 q0 L/ x" o
AND bukrs IN s_bukrs 5 W. A' I- j& ^' h- @; b
AND lifnr IN s_lifnr. 5 d9 T( `* H; W
( o* b4 ~+ p5 {$ [??K0 G# X2 N7 g
loop at header.
clear l_awkey.
concatenate header-belnr header-gjahr into l_awkey. ( R7 \: r- r6 t( l
select single belnr from bkpf ! @* }* x* E) m! E6 j. w
into header-s_belnr
where awkey = l_awkey.
. ~, _( l- v' R8 A; I! W9 J4 w6 L7 T; ]
modify header.
endloop. ??O# V6 B- e. z6 r; H# n
ENDFORM. 6 `" h% ^$ v3 K5 O4 R" B; w
*&---------------------------------------------------------------------*
*& FORM: get_item_data. 讀取行項(xiàng)目數(shù)據(jù) ! l2 [9 C1 [) L
*&---------------------------------------------------------------------*
FORM: get_item_data.
CHECK header[] IS NOT INITIAL. 1 E0 L* S" }8 `7 P( {
& ~- o* k" }! a* N8 ^
Select belnr
gjahr
buzei 2 ^/ f7 G1 L$ P3 R1 K- o' i) r
ebeln # P/ v1 s2 v3 W( Y- b) k
ebelp & H! U1 R6 v6 Q5 o??q??}
wrbtr , F2 Y5 j+ v/ T1 @
shkzg & j, Q% @% ~: V5 q4 R2 M! C, ?
menge 8 a; i0 Y+ k# [5 a6 Y/ p) m6 \
bstme + j+ R/ x% M$ N" j
FROM rseg $ C8 V% n3 A: _/ m9 a5 {; N# |
INTO CORRESPONDING FIELDS OF TABLE item ??N+ O2 R6 b8 @+ J! R* Z
FOR ALL ENTRIES IN header
Where belnr = header-belnr ) V* @" K5 b$ |) Q$ @& x
AND gjahr = header-gjahr.
. W; }??\" l2 A7 t. J5 V( }
Select ekpo~ebeln
ekpo~ebelp
ekpo~matnr 7 E5 j; F+ ~??d7 V( N
ekpo~txz01 - }" Q- d# q7 ]??t) Q
FROM ekko INNER JOIN ekpo ON ekko~ebeln = ekpo~ebeln + e7 q7 w/ o/ H3 _* b1 O8 P
INTO CORRESPONDING FIELDS OF TABLE EKPO_DATA
FOR ALL ENTRIES IN item
Where ekpo~ebeln = item-ebeln
AND ekko~ekgrp IN s_ekgrp. - Q0 g+ Y: x% q$ I
3 v: S6 O4 |/ V9 R0 k. w
LOOP AT item. , \, u??|, p: V( x3 z
READ TABLE header WITH KEY belnr = item-belnr 0 C3 {3 `( L! v/ w
gjahr = item-gjahr. ' u. X# R; \; j??~7 Q; ]
item-bldat = header-bldat. * H% b( |) A. ~0 j, U3 r
item-budat = header-budat.
item-rmwwr = header-rmwwr.
item-waers = header-waers.
item-zuonr = header-zuonr. / t/ v; M; U7 m+ P, G/ w' S
item-s_belnr = header-s_belnr. , \; J! g! w& k??]5 _
! j+ {: U' e' p& R1 d4 V7 C. e% Q
IF item-shkzg = 'H'. % z1 E: V% j/ Z) v8 L
item-rmwwr = 0 - item-rmwwr. 7 y) f9 [* Q: h+ ]??b
item-wrbtr = 0 - item-wrbtr.
item-menge = 0 - item-menge. % O2 ]: k5 V2 X9 y! ~/ s; B, J
ENDIF.
PERFORM frm_read_item_text USING item-ebeln item-ebelp item-text.
READ TABLE ekpo_data WITH KEY ebeln = item-ebeln 1 e/ G% d2 e: ]$ o+ g
ebelp = item-ebelp. $ K. X& r, r# R+ _
IF sy-subrc = 0. 8 \8 P3 r& [+ e, D$ Z
item-matnr = ekpo_data-matnr. 8 p: B! _# v2 P
item-txz01 = ekpo_data-txz01. ; m7 I4 q??H% f" ?8 z
MODIFY item. ??R' D, f2 @+ `# x; {??z
ELSE. # D7 b3 Z1 a; v' {
Delete item.
ENDIF.
ENDLOOP.
FREE ekpo_data. + a) Z# l3 @, z' Y$ }. N, i
FREE header. 9 ~, H8 k1 K0 S9 b5 Q) I3 Y- S
ENDFORM.
% c+ {9 s* w( V/ C! s0 H" @7 K$ m
*&---------------------------------------------------------------------* 0 D5 D( {5 `+ v7 o( n$ j
*& FORM:get_wdlgt
*&---------------------------------------------------------------------* - L6 C3 n! O3 t- g/ Z; e
*FORM get_wdlgt using l_ebeln l_ebelp. 7 p0 w1 ]3 o) Y. z% j/ m
*批次信息需要追蹤到交貨中,從交貨單的行項(xiàng)目中獲得物料號(hào),批次號(hào),然后再 & h+ U, t: e0 A- R
*根據(jù)這兩個(gè)數(shù)據(jù)從批次表中取得數(shù)據(jù),然后將根據(jù)數(shù)據(jù)內(nèi)容組合成規(guī)格數(shù)據(jù)
* 1 K5 d7 _9 T: z! X( C0 I0 D
*ENDFORM.
總結(jié)
以上是生活随笔為你收集整理的ABAP源程序---发票校验明细表的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SAP中关于物料主数据里物料类型的修改
- 下一篇: 现金流量表整理及开发