Convertion To type x  to char field in unicode system......

Hi all
please refer the following code .i need to assign type xstructure to single char field where data are .........
SRTFDHIGH =  xsrtfdhigh
unicode system gives error to convertion
DATA: BEGIN OF xsrtfdhigh,
          pernr LIKE pc2b0-pernr,
          restkey1(16) TYPE x VALUE 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF',
          restkey2(16) TYPE x VALUE 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF',
        END OF xsrtfdhigh.
   DATA: SRTFDHIGH LIKE PCL2-SRTFD VALUE                   
         '9999999999999999999999999999999999999999'.
PCL2-SRTFD type char 40.
pc2b0-pernr  type numc 8.
is there any solution to convert this .....
Edited by: Vikram  shirole on Feb 23, 2008 8:52 AM
Edited by: Vikram  shirole on Feb 23, 2008 8:54 AM

Read first some documentation like [Character String Processing|http://help.sap.com/saphelp_nw2004s/helpdata/en/79/c554d9b3dc11d5993800508b6b8b11/frameset.htm], usually hexadecimal fields contain control characters (line feed, carriage return, tabulations and the like), so use constants of class [CL_ABAP_CHAR_UTILITIES|http://help.sap.com/abapdocu_70/en/ABENCL_ABAP_CHAR_UTILITIES.htm].
Regards,
Raymond

Similar Messages

  • Need to assign a multi datatype struct to a single field in Unicode system

    Hi all,
    I had posted an earlier question related to this to understand what the issue is. Few responses helped. Then now I have gone thru the conversion rules in Unicode systems related to assigning a structure (with different data types) to a single field and looking for a solution for my case. The current code written in 4.6 says
    l_bapiparex-valuepart1 = l_bape_vbap
    where
    l_bape_vbap is a structure of type bape_vbap and
    l_bapiparex of type bapiparex.
    So according to the rules, when I do this kind of an assignment in ECC , the first field's length (i.e. VBELN) must be min 240 characters long. Only then this assignment will be error free, am I right ?
    Or Is this an inadmissable assignment situation ?
    If not then is there any other way how I can achieve the same result by fixing this issue ? I am not able to think of any !! Has any one come across this kind of an issue during upgrade? Please do suggest.
    Just for your reference I have pasted the rule details from SAP help..
    Conversion in Unicode Programs
    The following rules apply in Unicode programs when converting a flat structure to a single field and vice versa:
    If a structure is purely character-like, it is processed during conversion like a data object of the type c (Casting). The single field can have any elementary data type.
    If the structure is not purely character-like, the single field must have the type c and the structure must begin with a character-like fragment that is at least as long as the single field. The assignment takes place only between this fragment and the single field. The character-like fragment of the structure is treated like a data object of the type c (Casting) in the assignment. If the structure is the target field, the remaining character-like fragments are filled with blanks and all other components with the initial value that corresponds to their type.
    No conversion rule is defined for any other cases, so that assignment is not possible.
    Note
    If a syntax error occurs due to an inadmissible assignment between flat structures and single fields, you can display the fragment view of the corresponding structure when displaying the syntax error in the ABAP Editor by choosing the pushbutton with the information icon.
    thanks

    Try this way
          call method cl_abap_container_utilities=>fill_container_c
            exporting
              im_value               = l_bape_vbap
            importing
              ex_container           = l_bapiparex-valuepart1
            exceptions
              illegal_parameter_type = 1
              others                 = 2.

  • To assign data type input into a field on the system form

    Hi all,
       I made one company with local setting is Australia/New Zealand, and one with US of America. With first Comp, when I create BP, "Federal Tax ID" field can't input numeric first,first charater have to be letter(VN...). But with second comp., i can.
       Anybody tell me why and where to set that option. Thanks a lot !

    Hi All,
    In South Africa we had the same problem where we had to specify ZAR in front of every business partner's federal tax id. This was aparantly a bug which was solved in Patch level 03.
    Hope it helps,
    Adele

  • Converting DECIMAL field in R/3 into CHAR field on BW

    Hi all,
       We have a field in R/3 which is defined as :
          Data Type : Decimal
          Length      : 6
          Decimal Places : 2
         I want to receive it into CHAR field on BW side.
         How could I convert it, please. What should be length of this CHAR field in BW?
    Thanks in advance.

    Hi Venkat,
    Create a character infoobject of length 18. Include the infoobject in your data target and map the key figure value to the character infoobject by writting the following update routine for the character infoobject.
    Result = comm_structure-xxxxxx (xxxxxx = key figure infoobject you want to map for example say comm_structure-net_price if key figure is 0net_price)
    Please assign points if it helps,
    Neelima
    Message was edited by:
            Neelima Ravipati

  • Field UMSA1 cannot be converted in type CURR - long Text

    Hi All,
    I am getting the following error
    Error records written to application log
    Error in an arithmetic operation in record 489
    Record 489:Contents 四川省长江滥曝扇备总 from field UMSA1 cannot
    Record 489 :Contents 四川省长江滥曝扇备总 from field UMSA1 cannot be converted in type CURR ->lo
    This happened for the customized master data Z********(customer number). Data source; 0CUSTOMER_ATTR
    I have undertaken the following actions but all failed.
    1. Replicated the data source, activated the transfer structure through a program and the load was run but the load failed with the same issue.
    2. Pushed the data till PSA and tried to edit it in the PSA, but here too the load failed with the same issue.
    It is understood that the data source 0CUSTOMER_ATTR is obtained from the Funtion Module: MDEX_CUSTOMER_MD
    Out of 5 data packages, I could find only 3 data packages in PSA which are successful, the remaining had error and could not be found in PSA. Checked in R/3 but could not catch the correct record, since, did not had proper info. UMSA1 refers to Annual Sales, which are empty in R/3 and BW as well.
    The UMSA1 field in data source 0CUSTOMER_ATTR in BW.
    Data Type: CURR, Length: 15, Decimal: 2, curr/unit: UWAER
    The UMSA1 field in R/3
    Data Type: CURR, Length: 15, Decimal: 2
    Request your timely suggestions.
    Raj

    Dear Veerandra,
    I have already checked in R/3 as you had mentioned. But as I said earlier, could not catch the correct record, since, did not had proper info. UMSA1 refers to Annual Sales, which are empty in R/3 and BW as well.
    I have undertaken the following actions but all failed.
    1. Replicated the data source, activated the transfer structure through a program and the load was run but the load failed with the same issue.
    2. Pushed the data till PSA and tried to edit it in the PSA, but here too the load failed with the same issue.
    It is understood that the data source 0CUSTOMER_ATTR is obtained from the Funtion Module: MDEX_CUSTOMER_MD
    3. Error Handling option.
    Regards.
    Raj

  • Converting from NUMC field in R/3 into  CHAR field on BW

    Hi all,
       We have a field (COST) which is defined as NUMC 6 with DECIMAL 2 like12.50 in R/3. I want to receive it into CHAR field on BW side.
      What is the simplest way to convert it, please. What should be the CHAR length in BW?
    Thanks in advance.
    Regards.

    Hi Venkat,
    I don't have any sample code for this. You will create one local variable in the trasnfer routine. Accept the NUMC value in that local variable and then assign that local variable to the final destination i.e. to CHAR InfoObject.
    PB

  • Convert quantity field to char field

    Hi folks ,
    i have a requirement where i need to convert quantity field value to char field value so as to send in idoc.
    plz help me .its urgent
    regards,
    chandra

    data: f1(17).
    f1 = qauntity_field.
    lenth of the field f1 is the same or gr8 than quan_field also add one more place for decimal .
    ex-
    ur quan_filed like 13 and 3 decimal place than ur char field must be
    13 + 3 + 1(for decimal) = 17

  • Can't format a char field as a date

    I have a char field coming in from a table that really is a date. I wanted to display the YYYYMMDD char field as MM/DD/YYYY.
    I could not get any conversion (CDate) to work and I can't figure out how to set field[0,4]  = year and so on, so I could come back and build the string.
    Can somebody help me?

    I have a field that should be a DATE type, but is instead a VARCHAR2(8).  The data in the VARCHAR2(8) field is displayed as what looks like a date -- EX:  09/18/09.  I need to be able to convert the VARCHAR2(8) field so that it brings back the spelled out month plus the numeric day and year -- EX: September 18, 2009.
    I've been able to successfully convert a DATE type to the needed format (September 18, 2009) using the following syntax line, but now need to convert the VARCHAR2(8):
              to_char(jud_report_hear_off_v.incdate,'fmMonth dd, yyyy,') as INCDATE
    Your help is appreciated!!!

  • Joining RAW field with CHAR field

    Hi fellows,
    I need to join two tables within one view. In table 1 there is a ID of RAW/16. The same value but in different type (char/70) is placed in table 2. How can I manage a join on that IDs with these tables? I tried to convert the types by using FM SCMS_TEXT_TO_BINARY. Unfortunatly this converts not only the type but also the value which has to be the exactly same after "type conversion".
    Any ideas?
    Many thanks in advance!
    Cheers
    Tobias

    Since the referring ID has to be the key field I am not able to use another one. Furthermore I cannot change the type of the RAW16 field as it is a SAP standard table.
    With which type do I fill RAW fields through Open SQL statements? Char / String doesn't work.
    Cheers
    Tobias

  • HOW TO TRANSFER DATA FROM CHAR TYPE TO NON CHAR TYPE

    HI EXPORTS,
             THIS IS SASIDHAR, I HAD UPLOADED DATA FROM FLAT FILE INTO DYNAMICAL INTERNAL TABLE NAME <T_UPLOAD>. THIS INTERNAL TABLE FIELDS ARE CONVERTED INTO CHAR TYPE FIELDS. NOW I HAVE TO TRANSFER THIS DATA INTO ANOTHER INTERNAL TABLE  <DYN_TABLE> WHICH CONTAINS BOTH CHARACTER AND NON CHARACTER FIELDS. PLEASE ANY ONE GUIDE ME REGARDING THIS ISSUE.
    THANKS AND REGARDS
    SASIDHAR.V

    there is no specific CASTING operation in ABAP, so just do following:
    non-char-field = char-field.
    as long as it is possible ABAP does implicit casting and you dont have to care about anything.

  • Problem with converting data types

    Hi Experts,
    I am stuck up with a little problem, i need your help
    i am converting all the data types to CHAR but i am not getting the expected data out.........
    My code is as below...where do i go wrong...
    LOOP AT <T_ITAB> ASSIGNING <FIELD>.
    DO.
       ASSIGN COMPONENT SY-INDEX OF STRUCTURE <FIELD> TO <RECORD>.
       IF SY-SUBRC = 0.
          LV_FIELD = <RECORD>.
          N = STRLEN( LV_FIELD ).
          IF N = '8'.
               IF LV_FIELD IS NOT INITIAL.
                      LV_DATE = LV_FIELD.
                      CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
                              EXPORTING
                              DATE                     = LV_DATE
                             EXCEPTIONS
                                    PLAUSIBILITY_CHECK_FAILED = 1
                                    OTHERS                     = 2.
                             IF SY-SUBRC <> 0.
                                     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                             ENDIF.
                         IF SY-SUBRC EQ 0.
                            CONCATENATE LV_FIELD+6(2) LV_FIELD+4(2) LV_FIELD+0(4) INTO LV_FIELD SEPARATED BY '.'.
                        ENDIF.
                ENDIF.
             ENDIF.
                IF LV_RECORD IS INITIAL.
                         LV_RECORD = LV_FIELD.
                ELSE.
                       CONCATENATE LV_RECORD LV_FIELD INTO LV_RECORD SEPARATED BY '  * '.
               ENDIF.
           ELSE.
         EXIT." DO
        ENDIF.
       ENDDO.
      APPEND LV_RECORD TO LT_OUTPUT.
    CLEAR LV_RECORD.
    ENDLOOP.
    THE TABLE LT_OUTPUT     LIKE     THENV(CHAR 255)
    My output looks some thing like this:
    04  36876   15.09.2011  39600   1999
    06  36960   15.09.2011  39600   2632
    07  36874   15.09.2011  39541   9232
    My expected output
    04    36.876  15.09.2011    39.600  1.999
    06    36.960  15.09.2011    39.600  2.632
    07    36.874  15.09.2011    39.541  9.232
    Regards
    sam

    At run time you can see all the data........ like what i have shown...
    but if you clearly see, DATE will be in the internal format..but if you print it, it will be in dd:mm:yyyy
    can you suggest me if i have a dynamic field symbol (table data) ,,,, How can i convert data types dynamically..
    if it is a static internal table i am achieving with WRITE TO statement.....but i have huge data in field symbols...
    Instead of all these , please specify the exact problem your are facing . What is it with date field ? . In SAP while printing the internal format will be converted to external. What is your requirement with this date field?
    My output looks some thing like this:
    04 36876 15.09.2011 39600 1999
    06 36960 15.09.2011 39600 2632
    07 36874 15.09.2011 39541 9232
    My expected output
    04 36.876 15.09.2011 39.600 1.999
    06 36.960 15.09.2011 39.600 2.632
    07 36.874 15.09.2011 39.541 9.232
    I dont see any problems mentioned in your date field. Both your actual and expected outputs reflects the same in date field.
    In SCN you will only get solutions if your question is precise.
    Kesav

  • Unicode Program : # is appearing for data types declared as char type

    Hi friends,
    I have copied one program on unicode system to unicode system. As only char type data types are allowed, i converted structure EP to char type only. Now during execution it is giving dump because it is showing value as '#' for 2 fields whos original data type was P and currency. How shall i convert them? Any suggession will helpful.
    Abhijit

    Hi Sandeep,
    This is my piece of code : Initially structure EP was used in read dataset which is of different datatypes. so i created similar structure ep_c with data type as char. As u suggested, i  tried to declare field BETRG as type currency. Then also it gave dump. (Runtime errors: UC_OBJECTS_NOT_CHARLIKE). For 2 fields BETRG and POHRS which is of currency and dec type originally, i am getting values as '#' causing in dump. In non unicode program both fields have values as '0.00' If i put these values in debugging then after execution, program comes to selection screen! Kindly advise.
    Data : komok(2) type c,
           betrg(18) TYPE c,
             betrg type betrg,
             pohrs(10) type c.
    open dataset seq-in for input in text mode encoding default ignoring conversion errors.
          if sy-subrc = 0.
            do.
              read dataset seq-in into ep_c.
              case sy-subrc.
                when 0.
                  move :ep_c-id to ep-id,
                        ep_c-text to ep-text,
                        ep_c-abkrs to ep-abkrs,

  • Cannot be converted in type DEC,CURR - longtext

    Dear,
    When we are loading the data to the targets, we are getting the errors in the Transfer rules like mentioned bellow
    Info source 0EC_CS_1 (Transaction Data for Consolidation)
    Status (tab) :
    Technical : Collection in source system ended
    Processing Step : Processing End
    Details (tab):
    Processing end : Errors occurred
    Error records written to application log
    Error in an arithmetic operation in record 1
    Record 1 :Contents 00 0.0000000 from field PCNT1 cannot be converted in type DEC ->longtext
    Info source 0CO_OM_CCA_9 (Cost Centers: Actual Costs with Delta E)
    Record 39952:Contents 048624.95- 1 from field SWF cannot be converted in type CURR ->longtext
    Kindly help.
    Thanks & Regards,
    Kiran A
    Edited by: Kiran A on Mar 21, 2010 10:23 AM
    Edited by: Kiran A on Mar 21, 2010 11:36 AM

    Hi,
                   It is sure some where in transferrules the mapping wasdone wrongly , like char --char of info object but in ur case some where data element is not same for field and info object.
      check throughly transfer rules correctly field level and infoobject mapping  and activate.
    it is some where currency and unit fields the difference is there for data elements
    Thanks&Regards,
    Sathish
    Edited by: sathish kakumudi on Mar 21, 2010 4:01 PM

  • Cannot convert ÿØÿà of type class java.lang.String to class BFileDomain.

    Hi All,
    I am using Jdeveloper 11.1.2.3.0.
    I have a scenario of making an ADF page where I have a IMAGE field to show on the page. So,I have a table called "PRODUCT" with fields called photo with BFILE type. Now when I the data i have inserted using the DML command and i can see the path at the backend.
    However,when i am runnig my ADF page in the Filed called "PHOTO" I can only see a junk character stating 'yoyo'.
    When I click on it, it says ERROR "Cannot convert ÿØÿà of type class java.lang.String to class oracle.jbo.domain.BFileDomain".
    Your help will be appreciated ASAP.
    Regards,
    Shahnawaz

    Hi,
    did you show the id-value in the user interface as a input-component, and did the input-component include a converter?
    If yes, show the id as output-text and remove any existing converter-components.
    Best Regards

  • Cannot obtain an appropriate JDBC type for class char.

    The above error while deploying...The full error is below. The only datatypes used are: integer, timestamp,string, decimal and date (so no char).  Can anybody help?
    Caught exception during application deployment from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Cannot deploy application sap.com/SAPAS12013.. Reason: Cannot obtain an appropriate JDBC type for class char. To store the field with this class in the database, the class must implement java.io.Serializable.; nested exception is: com.sap.engine.services.deploy.container.DeploymentException: <--Localization failed: ResourceBundle='com.sap.engine.services.deploy.DeployResourceBundle', ID='com.sap.engine.services.ejb.exceptions.deployment.EJBDeploymentException: Cannot obtain an appropriate JDBC type for class char. To store the field with this class in the database, the class must implement java.io.Serializable.
    at com.sap.engine.services.ejb.deploy.tools.sql.Mappings.getDefaultSqlTypeForJavaType(Mappings.java:131)
    at com.sap.engine.services.ejb.deploy.xml.CMPParser.fillCmpFieldInfo(CMPParser.java:89)
    at com.sap.engine.services.ejb.deploy.xml.CMPParser.parseCMPFields(CMPParser.java:644)
    at com.sap.engine.services.ejb.deploy.xml.CMPParser.parseFields(CMPParser.java:121)
    at com.sap.engine.services.ejb.deploy.xml.EJBJarParser.parseXml(EJBJarParser.java:173)
    at com.sap.engine.services.ejb.deploy.xml.EJBJarParser.parseXml(EJBJarParser.java:97)
    at com.sap.engine.services.ejb.deploy.DeployAdmin.parseSingleJar(DeployAdmin.java:296)
    at com.sap.engine.services.ejb.deploy.DeployAdmin.generate(DeployAdmin.java:246)
    at com.sap.engine.services.ejb.EJBAdmin.deploy(EJBAdmin.java:2118)
    at com.sap.engine.services.deploy.server.application.DeploymentTransaction.makeComponents(DeploymentTransaction.java:594)
    at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:379)
    at com.sap.engine.services.deploy.server.application.DeploymentTransaction.begin(DeploymentTransaction.java:296)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:290)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:323)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3033)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:463)
    at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1555)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:294)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:183)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:119)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
    at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

    Hi Ashley,
    And yet, apparently you have a cmp-field with type <b>char</b> in one of your CMP entity beans. This is not supported. Please refer to the <a href="http://help.sap.com/saphelp_nw04/helpdata/en/13/dbb2b66146934a9662918755038ea1/frameset.htm">Object/Relational Mapping Rules</a> and especially to the first bullet under the table.
    Hope that helps!
    Vladimir

Maybe you are looking for

  • SAP MAP - Best Choices for Planning Technical Basis

    Hello, experts! For today there are 3 variants of MAP planning scenaries implementation: 1.Planning and reporting via MAP Business content for BI Integrated planning 2.Planning and reporting via MAP Business content for BPS 3.Planning in ECC based MA

  • IPad Connector not reading certain SD disks

    FedEx delivered the Camera/SD Card Connector kit today. The iPhone to the iPad is fine. Sadly, the SD card connector/iPad isn't performing like it should. I've tried 3 cameras and 4 different brands of SD cards. All the SD cards work on the Wii, my M

  • URGENT:US TAX BUSINESS PROCESS

    Hello Experts , Could Anyone tell me the US / CANADA TAX BUSINESS PROCESS  involved in SAP which include  Taxation. please list those business process with complete flow of processing. Thanks & Regards Balakrishna.. Edited by: balkrishna h on Jul 12,

  • SAP - ORACLE 10.2 DB CONNECT WITH TOAD

    Dear Friends, Is possible to use Toad sotware (for accessing tables & write query to get data from table) in SAP Oracle ? Will it create any log or log file in Oracle or in SAP iteself ? Kindly, suggest me. Suppose, if you know any other query softwa

  • Qe65000 spectrometer and dark spectra

    Hello everyone,  I'm working with an Ocean Optics QE65000 spectrometer and am trying to automate the process of acquiring and subtracting a dark spectra in the same way that SpectraSuite does. Does anyone know of a VI that does this without having to