Thursday, January 31, 2013

Posting keys in the standard system

Posting KeyDescription
40G/L account debit posting
50G/L account credit posting
01Customer invoice
11Customer credit memo
21Vendor credit memo
25Vendor payment
31Vendor invoice

Purpose of Defining Internal Orders


following information comes from http://sapdocs.info.

An example would help us understand this much better.
Lets say in an organization there are various events such as trade fairs, training seminars, which occur during the year. Now lets assume for a second that these Trade fairs are organized by the Marketing cost center of the organization. Therefore in this case marketing cost center is responsible for all the trade fairs costs. All these trade fairs costs are posted to the marketing cost centers. Now if the management wants an analysis of the cost incurred for each of the trade fair organized by the marketing cost center how would the marketing manager get this piece of information across to them? The cost center report would not give this piece of info
Now this is where Internal Order steps in .If you go through all cost center reports this information is not readily available since all the costs are posted to the cost center.
SAP, therefore provides the facility of using internal orders which comes in real handy in such situations. In the above scenario the controlling department would then need to create an internal order for each of the trade fair organized. The cost incurred for each of the trade fair will be posted to the internal orders during the month. At the month end, these costs which are collected in the internal order will be settled from these orders to the marketing cost center. Thus the controlling person is now in a position to analyze the cost for each of the trade fair separately. Thus internal order is used to monitor costs for short term events, activities. It helps in providing more information than that is provided on the cost centers. It can be widely used for various purposes .

Sales Order in SAP SD


following information comes from http://sapdocs.info.

A ‘Sales Order’ is a contract between your Sales Organization and a Customer for supply of specified goods and/services over a specified timeframe and in an agreed upon quantity or unit. All the relevant information from the customer master record and the material master record, for a specific sales area, are copied to the sales order. The sales order may be created with reference to a ‘preceding document’ such as a quotation, then all the initial data from the preceding document is copied to the sales order.
The ‘sales order’ contains:
  • Organizational data (sales organization, distribution channel, division, sales document type, pricing procedure, etc.).
  • Header data (sold-to-party, sales office, sales group, pricing date, document date, order reason, document currency, price group, sales district, customer group, shipping condition, incoterms, payment terms, billing schedule, PO number, etc.).
  • Item data (item category, order quantity, material, batch number, product hierarchy, plant, material group, shipping point, route, delivery priority, customer material, item number, etc.).
  • Schedule line data (schedule line, schedule line number, delivery date, order quantity, confirmed quantity, material availability date, loading date, proposed goods issue date, transportation date, movement type, shipping point, etc.).

Insert Horizontal Lines In Word Documents Quickly

in word document,just put three of any characters in following list,then hit enter,it will automatically created the horizontal lines in word
1)_
2)-
2)*
3)=
4)#
5)~

Thursday, January 17, 2013

bypass SSO

recently we has a situation that need fix and test few web applications that has been join the company SSO feature,but it looks like the SSO is not working for that environmental,we need bypass SSO,fix and test application.
go through the application,find out that,there is a Jspfilter that  add SSO securityToken to session,for all url if they are not exist,so we commented out the filter from web.xml, and change the auth-method to basic in web.xml,rebuild application and deploy to server,vola, SSO was bypassed.

Ho to log the web service soap communication

while working with a third part,doing web service communication with their API,some time,we need fidure out what soap message we send out by our java code,here is the how


System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");

Previous system property will help you print out all debug information include soap message(header,body) in IDE console.

SoapUI has a build in feature that can capture all HTTP communication,include soap communications,it it only apply to call fired from soapUI.

since Axis is using httpclient framework,this method tested successfully with axis.

we can also use log4j to log all debug information and get all soap communication details.
here is the article that has all details in the internet from Apache.

http://hc.apache.org/httpclient-3.x/logging.html


Logging Practices

Being a library HttpClient is not to dictate which logging framework the user has to use. Therefore HttpClient utilizes the logging interface provided by theCommons Logging package. Commons Logging provides a simple and generalized log interface to various logging packages. By using Commons Logging,HttpClient can be configured for a variety of different logging behaviours. That means the user will have to make a choice which logging framework to use. By default Commons Logging supports the following logging frameworks:
By implementing some simple interfaces Commons Logging can be extended to support basically any other custom logging framework. Commons Logging tries to automatically discover the logging framework to use. If it fails to select the expected one, you must configure Commons Logging by hand. Please refer to theCommons Logging documentation for more information.
HttpClient performs two different kinds of logging: the standard context logging used within each class, and wire logging.

Context Logging

Context logging contains information about the internal operation of HttpClient as it performs HTTP requests. Each class has its own log named according to the class's fully qualified name. For example the class HttpClient has a log named org.apache.commons.httpclient.HttpClient. Since all classes follow this convention it is possible to configure context logging for all classes using the single log named org.apache.commons.httpclient.

Wire Logging

The wire log is used to log all data transmitted to and from servers when executing HTTP requests. This log should only be enabled to debug problems, as it will produce an extremely large amount of log data, some of it in binary format.
Because the content of HTTP requests is usually less important for debugging than the HTTP headers, these two types of data have been separated into different wire logs. The content log is httpclient.wire.content and the header log is httpclient.wire.header.

Configuration Examples

Commons Logging can delegate to a variety of loggers for processing the actual output. Below are configuration examples for Commons LoggingLog4j andjava.util.logging.

Commons Logging Examples

Commons Logging comes with a basic logger called SimpleLog. This logger writes all logged messages to System.err. The following examples show how to configure Commons Logging via system properties to use SimpleLog.
Note: The system properties must be set before a reference to any Commons Logging class is made.
Enable header wire + context logging - Best for Debugging
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");

System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");

System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire.header", "debug");

System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");
Enable full wire(header and content) + context logging
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");

System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");

System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug");

System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");
Enable just context logging
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");

System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");

System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");

Log4j Examples

The simplest way to configure Log4j is via a log4j.properties file. Log4j will automatically read and configure itself using a file named log4j.properties when it's present at the root of the application classpath. Below are some Log4j configuration examples.
Note: Log4j is not included in the HttpClient distribution.
Enable header wire + context logging - Best for Debugging
log4j.rootLogger=INFO, stdout



log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n



log4j.logger.httpclient.wire.header=DEBUG

log4j.logger.org.apache.commons.httpclient=DEBUG
Enable full wire(header and content) + context logging
log4j.rootLogger=INFO, stdout



log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n



log4j.logger.httpclient.wire=DEBUG

log4j.logger.org.apache.commons.httpclient=DEBUG
Log wire to file + context logging
log4j.rootLogger=INFO



log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n



log4j.appender.F=org.apache.log4j.FileAppender

log4j.appender.F.File=wire.log

log4j.appender.F.layout=org.apache.log4j.PatternLayout

log4j.appender.F.layout.ConversionPattern =%5p [%c] %m%n



log4j.logger.httpclient.wire=DEBUG, F

log4j.logger.org.apache.commons.httpclient=DEBUG, stdout
Enable just context logging
log4j.rootLogger=INFO, stdout



log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n



log4j.logger.org.apache.commons.httpclient=DEBUG
Note that the default configuration for Log4J is very inefficient as it causes all the logging information to be generated but not actually sent anywhere. The Log4J manual is the best reference for how to configure Log4J. It is available at http://logging.apache.org/log4j/docs/manual.html

java.util.logging Examples

Since JDK 1.4 there has been a package java.util.logging that provides a logging framework similar to Log4J. By default it reads a config file from$JAVA_HOME/jre/lib/logging.properties which looks like this (comments stripped):
handlers=java.util.logging.ConsoleHandler

.level=INFO

java.util.logging.FileHandler.pattern = %h/java%u.log

java.util.logging.FileHandler.limit = 50000

java.util.logging.FileHandler.count = 1

java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter

java.util.logging.ConsoleHandler.level = INFO

java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

com.xyz.foo.level = SEVERE
To customize logging a custom logging.properties file should be created in the project directory. The location of this file must be passed to the JVM as a system property. This can be done on the command line like so:
$JAVA_HOME/java -Djava.util.logging.config.file=$HOME/myapp/logging.properties -classpath $HOME/myapp/target/classes com.myapp.Main
Alternatively LogManager#readConfiguration(InputStream) can be used to pass it the desired configuration.
Enable header wire + context logging - Best for Debugging
.level=INFO



handlers=java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter



httpclient.wire.header.level=FINEST

org.apache.commons.httpclient.level=FINEST
Enable full wire(header and content) + context logging
.level=INFO



handlers=java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter



httpclient.wire.level=FINEST

org.apache.commons.httpclient.level=FINEST
Enable just context logging
.level=INFO



handlers=java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter



org.apache.commons.httpclient.level=FINEST
More detailed information is available from the Java Logging documentation.



delete outlook emails from a folder without move them to deleted items folder

select the emails that you want delete permanently, click shift+ delete,confirmed with yes,the the email will delete permanently from you folder.