---------------------------------------------------------------* *& Report ZWCS_DEL_CREATE *& *&******************************************************************** *--------------------------------------------------------------------* * Object created: Report Program * * -------------------------------------------------------------------* ********************************************************************** * Tite : Dei!er" Creatio# i#ter$ace * * A%tor : 'a!jot Si#g * * Date : ()(+)(, *.%#ctio#a : /ar%# 0a%r * * '%mber PRO1OR : * * * * De2criptio# : Dei!er" Creatio# i#ter$ace ********************************************************************** * Ca#ge Co#tro 3#$ormatio# * ********************************************************************** * CR & Spec'o 4 Date 4 'ame 4 De2criptio# * * 4 4 4 * ********************************************************************** * *&-------------------------------------------------------------------* REPORT ZWCS_DEL_CREATE. ZWCS_DEL_CREATE.
*DATA DECLARAT3O' 3'CL5DE INCLUDE zwcs_del_create_to!" zwcs_del_create_to!". . *SECT3O' 3'CL5DE INCLUDE zwcs_del_create_s!" zwcs_del_create_s!". . PER#OR$ %etc&_data. %etc&_data. PER#OR$ create_del. create_del. PER#OR$ al' al'. .
6 .etc Data 6 Create Dei!er" 6 AL1
*E1E'TS 3'CL5DE INCLUDE zwcs_del_create_%!" zwcs_del_create_%!". .
*&---------------------------------------------------------------------* *& 3#c%de ZWCS_DEL_CREATE_TOP(, *&---------------------------------------------------------------------* T(PES ) E+IN O# t,_'e t,_'e /ELN T(PE /ELN /ELN
POSNR T(PE POSNR EDATU T(PE EDATU END O# t,_'e E+IN O# t,_%01al 023456 T(PE c 'el1 T(PE 'el1 del0' T(PE 'el1 wer7s T(PE wer7s_d edat8 T(PE edat8 2essa3e49::6 T(PE c END O# t,_%01al.
T(PES ) E+IN O# t,_%0eldcat. INCLUDE T(PE sl0s_%0eldcat_al'. T(PES) END O# t,_%0eldcat. Data ) 3t_'e wa_'e 3t_'a wa_'a 3t_'a_& wa_'a_& 3t_re;8est wa_re;8est 3t_0te2 wa_0te2 3t_ret8r1 wa_ret8r1 3t_%01al wa_%01al DATA DATA DATA DATA DATA
T(PE T(PE T(PE T(PE T(PE T(PE T(PE T(PE T(PE T(PE T(PE T(PE T(PE T(PE
STANDARD TALE O# t,_'e t,_'e STANDARD TALE O# 'a 'a STANDARD TALE O# 'a 'a STANDARD TALE O# APIDELICIOUSRE
67EC 'EEDED ) wa_la,o8t T(PE l'c_s_la,o. 67EC 'EEDED ) wa_t0tle T(PE l'c_t0tle. 67EC 'EEDED ) wa_sorts T(PE l'c_t_sort 67EC 'EEDED lt_sort LI=E LINE O# wa_sorts. ) 3t_%0eldcat T(PE TALE O# t,_%0eldcat INITIAL SIZE ! 67EC 'EEDED 67EC 'EEDED wa_%0eldcat T(PE t,_%0eldcat. 67EC 'EEDED ) 3_re0d LI=E s,-re0d 67EC 'EEDED 3_ta1a2e T(PE sl0s_ta1a2e 67EC 'EEDED 3_sa'e4"6 T(PE c 67EC 'EEDED 3s_la,o8t T(PE sl0s_la,o8t_al'.
*&---------------------------------------------------------------------* *& 3#c%de ZWCS_DEL_CREATE_S(, *&---------------------------------------------------------------------*
SELECTION-SCREEN ) e301 o% LOC= " WIT> #RA$E TITLE te?t-!!". SELECT-OPTIONS ) so_'el1 %or wa_'e-'el1 so_edat8 %or wa_'e-edat8 OLI+ATOR( so_wer7s %or wa_'a-wer7s 1o INTER/ALS 1o-E@TENSION OLI+A TOR( so_'stel %or wa_'a-'stel. SELECTION-SCREEN ) END O# LOC= ".
*&---------------------------------------------------------------------* *& 3#c%de ZWCS_DEL_CREATE_.(, *&---------------------------------------------------------------------* *&---------------------------------------------------------------------* *& .orm .ETC8_DATA *&---------------------------------------------------------------------* * te9t *----------------------------------------------------------------------* * -- p, te9t * ;-- p) te9t *----------------------------------------------------------------------* %or2 %etc&_data. *& .etc data ba2ed o# dei!er" date select 'el1 os1r edat8 %ro2 'e 01to TALE 3t_'e w&ere 'el1 01 so_'el1 a1d edat8 01 so_edat8 a1d 2e13 1e . *& .etc corre2po#di#g data 0% 1ot 3t_'eB 0s INITIAL . select * %ro2 'a 01to TALE 3t_'a #OR ALL ENTRIES IN 3t_'e w&ere 'el1 3t_'e-'el1 a1d wer7s 01 so_wer7s a1d 'stel 01 so_'stel. END0%. *& .iter data 3t_'a_&B 3t_'aB.
sort 3t_'a_& ASCENDIN+ , 'el1. delete ADACENT DUPLICATES #RO$ 3t_'a_& CO$PARIN+ 'el1. END%or2. *&---------------------------------------------------------------------* *& .orm CREATE_DEL *&---------------------------------------------------------------------* * te9t *----------------------------------------------------------------------* * -- p, te9t * ;-- p) te9t *----------------------------------------------------------------------* %or2 Create_del. 6 Loo loo at 3t_'a_& 01to wa_'a_&. p eader tabe clear ) 3t_re;8est 3t_0te2 3t_ret8r1. 6 Pop loo at 3t_'a 01to wa_'a W>ERE 'el1 wa_'a_&-'el1. %ate item data
* * *
CLEAR) wa_re;8est. wa_re;8est-doc82e1t_t,e A. wa_re;8est-doc82e1t_182 wa_'a-'el1. wa_re;8est-doc82e1t_0te2 wa_'a-os1r. wa_re;8est-;8a1t0t,_sales_8o2 wa_'a-=W$EN+. wa_re;8est-PLANT wa_'a-wer7s. wa_re;8est-ST+E_LOC wa_'a-l3ort. wa_re;8est-$ATERIAL wa_'a-2at1r. wa_re;8est-atc& wa_'a-c&ar3. READ TALE 3t_'e 01to wa_'e w0t& 7e, 'el1 wa_'a_&-'el1. 0% s,-s8rc !. wa_re;8est-date_8sa3e wa_'e-edat8. wa_re;8est-date wa_'e-edat8. e1d0%. APPEND wa_re;8est TO 3t_re;8est. clear ) wa_re;8est wa_'a wa_'e. e1dloo. CALL #UNCTION API_DELI/ER(PROCESSIN+_E@EC E
TEC8'_CO'TROL > TALES RE
0% 3t_0te2B 0s 1ot INITIAL. dei!r" created
6 3$
CALL #UNCTION API_TRANSACTION_CO$$IT E@PORTIN+ WAIT @ * 3?PORT3'0 * RET5R' > . wa_%01al-'el1 wa_'a_&-'el1. READ TALE 3t_0te2 01to wa_0te2 INDE@ ". 0% s,-s8rc !. wa_%01al-del0' wa_0te2-DOCU$ENT_NU$. e1d0%. wa_%01al-wer7s wa_'a_&-wer7s. READ TALE 3t_'e 01to wa_'e w0t& 7e, 'el1 wa_'a_&-'el1. 0% s,-s8rc !. wa_%01al-edat8 wa_'e-edat8. e1d0%. wa_%01al-2essa3e te?t-!!F .6@S%cce22@ wa_%01al-I$+ ICON_+REEN_LI+>T. APPEND wa_%01al to 3t_%01al. clear ) wa_'a_& wa_%01al wa_'e. *& S%bmit RS'AST(( $or proce22i#g o$ o%tp%t PER#OR$ o8t8t USIN+ wa_0te2-doc82e1t_182. clear ) wa_0te2. else. 6 3$ #ot LOOP at 3t_ret8r1 01to wa_ret8r1 w&ere t,e E. wa_%01al-'el1 wa_'a_&-'el1. wa_%01al-wer7s wa_'a_&-wer7s. READ TALE 3t_'e 01to wa_'e w0t& 7e, 'el1 wa_'a_&-'el1. 0% s,-s8rc !. wa_%01al-edat8 wa_'e-edat8. e1d0%. wa_%01al-2essa3e wa_ret8r1-$ESSA+E. wa_%01al-I$+ ICON_RED_LI+>T. APPEND wa_%01al to 3t_%01al. clear ) wa_'a_& wa_%01al wa_'e. e1dloo. e1d0%. clear ) wa_'a_&. ENDLOOP. e1d%or2. *&---------------------------------------------------------------------* *& .orm AL1 *&---------------------------------------------------------------------* * te9t *----------------------------------------------------------------------* * -- p, te9t * ;-- p) te9t
*----------------------------------------------------------------------* #OR$ AL/ . wa_la,o8t-3r0d_t0tle te?t-!9". wa_la,o8t-zera @. CLEAR 3t_%0eldcat. RE#RES> 3t_%0eldcat.
3_re0d 3_ta1a2e
s,-re0d. +T_#INAL.
wa_%0eldcat-%0eld1a2e I$+. wa_%0eldcat-selte?t_l te?t-!!G. wa_%0eldcat-selte?t_2 te?t-!!G. wa_%0eldcat-selte?t_s te?t-!!G. wa_%0eldcat-rete?t_dd0c te?t-!!G. wa_%0eldcat-o8t8tle1 F. wa_%0eldcat-e2&as0ze @. APPEND wa_%0eldcat TO 3t_%0eldcat. CLEAR wa_%0eldcat.
wa_%0eldcat-%0eld1a2e /ELN. wa_%0eldcat-selte?t_l te?t-!!9. wa_%0eldcat-selte?t_2 te?t-!!9. wa_%0eldcat-selte?t_s te?t-!!9. wa_%0eldcat-rete?t_dd0c te?t-!!9. wa_%0eldcat-o8t8tle1 ":. wa_%0eldcat-e2&as0ze @. APPEND wa_%0eldcat TO 3t_%0eldcat. CLEAR wa_%0eldcat.
wa_%0eldcat-%0eld1a2e WER=S. wa_%0eldcat-selte?t_l te?t-!!H. wa_%0eldcat-selte?t_2 te?t-!!H. wa_%0eldcat-selte?t_s te?t-!!H. wa_%0eldcat-rete?t_dd0c te?t-!!H. wa_%0eldcat-o8t8tle1 "!. wa_%0eldcat-e2&as0ze @. APPEND wa_%0eldcat TO 3t_%0eldcat. CLEAR wa_%0eldcat.
wa_%0eldcat-%0eld1a2e EDATU. wa_%0eldcat-selte?t_l te?t-!!5. wa_%0eldcat-selte?t_2 te?t-!!5. wa_%0eldcat-selte?t_s te?t-!!5. wa_%0eldcat-rete?t_dd0c te?t-!!5. wa_%0eldcat-o8t8tle1 "!. wa_%0eldcat-e2&as0ze @. APPEND wa_%0eldcat TO 3t_%0eldcat. CLEAR wa_%0eldcat.
wa_%0eldcat-%0eld1a2e $ESSA+E. wa_%0eldcat-selte?t_l te?t-!!:. wa_%0eldcat-selte?t_2 te?t-!!:. wa_%0eldcat-selte?t_s te?t-!!:. wa_%0eldcat-rete?t_dd0c te?t-!!:. wa_%0eldcat-o8t8tle1 :!. wa_%0eldcat-e2&as0ze @. APPEND wa_%0eldcat TO 3t_%0eldcat. CLEAR wa_%0eldcat.
wa_%0eldcat-%0eld1a2e DELI/. wa_%0eldcat-selte?t_l te?t-!!. wa_%0eldcat-selte?t_2 te?t-!!. wa_%0eldcat-selte?t_s te?t-!!. wa_%0eldcat-rete?t_dd0c te?t-!!. wa_%0eldcat-o8t8tle1 ":. wa_%0eldcat-e2&as0ze @. APPEND wa_%0eldcat TO 3t_%0eldcat. CLEAR wa_%0eldcat. 3_sa'e A. CALL #UNCTION REUSE_AL/_+RID_DISPLA( E@PORTIN+ 0_callac7_ro3ra2 3_re0d 0s_la,o8t 3s_la,o8t 0t_%0eldcat 3t_%0eldcatB 0_de%a8lt @ 0_sa'e 3_sa'e TALES t_o8tta 3t_%01al E@CEPTIONS ro3ra2_error " OT>ERS 9. I# s,-s8rc JK !. $ESSA+E ID s,-2s30d T(PE s,-2s3t, NU$ER s,-2s31o WIT> s,-2s3'" s,-2s3'9 s,-2s3'H s,-2s3'5. ENDI#.
END#OR$. *&---------------------------------------------------------------------* *& .orm O5TP5T *&---------------------------------------------------------------------* * te9t *----------------------------------------------------------------------* * --P_WA_3TE?_DOC5?E'T_'5? te9t *----------------------------------------------------------------------* #OR$ OUTPUT USIN+ P_WA_ITE$_DOCU$ENT_NU$. DATA) l'_182er T(PE ttco-oco81t l'_1a2e T(PE ttco-o1a2e /ALUE PRINT_OUTPUT
l'_r01t_ara2eters T(PE r0_ara2s.
CALL #UNCTION O_OPEN E@PORTIN+ o1a2e l'_1a2e I$PORTIN+ oco81t l'_182er E@CEPTIONS ca1t_create_o " 01'al0d_o_data 9 o1a2e_20ss013 H OT>ERS 5. I# s,-s8rc !. SU$IT rs1ast!! WIT> s_7al /9 WIT> s_o7, P_WA_ITE$_DOCU$ENT_NU$ WIT> s_7sc&l W$TA TO SAP-SPOOL SPOOL PARA$ETERS l'_r01t_ara2eters WIT>OUT SPOOL D(NPRO /IA O l'_1a2e NU$ER l'_182er AND RETURN. I# s,-s8rc !. CALL #UNCTION O_CLOSE E@PORTIN+ oco81t o1a2e strt022ed E@CEPTIONS ca1t_start_022ed0ate 01'al0d_startdate o1a2e_20ss013 o_close_%a0led o_1ostes o_1ote? loc7_%a0led OT>ERS I# s,-s8rc JK !. ... ENDI#. ENDI#. ENDI#. END#OR$.
l'_182er l'_1a2e @ " 9 H 5 : G F.