Problem with encoding of xml document

while parsing an xml document with SAX parser, i found that encoding of the xml document received as input stream is "ISO-8859-1" . After parsing certain fields has to be stored in the mysql table where table character set is "utf8" . Now what i found that ceratin characters in the original XML document are stored as question mark (?) in the database.
1. I am using mysql 4.1.7 with system variable character_set_database as "utf8". So all my tables have charset as "utf8".
2. I am parsing some xml file as inputsream using SAX parser api (org.apache.xerces.parsers.SAXParser ) with encoding "iso-8859-1". After parsing certain fields have to be stored in mysql database.
3. Some XML files contain a "iso-8859-1" character with character code 146 which appears like apostrophes but actually it is : - � and the problem is that words like can�t are shown as can?t by database.
4. I notiicied that parsing is going on well and character code is 146 while parsing. But when i reterive it from the database using jdbc it shows character code as 63.
5. I am using jdbc to prepared statement to insert parsed xml in the database. It seems that while inserting some problem occurs what is this i don't know.
6. I tried to convert iso-8859-1 to utf-8 before storing into database, by using
utfString = new String(isoString.getBytes("ISO-8859-1"),"UTF-8");
But still when i retreive it from the databse it shows caharcter code as 63.
7. I also tried to retrieve it using , description = new String(rs.getBytes(1),"UTF-8");
But it also shows that description contains character with code 63 instead of 146 and it is also showing can�t as can?t
help me out where is the problem in parsing or while storing and retreiving from database. Sorry for any spelling mistakes if any.

duggal.ashish wrote:
3. Some XML files contain a "iso-8859-1" character with character code 146 which appears like apostrophes but actually it is : - ’ and the problem is that words like can’t are shown as can?t by database.http://en.wikipedia.org/wiki/ISO8859-1
Scroll down in that page and you'll see that the character code 146 -- which would be 92 in hexadecimal -- is in the "unused" area of ISO8859-1. I don't know where you got the idea that it represents some kind of apostrophe-like character but it doesn't.
Edit: Actually, I do know where you got that idea. You got it from Windows-1252:
http://en.wikipedia.org/wiki/Windows-1252
Not the same charset at all.

Similar Messages

  • Problems with reports and XML-publisher - No XML

    Hi!
    I'm having a problem with Apps and XML-publisher. I made a report file, which queries some views. When executing in reports, I get all the data I expect.
    Now, when I upload the reportfile to Apps and let it generate XML, my xml-file is empty (well, almost empty)
    <?xml version="1.0" ?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <T03501684>
    <LIST_G_PERSOON>
    <LIST_G_PERSOON />
    </T03501684>
    Anyone who can shed any light upon this problem?

    OK, finally solved the problem... A good night's sleep always helps ;).
    After just trying each queried table one after an other, I found the problem:
    The difference between Oracle Apps (Dutch locale) and the reports builder (English) is the language... And our functional people have changed some names, but the Dutch ones, leaving the english names in place and one of the tables I query has language specific data, which is also appears in a where clause.

  • Problem with viewing Adobe PDF documents

    Problem with viewing Adobe PDF documents
    I have a Windows 7 Home Premium Computer
    I have read all the suggestions and I have tried downloading multiple versions of Adobe Reader for Windows 7 and Vista from http://get.adobe.com/reader/otherversions/.
    Prior to downloading each version I would delete the current version using  control panel programs uninstall.
    After each new installation I would shut down the computer and then restart the computer.
    I have tried downloading versions with and without having my antivirus (CA Total Defence) running.
    I am told after download that the version downloaded successfully.
    I have read Acrobat Help http://helpx.adobe.com/acrobat/kb/troubleshoot-reader-installation-windows.html and followed the instructions.
    None of the above has helped.
    The problem is no matter what version of Adobe Reader I download, I cannot seem to open a PDF and read it. Nor will the Reader itself stay open.
    1. If I try opening the reader from the desktop link or from the actual program menu, the reader opens for about 5 seconds and then closes of its own accord. If I try to click on any of the reader menus (eg File, Edit, View, Window, Help, Tools) then a warning bell is sounded and the menu does not open. Shortly thereafter the reader closes.
    2. If I try to open the reader by double clicking on a PDF document then the reader opens but the document is not shown (only the grey PDF reader screen is shown) and then the reader closes after about 5 seconds of its own accord.
    The desktop shortcut shows as the 'red Adobe Reader icon'. But the actual program menu icon shows as a blank folder icon.  All PDF documents show as the PDF Adobe icon.
    I have tested various PDFs and none will open on this computer but they will open on other computers.
    I have created a word document and saved it as a PDF. It looked like it had save correctly (has the appropriate icon) but when I try to open it as per step 2 above then the document is not shown and then the reader closes after about 5 seconds of its own accord.
    Does anyone have any ideas about what is going on and how I can fix this?
    Could you please answer in this forum and email me at [removed]
    I am so puzzled and frustrated.

    Thank you so much this did the trick.
    I spent so many hours on trying to sort this out and your answer was so  simple and clear.
    Regards
    Kazzamday

  • Authorization problem with VF01 "Create Billing Documents"

    Dear All,
    We face following problem with VF01 "Create Billing Documents".
    Transaction: VF01
    User: Joe
    Authorization of Joe:
         VKORG Sales Organization: A, B (authorization object V_VBRK_VKO)
         FKART Billing Type: 1, 2 (authorization object V_VBRK_FKA)
    The objective for Joe:
       Joe is qualified to create bills in
          sales org A only for billing type 1 and in
          sales org B only for billing type 2.
       Joe should not be able to create bills for
          sales org A with billing type 2 and in
          sales org B with billing type 1.
    How can we solve this problem?
    We already searched for userexits without any success.
    Any help or ideas are very appreciated.
    Regards
    Markus Wilhelm
    Project Manager ERP

    Dear,
    There are standard authority-checks based on Sales organization (authorisation object V_VBRK_VKO) and/or Billing type (V_VBRK_FKA).
    An option would be to create a new billing type, define specific authorisations and use the new billing type for these documents.
    The bad thing is that you would also need a special (new) sales order type, because the billing document type is unique per sales order.
    So maybe it is easier to have a different sales organization.
    Another option would be to create a new authorization object and check it in the billing documents.
    If you wish, you could modify program LV60A005 & LV60A006.
    Then you might check various user/customer exits.
    Some functions to check: EXIT_SAPLV60A_001/002,
    EXIT_SAPLV60B_001 - 008, EXIT_SAPLV60B_010 - 011.
    Regards,
    R.Brahmankar

  • Problem with multiple versions of documents being published with 001, 002, etc.

    I am using Contribute CS3. I am having a problem with multiple versions of documents being published on the sever with 001, 002, etc in the name. So that I end up with 2 or 3 versions of a document on the server. Does anyone know why / how Contribute  is doing this? Thanks for any help you can give.

    Your Web site administrator will need to update your key to allow you to delete files you are able to edit.

  • I'm having problems with the reproduction of documents in Adobe X due to low reproduction quality ¿c

    I'm having problems with the reproduction of documents in Adobe X due to low reproduction quality ¿can you help me

    Some things to try...
    Using Windows Explorer navigate to C:\Program Files (x86)\Adobe\Reader 11.0\Reader, then double-click on Eula.exe and accept the license agreement
    Can you open Adobe Reader by itself?  If so, try disabling Protected Mode [Edit | Preferences | Security (Enhanced)].
    If you cannot open Reader by itself, try to disable Protected Mode in the registry; download, unzip, then run the attached registry script
    It could even be a malware issue; see http://helpx.adobe.com/acrobat/kb/reader-core-dll-error.html

  • Problem with tabs in xml text

    I have a problem with my XML setup here
    i use Tab key to aligh up info in the xml text for aligned
    display in the program
    hoever i tested on several computers and get different
    resolts.
    how can i fix this.
    Please view the linked Image
    http://img129.imageshack.us/img129/8394/flashtextproblemti4.jpg
    this is what happenes even thow all run xp and all run same
    latest flash version.
    Anyone got an ideer how i can solve this.
    BTW the font is verdana.
    This is my actionscript ....
    // Function to parse an address
    f_parseAddress = function () {
    // Set the text
    _root.stageholder.textfield.htmlText =
    this.firstChild.firstChild.firstChild.nodeValue;
    // Create the XML object
    XML_address = new XML();
    // Set up the XML object
    XML_address.ignoreWhite = true;
    // Add the handlers
    XML_address.onLoad = f_parseAddress;
    // Load the XML file
    XML_address.load("./Data/xml/kontakt.xml");
    This is my XML file
    <?xml version="1.0" encoding="iso-8859-1"?>
    <text>
    <address>
    <![CDATA[
    <font size="20">Company name</font>
    Company name
    address
    address
    Dir. tlf. + xx xx xx xx xx
    + xx xx xx xx xx
    Mobil + xx xx xx xx xx
    + xx xx xx xx xx
    web: <a href="
    http://www.xxxxxxxxxxxxx.xx"><b>www.xxxxxxxxxxxxx.xx</b></a>
    E-mail: <a
    href="mailto:[email protected]"><b>[email protected]</b></a>
    ]]>
    </address>
    </text>
    If anyone got a solution on how i can get my text to allign
    corect
    i would like to hear about it
    Best reguards
    Mis

    alrighty then try this xml structure.
    Note: formatting information like b, or linkage tags should
    not be part of the xml.
    The XML format is a universal format for data, if you fill it
    with style information this is not good practive (in general, there
    are of course scenarios where it makes sense, also since (x)html IS
    also XML).
    In your case you want to put the information about multiple
    companies in a xml file, but you let the flash decide how to
    display format this information.
    so if you use the sugested XMl structure you will have full
    control of the layout within flash, because you can grab every
    piece of information from the xml and place it jsut where you want
    in flash and format it within flash.
    Of course this process is more coding work than your previous
    attempt, but it pays of when you have a lot of data to process and
    when you want to have full control of the final layout.
    But maybe its overkill for your application (I don't know how
    many companies will be stored in your xml and how complex the rest
    of the app is).

  • Problem with '&' character in xml

    Hello!
    i work with XI3.0 sp19
    i have a interface ftp ->XI-> idoc.
    ftp adapter send a xml file.
    I solve all problems with special characters using encoding="ISO-8859-9", but i have problem when in my message there are a '&' character.
    any idea?????

    This has been discussed lately:
    Ampersand ('&')  in  XML - Mapping error
    Regards
    Stefan

  • [CS3 - JS - Mac] Problem with encoding

    Hi,
    I made a script that perform a lot of actions on ID.
    Everytime this script performs an action it writes a line on a global variable and at the end of the script write this var into a text file ( in the Document folder).
    Yes, it's a log file...
    While I was testing this script through the Toolkit everything went right.
    Then I added a menu action inside the script to call the script from the application and something strange happened, in the log file (wich is a text file UTF8 encoding) and also in the alerts ID shows. Both display text from this:
    "È necessario effettuare una selezione" (running the script from the toolkit)
    to this:
    "È necessario effettuare una selezione" (running the script from ID menu)
    So I think it's an encoding problem...
    I just added this code:
    #targetengine "Lele";
    var Lele_menu = app.menus.item("Main").submenus.add("Lele");
    //     Menu
    var main_action = app.scriptMenuActions.add("Update");
    var main_event_listener = main_action.eventListeners.add("onInvoke", function(){main();});
    var main_menu = Lele_menu.menuItems.add(main_action);
    //     Functions
    What's the point?
    Hope you understood.
    Thanks!
    Lele

    I had problems with UTF encoding so I use this function to write the log file:
    var log_file = new File(file_path);
    log_file.encoding = "UTF8";
    log_file.lineFeed = "unix";
    log_file.open("w");
    log_file.write("\uFEFF" + text_var);
    log_file.close();
    Where text_var is the log string.
    When it's written form the ESTK everything is right, when called from the menu it isn't.
    It's strange that it also involves alert text innit?

  • Problem with CALL TRANSFORMATION xml - abap

    Hello!
    I got the following problems using call transformation to read a xml-file to local abap datatype!
    Simple xml file for testing:
    <BMECAT>
    <HEADER>
    asdf
    </HEADER>
    </BMECAT>
    XSLT file:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
      <xsl:template match="/">
        <xsl:value-of select="./BMECAT/HEADER"/>
      </xsl:template>
    </xsl:transform>
    The xslt transformation works with xslt-tester!
    My Source:
    DATA: xmlupl TYPE string,
    outputx TYPE XSTRING,
    lv_string TYPE string.
    * in xmlupl my xml import is stored
    CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
    text = xmlupl " variable type string
    IMPORTING
    buffer = outputx. " variable type xstring
    TRY .
         CALL TRANSFORMATION path_to_xslt_file
           SOURCE XML outputx
         RESULT HEADER = lv_string.
    CATCH cx_xslt_exception INTO xslt_error.
         data: xslt_message type string .
         xslt_message = xslt_error->get_text( ).
    ENDTRY.
    After debugging in xslt_message is stored the following text:
    "The element abap was expected for the XML-ABAP transformation"
    Can anyone help me with this problem?
    Regards,
    Daniel

    hi
    good
    try this code
    Just look at this piece of code, I think it should help you.
      DATA : ITAB   TYPE TABLE OF SPFLI,
             L_XML  TYPE REF TO CL_XML_DOCUMENT.
      SELECT * FROM SPFLI INTO TABLE ITAB.
    CREATE THE XML OBJECT
      CREATE OBJECT L_XML.
    CONVERT THE DATA TO XML
      CALL METHOD L_XML->CREATE_WITH_DATA( DATAOBJECT = ITAB[] ).
    DATA IS CONVERTED TO XML; DISPLAY THE XML-DOCUMENT
      CALL METHOD L_XML->DISPLAY.
    thanks
    mrutyun^

  • Issue with parsing an xml document and namespaces

    I am having an issue when parsing an xml document that includes a namespace.
    Here is my xml:
    <?xml version="1.0" encoding="utf-8"?>
    <StatusFile xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" TxCnt="247" TxTotal="5756845.31" SourceId="3" xmlns="http://www.test.com/cig/payments/optimizer/status/2004/10/">
    <Tx PmtId="350031" Amt="16739" TxSts="09" CustSts="04" ChkNum="10605770" />
    <Tx PmtId="350990" Amt="31698.66" TxSts="09" CustSts="04" ChkNum="10605821" />
    <Tx PmtId="354992" Amt="201320.08" TxSts="09" CustSts="04" />
    <Tx PmtId="349277" Amt="6675.17" TxSts="09" CustSts="04" ChkNum="10605822" />
    <Tx PmtId="354979" Amt="66949.75" TxSts="09" CustSts="04" ChkNum="10605823" />
    <Tx PmtId="349341" Amt="63258.49" TxSts="09" CustSts="04" ChkNum="10605824" />
    <Tx PmtId="350025" Amt="5866.04" TxSts="09" CustSts="04" ChkNum="10605830" />
    <Tx PmtId="350024" Amt="15671.8" TxSts="09" CustSts="04" ChkNum="10605831" />
    <Tx PmtId="346822" Amt="9880.64" TxSts="09" CustSts="04" />
    <Tx PmtId="350023" Amt="1360" TxSts="09" CustSts="04" />
    <Tx PmtId="349802" Amt="131267" TxSts="09" CustSts="04" ChkNum="10605832" />
    <Tx PmtId="343573" Amt="14532.76" TxSts="09" CustSts="04" ChkNum="10605833" />
    <Tx PmtId="352675" Amt="4436" TxSts="09" CustSts="04" />
    <Tx PmtId="350022" Amt="1260" TxSts="09" CustSts="04" ChkNum="10605834" />
    <Tx PmtId="349714" Amt="80778" TxSts="09" CustSts="04" ChkNum="10605835" />
    <Tx PmtId="352676" Amt="10136" TxSts="09" CustSts="04" ChkNum="10605836" />
    <Tx PmtId="352679" Amt="25511.69" TxSts="09" CustSts="04" ChkNum="10605837" />
    <Tx PmtId="346502" Amt="12842.69" TxSts="10" CustSts="05" />
    <Tx PmtId="346503" Amt="4232.61" TxSts="09" CustSts="04" ChkNum="10605838" />
    </StatusFile>
    Here is my current code base:
    CREATE OR REPLACE PROCEDURE ParseXML(xml VARCHAR2) IS
    myParser xmlparser.parser := xmlparser.newparser;
    myDoc xmldom.DOMNode;
    myNodes xmldom.DOMNodeList;
    myElement xmldom.DOMElement;
    trec NDE_CIG_STATUS_TRANSACTIONS%ROWTYPE;
    BEGIN
    xmlparser.parseBuffer(myParser,xml);
    myDoc := xmldom.makeNode(xmlparser.getDocument(myParser));
    myNodes := xslprocessor.selectNodes(myDoc,'//Tx');
    FOR i IN 0..xmldom.getLength(myNodes)-1 LOOP
    myElement := xmldom.makeElement(xmldom.item(buyOrders,i));
    trec.pmt_id := xmldom.getAttribute(curBuy,'PmtId');
    INSERT INTO NDE_CIG_STATUS_TRANSACTIONS(PMT_ID) VALUES (trec.pmt_id);
    END LOOP;
    COMMIT;
    END ParseXML;
    If I remove the namespace, everything works just fine. The issue is that I cannot remove the namespace.
    Anyone have any suggestions on how I can get the xslprocessor.selectNodes to recognize my namespace?
    Thanks,
    Mark Moran

    Everyone,
    Well after lots of hours spent reading web pages and blogs, etc... I was able to re-write my procedure and get it to work with different calls.
    Here is my updated code.
    PROCEDURE PARSE_STATUS_XML(P_FILE_NAME IN VARCHAR2, P_XML_FILE IN CLOB) IS
    V_PARSER XMLPARSER.PARSER := XMLPARSER.NEWPARSER;
    V_DOCUMENT XMLDOM.DOMDOCUMENT;
    V_NODES XMLDOM.DOMNODELIST;
    V_ELEMENT XMLDOM.DOMELEMENT;
    V_TBL_RECORD NDE_CIG_STATUS_TRANSACTIONS%ROWTYPE;
    BEGIN
    XMLPARSER.PARSECLOB(V_PARSER, P_XML_FILE);
    V_DOCUMENT := XMLPARSER.GETDOCUMENT(V_PARSER);
    V_ELEMENT := XMLDOM.GETDOCUMENTELEMENT(V_DOCUMENT);
    V_NODES := XMLDOM.GETELEMENTSBYTAGNAME(V_ELEMENT,'Tx','http://www.test.com/cig/payments/optimizer/status/2004/10/');
    FOR I IN 0..XMLDOM.GETLENGTH(V_NODES)-1 LOOP
    V_ELEMENT := XMLDOM.MAKEELEMENT(XMLDOM.ITEM(V_NODES,I));
    V_TBL_RECORD.PMT_ID := XMLDOM.GETATTRIBUTE(V_ELEMENT,'PmtId');
    V_TBL_RECORD.PMT_AMT := XMLDOM.GETATTRIBUTE(V_ELEMENT,'Amt');
    V_TBL_RECORD.E_STATUS_CODE := XMLDOM.GETATTRIBUTE(V_ELEMENT,'TxSts');
    V_TBL_RECORD.E_REASON_CODE := XMLDOM.GETATTRIBUTE(V_ELEMENT,'StsRsn');
    V_TBL_RECORD.E_CUSTOMER_STATUS_CODE := XMLDOM.GETATTRIBUTE(V_ELEMENT,'CustSts');
    V_TBL_RECORD.UPS_TRACKING_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'UpsTrcNum');
    V_TBL_RECORD.FED_REFERENCE_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'FedRefNum');
    V_TBL_RECORD.FIDB_TRACKING_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'FIDbtTrcNum');
    V_TBL_RECORD.CHECK_NBR := XMLDOM.GETATTRIBUTE(V_ELEMENT,'ChkNum');
    INSERT INTO NDE_CIG_STATUS_TRANSACTIONS(
    CREATE_DATE,
    XML_FILE_NAME,     
    PMT_ID,
    PMT_AMT,
    E_STATUS_CODE,
    E_REASON_CODE,
    E_CUSTOMER_STATUS_CODE,
    UPS_TRACKING_NBR,
    FED_REFERENCE_NBR,
    FIDB_TRACKING_NBR,
    CHECK_NBR
         VALUES (
    SYSDATE,
    P_FILE_NAME,
    V_TBL_RECORD.PMT_ID,
    V_TBL_RECORD.PMT_AMT,
    V_TBL_RECORD.E_STATUS_CODE,
    V_TBL_RECORD.E_REASON_CODE,
    V_TBL_RECORD.E_CUSTOMER_STATUS_CODE,
    V_TBL_RECORD.UPS_TRACKING_NBR,
    V_TBL_RECORD.FED_REFERENCE_NBR,
    V_TBL_RECORD.FIDB_TRACKING_NBR,
    V_TBL_RECORD.CHECK_NBR
    END LOOP;
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
         RAISE;
    END PARSE_STATUS_XML;
    Mark

  • Problem exporting mixdown audio XML document from Soundtrack to Final Cut P

    I am writing this up at the suggestion of FCP Tech Support.
    I treated a multiclip audio track I had sent (along with the video) from FCP using the Compressor (Effects Tab>Dynamics>Compressor). I then sent the mixdown back to FCP automatically (following the instructions on page 209, Vol III, FCP User Manual.pdf). In FCP I got an error message: “ERROR: Critical Error aborted the processing an XML document…”
    I noticed, however, that the sequence with the mixdown audio was listed in the Browser. Opening it in the Time Line, the mixdown audio was there along with the muted original audio tracks; however, the video track appeared with all of its cuts, but white and unrendered. So I copied the video from the original sequence and pasted it in the new sequence, in effect replacing the problematic video track. It played back fine. I saved and closed the project, quit FCP and shut down my computer.
    When I reopened the project later on, I got a General Error 34 message. I called TS to find out what it means. After creating a new project and reopening it and another current project, neither of which displayed a General Error 34, the problem seemed to be unique to that particular project.
    FYI that project was a multiclip one with 4 camera angles. The audio from one of the camera angles was used through out, except for one clip when the audio of another angle was temporarily used. The project was shot on Mini-DV using 2 Panasonic HVX-200’s and two consumer DV camcorders.

    Thank you for anyone who read my question. I found the results on another posting. The posting was titled, "Export results in silent audio file."
    Thank you,
    Brian

  • Problem with images in XML with excel output

    Hello:
    I made an XML concurrent program, with excel output, but i am having a problem:
    The rtf template has a logo (bmp image), but it is not showing in the excel (if i execute the concurrent in the oracle applications). However, if i create the xml in Oracle Reports in my computer, and then load that xml in the rdf template in word, i can see the logo in the excel preview. I don't know why is it not showing when i execute the program in applications.
    If someone can help me with this, i will be very grateful.
    Greetings
    Message was edited by:
    user632438

    xml cP, will not give you a image in excel output,..
    In RDF there is a placeholder for image, and the image is located in certain location, at runtime it picks and render the output with logo.
    but xml CP, will get the data in xml type and merge with rtf to get the output you wanted..
    if you have the rtf with logo embedded in it, if output is of pdf or rtf output , then it will display the logo ,.
    in excel currently it is not possible to show the logo,..
    excel you see could be xml-excel or csv-excel not the true binary excel.
    to get the logo embedded ,for that you have to wait on tim for the excel template, which will be release in near future i guess..

  • Problem with digital signature of documents

    I have a requirement to upload documents and his respected fingerprint signed (SHA1WithRSA).
    To achive this I am using the functions modules:
    SSF_KRN_DIGEST
    SSF_KRN_SIGN_BY_AS
    but I can´t make it work.
    I also ask for the .pem file used to generate the PSE that I'm using to sign documents.
    With this pem file I execute in openSSL this following command:
    #Creates Message Digest of document.txt, and the sign it with MyKey.pem
    dgst -sha1 -sign MyKey.pem -out document.sign document.txt
    AND THIS WORKS! Now, with this succesfull case I try to track down the problem with the FM that I'm using, and I detected that SSF_KRN_DIGEST is given me a diferent result than openssl (so I forget for sign the document for a while...).
    This are the HEX value for OpenSSL (this is the one that works):
    30
    21
    30
    09
    06
    05
    2B
    0E
    03
    02
    1A
    05
    00
    04
    14
    AC
    37
    25
    AC
    AD
    34
    E2
    F8
    B9
    21
    B3
    15
    DD
    20
    0D
    71
    5B
    FD
    EE
    EB
    And this is the HEX value of the result of FM SSF_KRN_DIGEST:
    30
    40
    06
    09
    2A
    86
    48
    86
    F7
    0D
    01
    07
    05
    A0
    33
    30
    31
    02
    01
    00
    30
    09
    06
    05
    2B
    0E
    03
    02
    1A
    05
    00
    30
    0B
    06
    09
    2A
    86
    48
    86
    F7
    0D
    01
    07
    01
    04
    14
    AC
    37
    25
    AC
    AD
    34
    E2
    F8
    B9
    21
    B3
    15
    DD
    20
    0D
    71
    5B
    FD
    EE
    EB
    As you can see, both files do countain the digest, but the metadata and padding is different. As far as I know, it should respect the ASN.1 structure, but I can figure out whats wrong with the SSF_KRN_DIGEST call.
    This is my code:
    * Creamos el message diggest del archivo
    CALL FUNCTION 'SSF_KRN_DIGEST'
       EXPORTING
         b_detached                         = 'X'
         ostr_input_data_l                  = lv_bin_data_len
         str_hashalg                        = 'SHA1'
      IMPORTING
        ostr_digested_data_l               = lv_digested_len
    *   CRC                                =
       TABLES
         ostr_input_data                    = lt_bin_data
         ostr_digested_data                 = lt_digested_data
      EXCEPTIONS
        ssf_krn_error                      = 1
        ssf_krn_noop                       = 2
        ssf_krn_nomemory                   = 3
        ssf_krn_opinv                      = 4
        ssf_krn_nossflib                   = 5
        ssf_krn_input_data_error           = 6
        ssf_krn_invalid_par                = 7
        ssf_krn_invalid_parlen             = 8
        ssf_fb_input_parameter_error       = 9
        OTHERS                             = 10.
    Where lt_bin_data contains the document, uploaded in binary mode.
    Thanks in advance.
    regards.

    Martin, as you said, the problem was the PKCS#7 format.
    In a communication problem, I was told that the application works with that format, whereas in reality is working with PKCS#1 - V1.5
    I just have to search for a FM that support that format, like SSFW_KRN_SIGN.
    This FM calculates the MD, and sign it, so it was easier than I originally thought.
    This is the FM call that I'm using, just in case someone needs the code:
    * Leemos los parametros definidos en la SSFA
    CALL FUNCTION 'SSF_GET_PARAMETER'
       EXPORTING
         application             = 'INTBAN'
       IMPORTING
         str_profileid           = lv_profileid
         str_profile             = lv_str_profile
       EXCEPTIONS
         ssf_parameter_not_found = 1
         OTHERS                  = 2.
    *Cargamos la tabla con el encargado de firmar
    lw_signer-id = lv_profileid.
    lw_signer-profile = lv_str_profile.
    INSERT lw_signer INTO TABLE lt_signer.
    *Calculamos MD del documento (SHA1), y firmamos
    CALL FUNCTION 'SSFW_KRN_SIGN'
       EXPORTING
         str_format                   = 'PKCS1-V1.5'
         str_hashalg                  = 'SHA1'
         ostr_input_data              = lv_xstring_data_to_sign
       IMPORTING
         ostr_signed_data             = lv_xstring_signed_data
       TABLES
         signer                       = lt_signer
       EXCEPTIONS
         ssf_krn_error                = 1
         ssf_krn_noop                 = 2
         ssf_krn_nomemory             = 3
         ssf_krn_opinv                = 4
         ssf_krn_nossflib             = 5
         ssf_krn_signer_list_error    = 6
         ssf_krn_input_data_error     = 7
         ssf_krn_invalid_par          = 8
         ssf_krn_invalid_parlen       = 9
         ssf_fb_input_parameter_error = 10
         OTHERS                       = 11.
    Where lv_xstring_data_to_sign is just a xstring with the document that I have to sign.
    Regards!
    German Guzelj

  • Problem with MICN(Physicall Inventory Document)

    Dear gurus,
    I Had a problem with MICN, when i proses it, it shows
    No session was created
    Message no. M7836
    How to solve it.
    Thx

    MICN - is used to generate physical inventory documents for all the materials having cyclic counting indicator.
    - Have you already maintained your cyclic counting profile in SPRO - OMCO
    - Have you assigned the cyclic counting indicator in material master. you can assign the indicatory manually in material master or automatically assign with MIBC if you are dealing with ABC materials.
    Note : MICN is used to generate the physical inventory documents, after you have the phy inv document, you have to follow the normal process of Mi04 and MI07 to post the differences

Maybe you are looking for