REPALCE() function issue. String getting truncated.

Hi,
I am using ORACLE DATABASE 11g. I am facing a very strange problem. I have a string in an variable when i print that sting i can see that the string is correct but after applying a replace function on to it when i print the string the string is incomplete.
Details are as follows :- In the code i am getting some DDL statement (alter table ) , this is the difference between the 2 compared tables. Then I want to place ';' at the last of each line and keyword 'BEGIN' at start and 'END;' at the last. I tried to do this with replace() function but the output string is shot than needed. Please follow the code :-
     dbms_output.put_line('V_TAB_DIFF_ALTER:=' || V_TAB_DIFF_ALTER); -- Print the original string. Variable datatype used varchar2(32767)/CLOB
     dbms_output.put_line('SOURCE Size := '||Length(V_TAB_DIFF_ALTER)); -- Size of the original string.
      V_TAB_DIFF_ALTER_REP :=V_TAB_DIFF_ALTER; -- Placed the sting in new variable.
      V_TAB_DIFF_ALTER_REP := 'BEGIN '||replace(V_TAB_DIFF_ALTER_REP,CHR(10),';') || ' END;'; -- Used the replace function and concatenate string.
     -- EXECUTE IMMEDIATE V_TAB_DIFF_ALTER_REP;
dbms_output.put_line('After replace := '||V_TAB_DIFF_ALTER_REP); -- Now again printing the sting but this time its not proper.The output is as follows :-
V_TAB_DIFF_ALTER:=ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("BENEFICIARY_ACCOUNT_ID" VARCHAR2(32))
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("HAS_OFFSET_ACCOUNT" CHAR(1) DEFAULT 'N')
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("MARKET_ENTITY" VARCHAR2(40))
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_PREVIOUS_STATUS" VARCHAR2(50))
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVIOUS_STATUS" VARCHAR2(50))
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_COUNTER" NUMBER)
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_DATE" DATE)
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("STMT_CYCLE_DAY" NUMBER)
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVENT_EXCESS_FLAG" CHAR(1))
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_START_DATE" DATE)
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_EXPIRY_DATE" DATE)
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_SANCTIONED_AMT" NUMBER)
SOURCE Size := 1830  -- Length of original string.
After replace := BEGIN ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("BENEFICIARY_ACCOUNT_ID" VARCHAR2(32));
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("HAS_OFFSET_ACCOUNT" CHAR(1) DEFAULT 'N');
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("MARKET_ENTITY" VARCHAR2(40));
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_PREVIOUS_STATUS" VARCHAR2(50));
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVIOUS_STATUS" VARCHAR2(50));
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_COUNTER" NUMBER);
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_DATE" DATE);
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("STMT_CYCLE_DAY" NUMBER);
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVENT_EXCESS_FLAG" CHAR(1));
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_START_DATE" DATE);
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_EXPIRY_DATE" DATE);
  ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_SANCTIONE                ------ Here the remaining string is missing.
NEW Var. Length  :- 1862 -- Length of the new string but still the printed string is not the perfect one. It only prints 1830 characters, rest are not printed.
{code}
Here you can see that the sting in after replace in actually short and will give error when trying to execute. As you can also see that length of new string is more i.e. 1862 but its reading and writing only 1830 characters => which is the actual size of original string.
Variable datatypes used varchar2(32767) and CLOB. Faced issues in both the cases.
Its very obvious that when i am trying to replace a few things then I can add a bit more to it. Why is it only reading or writing only the 1830 character string not the whole 1862 string ??? How can i get the size as 1862 but not the whole string ??
Let me know any solution on this ...
Thanks in advance.
Edited by: VIRU on Nov 17, 2011 10:24 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Thanks William for your reply.
I have tried with increasing the buffer size by
exec dnms_output.enable(40000000);but still no improvements.
I was able to successful print long strings than this one but when it comes to format it with replace i am facing this scenario.
Let me know if you have any idea.

Similar Messages

  • R3 to CRM direction - BDOC - Email address getting truncated on BP

    Hi,
    Customer details are being tranferred to CRM from R3 using BDOC.While doing so the Email address field is getting truncated to 40 Chars (if it is more than 40). This only happens when the Customer is changed in R3 and then BDOC is sent to CRM  (change in Email ID) , But when the customer is sent to CRM for the first time (new customer created), the Email ID is getting populated properly (no truncation).
    Can you please help me in the issue.
    Thanks in advance,
    Vivekanand

    Prasenjit,
    Your first two suggestions seem to work fine.  I know have a link that I think is raising an event.
    CASE iv_property.
      WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_event_link.
      WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
          rv_value = 'toemail'.
    endcase .
    Here is my hardcoded event handler but it dumps with a  FRONTEND_ERROR  ( sy-subrc = 2 )
    method EH_ONTOEMAIL.
    * Added by wizard: Handler for event 'toemail'
    CALL FUNCTION 'CALL_BROWSER'
    EXPORTING
       URL                          = 'mailto:hardcodedemailaddress'
    *   WINDOW_NAME                  = ' '
    *   NEW_WINDOW                   = ' '
    *   BROWSER_TYPE                 =
    *   CONTEXTSTRING                =
    * EXCEPTIONS
    *   FRONTEND_NOT_SUPPORTED       = 1
    *   FRONTEND_ERROR               = 2
    *   PROG_NOT_FOUND               = 3
    *   NO_BATCH                     = 4
    *   UNSPECIFIED_ERROR            = 5
    *   OTHERS                       = 6
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endmethod.
    But when I call CALL_BROWSER through se37 it worls fine and brings up my outlook client.
    Any ideas ?

  • Issue: Not getting response when the document is having special chars

    Please help following issue: Not getting response when the document is having special chars(Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    Error message:
    System.FormatException: Invalid length for a Base-64 char array. at
    System.Convert.FromBase64String(String s) at
    Summarize.Summarizer.AccumulateBroadcast(String filedata, String givenWords) in
    c:\DocumentSummarizer\App_Code\Summarizer.cs:line 66
    Code:
    File 1:
    import java.io.BufferedReader;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStream;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    import java.util.Properties;
    import org.apache.poi.poifs.filesystem.POIFSFileSystem;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import com.lowagie.text.Document;
    import com.lowagie.text.pdf.PRTokeniser;
    import com.lowagie.text.pdf.PdfReader;
    public class DocumentSummarizerClient {
         static Properties loadProperties() {
              Properties prop = new Properties();
              try {
                   prop.load(DocumentSummarizerClient.class.getClassLoader().getResourceAsStream("vep.properties"));
              } catch (Exception ioe) {
                   ioe.printStackTrace();
              return prop;
         public String getSummary(String fileName,String noOfWordsOrPercentage ){
              String summaryInputData ="";
              String summarizedData="";
              String summarizerURL = loadProperties().getProperty("Summarizer.serviceURL");
              try {
                   String fileExtension=fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
                   if (fileExtension.equalsIgnoreCase("doc")|| fileExtension.equalsIgnoreCase("txt")|| fileExtension.equalsIgnoreCase("pdf")) {
                                  if (fileExtension.equalsIgnoreCase("txt")) {
                                       BufferedReader bufferedReader = new BufferedReader(
                                                 new FileReader(fileName));
                                       String line = null;
                                       while ((line = bufferedReader.readLine()) != null) {
                                            summaryInputData += line;
                                  if(fileExtension.equalsIgnoreCase("doc")){
                                       POIFSFileSystem fs = null;
                                        fs = new POIFSFileSystem(new FileInputStream(fileName));
                                         HWPFDocument doc = new HWPFDocument(fs);
                                         WordExtractor we = new WordExtractor(doc);
                                         String[] paragraphs = we.getParagraphText();
                                         for( int i=0; i<paragraphs .length; i++ ) {
                                            paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
                                  summaryInputData+= paragraphs[i];
                                  if(fileExtension.equalsIgnoreCase("pdf")){
                                       Document document = new Document();
                   document.open();
                   PdfReader reader = new PdfReader(fileName);
                   int pageCount =reader.getNumberOfPages();
                        for(int i=1;i<=pageCount;i++){
                                  byte[] bytes = reader.getPageContent(i);
                                  PRTokeniser tokenizer = new PRTokeniser(bytes);
                                  StringBuffer buffer = new StringBuffer();
                                  while (tokenizer.nextToken()) {
                                  if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) {
                                  buffer.append(tokenizer.getStringValue());
                                  summaryInputData += buffer.toString();
                   else{
                        System.out.println("This is Invalid document. Presntly we support only text,word and PDF documents ");
                   // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        // System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
                   else{
                        System.out.println("Data given cannot be summarized further");
                        summarizedData="";
              } catch (FileNotFoundException e) {
                   return("The File is not found \n\n"+e.toString());
              } catch (IOException e) {
                   return("The File is already in use \n\n"+e.toString());
              } catch (Exception e) {
                   return(e.toString());
              return summarizedData;
         public static String postRequest(String parameters,String webServiceURL) throws Exception{
              Properties systemSettings = System.getProperties();
              systemSettings.put("http.proxyHost", loadProperties().getProperty("proxyHost"));
         systemSettings.put("http.proxyPort", loadProperties().getProperty("proxyPort"));
         System.setProperties(systemSettings);
              String responseXML = "";
              try {
                   URL url = new URL(webServiceURL);
                   URLConnection connection = url.openConnection();
                   HttpURLConnection httpConn = (HttpURLConnection) connection;
                   byte[] requestXML = parameters.getBytes();
                   httpConn.setRequestProperty("Content-Length", String
                             .valueOf(requestXML.length));
                   httpConn.setRequestProperty("Content-Type",
                             "application/x-www-form-urlencoded");
                   httpConn.setRequestMethod("POST");
                   httpConn.setDoOutput(true);
                   httpConn.setDoInput(true);
                   OutputStream out = httpConn.getOutputStream();
                   out.write(requestXML, 0, requestXML.length);
                   out.close();
                   InputStreamReader isr = new InputStreamReader(httpConn
                             .getInputStream());
                   BufferedReader br = new BufferedReader(isr);
                   String temp;
                   String tempResponse = "";
                   while ((temp = br.readLine()) != null)
                        tempResponse = tempResponse + temp;
                   responseXML = tempResponse;
                   br.close();
                   isr.close();
              } catch (java.net.MalformedURLException e) {
                   System.out
                             .println("Error in postRequest(): Secure Service Required");
              } catch (Exception e) {
                   System.out.println("Error in postRequest(): " + e.getMessage());
              return responseXML;
         public String replaceVal(String value) {
                   if (value == null) {
                        value = "";
                   value = value.replace("&lt;", "<");
                   value = value.replace("&gt;", ">");
                   value = value.replace("&amp;", "&");
                   return value;
              public static void main(String[] args) {  
                   DocumentSummarizerClient testdoc=new DocumentSummarizerClient();
                   System.out.println("hello");               
                   testdoc.getSummary("C:\\working_folder\\vep\\UnitTestCases\\VEP1.0\\DocumentSummarizerTestData\\TestErrorFour.doc","100%");     
    Note: Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
    File 2:
    ---------public class Base64Utils {
    private static byte[] mBase64EncMap, mBase64DecMap;
    * Class initializer. Initializes the Base64 alphabet (specified in RFC-2045).
    static {
    byte[] base64Map = {
    (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F',
    (byte)'G', (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L',
    (byte)'M', (byte)'N', (byte)'O', (byte)'P', (byte)'Q', (byte)'R',
    (byte)'S', (byte)'T', (byte)'U', (byte)'V', (byte)'W', (byte)'X',
    (byte)'Y', (byte)'Z',
    (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f',
    (byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l',
    (byte)'m', (byte)'n', (byte)'o', (byte)'p', (byte)'q', (byte)'r',
    (byte)'s', (byte)'t', (byte)'u', (byte)'v', (byte)'w', (byte)'x',
    (byte)'y', (byte)'z',
    (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
    (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'};
    mBase64EncMap = base64Map;
    mBase64DecMap = new byte[128];
    for (int i=0; i<mBase64EncMap.length; i++)
    mBase64DecMap[mBase64EncMap[i]] = (byte) i;
    * This class isn't meant to be instantiated.
    private Base64Utils() {
    * Encodes the given byte[] using the Base64-encoding,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the data to be encoded
    * @return the Base64-encoded <var>aData</var>
    * @exception IllegalArgumentException if NULL or empty array is passed
    public static String base64Encode(byte[] aData) {
    if ((aData == null) || (aData.length == 0))
    throw new IllegalArgumentException("Can not encode NULL or empty byte array.");
    byte encodedBuf[] = new byte[((aData.length+2)/3)*4];
    // 3-byte to 4-byte conversion
    int srcIndex, destIndex;
    for (srcIndex=0, destIndex=0; srcIndex < aData.length-2; srcIndex += 3) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+2] >>> 6) & 003 |
    (aData[srcIndex+1] << 2) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[aData[srcIndex+2] & 077];
    // Convert the last 1 or 2 bytes
    if (srcIndex < aData.length) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
    if (srcIndex < aData.length-1) {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
    (aData[srcIndex] << 4) & 077];
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] << 2) & 077];
    else {
    encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] << 4) & 077];
    // Add padding to the end of encoded data
    while (destIndex < encodedBuf.length) {
    encodedBuf[destIndex] = (byte) '=';
    destIndex++;
    String result = new String(encodedBuf);
    return result;
    * Decodes the given Base64-encoded data,
    * as specified in RFC-2045 (Section 6.8).
    * @param aData the Base64-encoded aData.
    * @return the decoded <var>aData</var>.
    * @exception IllegalArgumentException if NULL or empty data is passed
    public static byte[] base64Decode(String aData) {
    if ((aData == null) || (aData.length() == 0))
    throw new IllegalArgumentException("Can not decode NULL or empty string.");
    byte[] data = aData.getBytes();
    // Skip padding from the end of encoded data
    int tail = data.length;
    while (data[tail-1] == '=')
    tail--;
    byte decodedBuf[] = new byte[tail - data.length/4];
    // ASCII-printable to 0-63 conversion
    for (int i = 0; i < data.length; i++)
    data[i] = mBase64DecMap[data[i]];
    // 4-byte to 3-byte conversion
    int srcIndex, destIndex;
    for (srcIndex = 0, destIndex=0; destIndex < decodedBuf.length-2;
    srcIndex += 4, destIndex += 3) {
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    decodedBuf[destIndex+1] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    decodedBuf[destIndex+2] = (byte) ( ((data[srcIndex+2] << 6) & 255) |
    (data[srcIndex+3] & 077) );
    // Handle last 1 or 2 bytes
    if (destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
    ((data[srcIndex+1] >>> 4) & 003) );
    if (++destIndex < decodedBuf.length)
    decodedBuf[destIndex] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
    ((data[srcIndex+2] >>> 2) & 017) );
    return decodedBuf;
    issue 2: Exception when passing 2MB .txt file
    Steps to reproduce:
    Call getSummary() with 2MB .txt file
    Actual:
    The following exception has occured:
    1. Error in postRequest(): Unexpected end of file from server
    java.lang.NullPointerException
    Please provide your precious feedback/suggestions.
    Thanks in advance…..
    Edited by: EJP on 15/03/2011 16:52: added code tags. Please use them. Code is unreadable otherwise.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Thanks for your response….
    This is enhancement project and some one develops long back.
    Regarding point (b) You should be using the java.net.URLEncoder to encode URL parameters, not a base64 encoder.
    DocumentSummarizerClient.java I am using base64
    Ex:
    // String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
                   // encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
                        String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
                        summarizedData= postRequest(parameters,summarizerURL);
                        String slength= "<string xmlns=\"http://tempuri.org/\">";
                        if(summarizedData.contains("</string>")){
                        summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
                        summarizedData = replaceVal(summarizedData);
                        //System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
                        System.out.println("Summarized data "+summarizedData);
                        if(summarizedData.contains("Please enter the percentage")){
                             summarizedData="Data given cannot be summarized further";
    Above specific please I need to modify to resolve above issue.
    Could you please suggest me what changes I need to do.
    Waiting for positive response.

  • ALV Header getting truncated in excel

    I am using the GRid Layout. but when i am downloading the output in the Excel sheet, the headers are getting truncated.
    I have tried increasing the width in the FIELDCAT and also removing the coulmn-optimze option in the layout also. but still after trying the headers are getitng truncated.
    Any pointers how can i download without the headers getting truncated.
    Thanks

    Refer the code snippet:
    Follow this way:
    CONSTANTS :  c_delim TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    data :it_excel_dwnld TYPE STANDARD TABLE OF t_zzidwnld_data     ,
           wa_excel_dwnld TYPE t_zzidwnld_data .                      .
       CONCATENATE   'Physical Inventory Document'
                    'Item '
                    'Material '
                    'Material Description'
                    'Material Group'                
                    'Plant'
                    'Sloc'
                    'Doc Date'
                    'Book Qty'
                    'Counted Qty'
                    'Value of Phy Inv Count'
                    'Standard Price'
                    'Difference Qty'
                    'ABS Qty'                        
                    'BUn'
    INTO wa_excel_dwnld-line
                                   SEPARATED BY c_delim.
      APPEND wa_excel_dwnld TO it_excel_dwnld.
      CLEAR: wa_excel_dwnld.
    LOOP AT it_output INTO wa_output.
    CONCATENATE   wa_output-iblnr
                      wa_output-zeili
                      wa_output-matnr
                      wa_output-maktx
                      wa_output-matkl       
                      wa_output-werks
                      wa_output-lgort
                      wa_output-bldat
                      v_buchm
                      v_menge
                      v_wrtzl
                      v_stprs
                      v_difqy
                      v_absqy              
      INTO wa_excel_dwnld-line
                           SEPARATED BY c_delim.
        APPEND wa_excel_dwnld TO it_excel_dwnld.
      ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = l_flname
          filetype                = 'ASC'
          write_field_separator   = '#'
        TABLES
          data_tab                = it_excel_dwnld

  • In Read_text FM, the data after 256 characters gets truncated

    Hi All,
    In this FM, the internal table can't have string type field. In my case the data is in multiple lines of internal table and I am concatenating into a single field which is of type DESCRIPTIONS(string). I am passing this data to a table in smartform.Only 255 characters are printed, remaining data gets truncated. I am using CONVERT_OTF and SX_TABLE_LINE_WIDTH_CHANGE FMs to create PDF. Is it the limitation or I am incorect here?

    Your posting title is misleading; there's nothing wrong with FM READ_TEXT.  Yes, it returns a table of type TLINE, as you've noted.  Perhaps you could close this post and repost in FORM PRINTING with an appropriate title like: Can't show more than 255 characters of text.....but search first, because you cannot be the first person to encounter this limitation.

  • Problem in download to application server- file column is getting truncated

    We have a program for which there are 2 options a list output or file to be placed on the application server. The TXT file is of length 525 characters.
    My problem is while the list output is generated the whole list is getting outputted, but when we take a output on the application server last 10 columns are getting truncated.
    Can somebody give a help on this.
    Thanks in advance.
    Jilly

    Use the function module
    ARCHIVFILE_SERVER_TO_CLIENT
    Pass the values: as download file and destination in the respective fields.
    File to be downloaded in :(Pass the exact file name)
    PATH :                          
    SDEC01\SAPMNT\INT\HR\OUT\FMLA-20080205-0728
    and
    Destination to download the file in:
    TARGETPATH                      C:\DOCUMENTS AND SETTINGS\JILFEM\MY DOCUMENTS\FMLA-20080205-0728
    Regards,
    Jilly

  • E-mails get truncated when forwarded

    When I forward an e-mail from within the e-mail app, the e-mail does not get forwarded completely. For some reason the original text gets truncated.
    I first noticed this on IOS 6 on both the iPhone 5 and iPad 3rd gen.
    Please advice me what to do, because this way the e-mail app is not reliable.
    Kind regards.

    Thank you. I will have to try this out with a known troublesome link, but I don't recall getting an "open with" dialog in these circumstances. Also, as I understand these things (and I probably don't) the links I have tried to use have been communication links rather than a file opening function. The problem I got the other day was on a BBC site and the function of the link (which was an e-mail address) was to enable me to post a question. I was able to use that address to post the question without using the link shortcut - just sent an e-mail.

  • Spool header is getting truncated in SP01 after ECC6.0 upgrade

    Hi Experts,
    We have recently upgraded our SAP System from 4.6C version to ECC6.0. We are facing some problem with Spool display.
    Issue: Column header is truncated in spool list display through SP01 (Applied necessary notes)/ ZSP01(Created based on note 186603). The column header is not getting truncated while executing report in online mode.
    Can anybody else got the problem or have any suggestions to rectify this problem?
    Rgds,
    Vinodkumar

    Hello Vinodkumar,
    I have seen this problem and the solution was to follow the note 1226758:
    Do not forget Call SPAD and choose Settings -> Spool System -> Other. Select
    'SP01: Number of Columns for List Display from Format'.
    Hope it helps to you.
    Best regards,
    Rafael

  • Long memos get truncated in Palm Desktop

    Hi, I am facing an issue which I find baffling and hope experts out there can help me.
    I am using a Treo 680 unlocked version running Palm OS Garnet v.5.4.9
    Few months back, I upgraded my laptop from Windows XP to Windows 7  (both are 32 bit).  I reinstalled Palm Desktop version 4.2 and it seemed to be apparently working, and I was very happy about it (quick install was not working but I was ok with it).   However, on closer examination, I noticed that long memos were significantly truncated on the Palm Desktop.  This is a serious problem as my memos on the device are not fully reproduced on the laptop.  Hence, if my device were to be lost or broken, I would have all the memos in my backup but many of them would be truncated and not complete.    Also, I am unable to "copy paste" the latter part of a long memo into an email or word document.
    I  have only used one way synchronisation (ie from device to laptop) ever since I moved to Windows 7 because of long duration between backups and previous experience where 2 way syncronisation resulted in corruption of data on my device.   Fortunately I discovered this problem before I did my first 2 way syncronisation as this may result in my memos on the device becoming truncated as well.
    If someone could help here, I would be really grateful.
    PS: some background info:
    I have been on Palm platform right from 1996 with the Palm Pilot 5000, and then Treo 180 and then having been using Treo 680 for the last seven years and still going strong !
    I know from my earlier experience that:
    - earlier devices and earlier Palm Desktop versions had a much smaller length limit per memo
    - in between, there was a situation where the device had a much bigger length limit per memo than the Palm Desktop at that time (i believe version 2 or version 4.1.4), and a long memo in the device would be split into multiple memos on the Palm Desktop with a sequential number added eg abc 1, abc 2, abc 3 etc
    But since I went on Treo 680 and Palm Desktop ver 4.2  on a Windows XP 32bit laptop, I have had no such problem. It is only when I upgraded my laptop to Windows 7 32 bit, that I am having this problem.  I find it baffling as I know that Palm Desktop ver 4.2 is capable of very long memos unlike some earlier version of Palm Desktop.  
    Thanks very much in advance
    Regards 

    Unfortunately I don't have an answer for why your Memos get truncated in Palm Desktop in a Windows 7 machine.  I hvae Palm Desktop 6.2.2 on a Windows 7 and Windows 8 desktops and do not have that problem with Memos.  Maybe yours are much longer than mine.  Does everything else seem to work OK (other than QuickInstall)?
    You could try a couple of things...but the first thing I would do is get a backup of your data onto an SD card with the free app called NVBackup.  Google it, download and install the nvbackup.prc file onto the Treo, then run a backup onto a card.  It will save you the nightmare of having to recreate your data if it were to be lost or corrupted somehow.  Now, the only thing you can do with that data from NVBackup is to restore it to the same or another (same) Palm device.  But at least it is saved.
     Next thing you could try, without risk to any data, is to just email your Memos to yourself from your phone.  VersaMail lets you attach Memos to an email.  They should come through as .txt files which you can copy and paste into anything else you like.
    You could also try installing Palm desktop 6.2.2 and, if your complete Memos do not appear, try re-syncing your Treo to the new desktop installation.
    smkranz
    I am a volunteer, and not an HP employee.
    Palm OS ∙ webOS ∙ Android

  • Function module to get desktop path

    Hi All,
    Is there any function module to get the desktop path?
    I have tried using CL_GUI_FRONTEND_SERVICES=>GET_DESKTOP_DIRECTORY, but it is not returning any value.
    I can't hardcode "C:\Documents and Settings\<<<user-name>>>\Desktop" as some users have their desktop in "D:\Documents and Settings\<<<user-name>>>\Desktop".
    Thanks in advance.
    Regards,
    Arun Mohan

    Hello
    No problem:
    data: str TYPE string.
    CALL METHOD cl_gui_frontend_services=>GET_DESKTOP_DIRECTORY
      changing
        DESKTOP_DIRECTORY     = str
      EXCEPTIONS
        cntl_error            = 1.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_GUI_CFW=>UPDATE_VIEW.
    WRITE: str.

  • Leading zero getting truncated in .CSV format GUI_DOWNLOAD

    Hello experts,
    I am trying to download the data using GUI_DOWNLOAD in .CSV format but the leading zeros are getting truncated. For instance Company code 0001 is displayed as 1 in the CSV File. But when I open the same file in notepad I am seeing 0001. Is this a known issue or this is how .CSV format should be?
    I have gone through some threads in SDN but they are not helpful.
    Your expert advise is much appreaciated.
    Thanks
    Abdul Hakim

    That is how excel displays values like 0001. It interprets them as a number and removes leading zeros.
    If you don't want this happen and you want excel to treat them like text, you need to append a quote at the beginning of the token like '0001
    You can use concatenate like below to append a single leading quote
    field = '0001'.
    CONCATENATE ''''  field INTO field.

  • Datagrid getting truncated during printing

    Hi All,
    I have a panel which contains the following items :-
    1. A Header Label
    2. A time slider
    3. A combo box
    4. A view stack which has a chart at index 0 and a data grid at index 1
    5. Some buttons
    For the datagrid(which is inside a VBox,whose height is 100% and verticalScrollPolicy is "on"), I have set the following attributes:-
    1.variableRowHeight = true
    2.rowCount = "{gridDataProvider.length}"
    3.verticalScrollPolicy = "off"
    4. wordWrap = true
    5. dataProvider = "{gridDataProvider}"
    6. updateComplete = "onUpdateComplete()"
    The function onUpdateComplete is:-
    private function onUpdateComplete() : void
                   var  newHeight : Number;
                    if ( this.gridDataProvider )   
                        this.dataGrid.headerHeight=50;
                        newHeight = dataGrid.measureHeightOfItems(0, this.gridDataProvider .length) + this.dataGrid.headerHeight ;
                        this.dataGrid.height = newHeight;
                        this.dataGrid.validateNow();
    While printing, I am having a printVBox which contains all these components and its height = dataGrid.height + some buffer height for accomodating the height of other components in the panel.
    I am able to print all the components, both before and after the datagrid, but the content of the datagrid is getting truncated, many rows are not printed.
    Please help. Thanks in advance !!
    Regards,
    Rudhir

    Hi Rudhir,
    You should do something like below:
    private function doPrint(event:Event):void
        var printJob:FlexPrintJob = new FlexPrintJob();
        if(printJob.start() != true) return;
        try
         var originalDGHeight:int = dataGridId.height;
         //Increasing the height of the desired component to be printed without scroll.
         //Here Check  which one is giving you total height dataGridId.measuredMinHeight or dataGridId.measuredHeight
         dataGridId.height = dataGridId.measuredMinHeight;
         //dataGridId.height = dataGridId.measuredHeight;
         dataGridId.verticalScrollPolicy = "off";
         //Adding the resized Component to our FlexPrintjob and then sending the print request
         printJob.addObject(printVBox,FlexPrintJobScaleType.MATCH_WIDTH);    
         printJob.send();
         //Resizing the component back to normal size
         dataGridId.height = originalDGHeight;
         dataGridId.verticalScrollPolicy = "auto";    
        catch(error:Error)
                     trace("Error : " + error.message);
    Thanks,
    Bhasker

  • Username gets truncated when saved from BW

    Hi all,
    We have a function module that is called from a BW report which is developed as a BSP application in the BW client; this FM saves some data (such as contract number, username, etc.) in a Z table created in R/3. The FM is called with respect to R/3 RFC destination. All the details passed to this FM (except the username) are saved correctly in the Z table; however username gets truncated to 8 characters.
    When the same FM is called from portal or even executed manually complete user name gets saved. All the variables / fields etc. are declared with the correct data elements.
    Can someone advise what the cause can be. Is this related to RFC calls.
    Cheers,
    KC
    SAP SD

    Are you passing the User Name to RFC? If so check the Import parameter of RFC. If its char8, it will truncate the data.
    Raja T

  • Notes getting truncated while importing excel to MS project

    Hi All
    I am importing an excel sheet to MS project 2010 through import map. There are some notes related to tasks that are longer than 255 words in length. When the project map is completed, all the fields are fine other than the notes field. The data in notes
    field gets truncated to 126 characters. Can someone help me out on this.
    Udyan

    To those who may be interested in this thread.
    The jury is still out on whether this truncation bug is also present in Project 2013/Excel 2013. Meanwhile I've developed a macro that will export a formatted Excel Workbook into Project. The macro is structured to run from Excel. The main purpose of the
    macro is to export the full notes text data, (i.e. no truncation even at 255 characters), from a specified column on the Excel Worksheet into the Notes field of Project. Other basic Project data including Task Name, Outline level, Duration, Start,  &
    Resource Names are also exported. An example of the formatted Excel Worksheet is shown below.
    If you are interested in this macro, let me know.
    John
    Example of formatted data for export. Note that multiple resource assignments per task are handled (not easily done with an import map alone). The macro detects the units used in the worksheet duration column (i.e. number only,  or number with "h",
    "d", or "w") such that the proper data is exported to Project (i.e. minutes). For reference the note text shown for Task b is the text string that is truncated at 126 characters when using a simple import map. That bug is resolved by the macro. The notes text
    for Task c is is 406 characters and all of them are exported by the macro (i.e. no truncation at 255 characters). The notes text for Task d has a line feed in the text string and that is exported by the macro.

  • CRM ICWEB "END CALL" tab getting truncated in IE8

    Hi,
    We have CRM 6.0 (2007) running on IE6 and planning to upgrade the browser to IE8. During testing, found that "EndCall" tab on Identification screen is getting truncated after clicking on it. Upon click the tab moves up into the header area and gets truncated. This problem is happens only on IE8 browser. Also we implemented all IE8 related SAP notes and they did not fix the issue.
    Any inputs appreciated.
    regards,
    Venky Bogam

    Hi,
    We seem to be experiencing a similar problem when we upgrade to IE8.
    In CIC0 we have an Overview tab with which we can view information from the SAP ISU system.
    The tab consists of 2 html frames, but the top frame now only shows the html code instead of the html page itself.
    When I copy and paste the html in a separete file to open it in IE8.
    IE8 shows the page the way CIC0 should which means there's nothing wrong with the HTML code.
    Our GUI 640 has been upgraded to 720 and we tried the compatibility mode and lower security settings in IE8.
    We also installed all the SAP notes related to the IE8 issues.
    But nothing seems to work.
    Regards,
    Mark Manders

Maybe you are looking for

  • No WIFI after iOS 5.0.1 over-the-air update on original iPad

    No WIFI after iOS 5.0.1 over-the-air update on original iPad. I have reset the network settings,  power off the iPad, trying static IP and nothing, it's unable to join my wifi network. anybody with the same issue?

  • CUP mitigation wokflow

    Hi Everyone, We have configured in RAR, the workflow to send request for approval of Mitigation Owner using CUP Workflow. For Mitigation Control Using RAR  work fine, but unfortunately when we mitigated the Risks through the CUP request,  the workflo

  • Using Hdmi out, no audio with some apps

    I have a few apps that do not send sound out the hdmi adapter, but they play out the iPad 2 speaker. Any thoughts?

  • Picture to clear fonts?

    Hello I have a jpeg/png with text. After OCR in Acrobat 9 Pro the fonts are pixly. How can I get clear fonts? Do you have an idea? Thanks in advance nebben1000

  • Open Hub and Info Spoke

    Hi all, We have a bunch of Info Spokes created in our production and we want to delete them based on last used date. Can anyone tell me in which table in BW are the Info Spokes stored Also like aggregates where we can find out last used is there any