Consulting

Results 1 to 11 of 11

Thread: How to insert Japanese character to SAP from Excel?

  1. #1
    VBAX Regular
    Joined
    Feb 2013
    Location
    Bangalore
    Posts
    6
    Location

    How to insert Japanese character to SAP from Excel?

    Hi All,
    Help needed in an issue in Excel VBA.

    I can see the Japanese text in the excel cells. Exporting this data to SAP by using VBA code. It does the insert in the ECC, but Japanese characters are represented as "????"
    The Japanese string - れは、のテストです excel シート アップロード テンプレート

    the above string is displaying as - ???SES ?????? excel ??? ?????? ??????

    I am using the below code cv=Sheet1.Range("A1").Value
    i tried by using cv = StrConv(Sheet1.Range("A1").Value, vbUnicode)

    Any help would be appreciated.

  2. #2
    Can you please show us more of your code? Even better, can you upload a workbook with the relevant code and (a small portion of) some data?
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  3. #3
    VBAX Regular
    Joined
    Feb 2013
    Location
    Bangalore
    Posts
    6
    Location
    Thank you Jan for your prompt reply.
    Here is my part of the code

    headTextStr.Rows.Add ' Adding row in SAP internal table
    headTextStr.Value(inCnt, "PCKG_NO") = "0000000002"
    strtempLine_No = tmpEntryCount
    headTextStr.Value(inCnt, "LINE_NO") = tmpZeroStr & tmpEntryCount
    headTextStr.Value(inCnt, "TEXT_ID") = "LTXT"
    headTextStr.Value(inCnt, "TEXT_LINE") = Sheet1.Range("L" & rwNum).Value ' Here i am getting the ???? marks
    ' Actual value will be れは、のテストです excel シート アップロード テンプレート
    Please help to get it done.

  4. #4
    What kind of object is headTextStr?

    I expect you'll have to make sure the VBA code works with double-byte unicode characters and use the proper functions for that.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  5. #5
    VBAX Regular
    Joined
    Feb 2013
    Location
    Bangalore
    Posts
    6
    Location
    Public headTextStr As Object

    With the below function i am able to give a message box with the Japanese language
    CreateObject("Wscript.shell").popup Range("F3")

    But i am not able to assign the same value to an variable.

    I am not aware which double-byte code to use.
    can u please help with the sample code.

  6. #6
    Hmm. Showing me a declaration "As Object" is useless.
    Now I still don't know what type it is.
    (apologies for sounding annoyed).
    Show all of the code or even better, attach your file.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  7. #7
    VBAX Regular
    Joined
    Feb 2013
    Location
    Bangalore
    Posts
    6
    Location
    Hi Jan
    attached the excel file.
    Column "G" having the Japanese text while updating it is showing ???? in VBA and as well in SAP.

    @ at Code Line 90
    Thanks for your help..
    Attached Files Attached Files

  8. #8
    The problem lies with the SAP function library you are using I expect, because I can insert a userform and load the content of cell G2 into a textbox and have it properly display the japanese characters without doing anything special:
    TextBox1.Value = ActiveCell.Value

    suffices.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

  9. #9
    VBAX Regular
    Joined
    Feb 2013
    Location
    Bangalore
    Posts
    6
    Location
    In VBA editor also i am not able to see the exact characters.
    it is also displaying ??????

  10. #10
    VBAX Regular
    Joined
    Feb 2013
    Location
    Bangalore
    Posts
    6
    Location
    [IMG]http://www.vbaexpress.com/forum/C:%5CUsers%5Crafi%5CDesktop%5CNew%20Folder%5****itled.jpg[/IMG]
    the values displaying like above.
    Is there any chance to see the actual values.
    Last edited by rafeemd; 02-13-2013 at 11:06 AM.

  11. #11
    Not by using a messagebox or similar, but the japanese characters ARE properly picked up, as demo'd in this simple routine:

    Sub foo()
        Dim s As String
        s = ActiveCell.Value
        ActiveCell.Offset(, 3).Value = s
    End Sub
    Select a cell with japanese characters (and make sure a cell three columns to the right is empty). Then run the code.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •