Syslogd Consuming more CPU utilization in Solaris 10
Hi All,
The Syslogd process consuming more CPU utilization in Solaris 10. Kindly help how to reduce this cpu utilization.
Regards
Siva
Hi Robert,
Both are same architecture. x86
The following is the prstat o/p from the affected server. Pls note that one of the mount point in this server is in ZFS.
prstat -l
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/LWPID
26092 root 3933M 3930M cpu1 60 0 29:00:43 22% syslogd/56
26092 root 3933M 3930M run 30 0 289:47:33 12% syslogd/18
26092 root 3933M 3930M run 40 0 272:31:05 11% syslogd/22
26092 root 3933M 3930M run 22 0 14:47:16 9.7% syslogd/65
26092 root 3933M 3930M run 42 0 14:43:46 9.7% syslogd/63
26092 root 3933M 3930M run 31 0 14:40:42 9.6% syslogd/66
26092 root 3933M 3930M sleep 40 0 152:45:42 5.9% syslogd/21
26092 root 3933M 3930M cpu0 53 0 6:41:58 4.1% syslogd/58
26092 root 3933M 3930M run 52 0 6:23:13 4.0% syslogd/57
26092 root 3933M 3930M sleep 43 0 6:29:21 3.9% syslogd/59
26092 root 3933M 3930M sleep 52 0 5:55:14 3.6% syslogd/71
More over we are continuously receiving the below error message in the /var/adm/messages, we don't know, from where the error arises from the syslog server.
syslogd: malloc failed: dropping message from remote: Not enough space
PRIVILEGE :[4] 'NONE'
Edited by: Siva_Systems on Mar 29, 2010 5:06 AM
Edited by: Siva_Systems on Mar 29, 2010 8:18 AM
Similar Messages
-
How to find top 10 SQL statments which are consuming more cpu time.
hi all,
Is there any command or script to monitor the top 10 sql statments which are consuming more cpu time.
I know by using AWR REPORT we can find it, i want the command or script to find the top cpu utilization sql statments.
Regards
Subhash.Subhash,
A quick and dirty Google search could have get you started with the following:
Thread: how to get top CPU consuming sql oracle 10g
Re: how to get top CPU consuming sql oracle 10g
Oracle SQL top sessions
http://www.dba-oracle.com/oracle10g_tuning/t_sql_top_sessions.htm
"How to Find top 10 expensive sql's", version 9.2.0
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:73325450402303
HTH,
Thierry -
Query to find out which process consuming more cpu?
Hi All,
some one please tell me the query to find out which process is consuming more
cpu resources?
Thanks and Regards
SrikanthUse V$SESSTAT to determine which sessions are using most CPU, and investigate what SQL these users/sessions are executing:
SQL> select ss.sid, se.command, ss.value CPU, se.username, se.program
from v$sesstat ss, v$session se
where ss.statistic# in
(select statistic#
from v$statname
where name = 'CPU used by this session')
and se.sid=ss.sid
order by ss.value desc; -
How to identify TOP 5 SQL consuming more CPU time without using statspack
How to identify the TOP 5 SQL queries which are consuming more CPU time during the timespan of 24 hours for entire database. There are N number of users who have issued sql queries, out of which few users have disconnected and few user are still connected to the database(I need to consider all sessions). My database version is 9.0.1. I don't want to use statspack. Is there any way to identify TOP 5 SQL consuming more CPU time without affecting the performance of the database. Can any one help me on this? Its urgent!!.
My database version is 9.0.1. I don't want
to use statspack. Is there any way to identify TOP 5
SQL consuming more CPU time without affecting the
performance of the database. Can any one help me on
this? Its urgent!!.I cant understand why you dont want to use statspack. As it is very easy to use and very quick to identify bottlenecks. Try using statspack. Its really wonderful.
Particularly in your case statspack is the best.
Regards,
Sanju. -
Low CPU utilization on Solaris
Hi all.
We've recently been performance tuning our java application running
inside of an Application Server with Java 1.3.1 Hotspot -server. We've
begun to notice some odd trends and were curious if anyone else out
there has seen similiar things.
Performance numbers show that our server runs twice
as fast on Intel with Win2K than on an Ultra60 with Solaris 2.8.
Here's the hardware information:
Intel -> 2 processors (32bit) at 867 MHz and 2 Gig RAM
Solaris -> 2 processors (64bit) at 450 MHz and 2 Gig RAM.
Throughput for most use cases in a low number of threads is twice as
fast on Intel. The only exception is some of our use-cases that are
heavily dependent on a stored procedure which runs twice as fast on
Solaris. The database (oracle 8i) and the app server run on the same
machine in these tests.
There should minor (or no) network traffic. GC does not seem to be an
issue. We set the max heap at 1024 MG. We tried the various solaris
threading models as recommended, but they have accomplished little.
It is possible our Solaris machine is not configured properly in some
way.
My question (after all that ...) is whether this seems normal to
anyone? Should throughput be higher since the processors are faster on
the wIntel box? Does the fact that the solaris processors are 64bit
have any benefit?
We have also run the HeapTest recommended on this site on both
machines. We found that the memory test performs twice as fast on
solaris, but the CPU test performs 4 times as slow on solaris. The
"joint" test performs twice as slow on solaris. Does this imply bad
things about our solaris configuration? Or is this a normal result?
Another big difference is between Solaris and Win2K in these runs is
that CPU Utilization is low on solaris (20-30%) while its much higher
on Win2K (60-70%)
[both machines are 2 processor and the tests are "primarily" single
threaded at
this stage]. I would except the solaris CPU utilization to be around
50% as well. Any ideas why it isn't?Hi,
I recently went down this path and wound up coming to the realization that the
cpu's are almost neck and neck per cycle when running my Java app. Let me qualify
this a little more (400mhz Sparc II cpu vs 500mhz Intel cpu) under similar load
running the same test gave me similar results. It wasn't as huge difference in
performance as I was expecting.
My theory is given the scalability of the SPARC architecture, more chips==more
performance with less hardware, whereas the Wintel boxes are cheaper, but in order
to get scaling, the underlying hardware comes into question. (how many wintel
boxes to cluster, co-locate, manage, etc…)
From what little I've found out when running tests against our Solaris 8 (E-250's)
400mhz UltraSparc 2's is that it appears that the CPU performance in a lightly
threaded environment is almost 1 cycle / 1 cycle (SPARC to Intel). I don't think
the 64 bit SPARC architecture will buy you anything for java 1.3.1, but if your
application has some huge memory requirements, then using 1.4.0(when BEA supports
it) should be beneficial (check out http://java.sun.com/j2se/1.4/performance.guide.html).
If your application is running only a few threads, tying the threads to the LWP
kernel processes probably won't gain you much. I noticed that it decreased performance
for a test with only a few threads.
I can't give you a good reason as to why your Solaris CPU utilization is so low,
you may want to try getting a copy of Jprobe and profiling Weblogic and your application
to see where your bottlenecks are. I was able to do this with our product, and
found some nasty little performance bugs, but even with that our CPU utilization
was around 98% on a single and 50% on a dual.
Also, take a look at iostat / vmstat and see if your system is bottlenecking doing
io operations. I kept a background process of vmstat to a log and then looked
at it after my test and saw that my cpu was constantly pegged out (doing a lot
of context switching), but that it wasn't doing a whole lot of page faults
(had enough memory).
If you're doing a lot of serialization, that could explain slow performance as
well.
I did follow a suggestion on this board of running my test several times with
the optimizer (-server) and it boosted performance on each iteration until a plateau
on or about the 3rd test.
If you're running Oracle or another RDBMS on your Solaris machine you should see
a pretty decent performance benchmark against NT as these types of applications
are more geared toward the SPARC architecture. From what I've seen running Oracle
on Solaris is pretty darn fast when compared to Intel.
I know that I tried a lot of different tweaks on my Solaris configuration (tcp
buffer size, etc/system parameters for file descriptors, etc.) I even got to the
point where I wanted
to see how WebLogic was handling the Nagle algorithm as far as it's POSIX muxer
was concerned and ran a little test to see how they were setting the sockets (setTcpNoDelay(Boolean)
on java.net.Socket). They're disabling the Nagle algorithm so that wasn't an
issue sigh. My best advice would be to profile your application and see where
the bottlenecks are, you might be able to increase performance, but I'm not too
sure. I also checked out www.spec.org and saw some of their benchmarks that
coincide with our findings.
Best of luck to you and I hope this helps :)
Andy
[email protected] (feanor73) wrote:
Hi all.
We've recently been performance tuning our java application running
inside of an Application Server with Java 1.3.1 Hotspot -server. We've
begun to notice some odd trends and were curious if anyone else out
there has seen similiar things.
Performance numbers show that our server runs twice
as fast on Intel with Win2K than on an Ultra60 with Solaris 2.8.
Here's the hardware information:
Intel -> 2 processors (32bit) at 867 MHz and 2 Gig RAM
Solaris -> 2 processors (64bit) at 450 MHz and 2 Gig RAM.
Throughput for most use cases in a low number of threads is twice as
fast on Intel. The only exception is some of our use-cases that are
heavily dependent on a stored procedure which runs twice as fast on
Solaris. The database (oracle 8i) and the app server run on the same
machine in these tests.
There should minor (or no) network traffic. GC does not seem to be an
issue. We set the max heap at 1024 MG. We tried the various solaris
threading models as recommended, but they have accomplished little.
It is possible our Solaris machine is not configured properly in some
way.
My question (after all that ...) is whether this seems normal to
anyone? Should throughput be higher since the processors are faster on
the wIntel box? Does the fact that the solaris processors are 64bit
have any benefit?
We have also run the HeapTest recommended on this site on both
machines. We found that the memory test performs twice as fast on
solaris, but the CPU test performs 4 times as slow on solaris. The
"joint" test performs twice as slow on solaris. Does this imply bad
things about our solaris configuration? Or is this a normal result?
Another big difference is between Solaris and Win2K in these runs is
that CPU Utilization is low on solaris (20-30%) while its much higher
on Win2K (60-70%)
[both machines are 2 processor and the tests are "primarily" single
threaded at
this stage]. I would except the solaris CPU utilization to be around
50% as well. Any ideas why it isn't? -
Xsun (high CPU utilization) on Solaris 10 Sparc
hi
i have sun blade 1500 and am running solaris 10 on it. the machine is a 2 CPU (750Mhz) 4GB Sparc with the lastest cluster patch.
The Xsun process is alway at 50% util and the windowmaker (wmaker) is at 27%.
The Xsun is alway using all available CPU and the machine is really slow.. any help on what patch will fix the Xsun process ? any operation on the machine increases the Xsun's CPU util.
thx
SriramHi sridhar,
can i know which platform you are using....
if it is solaris,
can you paste the details of the prstat -L -p wlpid 1 1 ---> which gives the light wieght pid threads
and also (pstact wlspid) for lwpid to process id mapping
or you can follow these steps for finding which thread is causing the hight cpu utilization
1.find the highest usage lwpid in prstat output
2.find the lwpid in pstack output and get the matching thread number
3.convert the thread number to hexadecimal
4.find the hexadecimal thread number in the server thread dump (nid= xxx)
5.determine what thread was doing to cause the high cpu usage
you can find similar way if it is linux..
ps u -Lp wlspid and thread dump
Thank you,
Bob
Edited by: Bob on Sep 21, 2010 10:18 AM
Edited by: Bob on Sep 21, 2010 10:24 AM -
When running a series of performance tests on Solaris machine running Weblogic
8.1sp2 and comparing the results to a Windows200 machine running Weblogic 8.1sp2
I noticed the Solaris box was only using 10% of the each of its 4 CPUs. The Window2k
machine was however using 85% of it's single CPU and was performing 3 time better
than the Solaris machine.
I was hoping someone might have some suggestions for where to look for causes
of the cpus being under utilized.
Thanks
-FazleWhen running a series of performance tests on Solaris machine running Weblogic
8.1sp2 and comparing the results to a Windows200 machine running Weblogic 8.1sp2
I noticed the Solaris box was only using 10% of the each of its 4 CPUs. The Window2k
machine was however using 85% of it's single CPU and was performing 3 time better
than the Solaris machine.
I was hoping someone might have some suggestions for where to look for causes
of the cpus being under utilized.
Thanks
-Fazle -
Hai all,
Suddenly the output of top command shows that f60webmx consumes 100% of the CPU. like :
wap: 8217236k total, 84296k used, 8132940k free, 2675416k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18448 applprod 25 0 73892 48m 8076 R 100 48.2 1232:21 f60webmx
9245 applprod 17 0 2856 1236 760 S 1 0.0 0:02.26 top
9601 oraprod 16 0 3744 1208 756 R 1 0.0 0:00.08 top
19488 oraprod 16 0 614m 257m 254m S 1 6.3 6:18.75 oracle
17954 applprod 16 0 777m 231m 11m S 0 5.7 4:08.37 java
[oraprod@oracle bdump]$ ps -ef | grep f60webmx
applprod 18440 1 0 Feb29 ? 00:00:00 f60srvm em alioracle_9000_PROD port 9000 mode socket exe f60webmxapplprod 18448 18440 73 Feb29 ? 20:32:47 f60webmx webfile=5,0,alioracle_9000_PROD
applprod 18749 1 0 Feb29 ? 00:00:01 d2lc60 alioracle 9100 0 1 f60webmx
applprod 30752 18440 0 07:37 ? 00:02:41 f60webmx webfile=5,8,alioracle_9000_PROD
applprod 10278 18440 0 09:21 ? 00:00:01 f60webmx webfile=5,17,alioracle_9000_PROD
applprod 14089 18440 0 10:00 ? 00:00:05 f60webmx webfile=5,20,alioracle_9000_PROD
applprod 14497 18440 0 10:03 ? 00:00:14 f60webmx webfile=5,22,alioracle_9000_PROD
applprod 15902 18440 0 10:08 ? 00:00:27 f60webmx webfile=5,24,alioracle_9000_PROD
applprod 16958 18440 0 10:19 ? 00:00:24 f60webmx webfile=5,26,alioracle_9000_PROD
applprod 26906 18440 0 11:43 ? 00:00:06 f60webmx webfile=5,32,alioracle_9000_PROD
applprod 4823 18440 0 13:09 ? 00:00:00 f60webmx webfile=5,35,alioracle_9000_PROD
any idea how to rectify this otherthan rebooting the server ?
Thanks
YusufHussain,
as per the note.. Note: 185762.1 - Script: How To Identify The apps User Using The O/S PID For Forms Users In 11i
I could'nt find the session related to the database using PID from top command ..
like :
Enter value for pid: 18448
old 13: and a.SPID = &PID
new 13: and a.SPID = 18448
[applprod@alioracle bin]$ top
top - 14:52:22 up 47 days, 22:01, 3 users, load average: 1.07, 1.08, 1.09
Tasks: 504 total, 2 running, 502 sleeping, 0 stopped, 0 zombie
Cpu(s): 13.1% us, 0.2% sy, 0.0% ni, 86.4% id, 0.2% wa, 0.0% hi, 0.0% si
Mem: 4148304k total, 4111260k used, 37044k free, 28380k buffers
Swap: 8217236k total, 84260k used, 8132976k free, 2618612k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
18448 applprod 25 0 73892 48m 8076 R 100 1.2 1289:33 f60webmx
32664 oraprod 16 0 620m 350m 344m S 2 8.6 0:32.78 oracle
but unable to fetch the records ?
any idea /
Yusuf -
REPORT TAKING MORE CPU UTILIZATION
Hello Experts,
my following report is of sales order report it gives me an output in less than 250 seconds,
But taking 80 percentage CPU time so tell me how to overcome this problem ??
<b>&----
*& Report ZMSL_SALES_ORDER_REPORT
REPORT ZMSL_SALES_ORDER_REPORT.
DEFINE: M_FIELDCAT.
ADD 1 TO LS_FIELDCAT-COL_POS.
LS_FIELDCAT-FIELDNAME = &1.
LS_FIELDCAT-SELTEXT_L = &2.
LS_FIELDCAT-OUTPUTLEN = &3.
LS_FIELDCAT-TABNAME = 'gt_final_data'.
APPEND LS_FIELDCAT TO FELD_CAT.
END-OF-DEFINITION.
*==================Start of Datebase tables Declaration=================
TABLES : VBAK, "Sales Document: Header Data
VBAP, "Sales Document: Item Data
MARA, "Matrial Master
VBEP, "Sales Document: Schedule Line Data
VBPA, "Sales Document: Partner
TVROT,
YMSLT_MAIL_ID.
*=================End of Datebase tables Declaration====================
*==================Start of Virable ALV declaration=================
**=============================
TYPE POOLS
*=============================
TYPE-POOLS: SLIS.
*=============================
*FIELD CATALOG DECLARATION
*=============================
CONSTANTS : CO_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME
VALUE 'TOP_OF_PAGE'.
DATA : G_TABNAME_HEADER TYPE SLIS_TABNAME,
G_TABNAME_ITEM TYPE SLIS_TABNAME.
DATA: FELD_CAT TYPE SLIS_T_FIELDCAT_ALV," WITH HEADER LINE ,
ALV_LAYOUT TYPE SLIS_LAYOUT_ALV,
T_EVENTS TYPE SLIS_T_EVENT,
G_SAVE(1) TYPE C,
G_VARIANT LIKE DISVARIANT,
GX_VARIANT LIKE DISVARIANT,
EVENTS TYPE SLIS_T_EVENT,
G_EXIT(1) TYPE C,
LAYOUT TYPE SLIS_LAYOUT_ALV,
ALV_PRINT TYPE SLIS_PRINT_ALV,
ALV_DETAIL_FUNC(30),
EVENTS TYPE SLIS_T_EVENT,
T_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
CONSTANTS: FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE'.
RANGES : R_PARVW FOR VBPA-PARVW.
*=================End of Virable tables Declaration====================
*==================Start of Selection Screen Declaration================
SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF BLOCK VAR WITH FRAME TITLE VARIANT.
PARAMETERS : P_VARI LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF BLOCK VAR.
SELECTION-SCREEN :BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS : S_VKORG FOR VBAK-VKORG OBLIGATORY, " Sales Org.
S_VKBUR FOR VBAK-VKBUR, " Sales Office
S_VKGRP FOR VBAK-VKGRP, " Sales Group
S_VTWEG FOR VBAK-VTWEG. " Distribution Channel
SELECTION-SCREEN :END OF BLOCK B2.
SELECTION-SCREEN :BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS : S_KUNNR FOR VBAK-KUNNR, "Customer Number
S_VBELN FOR VBAK-VBELN, "Sales Order Number
S_ERDAT FOR VBAK-ERDAT, "OBLIGATORY, "Sales Order Date
S_AUGRU FOR VBAK-AUGRU, "Order Reason
S_BSTNK FOR VBAK-BSTNK, "PO Number
S_AUART FOR VBAK-AUART. "Sales order type
SELECTION-SCREEN :END OF BLOCK B3.
SELECTION-SCREEN :BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-004.
SELECT-OPTIONS : S_WERKS FOR VBAP-WERKS, "plant,
S_MATNR FOR VBAP-MATNR, " Matrial Code
S_PSTYV FOR VBAP-PSTYV, "Sales Order Item cat.
S_EDATU FOR VBEP-EDATU, "Conformatin Date
S_REQDAT FOR VBAP-ZZCUST_REQDAT. "Req.Del Date
SELECTION-SCREEN :END OF BLOCK B4.
SELECTION-SCREEN :BEGIN OF BLOCK B5 WITH FRAME TITLE TEXT-005.
SELECT-OPTIONS : S_ZE FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION , "Partner Function
S_ZS FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION, "Partner Function
S_ZA FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION, "Partner Function
S_ZR FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION, "Partner Function
S_ZI FOR VBPA-KUNNR NO INTERVALS NO-EXTENSION. "Partner Function
*FOR VBPA-KUNNR MATCHCODE OBJECT ZSMR ,
***SELECT-OPTIONS : S_ZE FOR VBPA-PARVW NO INTERVALS NO-EXTENSION , "Partner Function
S_ZS FOR VBPA-PARVW NO INTERVALS NO-EXTENSION, "Partner Function
S_ZA FOR VBPA-PARVW NO INTERVALS NO-EXTENSION, "Partner Function
S_ZR FOR VBPA-PARVW NO INTERVALS NO-EXTENSION, "Partner Function
S_ZI FOR VBPA-PARVW NO INTERVALS NO-EXTENSION. "Partner Function
SELECTION-SCREEN :END OF BLOCK B5.
SELECTION-SCREEN : BEGIN OF BLOCK B6 WITH FRAME TITLE TEXT-006.
PARAMETER : P_SCREEN RADIOBUTTON GROUP RTYP DEFAULT 'X' USER-COMMAND
UCOMM ,
P_FILE RADIOBUTTON GROUP RTYP,
P_MAIL RADIOBUTTON GROUP RTYP.
SELECTION-SCREEN :END OF BLOCK B6.
SELECTION-SCREEN : BEGIN OF BLOCK B7 WITH FRAME TITLE TEXT-007.
PARAMETER : P_PEN RADIOBUTTON GROUP RE1 DEFAULT 'X' USER-COMMAND
UCOMM , " Pending Sales order
P_ALL RADIOBUTTON GROUP RE1, " ALL Sales order
P_BLOCK RADIOBUTTON GROUP RE1. " Blocked Sales order
P_DELE RADIOBUTTON GROUP RE1. " Delevered Sales order
SELECTION-SCREEN :END OF BLOCK B7.
SELECTION-SCREEN : END OF BLOCK B1.
*=================End of Selection Screen Declaration===================
*==================Start of Internal table Declaration==================
Internal table for vbak
DATA : BEGIN OF GT_VBAK OCCURS 0 ,
VBELN LIKE VBAK-VBELN , " Sales Document Number
ERDAT LIKE VBAK-ERDAT , " Order Date
AUART LIKE VBAK-AUART, "Sales Document Type
VTWEG LIKE VBAK-VTWEG, "Distribution Channel
SPART LIKE VBAK-SPART, "Division
KNUMV LIKE VBAK-KNUMV , "Number of the document condition
BSTNK LIKE VBAK-BSTNK, " cUSTOMER pURCHASE ORDER NUMBER
BSTDK LIKE VBAK-BSTDK, "Customer purchase order date
KUNNR LIKE VBAK-KUNNR, " Customer Code
ZOA_RECP_PLAN_DT LIKE VBAK-ZOA_RECP_PLAN_DT, "Order receipt at plant
END OF GT_VBAK.
Internal table for VBAP
DATA : BEGIN OF GT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN, " Sales Document Number
POSNR LIKE VBAP-POSNR, " Sales Doc. Line item number
MATNR LIKE VBAP-MATNR,
ABGRU LIKE VBAP-ABGRU, "Reason for rejection
MEINS LIKE VBAP-MEINS, "Base Unit of Measure
FAKSP LIKE VBAP-FAKSP,
NETWR LIKE VBAP-NETWR, " Net Value
KWMENG LIKE VBAP-KWMENG, " Order Quantity
WERKS LIKE VBAP-WERKS, "PLANT
LGORT LIKE VBAP-LGORT, "S.Loc
ROUTE LIKE VBAP-ROUTE, " Route
ZZWIDTH LIKE VBAP-ZZWIDTH, " widht
ZZKDMAT LIKE VBAP-ZZKDMAT, " customer Matrial
ZZBRAND LIKE VBAP-ZZBRAND, " bRAND
ZZSPLDIA LIKE VBAP-ZZSPLDIA, "Spool Diameter
ZZCUST_REQDAT LIKE VBAP-ZZCUST_REQDAT, " REquested Date
ZZCOATING LIKE VBAP-ZZCOATING,
ZZWEIGHT LIKE VBAP-ZZWEIGHT,
ZZWEIGHT_UMO LIKE VBAP-ZZWEIGHT_UMO,
END OF GT_VBAP.
Internal table for VBEP
DATA : BEGIN OF GT_VBEP OCCURS 0,
VBELN LIKE VBEP-VBELN, " Sales Doc. Number
POSNR LIKE VBEP-POSNR, " Sales Doc. Item Number
ETENR LIKE VBEP-ETENR, "Delivery Schedule Line Number
EDATU LIKE VBEP-EDATU, "Schedule line date
END OF GT_VBEP.
Internal table for VBPA
DATA : BEGIN OF GT_VBPA OCCURS 0,
VBELN LIKE VBAP-VBELN, "Sales Document Number
POSNR LIKE VBAP-POSNR, "Sales Document Item Number
PARVW LIKE VBPA-PARVW, "Partner Function
KUNNR LIKE VBPA-KUNNR, " Customer Number
END OF GT_VBPA.
Internal table for VBKD
DATA : BEGIN OF GT_VBKD OCCURS 0,
VBELN LIKE VBKD-VBELN , " Sales Documet number
KDGRP LIKE VBKD-KDGRP, " Custoemr Group
INCO1 LIKE VBKD-INCO1, "Incoterms (Part 1)
INCO2 LIKE VBKD-INCO2, "Incoterms (Part 2)
ZTERM LIKE VBKD-ZTERM, " Payment Term
STCUR LIKE VBKD-STCUR, " Exchang Rate
END OF GT_VBKD.
Internal table VBFA
DATA : BEGIN OF GT_VBFA OCCURS 0 ,
VBELV LIKE VBFA-VBELV, " Preceding sales and distribution document
POSNV LIKE VBFA-POSNV, "Preceding item of an SD document
VBELN LIKE VBFA-VBELN, "Subsequent sales and distribution document
POSNN LIKE VBFA-POSNN, "Subsequent item of an SD document
VBTYP_N LIKE VBFA-VBTYP_N, "Document category of subsequent document
RFMNG LIKE VBFA-RFMNG, "Referenced quantity in base unit of measure
END OF GT_VBFA.
Internal table for KONV
DATA : BEGIN OF GT_KONV OCCURS 0,
KNUMV LIKE KONV-KNUMV, "Number of the document condition
KPOSN LIKE KONV-KPOSN, "Condition item number
KSCHL LIKE KONV-KSCHL , "Cond Type.
KBETR LIKE KONV-KBETR, " Rate per KG
WAERS LIKE KONV-WAERS, "currency
KWERT LIKE KONV-KWERT, "Condition value
END OF GT_KONV.
Internal table for MSKA,
DATA : BEGIN OF GT_MSKA OCCURS 0,
MATNR LIKE MSKA-MATNR, "Matrial
WERKS LIKE MSKA-WERKS, "PLANT
LGORT LIKE MSKA-LGORT, "S. Loc
CHARG LIKE MSKA-CHARG,"Batch Number
SOBKZ LIKE MSKA-SOBKZ, "Special Stock Indicator
VBELN LIKE MSKA-VBELN , "Sales Doc Number
POSNR LIKE MSKA-POSNR, "Sales Doc Item Number
KALAB LIKE MSKA-KALAB, "Unrestricted-Use Stock
KAINS LIKE MSKA-KAINS, " Stock in Quality Inspection
END OF GT_MSKA.
Internal table for MARD
DATA : BEGIN OF GT_MARD OCCURS 0 ,
MATNR LIKE MARD-MATNR, "Matrial
WERKS LIKE MARD-WERKS, "PLANT
LGORT LIKE MARD-LGORT, "S. Loc
LABST LIKE MARD-LABST, "Valuated Unrestricted-Use Stock
END OF GT_MARD.
Internal table for KNA1
DATA : BEGIN OF GT_KNA1 OCCURS 0,
KUNNR LIKE KNA1-KUNNR , " Customer Number
NAME1 LIKE KNA1-NAME1, "Customer Name
NAME2 LIKE KNA1-NAME2, " Customer Name
ORT01 LIKE KNA1-ORT01, "City
END OF GT_KNA1.
DATA: BEGIN OF GT_KNA1_1 OCCURS 0,
KUNNR LIKE KNA1-KUNNR , " Customer Number
NAME1 LIKE KNA1-NAME1, "Customer Name
ORT01 LIKE KNA1-ORT01,
END OF GT_KNA1_1.
Internal table for KNVV
DATA : BEGIN OF GT_KNVV OCCURS 0,
KUNNR LIKE KNVV-KUNNR , " Customer Number
KLABC LIKE KNVV-KLABC, " Custoemr Class
END OF GT_KNVV.
Internal table for MAKT,
DATA : BEGIN OF GT_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR, "Matrial
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX, "Matrial DESC
MAKTG LIKE MAKT-MAKTG,
END OF GT_MAKT.
Internal table for MVKE
DATA : BEGIN OF GT_MVKE OCCURS 0 ,
MATNR LIKE MVKE-MATNR, "Matrial
MVGR1 LIKE MVKE-MVGR1, " Matrial Group
END OF GT_MVKE.
Internal table for TVM1T
DATA : BEGIN OF GT_TVM1T OCCURS 0 ,
SPRAS LIKE TVM1T-SPRAS,
MVGR1 LIKE TVM1T-MVGR1, " Matrial Group
BEZEI LIKE TVM1T-BEZEI, " Matrial Group DESC
END OF GT_TVM1T.
Internal table for TSPAT
DATA : BEGIN OF GT_TSPAT OCCURS 0,
SPRAS LIKE TSPAT-SPRAS,
SPART LIKE VBAK-SPART, "Division
VTEXT LIKE TSPAT-VTEXT, "Division Desc
END OF GT_TSPAT.
Internal table for TVTWT
DATA : BEGIN OF GT_TVTWT OCCURS 0 ,
SPRAS LIKE TVTWT-SPRAS,
VTWEG LIKE VBAK-VTWEG, " Distribution Channel
VTEXT LIKE TVTWT-VTEXT, "Distribution Channel Desc
END OF GT_TVTWT.
Internal table for TVAKT
DATA : BEGIN OF GT_TVAKT OCCURS 0,
SPRAS LIKE TVAKT-SPRAS,
AUART LIKE VBAK-AUART, "Sales Document Type
BEZEI LIKE TVAKT-BEZEI, "sALES dOC TYPE Description
END OF GT_TVAKT .
Internal table for T151t
DATA: BEGIN OF GT_VBUP OCCURS 0,
VBELN LIKE VBUP-VBELN,
POSNR LIKE VBUP-POSNR,
GBSTA LIKE VBUP-GBSTA,
END OF GT_VBUP.
DATA : BEGIN OF GT_T151T OCCURS 0,
SPRAS LIKE T151T-SPRAS,
KDGRP LIKE VBKD-KDGRP, " Custoemr Group
KTEXT LIKE T151T-KTEXT, " Custoemr Group Desc
END OF GT_T151T.
DATA : BEGIN OF GT_TVROT OCCURS 0,
SPRAS LIKE TVROT-SPRAS,
ROUTE LIKE TVROT-ROUTE, " Route code
BEZEI LIKE TVROT-BEZEI , " Route Desc
END OF GT_TVROT.
DATA : BEGIN OF GT_T052U OCCURS 0,
SPRAS LIKE T052U-SPRAS,
ZTERM LIKE T052U-ZTERM, " Payment terms
TEXT1 LIKE T052U-TEXT1, " text
END OF GT_T052U.
DATA: BEGIN OF GT_VBUK OCCURS 0,
VBELN LIKE VBUK-VBELN,
WBSTK LIKE VBUK-WBSTK,
END OF GT_VBUK.
*-------fINAL iNTERNAL TABLE FOR OUTPUT
DATA : BEGIN OF GT_FINAL_DATA OCCURS 0,
KUNNR LIKE VBAK-KUNNR, " cUSTOMER CODE
NAME(70) TYPE C, " cUSTOMER NAME
ORT01 LIKE KNA1-ORT01, "cITY
S_KUNNR LIKE VBAK-KUNNR, " cUSTOMER CODE
S_NAME(70) TYPE C, " cUSTOMER NAME
S_ORT01 LIKE KNA1-ORT01, "cITY
KLABC LIKE KNVV-KLABC, " Custoemr Class
VBELN(70) TYPE C, " LIKE VBAK-VBELN, "sALES oRDER nUMBER
POSNR LIKE VBAP-POSNR, "SALES ORDER LINE NUMBER
INCO1 LIKE VBKD-INCO1, "Incoterms (Part 1)
INCO2 LIKE VBKD-INCO2, "Incoterms (Part 2)
KALAB LIKE MSKA-KALAB, "Unrestricted-Use Stock
KAINS LIKE MSKA-KAINS, " Stock in Quality Inspection
LABST LIKE MARD-LABST, "Valuated Unrestricted-Use Stock
ERDAT LIKE VBAK-ERDAT , " Order Date
MATNR LIKE MAKT-MATNR, "Matrial
MAKTX LIKE MAKT-MAKTX, "Matrial DESC
MAKTG LIKE MAKT-MAKTG, "Matrial DESC
ZZKDMAT LIKE VBAP-ZZKDMAT, "Customter Mat. Number
ABGRU LIKE VBAP-ABGRU, " Reason for rejection
COLOR(20) TYPE C, "Color
COMPLEX(20) TYPE C, "Complex
WIDTH(10) TYPE C, "Width
KBETR LIKE KONV-KBETR, " Rate per KG
WAERS LIKE KONV-WAERS, "currency
STCUR LIKE VBKD-STCUR, " Exchang Rate
MEINS LIKE VBAP-MEINS, "Base Unit of Measure
KWMENG LIKE VBAP-KWMENG, " Order Quantity
RFMNG LIKE VBFA-RFMNG, "Referenced quantity in base unit of measure
BAL_QTY LIKE VBFA-RFMNG, " Balance QTY
EDATU LIKE VBEP-EDATU, "Schedule line date
DAYS(5) TYPE C, " Sch.Delay
BSTNK LIKE VBAK-BSTNK, " cUSTOMER pURCHASE ORDER NUMBER
BSTDK LIKE VBAK-BSTDK, "Customer purchase order date
VTWEG LIKE VBAK-VTWEG, "Distribution Channel
SPART LIKE VBAK-SPART, "Division
DIST_NAME LIKE TVTWT-VTEXT, "Distribution Channels NAME
DIV_NAME LIKE TSPAT-VTEXT, "Sales Divisions NAME
ZA_KUNNR LIKE KNA1-KUNNR,
ZA_NAME LIKE KNA1-NAME1,
ZE_KUNNR LIKE KNA1-KUNNR,
ZE_NAME LIKE KNA1-NAME1,
ZI_KUNNR LIKE KNA1-KUNNR,
ZI_NAME LIKE KNA1-NAME1,
ZR_KUNNR LIKE KNA1-KUNNR,
ZR_NAME LIKE KNA1-NAME1,
ZS_KUNNR LIKE KNA1-KUNNR,
ZS_NAME LIKE KNA1-NAME1,
MVGR1(20) TYPE C , " Matrial Group
B_VALUE LIKE KONV-KWERT, "bASIC value
EX_VALUE LIKE KONV-KWERT, "eXCISE value
EC_VALUE LIKE KONV-KWERT, "ecess value
HE_VALUE LIKE KONV-KWERT, "hcess value
VAT_VALUE LIKE KONV-KWERT, "VAT value
CST_VALUE LIKE KONV-KWERT, "CST
F_VALUE LIKE KONV-KWERT, "fREIGJT
C_VALUE LIKE KONV-KWERT, "cOMISSION
KDGRP(70) TYPE C, " Custoemr Group
NETWR LIKE VBAP-NETWR, " Net Value
INR LIKE VBAP-NETWR, " inr Net Value
AUART LIKE VBAK-AUART, "Sales Document Type
BEZEI LIKE TVAKT-BEZEI, "SALES DOC TYPE DESC
ZOA_RECP_PLAN_DT LIKE VBAK-ZOA_RECP_PLAN_DT, "Order receipt at plant
ZZCUST_REQDAT LIKE VBAP-ZZCUST_REQDAT, " REquested Date
ROUTE LIKE VBAP-ROUTE, " Route
ROUTE_NAME LIKE TVROT-BEZEI , "Route name
ZZBRAND LIKE VBAP-ZZBRAND, " bRAND
ZZSPLDIA LIKE VBAP-ZZSPLDIA, "Spool Diameter
ZTERM LIKE VBKD-ZTERM, " Payment Term
Z_TERM_TEXT(50) TYPE C, "Payment Terms Text
Z001(50) TYPE C, "text
Z002(50) TYPE C, "text
Z003(50) TYPE C, "text
Z004(50) TYPE C, "text
ZI_001(50) TYPE C, "text
ZI_002(50) TYPE C, "text
ZZCOATING(20) TYPE C,
ZZWEIGHT LIKE VBAP-ZZWEIGHT,
ZZWEIGHT_UMO LIKE VBAP-ZZWEIGHT_UMO,
WBSTK LIKE VBUK-WBSTK,
T_NETWR LIKE VBAP-NETWR, " Net Value
FAKSP LIKE VBAP-FAKSP,
END OF GT_FINAL_DATA.
*****Mail Data Decleration.
DATA : BEGIN OF MAIL_TAB OCCURS 0 ,
ZE_NAME LIKE KNA1-NAME1,
ZS_NAME LIKE KNA1-NAME1,
NAME LIKE KNA1-NAME1,
ORT01 LIKE KNA1-ORT01, "cITY
S_NAME LIKE KNA1-NAME1,
S_ORT01 LIKE KNA1-ORT01, "cITY
KLABC LIKE KNVV-KLABC, " Custoemr Class
VBELN LIKE VBAK-VBELN, "sALES oRDER nUMBER
POSNR LIKE VBAP-POSNR, "SALES ORDER LINE NUMBER
ERDAT LIKE VBAK-ERDAT , " Order Date
MATNR LIKE MAKT-MATNR, "Matrial
MAKTX LIKE MAKT-MAKTX, "Matrial DESC
ZZKDMAT LIKE VBAP-ZZKDMAT, "Customter Mat. Number
COLOR(20) TYPE C, "Color
COMPLEX(20) TYPE C, "Complex
WIDTH(10) TYPE C, "Width
KBETR LIKE KONV-KBETR, " Rate per KG
WAERS LIKE KONV-WAERS, "currency
MEINS LIKE VBAP-MEINS, "Base Unit of Measure
KWMENG LIKE VBAP-KWMENG, " Order Quantity
BAL_QTY LIKE VBFA-RFMNG, " Balance QTY
EDATU LIKE VBEP-EDATU, "Schedule line date
DAYS(5) TYPE C, " Sch.Delay
BSTNK LIKE VBAK-BSTNK, " cUSTOMER pURCHASE ORDER NUMBER
BSTDK LIKE VBAK-BSTDK, "Customer purchase order date
ZA_NAME LIKE KNA1-NAME1,
ZI_NAME LIKE KNA1-NAME1,
ZR_NAME LIKE KNA1-NAME1,
MVGR1(20) TYPE C , " Matrial Group
ZZCUST_REQDAT LIKE VBAP-ZZCUST_REQDAT, " REquested Date
ZZBRAND LIKE VBAP-ZZBRAND, " bRAND
END OF MAIL_TAB.
DATA : IT_MAIL_ID TYPE YMSLT_MAIL_ID OCCURS 0 WITH HEADER LINE.
DATA : SM_MAIL_ID TYPE YMSLT_MAIL_ID OCCURS 0 WITH HEADER LINE.
DATA : SP_MAIL_ID TYPE YMSLT_MAIL_ID OCCURS 0 WITH HEADER LINE.
DATA: IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
W_CNT TYPE I,
W_SENT_ALL(1) TYPE C,
W_DOC_DATA LIKE SODOCCHGI1,
GD_ERROR TYPE SY-SUBRC,
GD_RECIEVER TYPE SY-SUBRC.
DATA STR_VAL TYPE STRING.
CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
CONSTANTS:
CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
DATA: GT_VBAK_KNA1 LIKE GT_VBAK OCCURS 0 WITH HEADER LINE,
GT_VBAP_VBPA LIKE GT_VBAP OCCURS 0 WITH HEADER LINE,
GT_VBAP_MAKT LIKE GT_VBAP OCCURS 0 WITH HEADER LINE,
GT_MVKE_TVM1T LIKE GT_MVKE OCCURS 0 WITH HEADER LINE,
GT_VBAP_MSKA LIKE GT_VBAP OCCURS 0 WITH HEADER LINE,
GT_VBPA_KNA1 LIKE GT_VBPA OCCURS 0 WITH HEADER LINE,
GT_VBFA_VBUK LIKE GT_VBFA OCCURS 0 WITH HEADER LINE,
GT_VBAP_INOB LIKE GT_VBAP OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF GT_INOB OCCURS 0.
INCLUDE STRUCTURE INOB.
DATA : END OF GT_INOB.
DATA: BEGIN OF GT_YCAT_PARAMS OCCURS 0,
KEY01 TYPE YYKEY01_C10,
KEY02 TYPE YYKEY02_C16,
KEY03 TYPE YYKEY03_C20,
SRNO TYPE YYSRNO_N4,
VALUE TYPE YYVALUE_C25,
END OF GT_YCAT_PARAMS.
DATA: BEGIN OF GT_CABN OCCURS 0,
ATINN LIKE CABN-ATINN,
ATNAM LIKE CABN-ATNAM,
END OF GT_CABN.
DATA: BEGIN OF GT_AUSP OCCURS 0,
OBJEK LIKE AUSP-OBJEK,
ATINN LIKE AUSP-ATINN,
ATWRT LIKE AUSP-ATWRT,
END OF GT_AUSP.
DATA: BEGIN OF GT_CUOBJ OCCURS 0,
CUOBJ(18) TYPE C,
CUOBJ TYPE OBJNUM,
END OF GT_CUOBJ.
DATA: BEGIN OF GT_CAWN OCCURS 0,
ATINN LIKE CAWN-ATINN,
ATZHL LIKE CAWN-ATZHL,
ATWRT LIKE CAWN-ATWRT,
END OF GT_CAWN.
DATA: BEGIN OF GT_CAWNT OCCURS 0,
ATINN LIKE CAWNT-ATINN,
ATZHL LIKE CAWNT-ATZHL,
SPRAS LIKE CAWNT-SPRAS,
ATWTB LIKE CAWNT-ATWTB,
END OF GT_CAWNT.
START-OF-SELECTION *
INITIALIZATION.
VARIANT = 'Display Options'.
RB1 = 'X'.
REPNAME = SY-REPID.
PERFORM BUILD_EVENTTAB USING EVENTS[].
PERFORM BUILD_LAYOUT .
PERFORM INITIALIZE_VARIANT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_VARI.
PERFORM F4_FOR_VARIANT.
AT SELECTION-SCREEN.
PERFORM PAI_OF_SELECTION_SCREEN.
END-OF-SELECTION.
PERFORM SELECT_DATA.
PERFORM PROCESS_DATA.
PERFORM FILTER_PATNER_DATA.
IF P_FILE = 'X'.
PERFORM OUT_PUT_FILE.
ELSEIF P_SCREEN = 'X'.
PERFORM FILED_CAT_LOG.
PERFORM CREATE_ALV_LAYOUT.
PERFORM fill_events.
PERFORM OUT_PUT_DATA.
ELSEIF P_MAIL = 'X'.
PERFORM MAIL_RPT.
ENDIF.
*=================Start of Internal table Declaration===================
*===========
*& Form SELECT_DATA
sELECTING DATA FROM dATA bASE
FORM SELECT_DATA .
REFRESH R_PARVW.
R_PARVW-SIGN = 'I'.
R_PARVW-OPTION = 'EQ'.
IF NOT S_ZE[] IS INITIAL.
R_PARVW-LOW = S_ZE-LOW.
APPEND R_PARVW.
ENDIF.
IF NOT S_ZS[] IS INITIAL.
R_PARVW-LOW = S_ZS-LOW.
APPEND R_PARVW.
ENDIF.
IF NOT S_ZA[] IS INITIAL.
R_PARVW-LOW = S_ZA-LOW.
APPEND R_PARVW.
ENDIF.
IF NOT S_ZR[] IS INITIAL.
R_PARVW-LOW = S_ZR-LOW.
APPEND R_PARVW.
ENDIF.
IF NOT S_ZI[] IS INITIAL.
R_PARVW-LOW = S_ZI-LOW.
APPEND R_PARVW.
ENDIF.
R_PARVW-LOW = 'SH'.
APPEND R_PARVW.
sELECTING DATA FROM VBAK TABLE INTO INTERNAL TABLE GT_VBAK
SELECT VBELN ERDAT AUART
VTWEG SPART KNUMV
BSTNK BSTDK KUNNR
ZOA_RECP_PLAN_DT
INTO TABLE GT_VBAK
FROM VBAK
WHERE VBELN IN S_VBELN
AND ERDAT IN S_ERDAT
AND VBTYP = 'C'
AND AUART IN S_AUART
AND AUGRU IN S_AUGRU
AND VKORG IN S_VKORG
AND VTWEG IN S_VTWEG
AND VKGRP IN S_VKGRP
AND VKBUR IN S_VKBUR
AND BSTNK IN S_BSTNK
AND KUNNR IN S_KUNNR.
SORT GT_VBAK[] BY VBELN.
IF NOT GT_VBAK[] IS INITIAL.
Selecting data from VBAP into Internal tabl gt_vbap
IF P_BLOCK = 'X' .
SELECT VBELN POSNR
MATNR ABGRU
MEINS FAKSP
NETWR KWMENG
WERKS LGORT
ROUTE ZZWIDTH
ZZKDMAT ZZBRAND
ZZSPLDIA ZZCUST_REQDAT
ZZCOATING ZZWEIGHT
ZZWEIGHT_UMO
INTO TABLE GT_VBAP
FROM VBAP
FOR ALL ENTRIES IN GT_VBAK
WHERE VBELN = GT_VBAK-VBELN
AND MATNR IN S_MATNR
AND ABGRU <> ''
AND WERKS IN S_WERKS
ELSEIF P_PEN = 'X'.
SELECT VBELN POSNR
MATNR ABGRU
MEINS FAKSP
NETWR KWMENG
WERKS LGORT
ROUTE ZZWIDTH
ZZKDMAT ZZBRAND
ZZSPLDIA ZZCUST_REQDAT
ZZCOATING ZZWEIGHT
ZZWEIGHT_UMO
INTO TABLE GT_VBAP
FROM VBAP
FOR ALL ENTRIES IN GT_VBAK
WHERE VBELN = GT_VBAK-VBELN
AND MATNR IN S_MATNR
AND FAKSP <> '10'
AND WERKS IN S_WERKS.
ELSE.
SELECT VBELN POSNR
MATNR ABGRU
MEINS FAKSP
NETWR KWMENG
WERKS LGORT
ROUTE ZZWIDTH
ZZKDMAT ZZBRAND
ZZSPLDIA ZZCUST_REQDAT
ZZCOATING ZZWEIGHT
ZZWEIGHT_UMO
INTO TABLE GT_VBAP
FROM VBAP
FOR ALL ENTRIES IN GT_VBAK
WHERE VBELN = GT_VBAK-VBELN
AND MATNR IN S_MATNR
AND WERKS IN S_WERKS.
ENDIF.
ENDIF.
IF P_PEN = 'X'.
SELECT VBELN POSNR GBSTA FROM VBUP INTO TABLE GT_VBUP
FOR ALL ENTRIES IN GT_VBAP
WHERE VBELN = GT_VBAP-VBELN AND POSNR = GT_VBAP-POSNR AND
GBSTA <> 'C'.
SORT GT_VBUP[] BY VBELN.
LOOP AT GT_VBAP.
READ TABLE GT_VBUP WITH KEY VBELN = GT_VBAP-VBELN
POSNR = GT_VBAP-POSNR.
IF SY-SUBRC <> 0.
DELETE GT_VBAP.
ENDIF.
CLEAR GT_VBUP.
ENDLOOP.
LOOP AT GT_VBAK.
READ TABLE GT_VBAP WITH KEY VBELN = GT_VBAK-VBELN.
IF SY-SUBRC <> 0.
DELETE GT_VBAK.
ENDIF.
CLEAR GT_VBAP.
ENDLOOP.
ENDIF.
IF NOT GT_VBAP[] IS INITIAL.
GT_VBAP_INOB[] = GT_VBAP[].
SORT GT_VBAP_INOB[] BY MATNR.
DELETE ADJACENT DUPLICATES FROM GT_VBAP_INOB COMPARING MATNR.
SELECT * FROM INOB INTO TABLE GT_INOB
WHERE KLART = '023'
AND OBTAB = 'MARA'.
IF SY-SUBRC = 0.
SELECT KEY01 KEY02 KEY03 SRNO VALUE
INTO TABLE Gt_YCAT_PARAMS
FROM YCAT_PARAMS
WHERE KEY01 = 'CHAR_NAME'
AND KEY02 = 'ATNAM'
AND ( KEY03 = 'COLOR' OR KEY03 = 'COMPLEX' )
AND SRNO = '0001'.
SELECT ATINN ATNAM INTO TABLE GT_CABN FROM CABN
WHERE ( ATNAM = 'COLOUR' OR ATNAM = 'COMPLEX' ).
LOOP AT GT_INOB.
GT_CUOBJ-CUOBJ = GT_INOB-CUOBJ.
APPEND GT_CUOBJ.
ENDLOOP.
SELECT OBJEK ATINN ATWRT
INTO TABLE GT_AUSP FROM AUSP
FOR ALL ENTRIES IN GT_CUOBJ
WHERE OBJEK = GT_CUOBJ-CUOBJ.
AND ATINN = L_ATINN.
SELECT ATINN ATZHL ATWRT INTO TABLE GT_CAWN
FROM CAWN FOR ALL ENTRIES IN GT_AUSP
WHERE ATWRT = GT_AUSP-ATWRT.
SELECT ATINN ATZHL SPRAS ATWTB INTO TABLE GT_CAWNT
FROM CAWNT FOR ALL ENTRIES IN GT_CAWN
WHERE ATINN = GT_CAWN-ATINN
AND ATZHL = GT_CAWN-ATZHL
AND SPRAS = 'EN'.
ENDIF.
Selecting data from VBeP into Internal tabl gt_vbep
SORT GT_VBAP[] BY VBELN POSNR.
SELECT VBELN POSNR
ETENR EDATU
INTO TABLE GT_VBEP
FROM VBEP
FOR ALL ENTRIES IN GT_VBAP
WHERE VBELN = GT_VBAP-VBELN
AND POSNR = GT_VBAP-POSNR
AND EDATU IN S_EDATU
AND BMENG <> 0.
SELECT SPRAS ROUTE BEZEI
INTO TABLE GT_TVROT
FROM TVROT
WHERE SPRAS = 'EN'.
ENDIF.
IF NOT GT_VBAP[] IS INITIAL.
GT_VBAP_VBPA[] = GT_VBAP[].
SORT GT_VBAP_VBPA[] BY VBELN.
DELETE ADJACENT DUPLICATES FROM GT_VBAP_VBPA COMPARING VBELN.
Selecting data from VBPA into Internal tabl GT_VBPA
IF NOT R_PARVW[] IS INITIAL.
SELECT VBELN POSNR
PARVW KUNNR
INTO TABLE GT_VBPA
FROM VBPA
FOR ALL ENTRIES IN GT_VBAP_VBPA
WHERE VBELN = GT_VBAP_VBPA-VBELN
AND ( PARVW IN R_PARVW
OR PARVW = 'WE' ).
ELSE.
SELECT VBELN POSNR
PARVW KUNNR
INTO TABLE GT_VBPA
FROM VBPA
FOR ALL ENTRIES IN GT_VBAP_VBPA
WHERE VBELN = GT_VBAP_VBPA-VBELN
AND ( PARVW = 'ZE'
OR PARVW = 'ZS'
OR PARVW = 'ZA'
OR PARVW = 'ZR'
OR PARVW = 'ZI' OR PARVW = 'WE' ).
ENDIF.
ENDIF.
SORT GT_VBPA[].
GT_VBPA_KNA1[] = GT_VBPA[].
SORT GT_VBPA_KNA1[] BY KUNNR.
DELETE ADJACENT DUPLICATES FROM GT_VBPA_KNA1 COMPARING KUNNR.
IF NOT GT_VBPA_KNA1[] IS INITIAL.
SELECT KUNNR NAME1 ORT01 FROM KNA1 INTO TABLE
GT_KNA1_1 FOR ALL ENTRIES IN GT_VBPA_KNA1
WHERE KUNNR = GT_VBPA_KNA1-KUNNR.
ENDIF.
Selecting data from VBKD into Internal tabl GT_VBKD
IF NOT GT_VBAK[] IS INITIAL.
SELECT VBELN KDGRP
INCO1 INCO2
ZTERM STCUR
INTO TABLE GT_VBKD
FROM VBKD
FOR ALL ENTRIES IN GT_VBAK
WHERE VBELN = GT_VBAK-VBELN
AND PRSDT <> ''.
Selecting data from VBFA into Internal table gt_vbfa
IF P_PEN = 'X'.
SELECT VBFAVBELV VBFAPOSNV
VBFAVBELN VBFAPOSNN
VBFAVBTYP_N VBFARFMNG
INTO TABLE GT_VBFA
FROM VBFA INNER JOIN
VBAK ON VBFAVBELV = VBAKVBELN
WHERE
( VBFA~VBTYP_N = 'J' OR
VBFA~VBTYP_N = 'R').
LOOP AT GT_VBFA.
READ TABLE GT_VBAK WITH KEY VBELN = Gt_VBFA-VBELV.
IF SY-SUBRC <> 0.
DELETE GT_VBFA.
ENDIF.
CLEAR GT_VBFA.
ENDLOOP.
SELECT VBELV POSNV
VBELN POSNN
VBTYP_N RFMNG
INTO TABLE GT_VBFA
FROM VBFA
FOR ALL ENTRIES IN GT_VBAK
WHERE VBELV = GT_VBAK-VBELN
AND ( VBTYP_N = 'J' OR
VBTYP_N = 'R').
ELSE.
SELECT VBELV POSNV
VBELN POSNN
VBTYP_N RFMNG
INTO TABLE GT_VBFA
FROM VBFA
FOR ALL ENTRIES IN GT_VBAK
WHERE VBELV = GT_VBAK-VBELN
AND VBTYP_N = 'J'.
ENDIF.
SORT GT_VBFA[].
IF GT_VBFA[] IS NOT INITIAL.
GT_VBFA_VBUK[] = GT_VBFA[].
SORT GT_VBFA_VBUK[] BY VBELN.
DELETE ADJACENT DUPLICATES FROM GT_VBFA_VBUK COMPARING VBELN.
SELECT VBELN WBSTK FROM VBUK INTO TABLE GT_VBUK
FOR ALL ENTRIES IN GT_VBFA_VBUK
WHERE VBELN = GT_VBFA_VBUK-VBELN.
ENDIF.
-----------Selection data from KONv into Internal table gt_konv
SORT GT_VBAK[] BY KNUMV.
SELECT KNUMV KPOSN KSCHL
KBETR WAERS KWERT
INTO TABLE GT_KONV
FROM KONV
FOR ALL ENTRIES IN GT_VBAK
WHERE KNUMV = GT_VBAK-KNUMV
AND ( KSCHL = 'ZBAP'
OR KSCHL = 'JEXP'
OR KSCHL = 'JEDC'
OR KSCHL = 'JEDH'
OR KSCHL = 'ZJIP'
OR KSCHL = 'ZCOM'
OR KSCHL = 'JIVC'
OR KSCHL = 'JFRE' ).
ENDIF.
IF NOT GT_VBAP[] IS INITIAL.
sELECING dATA FROM MSKA INTO INTERNAL TABLE GT_MSKA
GT_VBAP_MSKA[] = GT_VBAP[].
SORT GT_VBAP_MSKA[] BY MATNR WERKS VBELN POSNR.
DELETE ADJACENT DUPLICATES FROM GT_VBAP_MSKA COMPARING MATNR WERKS VBELN POSNR.
SELECT MATNR WERKS
LGORT CHARG
SOBKZ VBELN
POSNR
KALAB KAINS
INTO TABLE GT_MSKA
FROM MSKA
FOR ALL ENTRIES IN GT_VBAP_MSKA
WHERE MATNR = GT_VBAP_MSKA-MATNR
AND WERKS = GT_VBAP_MSKA-WERKS
AND LGORT = GT_VBAP-LGORT
AND VBELN = GT_VBAP_MSKA-VBELN
AND POSNR = GT_VBAP_MSKA-POSNR.
SORT GT_MSKA[].
DATA :BEGIN OF TMP_MATNR OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF TMP_MATNR.
LOOP AT GT_VBAP.
TMP_MATNR-MATNR = GT_VBAP-MATNR.
TMP_MATNR-MATNR+0(1) ='S'.
APPEND TMP_MATNR.
ENDLOOP.
SORT TMP_MATNR[].
DELETE ADJACENT DUPLICATES FROM TMP_MATNR COMPARING MATNR.
SELECT MATNR
WERKS
LGORT
LABST
FROM MARD
INTO TABLE GT_MARD
FOR ALL ENTRIES IN TMP_MATNR
WHERE MATNR = TMP_MATNR-MATNR."'SDX25000B040GC01'."GT_VBAP-MATNR.
ENDIF.
SORT GT_MARD[].
IF NOT GT_VBAK[] IS INITIAL.
GT_VBAK_KNA1[] = GT_VBAK[].
SORT GT_VBAK_KNA1[] BY KUNNR.
DELETE ADJACENT DUPLICATES FROM GT_VBAK_KNA1 COMPARING KUNNR.
SELECT KUNNR
NAME1
NAME2
ORT01
FROM KNA1
INTO TABLE GT_KNA1
FOR ALL ENTRIES IN GT_VBAK_KNA1
WHERE KUNNR = GT_VBAK_KNA1-KUNNR.
SELECT KUNNR KLABC
FROM KNVV
INTO TABLE GT_KNVV
FOR ALL ENTRIES IN GT_VBAK_KNA1
WHERE KUNNR = GT_VBAK_KNA1-KUNNR.
ENDIF.
IF NOT GT_VBAP[] IS INITIAL.
GT_VBAP_MAKT[] = GT_VBAP[].
SORT GT_VBAP_MAKT[] BY MATNR.
DELETE ADJACENT DUPLICATES FROM GT_VBAP_MAKT COMPARING MATNR.
SELECT MATNR
SPRAS
MAKTX
FROM MAKT
INTO TABLE GT_MAKT
FOR ALL ENTRIES IN GT_VBAP_MAKT
WHERE MATNR = GT_VBAP_MAKT-MATNR AND
SPRAS = 'EN'.
SELECT MATNR
MVGR1
FROM MVKE
INTO TABLE GT_MVKE
FOR ALL ENTRIES IN GT_VBAP_MAKT
WHERE MATNR = GT_VBAP_MAKT-MATNR
AND MVGR1 <> ''.
ENDIF.
IF NOT GT_MVKE[] IS INITIAL.
GT_MVKE_TVM1T[] = GT_MVKE[].
SORT GT_MVKE_TVM1T[] BY MVGR1.
DELETE ADJACENT DUPLICATES FROM GT_MVKE_TVM1T COMPARING MVGR1.
SELECT SPRAS MVGR1 BEZEI
FROM TVM1T
INTO TABLE GT_TVM1T
FOR ALL ENTRIES IN GT_MVKE_TVM1T
WHERE SPRAS = 'EN' AND
MVGR1 = GT_MVKE_TVM1T-MVGR1.
ENDIF.
IF NOT GT_VBAK[] IS INITIAL.
SELECT SPRAS
SPART
VTEXT
FROM TSPAT
INTO TABLE GT_TSPAT
WHERE SPRAS = 'EN'.
SELECT SPRAS
VTWEG
VTEXT
FROM TVTWT
INTO TABLE GT_TVTWT
WHERE SPRAS = 'EN'.
SELECT SPRAS AUART BEZEI
FROM TVAKT
INTO TABLE GT_TVAKT
WHERE
SPRAS = 'EN'.
ENDIF.
IF NOT GT_VBKD[] IS INITIAL.
SELECT SPRAS KDGRP
KTEXT
FROM T151T
INTO TABLE GT_T151T
FOR ALL ENTRIES IN GT_VBKD
WHERE SPRAS = 'EN' .
AND
KDGRP = GT_VBKD-KDGRP.
ENDIF.
IF NOT GT_VBKD[] IS INITIAL.
SELECT SPRAS ZTERM TEXT1
FROM T052U
INTO TABLE GT_T052U
FOR ALL ENTRIES IN GT_VBKD
WHERE SPRAS = 'EN'.
AND ZTERM = GT_VBKD-ZTERM.
ENDIF.
ENDFORM. " SELECT_DATA
*& Form PROCESS_DATA
text
--> p1 text
<-- p2 text
FORM PROCESS_DATA .
DATA : T_FLAG(2) TYPE C,
J_AMT LIKE VBFA-RFMNG,
M_AMT LIKE VBFA-RFMNG,
R_AMT LIKE VBFA-RFMNG,
N_AMT LIKE VBFA-RFMNG,
JR_AMT LIKE VBFA-RFMNG,
MN_AMT LIKE VBFA-RFMNG,
TMP_WBSTK LIKE VBUK-WBSTK,
SFG_MATNR LIKE MARD-MATNR.
LOOP AT GT_VBAP.
CLEAR : GT_FINAL_DATA,
J_AMT ,
M_AMT ,
R_AMT,
N_AMT ,
JR_AMT ,
SFG_MATNR,
MN_AMT .
READ TABLE GT_VBAK WITH KEY VBELN = GT_VBAP-VBELN.
IF SY-SUBRC = 0.
GT_FINAL_DATA-KUNNR = GT_VBAK-KUNNR.
GT_FINAL_DATA-VBELN = GT_VBAK-VBELN.
GT_FINAL_DATA-POSNR = GT_VBAP-POSNR.
GT_FINAL_DATA-ABGRU = GT_VBAP-ABGRU.
ENDIF.
READ TABLE GT_KNA1 WITH KEY KUNNR = GT_VBAK-KUNNR.
IF SY-SUBRC = 0.
GT_FINAL_DATA-NAME = GT_KNA1-NAME1.
GT_FINAL_DATA-ORT01 = GT_KNA1-ORT01.
ENDIF.
READ TABLE GT_KNVV WITH KEY KUNNR = GT_VBAK-KUNNR.
IF SY-SUBRC = 0.
GT_FINAL_DATA-KLABC = GT_KNVV-KLABC.
ENDIF.
IF SY-SUBRC = 0.
READ TABLE GT_VBKD WITH KEY VBELN = GT_VBAK-VBELN.
GT_FINAL_DATA-INCO1 = GT_VBKD-INCO1. "Incoterms (Part 1)
GT_FINAL_DATA-INCO2 = GT_VBKD-INCO2. "Incoterms (Part 2)
GT_FINAL_DATA-ZTERM = GT_VBKD-ZTERM. " Payment Term
ENDIF.
LOOP AT GT_MSKA WHERE MATNR = GT_VBAP-MATNR
AND WERKS = GT_VBAP-WERKS
AND LGORT = GT_VBAP-LGORT
AND VBELN = GT_VBAP-VBELN
AND POSNR = GT_VBAP-POSNR.
GT_FINAL_DATA-KALAB = GT_FINAL_DATA-KALAB + GT_MSKA-KALAB. "Unrestricted-Use Stock
GT_FINAL_DATA-KAINS = GT_FINAL_DATA-KAINS + GT_MSKA-KAINS. " Stock in Quality Inspection
ENDLOOP.
SFG_MATNR = GT_VBAP-MATNR.
SFG_MATNR+0(1) ='S'.
READ TABLE GT_MARD WITH KEY MATNR = SFG_MATNR
WERKS = GT_VBAP-WERKS
LGORT = 'SF01'.
loop at gt_mard where MATNR = SFG_MATNR
and WERKS = GT_VBAP-WERKS.
IF SY-SUBRC = 0.
GT_FINAL_DATA-LABST = GT_FINAL_DATA-LABST + GT_MARD-LABST . "Valuated Unrestricted-Use Stock
ENDIF.
endloop.
GT_FINAL_DATA-MATNR = GT_VBAP-MATNR. "Matrial
GT_FINAL_DATA-ZZKDMAT = GT_VBAP-ZZKDMAT. " Customer Mat. NHi Rajan,
There is a lot of scope for performance tuning the code:
1. Read statement should be with BINARY SEARCH
2. Select statement should have FIELDS in the same order as they exist in the table
3. Select statement where clause should have fields in same order as they exist in the table.
4. Internal tables seem to be having a huge number of fields. If possible, please limit the fields to only required fields in the internal table.
Best regards,
Prashant -
The process WindowServer is constantly running at 10 % or more CPU utilization
It is causing the fans on my Macbook Pro to constantly run. How can I tell what is causing this? The acvitity monitor line reads:
Process Name - WindowServer
CPU% - (bounces between 7.8% and 10.5%)
CPU Time - 47:52.73 (as of this posting)
Threads - 5
Idle Wake Ups - 75
PID - 42387 (althought sometimes this says 116)
User - _window
Parent process is: launchd(1)
My system is:
Early 2011 MacBook Pro 2.3 Ghz Intel Core i7
8 GB 1333 MHz DDR3
512Gig SSD Drive
OSX 10.9.2
Any advice is appreciated. I am sure it's not good for my system to constantly be running this hot!
Thanks much!Quote
Originally posted by Tiresmoke
Also what OS are you using. I used Win 2k Pro and C&C is worthless with it.
for me it's kinda worthless in XP too. none of the settings I set (in alarm thresholds) have any effect. -
How to over come jlaunch process High CPU utilization
Hi ,
I am facing problem in Poratal Production system
Jlaunch process consuming more CPu utilization, Can you suggest me How to overcome this problem with out restart server
regards,
BalaramHi,
This is because of parameters of your J2ee engine are not optimized. Check SAP 723909 Java VM settings for J2EE 6.40/7.0 Prerequisite for performance optimization
Thanks
Sunny -
Dbwr consuming high CPU after enabling DirectIO
Hi,
DBWR is consuming high CPU. After enabling DirectIO on Solaris SPARC 10, dbwr is eating away almost 1 CPU on a v440 machine i.e. 19% throughout the day. Neither of "buffer busy waits" or "write complete waits" or "free buffer waits" are in the top 5 wait events, which, to me, means that there is no buffer contention.
What I understand is that after enabling DirectIO, it takes longer for the IO to complete because pre-DirectIO it would return from the file system cache whereas now it has to return from the disk (and I do see at the OS level that IO has become slow), but should that result in dbwr consuming more CPU?
Infact after enabling DirectIO, IO has become very slow which is another problem and as a result log file writes have also become slow which is a 3rd problem. btw, I am aware that if there were many FTS, then DirectIO can make the system slow but there are no FTS in my case. Also, that SGA should be increased after enabling DirectIO, which has also been done.
Thanksuser12022918 wrote:
DBWR is consuming high CPU. After enabling DirectIO on Solaris SPARC 10, dbwr is eating away almost 1 CPU on a v440 machine i.e. 19% throughout the day. 19% is less than 1/5th of a CPU. Or are you referring to a 100% being all 4 CPUs?
What I understand is that after enabling DirectIO, it takes longer for the IO to complete because pre-DirectIO it would return from the file system cache whereas now it has to return from the disk Incorrect. See directio for details.
Yes, removing the file system cache from the I/O layer for a device can reduce I/O performance if the caller does not perform its own caching. However, direct I/O will eliminate the system cache overheads (and associated CPU resources needed) from a caller (like Oracle) that implements its own sophisticated buffer cache.
Direct I/O should therefore increase Oracle I/O performance and decrease resource footprint as it eliminates the need for the kernel to maintain a cache for that device.
Infact after enabling DirectIO, IO has become very slow which is another problem and as a result log file writes have also become slow which is a 3rd problem. Direct I/O, as per the Sun docs, is an advisory call. It may not place that device in direct I/O modes. It may result in partial direct I/O. So you need to make sure exactly what happens and how successful (partial or complete) this setting was.
btw, I am aware that if there were many FTS, then DirectIO can make the system slow but there are no FTS in my case. FTS (multi block reads/large sequential reads) is slower? This is contrary to Sun's docs that state:
Large sequential I/O generally performs best with DIRECTIO_ON, except when a file is sparse or is being extended and is opened with O_SYNC or O_DSYNC. -
Urgt:How to identify TOP 5 SQL using more CPU time without using statspack
How to identify the TOP 5 SQL queries which are consuming more CPU time during the timespan of 24 hours for entire database. There are N number of users who have issued sql queries, out of which few users have disconnected and few user are still connected to the database(I need to consider all sessions). My database version is 9.0.1. I don't want to use statspack. Is there any way to identify TOP 5 SQL consuming more CPU time without affecting the performance of the database. Can any one help me on this? Its urgent!!. I don't want to use statspack becasue it degrades the performance and i cannot afford to run it for 24 hours.
You don't run statspack for 24 hours, that would infact be pointless...
Run statspack for say a 10 or 15 minute window during a particular "busy" period on your database. If you run it for longer then all the useful data will have been "averaged out". You want a snapshot in time, not an average over the day. -
We have a test server that has 1 database.
OS: Win2k3
DB: 10gR2
We have a handful of users or less on that test server at any given time. I am running a query against a huge view (about 50 million records); and it's taking forever. The host CPU utilization is only ranging at 11% - 13%.
resource_limit on the database is FALSE. No profiles limiting resources were created on test server.
No one is using the machine right now and it's driving me nuts to think I can only utilize 11-13% of the machine's brains.
So, my question is,
1) will allocating more cpu utilization (especially when no one else is using it) improve my query run-time?
2) if so, how do I do it?We have a handful of users or less on that test server at any given time. I am running a
query against a huge view (about 50 million records); and it's taking forever. The host CPU utilization is only ranging at 11% - 13%.
resource_limit on the database is FALSE. No profiles limiting resources were created on test server.
No one is using the machine right now and it's driving me nuts to think I can only utilize 11-13% of the machine's brains.It's not the brains, it's the brawn.
So, my question is,
1) will allocating more cpu utilization (especially when no one else is using it) improve my query run-time?
2) if so, how do I do it?How many discs on your test server? Please, oh please tell me the same as on prod!
Paul... -
Email alerts if the free drive space is less than 50 GB and CPU utilization is more than 95%
Hi all,
I am new to SQl servers , Can someone please explain how can I add email alert to my Sq l server box for following scenarios.
Drive free space is less than 50GB.
CPU utilization is more than 95%
Any help would be much appreciated.Try with Powershell and scheduled it to run from task scheduler
Refer below links for more information
https://www.simple-talk.com/sysadmin/powershell/disk-space-monitoring-and-early-warning-with-powershell/
http://sqlpowershell.wordpress.com/2013/07/11/powershell-get-cpu-details-and-its-usage-2/
--Prashanth
Maybe you are looking for
-
Can't get my ipod out of Disk Mode
My iPod froze and was not being recognized by my computer. I got it into Disk Mode and now the computer is recognizing it but I can't get it out of disk mode. Any suggestions? Thanks!!!
-
Creation of DME - how to customize the DME to sumarise payments by vendor?
Dear all, I am creating a DME for automatic payments file creation. I would like to ste the file to sumarise the payments for one vendor as one single line. Currently, the proposal creates new line item for every separate invoice, even it is one and
-
Transfer of Images from fone to PC not registering...
Hi, I'm awaiting a new phone and sim as I'm currently experiencing problems and cannot transfer my pictures from my phone to pc and don't want to lose them when I exchange my phone. The Nokia PC Suite - Image Store states that "no new images or video
-
Loading non-standard Hierarchies from an external Sap System
Hi experts, We are trying to load a hierarchy of a non-standard characteristic from an external Sap System. From what we know till now, we can't create a Generic Datasource to load hierarchies, so the only way is to use a File Datasource (csv file, f
-
Placing photo into a resume template
Hi, been at this for a couple of hours, learning plenty about everything other than what I really want to do: How do I place a photo into a Pages template? I am using one of the resume templates, have my completed resume and it looks great. Only the