2008年10月7日火曜日

自己做的ALV例子(DN List)

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L1S31 { font-style. italic; color: #808080; } .L1S32 { color: #3399FF; } .L1S33 { color: #4DA619; } .L1S52 { color: #0000FF; }
S6j2Vjo?0}0*&---------------------------------------------------------------------*
~8vkd-o/F6v�lA%W0*& Report ZPPR013A *
3JI�vu$E_9RC0*& *ITPUB个人空间x"bC-PP2w5oy
*&---------------------------------------------------------------------*ITPUB个人空间Y#q G ^ h"|-yX
*& *ITPUB个人空间J$XXTI_u0[
*& *ITPUB个人空间1c0jΜe _){
*&---------------------------------------------------------------------*ITPUB个人空间wj2S({4\&D)y\
ITPUB个人空间S~$H"ML v
REPORT ZPPR013A NO STANDARD PAGE HEADING..ITPUB个人空间D$P.x kM|6D DX
ITPUB个人空间m#S+Y)c%iA`"Alj
TABLES: LIKP, "SD Document: Delivery Header Data
0QH9f"PNY6`j7l0 LIPS, "SD document: Delivery: Item dataITPUB个人空间c-~ [;c:I| l.}y
VBAK,ITPUB个人空间`ZSdm
VBAP,ITPUB个人空间_1B.~)R1vq~:yy8fh
VBKD,
ACr2B)v+hA{z]'l'A:R0 VBUK, "Sales Document: Header Status and Administrative Data
}(T z j Ec0 T001W,
I%B^vY5}PR i;Wg'K0 KONH,
9f%a }#W6Q0 KONP,
]yn9^3pg0[0 KONV.
t?f q3L0ITPUB个人空间 Kv:i$Tq)uP&h0P3o
DATA: BEGIN OF ST_DN OCCURS 0,ITPUB个人空间| O eKM6hW
VBELN LIKE LIKP-VBELN,ITPUB个人空间B l1c+q1\]}
LFDAT LIKE LIKP-LFDAT,
r oA"f2jTo;x0 DNMON(6) TYPE C,
E6{#n9rK"G/K$OA0 KUNNR LIKE LIKP-KUNNR,
-P3]tZ:Y"K%T+n&~Bf0 KUNAG LIKE LIKP-KUNAG,
J M&X\?u Gtk'l vY0 WERKS LIKE LIPS-WERKS,
'h%?o"E8Ly;}4dG0 LGORT LIKE LIPS-LGORT,ITPUB个人空间M0_0A Afz0z]@
POSNR LIKE LIPS-POSNR,
(g+k f9@1H-y,w0 MATNR LIKE LIPS-MATNR,
+Ng9tp#M.F&V A0 MAKTX LIKE MAKT-MAKTX,ITPUB个人空间whdU,ikK Wy
VFLAG(1) TYPE C,
Cj3C8W]~MDX0 LFIMG LIKE LIPS-LFIMG,ITPUB个人空间 Q vu)m�r@Ka.{,c
VRKME LIKE LIPS-VRKME,ITPUB个人空间�x/kng5Fv9k%}
VFACT TYPE P DECIMALS 2,ITPUB个人空间}t'L$fd-W
BUQTY LIKE LIPS-LFIMG,ITPUB个人空间,tmKzp%D4e
MEINS LIKE LIPS-MEINS,
6oYx7BT&R-}0 CHARG LIKE LIPS-CHARG,ITPUB个人空间'eq$_3k?O6p-rE
NTGEW LIKE LIPS-NTGEW,ITPUB个人空间3Se/? {8[ f+`W
BRGEW LIKE LIPS-BRGEW,ITPUB个人空间xU8d0kM'|
VGBEL LIKE LIPS-VGBEL,ITPUB个人空间#q6dLw1xRcv{8m;N
VGPOS LIKE LIPS-VGPOS,ITPUB个人空间&d&Of0m/[
NTPRI TYPE P DECIMALS 4,
X j8R$c\+I0 WAERK LIKE VBAP-WAERK,ITPUB个人空间6y6y1|(?(gYo
NTAMT LIKE VBAP-NETWR,ITPUB个人空间CK2T$W+TP G&N@:A:ML
NTPR2 TYPE P DECIMALS 4, "SO PRICE USDITPUB个人空间|hE'Jp@
NTAM2 LIKE VBAP-NETWR, "SO AMOUNT USDITPUB个人空间A2e`m i�VNg
NTAM3 LIKE VBAP-NETWR, "SHIP AMOUNT USDITPUB个人空间 z'km/@L
BSTKD LIKE VBKD-BSTKD,
'q#{$qEI)q4d`+j!`0 WBSTK LIKE VBUK-WBSTK,
Hu"E"p"ELmp%H a0 FKSTK LIKE VBUK-FKSTK,
+s2PI_PA[}|6n0 INVNO LIKE VBRP-VBELN,
8Z/z(M$[#yvN;V;|^0 INMON(6) TYPE C,ITPUB个人空间LR+nX0Qk
FKDAT LIKE VBRK-FKDAT,ITPUB个人空间�t)~ ex$y7m{aFn
NETWR LIKE VBRP-NETWR,
M"V4V.T"[R(JA0 END OF ST_DN.ITPUB个人空间P9~G,UFL~
DATA IT_DN LIKE ST_DN OCCURS 0 WITH HEADER LINE.
2S j&iwF @D1O0ITPUB个人空间E_jH2]
type-pools: slis.
1[Md xCJ3j)x0data: i_fieldcat type slis_t_fieldcat_alv,
| ^kY e{H!^0 l_fieldcat type slis_fieldcat_alv,ITPUB个人空间%b*GqLt5XAo
xevents type slis_t_event,
2a;P ]H+g,Rm0 is_event type slis_alv_event,
Va)ac? [#S0 slis_ev_top type slis_formname value 'TOP-OF-PAGE',
Q Dbc9DZZ{0 v_repid type sy-repid,ITPUB个人空间 D5tuma^y
gs_tab_head type slis_tabname.
1QJ�]c zH0ITPUB个人空间9c p+Pb@n.g-_$Q
ITPUB个人空间6j{4A4glhI
SELECTION-SCREEN BEGIN OF BLOCK VEN WITH FRAME TITLE TEXT-100.ITPUB个人空间�] BT5jE)U
SELECT-OPTIONS:ITPUB个人空间)x }dj?
WBS FOR LIPS-PS_PSP_PNR,
!DLSE9LE0c-Yl!~|0 DNNO FOR LIKP-VBELN,
/y+d'pR/U\/DM:B0 PDATE FOR LIKP-WADAT_IST,
"h S*~'xmATnK0 MATNO FOR LIPS-MATNR,ITPUB个人空间Hbiq{\ y
PLANT FOR LIPS-WERKS,ITPUB个人空间_Og,n dD i#J/R3Yn6O
LOCAT FOR LIPS-LGORT,ITPUB个人空间�ds~7C8Q+]l!VQ
CUSTO FOR LIKP-KUNNR,ITPUB个人空间h;}gqgQ kwbB
SALTO FOR LIKP-KUNAG,ITPUB个人空间`"?_+t C
SOTYP FOR VBAK-AUART,ITPUB个人空间s4rt;Kx3S%r
SONO FOR LIPS-VGBEL,
oUXSQ*h%E0 GSTAT FOR VBUK-WBSTK,ITPUB个人空间Q1ks ~.z-K6u
BSTAT FOR VBUK-FKSTK.
h:kGY7}R-c0* ISTAT FOR VBUK-FKIVK.ITPUB个人空间v5\:So0\}T-|
SELECTION-SCREEN SKIP.ITPUB个人空间S\iZ*Oj"[t[$x
PARAMETERS: BATCH TYPE C AS CHECKBOX DEFAULT 'X'.ITPUB个人空间_#xwN2Yv
SELECTION-SCREEN END OF BLOCK VEN.ITPUB个人空间6w�fhZCj9[H3\Q N
ITPUB个人空间7t%XT`;qx p

*T&Nvl5M`i x([0START-OF-SELECTION.ITPUB个人空间&xi(MAKA r7}
ITPUB个人空间q/R0\sDh j
PERFORM GET_DATA.
"@&m Vl'Z%Z"KD0
sg | J&@)`.dp0 CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
O)E8YTq0 EXPORTING
I.[a sP;gw&a5J9X r0 I_LIST_TYPE = 0
q5j7]5~MPQ8d0 IMPORTING
|M4H8f!R2c2@+]0ew0 ET_EVENTS = xeventsITPUB个人空间bsmm!T�[
EXCEPTIONS
&H?e*xr d0 LIST_TYPE_WRONG = 1ITPUB个人空间rX C;jnWV |
OTHERS = 2.
iun)^+hw�S0 IF SY-SUBRC <> 0.ITPUB个人空间 l,wTz)q-H7x?K$[+o
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNOITPUB个人空间a w!t)r)D;`\{ AI5C
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.ITPUB个人空间"O)_P*K4e~
ENDIF.ITPUB个人空间/qU)^m!{8c`
ITPUB个人空间#qB1CG)IQ"y-t
read table xevents with key name = slis_ev_top into is_event.
1k3M S5GEu0 if sy-subrc = 0.ITPUB个人空间5Q y/s3Z q
move slis_ev_top to is_event-form.
3j,Z&S&N;a],q0 append is_event to xevents.
W2x{ f6O3w+m#k\!x0 endif.
8NIE3m;_v4H0ITPUB个人空间V+r)t{@\}_9mB~T
gs_tab_head = 'ST_DN'.
at;O i-b~}0ITPUB个人空间S{ xH�J:h6k0k
v_repid = sy-repid.ITPUB个人空间"P1_.FB6H

x:sk3yUh0 CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
#U/LQ$FNc)`.q0 EXPORTINGITPUB个人空间e WX X7Fa
I_PROGRAM_NAME = v_repidITPUB个人空间VtE3_:N.\;o%R
I_INTERNAL_TABNAME = gs_tab_head
*h#[9x3E s$h(^0|X0 I_CLIENT_NEVER_DISPLAY = 'X'ITPUB个人空间S&s k`Mn[
I_INCLNAME = v_repidITPUB个人空间*T1D2U2E7e�XE @:ar
CHANGING
%A@BjI4d%R0 CT_FIELDCAT = i_fieldcatITPUB个人空间 \7F qa;qi
EXCEPTIONSITPUB个人空间n6Y{,d+ks5Y:v6J.a
INCONSISTENT_INTERFACE = 1ITPUB个人空间bj5|:LGT'@
PROGRAM_ERROR = 2
Rpl`!T3ZM0 OTHERS = 3.ITPUB个人空间7lqJJH;Z K5H'U
IF SY-SUBRC <> 0.
#Ky*e/sk0g0 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNOITPUB个人空间/{L pP!E@
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
0Cwk5C0x{�e J]S!m0 ENDIF.
'kk2o?6IC*S(J0
9b \[8n"E@5u0 PERFORM BUILD_FIELDCAT.ITPUB个人空间0l+p*ew;} ]"~w
ITPUB个人空间(Sh3d+}7L @"j
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
l)L4K$zh4e0 EXPORTINGITPUB个人空间`(O,C6@'N5r&H
I_BYPASSING_BUFFER = 'X'
`b8M6?2A%H-BD0 I_BUFFER_ACTIVE = ' '
E ? m*tcCtH'B0 I_CALLBACK_PROGRAM = v_repid
N(P&uYL_ s {0 I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-HEAD'
P(]7LN(v,?0 i_callback_user_command = 'USER_COMMAND'ITPUB个人空间P2Z~O'p
IT_FIELDCAT = i_fieldcatITPUB个人空间y0Pf%T,K1?*A
I_SAVE = 'A'ITPUB个人空间pLTZ+t&Fgh!rU
IT_EVENTS = xeventsITPUB个人空间8me&[/o!Z
TABLESITPUB个人空间&L!_ b,MD*]�e3|(b
T_OUTTAB = it_dnITPUB个人空间*Y5R4dHU m
EXCEPTIONSITPUB个人空间)g0F0yZj R
PROGRAM_ERROR = 1ITPUB个人空间 iI.^�`;O)Ra5C
OTHERS = 2.
$_d-yo#N/r!l0 IF SY-SUBRC <> 0.
AyCQ�aM8Z0 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
o bD4Z)M,O;y�S`0 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
.b6g2Z ~#]6e8HF0 ENDIF.ITPUB个人空间*x9E C2WsB1ttY3`w

5~N8N8o$G(DaV~p0*&---------------------------------------------------------------------*
:~Z]|4zpi0*& Form user_command
~T"e\�_L/`X;B0*&---------------------------------------------------------------------*ITPUB个人空间 Y Z\f}u H T1F
* text
3p9h#]\&sK~ z,R]0*----------------------------------------------------------------------*ITPUB个人空间�M$kZy+]
* -->R_UCOMM textITPUB个人空间:x%|+p$T$z!Wg�fk1q(` M-Y
* -->RS_SELFIELD text
K-v&hU�^:@!V0*----------------------------------------------------------------------*
#Es,N(v"[Q0FORM user_command USING r_ucomm LIKE sy-ucommITPUB个人空间9I1@:p^1`:pu
rs_selfield TYPE slis_selfield.ITPUB个人空间`/AjO3ioDf(L+E
ITPUB个人空间{7_ b[1|'lk$w

8w/d,b o [ n.E.^so0 IF rs_selfield-fieldname EQ 'VBELN'.
~IMk}(rQ1kj n0 READ TABLE IT_DN INDEX rs_selfield-tabindex.ITPUB个人空间 k\+FL7w/^'S,~
SET PARAMETER ID: 'VL' FIELD IT_DN-VBELN.ITPUB个人空间m�vBY:cA'N
CASE r_ucomm.
I5?"_~gT+Yf0 WHEN '&IC1'.ITPUB个人空间Sa{Uae
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
ee8l|F4b3M:gfPo0 ENDCASE.
|m {(U%`,@0 ENDIF.ITPUB个人空间 [m7E^,z7S

z7@4n+Dk3{Jx0 IF rs_selfield-fieldname EQ 'MATNR'.
d:V}U"f9G+^9K$Y0 SET PARAMETER ID 'MXX' FIELD 'K'.ITPUB个人空间OJQ'X C/xD
READ TABLE IT_DN INDEX rs_selfield-tabindex.ITPUB个人空间;Yt[4H0Vh{
SET PARAMETER ID: 'MAT' FIELD IT_DN-MATNR.ITPUB个人空间+[2Z }AD#h/Ar
CASE r_ucomm.
8|6u/lw-d#@6}0 WHEN '&IC1'.
Ujo R~sWP0 CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.ITPUB个人空间w/Av�{v8G q
ENDCASE.
VjP l)Dy4c(^ }G0 ENDIF.
$Z,Tx`3GBf!]0ENDFORM. "user_command
_] c!V(p(Y0ITPUB个人空间q k]-^ m H
ITPUB个人空间 IKS|-].kd
*&---------------------------------------------------------------------*
Ai |*Ymi ].eci0*& Form BUILD_FIELDCAT
kEo\ o2k,jY0*&---------------------------------------------------------------------*
-@ Z'K7YFL;m4o0* text
.aO5F?7G*e nr!nZk0*----------------------------------------------------------------------*
;@*K,X$@ W6CD}_0FORM BUILD_FIELDCAT.
8g&p:?8h B9D Y:W0 loop at i_fieldcat into l_fieldcat.
$x)vN#b8~+P0 if sy-langu = 'E'.ITPUB个人空间1r0GOE.g8gEN
case l_fieldcat-fieldname.
\],{$_ m.X�iU}X7z'^;Z0 when 'VBELN'.ITPUB个人空间�@nFJ0g-f0X.X
l_fieldcat-hotspot = 'X'.ITPUB个人空间b2y&d;V]"z v
when 'DNMON'.
W.G�B:T;t-x2Cz ?H.E0 l_fieldcat-seltext_s = 'Month'.
Y+k#ZaA,x8sUl0 l_fieldcat-seltext_m = 'DN Month'.ITPUB个人空间"m+X8@}7hH n
l_fieldcat-seltext_l = 'DN Month'.
ZE {+}2c%s(l0 when 'VFLAG'.ITPUB个人空间:@UD9N Y6@!Yra;v
l_fieldcat-seltext_s = '+/-'.
+n#L}5UIE:L CJ/W0 when 'VFACT'.ITPUB个人空间gZ4BU5U/r`
l_fieldcat-seltext_s = 'Conversion'.ITPUB个人空间Z+v/I6l ]#e+e)l+|)Y
l_fieldcat-seltext_m = 'Conversion'.
'Us}U*Yt Fa}0 l_fieldcat-seltext_l = 'Conversion Factor'.ITPUB个人空间3|1CIUp"h�Oj?
when 'NTPRI'.
)~h.x'g;I __e,OOJ0 l_fieldcat-seltext_s = 'Price'.
6qi^3q7e!t0 l_fieldcat-seltext_m = 'Sales Price'.ITPUB个人空间T3IN `3V/];T
l_fieldcat-seltext_l = 'Sales Price'.
s5s#z7D1k` L2z0 when 'INMON'.ITPUB个人空间xf+~-q,TmA7E Z9aS.}
l_fieldcat-seltext_s = 'Month'.
*P g0mGTN N,h)]0 l_fieldcat-seltext_m = 'Bill.Month'.ITPUB个人空间V:V)K1^#sXE(C
l_fieldcat-seltext_l = 'Billing Month'.
O6dR/Z-q.[3u E0 when 'NTGEW'.ITPUB个人空间-@Pc#r B!v@cd+F}]
l_fieldcat-seltext_s = 'Net(KG)'.ITPUB个人空间0uG9[~B A
l_fieldcat-seltext_m = 'Net weight(KG)'.
s5u/I(w{cz;H0 l_fieldcat-seltext_l = 'Net weight(KG)'.
QZ]x�nMV9TV0 when 'BRGEW'.
$T&[oo e0 l_fieldcat-seltext_s = 'Gross(KG)'.ITPUB个人空间)?4k.S:Gk]h�QFx(Q`
l_fieldcat-seltext_m = 'Gross weight(KG)'.ITPUB个人空间2hL7\3vr#|
l_fieldcat-seltext_l = 'Gross weight(KG)'.
U!ADf;q\KQ0 when 'NTPR2'.ITPUB个人空间0UE w3u:^^;nt sz$gN9t
l_fieldcat-seltext_s = 'Price(USD)'.ITPUB个人空间E1_T5Py'L3o6J
l_fieldcat-seltext_m = 'Sales Price(USD)'.
7A)_qJ I0 l_fieldcat-seltext_l = 'Sales Price(USD)'.
k q:['Av+Hx0 when 'NTAM2'.
}I5?)oC5O0 l_fieldcat-seltext_s = 'Amount(USD)'.ITPUB个人空间9k7k8e [K1^|
l_fieldcat-seltext_m = 'Sales Amount(USD)'.ITPUB个人空间d'W+V/E!pNv
l_fieldcat-seltext_l = 'Sales Amount(USD)'.ITPUB个人空间:g_4F,a(n
when 'NTAM3'.ITPUB个人空间*x L2w3z�`(I6? i
l_fieldcat-seltext_s = 'Amount(USD)'.ITPUB个人空间0x)oc(g'B*R5L$t
l_fieldcat-seltext_m = 'Shipped Amount(USD)'.
3XK)U'Id!h?.e0 l_fieldcat-seltext_l = 'Shipped Amount(USD)'.ITPUB个人空间'@(oK2|*w4{8a
endcase.ITPUB个人空间@X b&Kw
else.ITPUB个人空间$~5reJ Bz)}_
case l_fieldcat-fieldname.
| QP|S:g'H!A:n/fC0 when 'DNMON'.
+Z}8b1n�o.mwg-j0 l_fieldcat-seltext_s = '月'.ITPUB个人空间6J9p2W:z_L6c
l_fieldcat-seltext_m = '交货月'.
7D!cW&P]0 l_fieldcat-seltext_l = '交货月'.
;sJM L#wLw)O0 when 'VFLAG'.ITPUB个人空间{{?)oE*j�q;YC8~
l_fieldcat-seltext_s = '+/-'.ITPUB个人空间Py8K8Z+L
when 'VFACT'.ITPUB个人空间 K9T&o&|U W/d@
l_fieldcat-seltext_s = '比率'.ITPUB个人空间&n"{+l$ag"s1dY
l_fieldcat-seltext_m = '比率'.ITPUB个人空间gI_'fa5g$TD
l_fieldcat-seltext_l = '比率'.ITPUB个人空间SMo1R z*v8Av4ZE
when 'NTPRI'.ITPUB个人空间j9P$E;x!Gmz
l_fieldcat-seltext_s = '价格'.ITPUB个人空间)AEW9R^O P&z
l_fieldcat-seltext_m = '销售价格'.ITPUB个人空间7D%A8K"I�O I
l_fieldcat-seltext_l = '销售价格'.
2il%I&{�u o0 when 'INMON'.
u-R6SJ8|OA#{f0 l_fieldcat-seltext_s = '月'.ITPUB个人空间�Z;S-{T7H4Z0w*^r
l_fieldcat-seltext_m = '发票月'.ITPUB个人空间eLXi+S2pk8A
l_fieldcat-seltext_l = '发票月'.ITPUB个人空间Z%K#C#E Cm
when 'NTGEW'.
UR2xl:]0A(|)bn/h0 l_fieldcat-seltext_s = '净重(KG)'.
&A toK7G-KL oc0 l_fieldcat-seltext_m = '净重(KG)'.ITPUB个人空间7S8Q*O3M-Q�M(J7Z
l_fieldcat-seltext_l = '净重(KG)'.ITPUB个人空间.y.c|(S$J3^+|\
when 'BRGEW'.ITPUB个人空间*@7m!@W1s)j w
l_fieldcat-seltext_s = '毛重(KG)'.ITPUB个人空间COeAA'P~ K
l_fieldcat-seltext_m = '毛重(KG)'.ITPUB个人空间 K3Vg L)GW2[6p*qK
l_fieldcat-seltext_l = '毛重(KG)'.
p yC P@:T!X0 when 'NTPR2'.ITPUB个人空间C a6prtz){9l
l_fieldcat-seltext_s = '价格(USD)'.ITPUB个人空间&A;|}y6Qy!`
l_fieldcat-seltext_m = '销售价格(USD)'.
p#yJPNss0 l_fieldcat-seltext_l = '销售价格(USD)'.ITPUB个人空间kC5u E7T%a
when 'NTAM2'.
7d,K5[d"P:y:Qx0 l_fieldcat-seltext_s = '总价值(USD)'.ITPUB个人空间xa@2Nb gKX`
l_fieldcat-seltext_m = '总价值(USD)'.
k:q/ep.hlG0 l_fieldcat-seltext_l = '总价值(USD)'.ITPUB个人空间QScV ^9`X1k
when 'NTAM3'.
]0{ r](E*g7nT0 l_fieldcat-seltext_s = '走货价值(USD)'.ITPUB个人空间3{!Tw @u7]6I;I/d8`
l_fieldcat-seltext_m = '走货价值(USD)'.
o^,J+C&~3Y$PWf0 l_fieldcat-seltext_l = '走货价值(USD)'.
N G b2LoK#i0{0 endcase.
:Q,m Ol6f0 endif.ITPUB个人空间BMZ9ci8oN

9~_c6RG/O"]5d0 modify i_fieldcat from l_fieldcat.ITPUB个人空间K8I)f'g&pq*R
endloop.ITPUB个人空间�PP d:x*i\j
ENDFORM. "BUILD_FIELDCATITPUB个人空间1u@}(^N2z'R O
ITPUB个人空间t/H3wO+w;H$`
*&---------------------------------------------------------------------*
0d{bn%bN)fu q0*& Form top-of-headITPUB个人空间vl V eN3_ C4BL fTx
*&---------------------------------------------------------------------*ITPUB个人空间F(j_/w$P.B/G
* text
f2rkQteYhi dr0*----------------------------------------------------------------------*
:tO*Q!ECX A6fC$SE0X0form top-of-head.ITPUB个人空间0G?�j#u!e/~L'n
data: t_header type slis_t_listheader,ITPUB个人空间&kd(}Rs7x1M'ml0f
wa_header type slis_listheader.
`G(P wpi0ITPUB个人空间'M�Q-|4a t*ws
data v_value1(18) type c.ITPUB个人空间y�c{ x _Jo/}+A']
data v_value2(18) type c.ITPUB个人空间N^.OPy8z)b
data v_info(60) type c.
$o(~O U,d7gtlg0
8VR)j m lW0 if wbs is not initial.
M1H!cEII6G H0 v_value1 = wbs-low.
+Kv*m�x&T)P.[Gvh0 v_value2 = wbs-high.ITPUB个人空间8y#jRj,l9i
concatenate v_value1 ' To ' v_value2 into v_info separated by space.ITPUB个人空间H(K2X _A
ITPUB个人空间 HL4IP5t
clear wa_header.ITPUB个人空间B?5TCu9dA7r gi
wa_header-typ = 'S'.
A$Z&Yr@�?_&?�K7G c0 if sy-langu = '1'.
O:g�x}}].T#S0 wa_header-key = 'WBS 项目 '.ITPUB个人空间j FY7loe i
else.
8G Mo,g8Q�a*T0E0 wa_header-key = 'WBS Element '.
aO#{-ZOl0 endif.
0\1p#}F7lfx)S$|1{0 wa_header-info = v_info.
?}kp!A?!Wj X)x0 append wa_header to t_header.
] \+E d0{!C0 endif.ITPUB个人空间VL9b l;p1gp*{"DR
*-----------------------------------------------------------
%xwHc;p'v0 if dnno is not initial.
2a2Q{+i `;iT2stw0 v_value1 = dnno-low.
x�Z!K%aj0 v_value2 = dnno-high.ITPUB个人空间`.x]Q"IQ
concatenate v_value1 ' To ' v_value2 into v_info separated by space.ITPUB个人空间s4v,]`JtaS N-C

z$Umsno5p0 clear wa_header.ITPUB个人空间Q j1~;^2[O)Fc"?e.V
wa_header-typ = 'S'.ITPUB个人空间 z.H[fg
if sy-langu = '1'.
\He:e�w(z+B;lRtL/W0 wa_header-key = '交货单号 '.ITPUB个人空间%ZYJ:v7XK0o
else.
4C7_(lu~%rJl0 wa_header-key = 'DN Number '.ITPUB个人空间9B2\&I;h O
endif.
,b3R0i'iDi0J0 wa_header-info = v_info.ITPUB个人空间4jl.j pc S HqJ
append wa_header to t_header.ITPUB个人空间8wgnN$v[ c!NeVVn
endif.ITPUB个人空间D| a(jI*q)@/k'W,i
*-----------------------------------------------------------
DC~s?kx0 if pdate is not initial.ITPUB个人空间o`!^c0jEJ e&n
v_value1 = pdate-low.
'z�~4vmPEg7_/`lj0 v_value2 = pdate-high.ITPUB个人空间"_-Y"BK*ua)N
concatenate v_value1 ' To ' v_value2 into v_info separated by space.ITPUB个人空间y�w R3K$I){*S!Ap

9g jV1q"e{ S0 clear wa_header.ITPUB个人空间ZJ,w3SkM
wa_header-typ = 'S'.ITPUB个人空间6j D(T x3s+rn._
if sy-langu = '1'.ITPUB个人空间2?8x+G6k)n/m \
wa_header-key = '实际发货日期 '.ITPUB个人空间2X y'p[|e
else.
!v&kX1XJ9zZ.N[0 wa_header-key = 'Posting Date '.ITPUB个人空间#r;zH5O Hv
endif.ITPUB个人空间TP*noY
wa_header-info = v_info.ITPUB个人空间 V-L&me#jM-l@
append wa_header to t_header.
5q+O;`w1`T0 endif.ITPUB个人空间*x1~ v{X3w
*-----------------------------------------------------------
6R:|&|\E+i0Y6e0 if matno is not initial.ITPUB个人空间5F W;|'O#G7A CU
v_value1 = matno-low.
3t cRurF#_ [^0 v_value2 = matno-high.ITPUB个人空间2sE3`%X3a[6P*Vx4x
concatenate v_value1 ' To ' v_value2 into v_info separated by space.
*P}%[.gl0
(?*w9I#ejNj%H aG0 clear wa_header.
_&C%j$Z2_0Q-oC['M&GN0 wa_header-typ = 'S'.
G"E{/A+C)\/MG�C u+m0 if sy-langu = '1'.ITPUB个人空间cGW cp,j6r
wa_header-key = '物料编号 '.ITPUB个人空间Wbt.g\Ob
else.
g+pZ?y/^ FS0 wa_header-key = 'Material '.ITPUB个人空间/i uZ/}8_H"YT
endif.
RUPY%TQ.S.a8a0d(Xo0 wa_header-info = v_info.
&Wm6]n!lu(cdf0 append wa_header to t_header.
F3E6?V vf%G d1@0 endif.
8`/DpHr4J~6i0*-----------------------------------------------------------ITPUB个人空间LR:xx9L"Kf4D~
if plant is not initial.
{+M`HhT`-s'F0 v_value1 = plant-low.ITPUB个人空间l"^{ \VbN$c
v_value2 = plant-high.
L%~8Er a J1q"\.L-wK0 concatenate v_value1 ' To ' v_value2 into v_info separated by space.ITPUB个人空间 X4Mef+HAW&}

5V7Z"})a&FJ'vX0 clear wa_header.
Y%Ih I n/I]0 wa_header-typ = 'S'.
ffDDyt0 if sy-langu = '1'.
"K:gP-q|'Qf @O0 wa_header-key = '工厂 ' .
Ke'~6k Q%? b1^0 else.
2`%M yNSw+vS0 wa_header-key = 'Plant '.
*iY9}}_-F-my_l~0 endif.
2Z@M�Pu3H;s0 wa_header-info = v_info.ITPUB个人空间5kQ5W^y"I[/H\
append wa_header to t_header.ITPUB个人空间{Fw3gVO2Q?B
endif.ITPUB个人空间PZG N1[
*-----------------------------------------------------------
_"et7Gj0 if locat is not initial.ITPUB个人空间KN"\8p#Vpz9g)|
v_value1 = locat-low.ITPUB个人空间xe;jx m[b#vQN
v_value2 = locat-high.ITPUB个人空间vL0\CRX
concatenate v_value1 ' To ' v_value2 into v_info separated by space.ITPUB个人空间#^b8\qp.J(f
ITPUB个人空间9j v C8Cq o1w
clear wa_header.
&WI(BY(Gs]5QB0 wa_header-typ = 'S'.
#t7| H�\'r SrhS0 if sy-langu = '1'.ITPUB个人空间'lv n X+H
wa_header-key = '仓位 '.
?J�A�O.[E8M0 else.
6X'G3XO_vcw0 wa_header-key = 'Location '.
.mS9~:N3u*R&b(C1w8n~$t6{0 endif.
d-}cS^CBK0 wa_header-info = v_info.
Nd3V#pcn9TI,W0 append wa_header to t_header.ITPUB个人空间LnM2c H"^*tY
endif.
3[!_#S:sW'E.C/G$G0*-----------------------------------------------------------
lg;[*t8c&K0 if custo is not initial.
O*u!r6r s~6yk(}{0 v_value1 = custo-low.
;b pXGB~0 v_value2 = custo-high.
r c$m!UR5s3C0 concatenate v_value1 ' To ' v_value2 into v_info separated by space.
`)uZ5r0nz�lj1d0ITPUB个人空间2G7E,KS.w
clear wa_header.
'q;y0`%OB6F,i'UMF CZ0 wa_header-typ = 'S'.
:@L.P-RY EN5K%i0 if sy-langu = '1'.
H-x7Q0t8r*I0 wa_header-key = '送达方 '.ITPUB个人空间W yq�mh7HV,aC
else.ITPUB个人空间 kj ~o4u,{ Z
wa_header-key = 'Ship-to Party '.ITPUB个人空间hW%?'?8}-Q oJ
endif.ITPUB个人空间.};A Z qHX�YOB
wa_header-info = v_info.
4^)~3^:~kR#CE)f.^ Y]0 append wa_header to t_header.
wK`.r4J0 endif.ITPUB个人空间*G h!z;v;J }0I0T
*-----------------------------------------------------------ITPUB个人空间G3z h8RacY5z
if salto is not initial.
5leAtk%O-IL6d0 v_value1 = salto-low.
X�K8H[D7[0 v_value2 = salto-high.ITPUB个人空间hd2XI_|
concatenate v_value1 ' To ' v_value2 into v_info separated by space.
SX b�P8p�kJY0
;j&i r*f%xSUDB J0 clear wa_header.ITPUB个人空间&QPfv.|7?5E_ZZ
wa_header-typ = 'S'.
eUK a6P|:c0L0 if sy-langu = '1'.
9hI)M+c6|)G0 wa_header-key = '售达方 '.ITPUB个人空间}sTr"E/a@
else.ITPUB个人空间[8v }4K zx
wa_header-key = 'Sold-to Party '.ITPUB个人空间$wk.C6a ztnu
endif.ITPUB个人空间 lc3n(m @5]
wa_header-info = v_info.ITPUB个人空间0Q D"sb-?-{wH3`
append wa_header to t_header.
8XO;d%Z-Wa0 endif.
:VUV:`\7d%x2\%u#r0*-----------------------------------------------------------ITPUB个人空间 x a+KWf.z*g S
if sotyp is not initial.ITPUB个人空间2D.KS x�T7A s
v_value1 = sotyp-low.
6`5Yj5r.ww5O0 v_value2 = sotyp-high.
Ud xN\0 concatenate v_value1 ' To ' v_value2 into v_info separated by space.ITPUB个人空间hT'sm(`\|
ITPUB个人空间q6e3F]2C RRvYv r)]N
clear wa_header.ITPUB个人空间M�H5s},]*s o H
wa_header-typ = 'S'.ITPUB个人空间6t)I kJ\7e*s
if sy-langu = '1'.ITPUB个人空间0? l4b)w K
wa_header-key = '订单类型 '.
6y9cIK%u3[L S0 else.
Nz3R3@0Ze$WA0 wa_header-key = 'SO Type '.
.j?M vpE2?^ C0 endif.
zu?n#p u&pg0 wa_header-info = v_info.
e2?]l7s+\4k"Q0 append wa_header to t_header.ITPUB个人空间DTsA6S
endif.
L([B,Rn1F@0*-----------------------------------------------------------
!b b0b%\D&M~0 if sono is not initial.ITPUB个人空间JUuW"CxB
v_value1 = sono-low.
N$]Wmo0 v_value2 = sono-high.
[UmD2a!j#k0 concatenate v_value1 ' To ' v_value2 into v_info separated by space.
!L)d Z+hTV~6Q&_,p0
jC!G0iE'Xm0 clear wa_header.
)L ~~{&Y(s U0 wa_header-typ = 'S'.ITPUB个人空间-@+Au S5D!b0e+DI(`
if sy-langu = '1'.ITPUB个人空间&vA_W)q8K
wa_header-key = '销售订单 '.ITPUB个人空间Ey4d1x.d{(F%g6aW�K-k
else.ITPUB个人空间[-kys'n0h
wa_header-key = 'SO. Number '.
3kxZ7}/FB%W0 endif.ITPUB个人空间3ju6]UT \
wa_header-info = v_info.
:q F#]{7Qc0 append wa_header to t_header.
V9R-w6eM8hr {Yqs0 endif.
`!s:H?H j0*-----------------------------------------------------------ITPUB个人空间6p�aI�?!~:`sI S@ o
if gstat is not initial.ITPUB个人空间 NZK9?2~
v_value1 = gstat-low.
*v(C)L9Np{b*A,t0 v_value2 = gstat-high.ITPUB个人空间_Pb[K*N
concatenate v_value1 ' To ' v_value2 into v_info separated by space.
.e8|DY i'k K0ITPUB个人空间pXk Q%~;S(X
clear wa_header.ITPUB个人空间+\#u!bDFT8i)E
wa_header-typ = 'S'.
L in1s!s!i0 if sy-langu = '1'.ITPUB个人空间1D-p6|e/nt$en
wa_header-key = '发货状态 '.ITPUB个人空间W9LbcR*zCM
else.ITPUB个人空间sj.f&y,z;Oz
wa_header-key = 'GoodsIss Status'.ITPUB个人空间#{cH&mfF @
endif.
.FM&rrQj[0 wa_header-info = v_info.ITPUB个人空间ho!R?.Fl` O
append wa_header to t_header.ITPUB个人空间M8z2l2\&e5V4|O
endif.
;s ~@K*{~\0*-----------------------------------------------------------
I1ow-u!yXv#w0 if bstat is not initial.ITPUB个人空间 ~ OW&bu v!_ q#|'x
v_value1 = bstat-low.
qC*@,P#st0 v_value2 = bstat-high.ITPUB个人空间se jb |'w
concatenate v_value1 ' To ' v_value2 into v_info separated by space.
~Qj)pAP$~)E0ITPUB个人空间!U G"bN FA*Sn�F
clear wa_header.ITPUB个人空间;SAxpY` t1ow
wa_header-typ = 'S'.
mul v_O }5IZyL H0 if sy-langu = '1'.
P,?qCb0 wa_header-key = '开票凭证状态 '.
4xsQ_(|:L }0 else.ITPUB个人空间v6^$_Rs?k
wa_header-key = 'Bill Doc.Status'.ITPUB个人空间�Z$`T wbY
endif.ITPUB个人空间 sI7P%_#l7~&H*sAnE
wa_header-info = v_info.ITPUB个人空间]zO,l;o&TP5z#h5d |
append wa_header to t_header.
/j^#{G-zX�i0 endif.
7rg!m$VX6x*I*O0*-----------------------------------------------------------
7E U(B9~K0
g4M b.t+^n^reC0 call function 'REUSE_ALV_COMMENTARY_WRITE'
5QFS3L'q]&j0 EXPORTINGITPUB个人空间Xj|8J{9Otp9S
it_list_commentary = t_header.ITPUB个人空间2T{ YT i
ITPUB个人空间1K2C8aE'iy5H�}tjb8L
endform. "top-of-headITPUB个人空间kL,J:?"R,v*Y,\9e wH
*&---------------------------------------------------------------------*
.ykN'qs0*& Form GET_DATAITPUB个人空间 @_F1B2zZ
*&---------------------------------------------------------------------*ITPUB个人空间/|l|*Q$wke
* text
:?(b8c)j)TE&z!K-?,S*Y0*----------------------------------------------------------------------*ITPUB个人空间tV^&T3c-q(S*l
FORM GET_DATA.ITPUB个人空间w,RW+d7f-P
ITPUB个人空间2aQl!VR
DATA WA_LIKP LIKE LIKP OCCURS 10 WITH HEADER LINE.ITPUB个人空间dk?ZP xV`*pg
DATA WA_LIPS LIKE LIPS OCCURS 10 WITH HEADER LINE.ITPUB个人空间,hOn%NC*}M7gC
DATA WA_VBAP TYPE VBAP.ITPUB个人空间6hM(Ps(_`|3Y"s'H
DATA WA_VBRK TYPE VBRK.ITPUB个人空间&JX6E\ b2xn IF
DATA WA_VBRP TYPE VBRP.
UtY/tDu^d0 DATA WA_VBKD TYPE VBKD.
+\/f&nl@d+b)].}0 DATA WA_VBAK TYPE VBAK.
J L N b C0 DATA VA_KONV TYPE KONV.
K1Zn6iEg$hY7K0 DATA V_FLAG(2) TYPE C.ITPUB个人空间*` i[9w�U+B
DATA V_NTPR TYPE P DECIMALS 4.
R,fKHE0OR q0 DATA V_NTPR2 TYPE P DECIMALS 4.ITPUB个人空间 T4uC2XpaD6M
DATA V_NTAM2 TYPE VBAP-NETWR.ITPUB个人空间gK(E}/VAt'~0P
DATA V_NTAM3 TYPE VBAP-NETWR.
c i.r9L�^8A x7A\]0 DATA V_PRSDT TYPE VBKD-PRSDT.ITPUB个人空间u.f'I+^7X"b
ITPUB个人空间hA S?2P3N,U%` |
DATA: BEGIN OF WA_VBUK OCCURS 10,
5k J {6ov[l;Y0 WBSTK TYPE VBUK-WBSTK,ITPUB个人空间Ru3| T2]4P!k&s
FKSTK TYPE VBUK-FKSTK,ITPUB个人空间~4RX2}c+x;YZV&p?
FKIVK TYPE VBUK-FKIVK,ITPUB个人空间s(@:X#O�k:{~
END OF WA_VBUK.
pe�Q}h L ~H0ITPUB个人空间2N#?G;X[
DATA V_POSDAT TYPE LIKP-WADAT.
qc/I3Kp#dT\!g.u0 DATA V_INVQTY TYPE LIPS-LFIMG.ITPUB个人空间^-F0X%NJ4g
DATA V_NETWGT TYPE LIPS-NTGEW.
+D!K~.[7|,a0 DATA V_GROWGT TYPE LIPS-BRGEW.ITPUB个人空间 A8u9}%`:J0F
DATA V_AUART TYPE VBAK-AUART.
W7Lj_p0 DATA V_FACTOR TYPE P DECIMALS 2.ITPUB个人空间C$a1M#]N_n
DATA DN_MONTH(6) TYPE C.ITPUB个人空间Q,z{!U4T'LX2rq
DATA IN_MONTH(6) TYPE C.ITPUB个人空间|yD;gJ
DATA V_FKDAT TYPE VBRK-FKDAT.ITPUB个人空间3_FUv0s`5y"m0]3}
DATA V_MAKTX TYPE MAKT-MAKTX.ITPUB个人空间5M:T.f;S5x5[~ r
DATA V_NUMBER TYPE KONV-KNUMV.ITPUB个人空间0`j(H P7i8kA
DATA WA_KONV TYPE KONV.ITPUB个人空间 { LaKF/kO}l
DATA V_NUMBER1 TYPE KONV-KNUMV.ITPUB个人空间ed"r*k~2h f
DATA V_NETWR1 TYPE VBRP-NETWR.
2Z\4I.HF0
3[ ^y"RZ5N�C0 CLEAR IT_DN.
r{&jP A�gq0 REFRESH IT_DN.ITPUB个人空间lOr i\?uXK{
ITPUB个人空间&Q9rq(|D ~�f"w$t4Y
*-----------------------------------------------------------------------
6R'fZ/b i�`0 CLEAR WA_LIKP.
ZitP;IH]s0 REFRESH WA_LIKP.ITPUB个人空间]qRzX3O\$Nm
SELECT VBELN KUNNR WADAT WADAT_IST BOLNR KUNAG
L(z%auw)q0 INTO CORRESPONDING FIELDS OF TABLE WA_LIKPITPUB个人空间{#t.DbH `K D-I
FROM LIKP
D7^+h {M+U?Y;z0 WHERE VBELN IN DNNO AND KUNNR IN CUSTO
[0XbvOTn3D6@-A0 AND KUNAG IN SALTOITPUB个人空间/?a U{P'`
AND ( WADAT_IST IN PDATE ORITPUB个人空间(wxf+H-DV2_
( WADAT_IST EQ SPACE AND WADAT IN PDATE ) ) ANDITPUB个人空间6j;~,X1@dO
VBELN IN ( SELECT VBELN FROM VBUK WHERE WBSTK IN GSTAT ANDITPUB个人空间3W1f8zToe4Yt
FKSTK IN BSTAT ) ANDITPUB个人空间z z2w^N
VBELN IN ( SELECT VBELN FROM LIPS WHERE MATNR IN MATNO AND
yR1x1? h7W qd�C0 WERKS IN PLANT AND LGORT IN LOCAT ANDITPUB个人空间+QH LZ&E%[
PS_PSP_PNR IN WBS AND
~}puF�m7E0 VGBEL IN SONO ANDITPUB个人空间`Z"Z*lk?A`
VGBEL IN ( SELECT VBELN FROM VBAK WHERE
0kaoQb!E0 AUART IN SOTYP ) )
z!Fz2rOZ R%V*N0 ORDER BY VBELN.
R2g }@(kzq0
X2u7t*i4v:Tn){0 LOOP AT WA_LIKP.ITPUB个人空间?"~@ QB ln4|NY5E

sSUfQ s^B0* Get the Posting DateITPUB个人空间ec(E%|7t Q#a2Mgs
CLEAR V_POSDAT.
/a)R {EJG0 IF WA_LIKP-WADAT_IST EQ SPACE OR WA_LIKP-WADAT_IST EQ '00000000'.ITPUB个人空间 e.?$o:{'H
V_POSDAT = WA_LIKP-WADAT.ITPUB个人空间_pl:v4u_
ELSE.
COY-n%P8wDL|p0 V_POSDAT = WA_LIKP-WADAT_IST.
'g6n6J5b)_"RMLt0 ENDIF.
8CN~+ha�}'T3[�D0
N WE.h Mh0 CLEAR DN_MONTH.ITPUB个人空间�mphij
DN_MONTH = V_POSDAT+0(6).ITPUB个人空间 x rO-ka W5e3u Iv

)v/be~7O]l*N9t0* GET DN Overall StatusITPUB个人空间-q"wn"?K)T4I
CLEAR WA_VBUK.ITPUB个人空间&|Yjfvn
SELECT WBSTK FKSTK FKIVKITPUB个人空间 ^Vp*~lb]6JS
FROM VBUK
rOwe n-gaB1yR0 INTO WA_VBUK
u%JQzMaA0 WHERE VBELN = WA_LIKP-VBELN.
c nFC{ f'LBy0
%Y2cs#b;y c0 APPEND WA_VBUK.ITPUB个人空间(Y-Q5} `Y1k
ENDSELECT.ITPUB个人空间?/o2m M*Y;J
ITPUB个人空间W-}7D7Tv"v
CLEAR WA_LIPS.
)~oRc"j pb0_c0 REFRESH WA_LIPS.ITPUB个人空间X&| gF6uE�M
IF BATCH EQ SPACE.
-a6I J#N)v&g0 SELECT WERKS LGORT&nb

0 件のコメント: