This document provides details on useful scripts for extracting data from an ERP system, including scripts to check for purchase order notifications, view related catalog data, find approved purchase orders without associated purchase contracts, set date formats, view pending approvals, check employee workflow status, view job history, view employee and user data, and extract purchase order and contract information. The scripts are written in SQL and PL/SQL.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
96 views14 pages
Purchasing Useful Script - TeangMM
This document provides details on useful scripts for extracting data from an ERP system, including scripts to check for purchase order notifications, view related catalog data, find approved purchase orders without associated purchase contracts, set date formats, view pending approvals, check employee workflow status, view job history, view employee and user data, and extract purchase order and contract information. The scripts are written in SQL and PL/SQL.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14
urchas|ng Usefu| Scr|pt
Purchasing Useful Script
Revision 1.00
estern Digital Proprietary and Confidential Page 2 of 14
@ab|e of Content
1 kev|s|ons 3 2 Introduct|on 3 3 Deta||s 3
Purchasing Useful Script
Revision 1.00
estern Digital Proprietary and Confidential Page 3 of 14
1 kev|s|on n|story 1racklng of all revlslons of Lhls documenL requlres a revlslon number Lhe daLe of Lhe revlslon and commenLs Lo lndlcaLe Lhe changes made kev|s|on Date Ld|tor Changes 100 2SepL2011 1eang MM lnlLlal creaLlon of Lhe documenL
2 Introduct|on 1hls documenL deLalls Lhe useful scrlpL used Lo exLracL Lhe 8/C daLa
3 Deta||s
31 Check not|f|cat|on for a spec|f|c k]C SLLLC1 * l8CM ASWl_nC1lllCA1lCnS WPL8L 1 1 and sub[ecL llke MA883018143
estern Digital Proprietary and Confidential Page S of 14
lC8CCMLL1lCn_1Lx1lC8A8CuMLn1_1Lx1 lC88LSCnSl8lLl1?_lu l8CM ASlnu_CCnCu88Ln1_8LCuLS1S lC8 ASlnu_CCnCu88Ln1_8CC8AMS_1L lCASlnu_uSL8 lu WPL8L lC8AC1uAL_S1A81_uA1L 8L1WLLn 10082010 000000 Anu 10102010 233939 Anu lCCCnCu88Ln1_8CC8AM_lu lC8CCnCu88Ln1_8CC8AM_lu Anu lC88LCuLS1Lu_8? luuSL8_lu Anu lCuSL8_CCnCu88Ln1_8CC8AM_nAML llke Wu lnvenLory lnbound 1ransacLlon lmporL and luuSL8_nAML MAL_LM1l
noLe 8eplace sLarL daLe and end daLe program name and user name
38 Check the emp|oyee and re|ated user data selecL ouser_nameflasL_namefeffecLlve_end_daLefemall_addressfemployee_number from per_people_f f fnd_user o where femployee_number MAL43280 and fperson_ld oemployee_ld (+) and fperson_Lype_ld 6
noLe 8eplace MAL43280 wlLh employee lu
39 |st out C |nformat|on k |nformat|on for a |cata|og contract number
selecL pohsegmenL1prhsegmenL1 as 8numprlllne_locaLlon_lu prlcreaLlon_daLe prl* from appspo_requlslLlon_llnes_all prl lefL ouLer [oln appspo_requlslLlon_headers_all prh on prlrequlslLlon_header_ldprhrequlslLlon_header_ld lefL ouLer [oln appspo_llne_locaLlons_all poll on prlllne_locaLlon_ldpollllne_locaLlon_ld lefL ouLer [oln appspo_llnes_all pol on pollpo_llne_ldpolpo_llne_ld lefL ouLer [oln appspo_headers_all poh on polC_header_ldpohC_header_ld where blankeL_po_header_ld493444
noLe 8eplace 493444 wlLh Lhe conLracL purchase agreemenL's header lu
estern Digital Proprietary and Confidential Page 6 of 14
311 Check the data |n emp|oyee stag|ng tab|e (nk orac|e |nterface) selecL * from appsapxwd_psfL_emp_sLaglng
312 @o check a Cs act|on h|story selecL pohasegmenL1 ah* from appspo_acLlon_hlsLory ah lnner [oln appspo_headers_all poha on pohapo_header_ldahob[ecL_ld where pohasegmenL1MA883018143
noLe 8eplace MA883018143 wlLh Lhe C number
313 @o check the report|ng superv|sor for an emp|oyee selecL ppflasL_nameppfemployee_numberass* from appsL8_ASSlCnMLn1S_v7 ass lnner [oln appsper_people_f ppf on ppfperson_ldassperson_ld where ppfemployee_number'MAL34141'
noLe 8eplace MAL34131 wlLh Lhe employee number
314 @o check the k@]Invo|ce |nfor for a C SLLLC1 rshrecelpL_numspay_on_code rLxnsorganlzaLlon_ld rLxnsLransacLlon_Lype rLxnslnvolce_sLaLus_codeald1dlsLrlbuLlon_llne_numberrslquanLlLy_recelved ald1lnvolce_ld decode(ald1lnvolce_ldnullnull (selecL lnvolce_num from appsap_lnvolces_all l where llnvolce_ld ald1lnvolce_ld)) lnvolce_num decode(ald1lnvolce_ldnullnull (selecL Cancelled_daLe from appsap_lnvolces_all l where llnvolce_ld ald1lnvolce_ld)) Cancelled_daLe rsllLem_descrlpLlon rLxnsLransacLlon_daLeald1accounLlng_daLeald1perlod_name phsegmenL1 po_numberpvvendor_name pvsegmenL1 vendor_number phpo_header_ld l8CM appsrcv_LransacLlons rLxns appsrcv_shlpmenL_headers rsh appsrcv_shlpmenL_llnes rsl appspo_headers_all ph appspo_vendor_slLes_all s appspo_vendors pv appsap_lnvolce_dlsLrlbuLlons_all ald1 WPL8L rLxnsLransacLlon_Lype 8LCLlvL Anu rLxnsshlpmenL_header_ld rshshlpmenL_header_ld Anu rLxnsshlpmenL_header_ld rslshlpmenL_header_ld Purchasing Useful Script
Revision 1.00
estern Digital Proprietary and Confidential Page 7 of 14
Anu rLxnsshlpmenL_llne_ld rslshlpmenL_llne_ld Anu rshrecelpL_num ln (143687) and phsegmenL1MAA81016039 Anu rLxnsvendor_ld pvvendor_ld Anu rLxnspo_header_ld phpo_header_ld Anu rLxnsvendor_ld svendor_ld Anu rLxnsvendor_slLe_ld svendor_slLe_ld Anu spay_on_code 8LCLl1 Anu rLxnsLransacLlon_ld ald1rcv_LransacLlon_ld(+) and rLxnsorganlzaLlon_ld 108
noLe 8eplace MAA81016039 wlLh Lhe C number
31S Check LkDkL [ob h|story]status (arch|ve tab|e) SLLLC1 lCuSL8_CCnCu88Ln1_8CC8AM_nAMLluuSL8_nAML lC88LCuLS1_lu lC8A8Ln1_8LCuLS1_lu lC8PASL_CCuL lC8S1A1uS_CCuL lC88LCuLS1_uA1L lC8AC1uAL_S1A81_uA1L lC8AC1uAL_CCMLL1lCn_uA1L lC8CCMLL1lCn_1Lx1lC8A8CuMLn1_1Lx1 l8CM ASlnu_CCnCu88Ln1_8LCuLS1_A8CPlvL lC8ASlnu_CCnCu88Ln1_8CC8AMS_1L lCASlnu_uSL8 lu WPL8L lCuSL8_CCnCu88Ln1_8CC8AM_nAML llke Wu updaLe lLem ALLrlbuLe Anu lCCCnCu88Ln1_8CC8AM_lu lC8CCnCu88Ln1_8CC8AM_lu and lC8AC1uAL_CCMLL1lCn_uA1L 8L1WLLn 01022009 000000 Anu 01032009 233939 Anu lC88LCuLS1Lu_8? luuSL8_lu Anu luuSL8_nAML AWC8xlnv
noLe 8eplace Wu updaLe lLem ALLrlbuLe wlLh program name sLarL and end daLe and AWC8xlnv wlLh user name
noLe 8eplace cusLorder[malayslaxyraLexcom wlLh user emall address
317 @o ceck ema|| preference or ro|e for an user
SLLLC1 uuser_name rnoLlflcaLlon_preference remall_address l8CM appsfnd_user u appswf_local_roles r WPL8L rname uuser_name and uuser_name lS_WAvLLnC_MAL
noLe 8eplace lS_WAvLLnC_MAL wlLh user name
Purchasing Useful Script
Revision 1.00
estern Digital Proprietary and Confidential Page 8 of 14
318 @o check users w|th spec|f|c respons|b|||ty
selecL furgd* fnd* from appsfnd_user fnd lnner [oln appsfnd_user_resp_groups_dlrecL furgd on furgduser_ldfnduser_ld lnner [oln appslnu_8LSCnSl8lLl1?_1L frLl on frLlresponslblllLy_ldfurgdresponslblllLy_ld where frLlresponslblllLy_name llke MAL C l1
319 @o check k deta||s
selecL prha* prla* prda* from appsC_8equlslLlon_headers_all prha lnner [oln appspo_8equlslLlon_llnes_all prla on prlarequlslLlon_header_ldprharequlslLlon_header_ld lnner [oln appspo_8eq_dlsLrlbuLlons_all prda on prdarequlslLlon_llne_ldprlarequlslLlon_llne_ld where prhasegmenL111M001231
noLe 8eplace 11M001231 wlLh 8 number
320 @o check C deta||s
selecL pohasegmenL1 pola* from appsC_PLaders_all poha lnner [oln appspo_llnes_all pola on polapo_header_ldpohapo_header_ld lnner [oln appspo_llne_locaLlons_all polla on pollapo_llne_ldpolapo_llne_ld lnner [oln appspo_dlsLrlbuLlons_all poda on podallne_locaLlon_ldpollallne_locaLlon_ld where pohasegmenL1'MAA81016039'
noLe 8eplace MAA81016039 wlLh C number
321 @o ||st out cap|ta| k
selecL prhasegmenL1prda* from appsC_8equlslLlon_headers_all prha lnner [oln appspo_8equlslLlon_llnes_all prla on prlarequlslLlon_header_ldprharequlslLlon_header_ld lnner [oln appspo_8eq_dlsLrlbuLlons_all prda on prdarequlslLlon_llne_ldprlarequlslLlon_llne_ld where prdaaLLrlbuLe1C
322 @o check the |tem cost |nfo
selecL a*lsegmenL1lllsL_prlce_per_unlL lmLl_LransacLlons_enabled_flaglsLock_enabled_flag lcosLlng_enabled_flag from appscsL_lLem_cosLs a appsmLl_sysLem_lLems l where lorganlzaLlon_ld 108 and (lsegmenL1 2060771823300 or lsegmenL1 2060771767300) and lorganlzaLlon_ld aorganlzaLlon_ld and llnvenLory_lLem_ld alnvenLory_lLem_ld and acosL_Lype_ld 1 1 lrozen
324 @o ||st out the va|ue for C Item category (or f|exf|e|d) segment va|ue
selecL ffsvsegmenL_name ffvv* from appslnu_lLLx_vALuLS_vL ffvv lnner [oln appslnu_lu_lLLx_SLCMLn1S_vL ffsv on ffsvflex_value_seL_ldffvvflex_value_seL_ld where (ffsvsegmenL_nameurchaslng SubClass or ffsvsegmenL_nameurchaslng Class or ffsvsegmenL_nameA8C Class )
32S @o ||st out k and C data by C number Purchasing Useful Script
Revision 1.00
estern Digital Proprietary and Confidential Page 10 of 14
selecL prhasegmenL1 poha* from appsC_PLaders_all poha lnner [oln appspo_llnes_all pola on polapo_header_ldpohapo_header_ld lnner [oln appspo_llne_locaLlons_all polla on pollapo_llne_ldpolapo_llne_ld lnner [oln appspo_dlsLrlbuLlons_all poda on podallne_locaLlon_ldpollallne_locaLlon_ld lnner [oln appspo_8equlslLlon_llnes_all prla on prlallne_locaLlon_ldpollallne_locaLlon_ld lnner [oln appsC_8equlslLlon_headers_all prha on prlarequlslLlon_header_ldprharequlslLlon_header_ld lnner [oln appspo_8eq_dlsLrlbuLlons_all prda on prdarequlslLlon_llne_ldprlarequlslLlon_llne_ld where pohasegmenL110008982
noLe 8eplace 10008982 wlLh C number
326 @o ||st out C Item Category comb|nat|on and category ID
selecL * from M1L_CA1LCC8lLS_v where sLrucLure_ld101
estern Digital Proprietary and Confidential Page 13 of 14
8ALlCA1lCn_CCLuMn_nAML 8SLCMLn1_nAML ClLLx_vALuL_SL1_nAML ulLLx_vALuL_lu l8CM ASfnd_ld_flex_sLrucLures A ASfnd_ld_flex_segmenLs 8 ASfnd_flex_value_seLs C ASfnd_flex_values u ASfnd_flex_values_Ll L WPL8L Alu_lLLx_nuM8lu_lLLx_nuM Anu Alu_lLLx_CCuLCL# Anu 8lu_lLLx_CCuLCL# Anu 8lLLx_vALuL_SL1_luClLLx_vALuL_SL1_lu Anu ClLLx_vALuL_SL1_luulLLx_vALuL_SL1_lu Anu ulLLx_vALuL_luLlLLx_vALuL_lu Anu AALlCA1lCn_lu ln (101201) Anu LLAnCuACLuS Anu bld_flex_codeCL# C8uL8 8? Alu_lLLx_S18uC1u8L_CCuL