Char to Hex?

hi
i want to convert the char like A to 41H
how can i do this
plz relpy me
thanks in advance..
-chiru

java.lang.Integer
static String      toBinaryString(int i)
Returns a string representation of the integer argument as an unsigned integer in base 2.
static String      toHexString(int i)
Returns a string representation of the integer argument as an unsigned integer in base 16.
static String      toOctalString(int i)
Returns a string representation of the integer argument as an unsigned integer in base 8.

Similar Messages

  • Unicode, assignment  char to hex

    Hi Experts,
        I have a question related to assignment of char to hex in
    uni-code system.
    Here is piece of code:
    In non-uncode system:
    data:
    begin of struct,
    x1(1) type x,
    end of struct.
    data:
    c1 type c value 'C'.
    struct1 = c1.
    In unicode system
    *struct1 = c1 is not allowed.
    If i assign struct1-x1 = c1, intenally the values value are getting changed that can be seen in debug mode .
    for example: internal value for 'C' is 43,similarlly for 'L' it is 4C.
    so how can i assign this in unicode system with out the values to be changed ...
    please reply
    Sorry iam posting this twice because the first post thread got closed .....
    Regards
    Syed Abdul Adil.

    There are function modules in the system to convert hex values to char values.
    These function modules are:
    NLS_STRING_CONVERT_TO_SYS (hex to char)
    NLS_SRING_CONVERT_FROM_SYS (char to hex)
    If it's the tab character then it can be done with (example):
    data: x1 type char1 value c1_abap_char_utilities=>horizontal_tab.

  • Convertion from Char to Hex

    Hi Experts,
    I have a requirement to convert char type to Hex type.
    I have two structures. one is Character type and other is hex type like below.
    data: v_hex(300) type h,
            v_char(300) type c.
    When we move v_char(300) to v_char(300), it is working fine in 4.6 system.
    But it is giving unicode error in ECC 6.0. So i have changed the statement to v_hex = v_char.
    There is no syntax error but it is not converting the same.
    Please post your replies. Thanks in advance.

    REPORT  ZSRK_039                                .
    DATA: V_HEX(300) TYPE X,
          V_CHAR(300) TYPE C.
    V_CHAR = 'Test'.
    PERFORM CHAR_TO_HEX_CONV USING V_CHAR
                             CHANGING V_HEX.
    WRITE : / V_HEX.
    *&      Form  CHAR_TO_HEX_CONV
          text
         -->P_V_CHAR  text
         <--P_V_HEX  text
    FORM CHAR_TO_HEX_CONV  USING    CH TYPE C
                           CHANGING CH1 TYPE X.
      FIELD-SYMBOLS : <FS_TR> TYPE X.
      ASSIGN CH TO <FS_TR> CASTING TYPE X .
      CH1 = <FS_TR>.
    ENDFORM.                    " CHAR_TO_HEX_CONV

  • Convert from CHAR to HEXA

    Hi Experts ,
    i am working  in Upgradation project. In one of the program i  came   across  Moving  Char  value to Hexa value. More over , the char(  CHAR(1)  )   value is passing dynamically to Hex.
    Is there any function module to solve this issue. i got  CHAR_HEX_CONVERSION  but it is not working.
    Thank you.
    Regards,
    Kiran.

    Hello,
    Does the method CONVERT of class CL_ABAP_CONV_IN_CE help ?
    A few links which might interest you :
    [Conversion xstring to string|Conversion xstring to string]
    [http://help.sap.com/saphelp_nw70/helpdata/en/ba/78d3c747b24546ab1c1499a054d8a5/content.htm|http://help.sap.com/saphelp_nw70/helpdata/en/ba/78d3c747b24546ab1c1499a054d8a5/content.htm]
    BR,
    Suhas
    Edited by: Suhas Saha on Jan 21, 2010 5:41 PM

  • Chinese char to hex

    how can i get the chinese character hex format from sql

    select upper(lpad(ltrim(to_char(ascii(unistr ('<your letter here> ')),'xxxx')),4,'0')) hex from dual;
    scott@ORCL> select upper(lpad(ltrim(to_char(ascii(unistr ('a')),'xxxx')),4,'0')) hex_format from dual;
    HEX_
    0061

  • Chinese chars to hex?

    how can I convert chinese characters to hexadecimal format when I read those char from a file?

    It's not too clear what you mean by converting to hexadecimal but I guess this is what you want:char c = someChineseCharacter;
    String inHex = Integer.toHexString(c);

  • Converting Char  type  structure to Hex type structure

    Hello ,
             In unicode system how to convert char type structure to hex type structure . I am having structures as follows :
    DATA: BEGIN OF HEXBYTE,
      X TYPE X,
      END OF HEXBYTE.
    DATA: BEGIN OF CHARBYTE,
      C TYPE C,
      END OF CHARBYTE.
    HEXBYTE-X = CHARFIELD.
    CHARBYTE = HEXBYTE.
    But error coming is Charbyte and HexByte are not compatible . Plz suggest!!
    Thanks ,
    Keith

    Hi,
    These function modules are:
    NLS_STRING_CONVERT_TO_SYS (hex to char)
    NLS_SRING_CONVERT_FROM_SYS (char to hex)
    Regards,
    Nikhil

  • Converting Hex to Integer Value

    I'm trying to convert hex code to the corresponding integer, which can then be used to display a character.
    For example I have the code.
    int i = 0xE7;
    System.out.println(i);
    System.out.write(i)This produces the output as expected with the first output outputting 231, and the second line outputting the corresponding character.
    My problem comes when trying to make it so the hex code is variable.
    For example, I receive an output of 7
    This output is then the last digit of the hex code (so i check if needs to be converted to a, b etc.) then try and combine it with the prefix 0xE to create the hex code.
    I'm not quite sure how to do this bit as I cant carry out
    num = 7;
    hex = "0xE"+num;
    int i = hex;as the last line doesn't calculate due to hex being a string.
    Many thanks for your help.

    leesto wrote:
    The char array is currently being created using:
    char [] hexchar = "0123456789ABCDEF".toCharArray();
    Look this is OK, you need to do nothing but just the following:
    // I am using the very first example you provided
    // i is the index for the char
    String hex = "0E" + hexchar;
    Integer.parseInt(hex, 16);
    System.out.println(i);

  • Unicode to hex conversion

    Guys, I look at ASCII table given to me for Czech chars and hex value for character "á" is E1. But when I use rawtohex function to get hex value I get below output.
    WHY ?
    SQL> select rawtohex('á') from dual;
    C3A1
    How can I get value E1 ? Thanks

    My Oracle version is
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE     9.2.0.1.0     Production
    TNS for Solaris: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    NLS settings are ---
    1* select * from v$nls_parameters
    SQL> /
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_CHARACTERSET EE8ISO8859P2
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXF
    F AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXF
    F AM TZR
    NLS_DUAL_CURRENCY $
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    Anything more I need to setup. Btw I dun understand yet very clearly difference between NLS_CHARACTER_SET and NLS_NCHAR_CHARACTERSET

  • Convert Unicode to Hex (Big5 hex)

    i have a content in MySql as Blob type. The content is a string of unicode. The below string is the content.
    82f1570b5a929ad4900f9732002c67008fd16df153d75b9853f87e8f8eab76849ea553ef5091905c62537b9754119ed15e6b592780337abf501f9322002c4ee589e36c7a4ed69ad890544e0051044e8c5343842c7f8e91d1768450b552d9002c800c9ea553ef5df2548c5c0d65b9800159276210597d53cb002e
    This is representing a sentence of chinese character. Well, for instance:
    82f1 - ying
    570b - guo
    (ying guo = England country)
    My question is, how can i convert 82f1 into Big5 format? Eg: "82f1" will becomes "AD5E".
    Anyone has idea to convert it? Thanks

    this might be helpful as well
    String s = "abcdef";
    byte[] bytes;
    try {
    bytes = s.getBytes("UTF-16BE");
    catch (java.io.UnsupportedEncodingException ex) {
    for (int i = 0; i < bytes.length; ++i) {
    System.out.print
    (Integer.toHexString(bytes|0x100).substring(1,3) +
    First of all, thank you for replying. This above code showed conversion from char to hex. But my problem is to convert from UTF-16 to Big5. Every 4 digits (82f1) is representing a char in chinese encoding. Therefore, i am looking a way to convert every 4 digits back to Big5 encoding. Do you have any idea of that? :)

  • Importing internal table from one program to another program

    Hi everybody,
    i have one small doubt.
    i am using submit statement and passing the values from this program to another program selection screen. in that program logic is written.In that program one internal table values are being exported to the memory id of that program. now i have to import that internal table values into my program by using import statement. i am using the following syntax
    import itab from menory id 'program name'.
    but i am getting an error saying program name is unknown.
    what is the exat syntax for this .
    thanking you,
    giri.

    hi,
    check these statements.
    IMPORT - Get data
    Variants:
    1. IMPORT obj1 ... objn FROM DATA BUFFER f.
    2. IMPORT obj1 ... objn FROM INTERNAL TABLE itab.
    2. IMPORT obj1 ... objn FROM MEMORY.
    3. IMPORT obj1 ... objn FROM SHARED MEMORY itab(ar) ID key.
    4. IMPORT obj1 ... objn FROM SHARED BUFFER itab(ar) ID key.
    5. IMPORT obj1 ... objn FROM DATABASE dbtab(ar) ID key.
    6. IMPORT obj1 ... objn FROM DATASET dsn(ar) ID key.
    7. IMPORT obj1 ... objn FROM LOGFILE ID key.
    8. IMPORT DIRECTORY INTO itab FROM DATABASE dbtab(ar) ID key.
    9. IMPORT (itab) FROM ... .
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. For more details, see Storing Cluster Tables.
    Variant 1
    IMPORT obj1 ... objn FROM DATA BUFFER f.
    Extras:
    1. ... = f (for each object to be imported)
    2. ... TO f (for each object to be imported)
    3. ... ACCEPTING PADDING
    4. ... ACCEPTING TRUNCATION
    5. ... IGNORING STRUCTURE BOUNDARIES
    6. ... IGNORING CONVERSION ERRORS
    7. ... REPLACEMENT CHARACTER c
    8. ... IN CHAR-TO-HEX MODE
    9. ... CODE PAGE INTO f1
    10. ... ENDIAN INTO f2
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.
    See You Cannot Use Implicit Field Names in Clusters.
    Effect
    Imports the data objects obj1 ... objn from the data buffer declared. The data buffer must be of type XSTRING . The data objects obj1 ... objn can be fields, structures, complex structures, or tables. The system imports all the data that has been stored in the data buffer f using the EXPORT ... TO DATA BUFFER statement and is listed here. It also checks that the structure used in the IMPORT statement matches the one in the EXPORT statement.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged. (In some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported. The contents of all the objects remain unchanged.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is stored in the field f.
    Addition 3
    ... ACCEPTING PADDING
    Effect
    This addition allows you to append new fields to the end
    of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 4
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR
    fields, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 5
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is
    relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 3 (enlarge structure) or addition 4 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Addition 6
    ...IGNORING CONVERSION ERRORS
    Effect
    This addition prevents the system from triggering a
    runtime error, if an error occurs when the character set is converted. '#' is used as a replacement character.
    Addition 7
    ... REPLACEMENT CHARACTER c
    Effect
    The replacement character is used if a particular
    character cannot be converted when the character set is converted.
    This addition can only be used in conjunction with addition 6.
    Addition 8
    ... IN CHAR-TO-HEX MODE
    Effect
    Not all character-type fields are converted. To convert
    a field, you must create a field (or structure) that is identical to the exported field or structure, except that all its character-type components must be replaced with hexadecimal fields.
    You can only use this addition in Unicode programs, to allow you to import camouflaged binary data as single-byte characters.
    Moreover, you cannot use this addition in conjunction with the additions 3, 4, 5, 6, or 7.
    Addition 9
    ... CODE PAGE INTO f1
    Effect
    The code page of the exported data is stored in the
    character-type field f1 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition.
    Addition 10
    ... ENDIAN INTO f2
    Effect
    The byte order (LITTLE or BIG) of the
    exported data is stored in the field f2 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition. The field f2 must have the type ABAP_ENDIAN, which is defined in the type group ABAP. For this reason, the type group ABAP must be included in the ABAP program using a TYPE-POOLS statement.
    Variant 2
    IMPORT obj1 ... objn FROM INTERNAL TABLE itab.
    Extras:
    1. ... = f (for each object to be imported)
    2. ... TO f (for each object to be imported)
    3. ... ACCEPTING PADDING
    4. ... ACCEPTING TRUNCATION
    5. ... IGNORING STRUCTURE BOUNDARIES
    6. ... IGNORING CONVERSION ERRORS
    7. ... REPLACEMENT CHARACTER c
    8. ... IN CHAR-TO-HEX MODE
    9. ... CODE PAGE INTO f1
    10. ... ENDIAN INTO f2
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See No implicit field names in cluster.
    Effect
    Imports the data objects obj1 ... objn (fields, structures, complex structures, or tables) from the specified internal table itab. The first column in the internal table must be of the predefined type INT2 and the second must be type X. To define the first column you must refer to a data element in the ABAP Dictionary that has the predefined type INT2.
    All data that was stored in the internal table itab using EXPORT ... TO INTERNAL TABLE and listed, is imported. The system checks that the EXPORT and IMPORT structures match.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the specified data cluster were imported, the rest remain unchanged (it is possible that no data object was imported).
    SY-SUBRC = 4:
    The data objects could not be imported.
    The contents of all listed objects remain unchanged
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    Places the object in the field f.
    Addition 3
    ... ACCEPTING PADDING
    Effect
    This addition allows you to add new fields to the ends
    of structures, even to substructures and internal tables (the additional fields are filled with initial value during the IMPORT). It also allows you to increase the size of existing fields (C, N, X, P, I1, and I2) and to map Char fields to STRING type fields or byte fields to XSTRING type fields.
    Addition 4
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR
    field or omit the last component on the highest level (till Release 4.6 this was possible without specifying an addition).
    Addition 5
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the page order is
    relevant, that is any substructures match. With this addition, the system also ignores alignment changes arising from the Unicode conversion (for example, due to subsequent insertion of named includes).
    This addition rules out any subsequent structural enhancements (addition 3) or structural shortening (addition 4) because with this addition it is the structural limits and include limits that are to be ignored.
    As from Release 6.10, the include information will also be stored in the dataset, so that it is possible to also check whether the includes match, that is substructures and includes (named or unnamed) are treated the same. When importing data that was exported in a Release lower than 6.10, the includes are not checked.
    Addition 6
    ...IGNORING CONVERSION ERRORS
    Effect
    This addition has the effect that an error in the
    character set conversion does not cause a runtime error. The system uses "#" as a replacement character.
    Addition 7
    ... REPLACEMENT CHARACTER c
    Effect
    The system uses the specified replacement character if a
    character cannot be converted during a character set conversion. If this addition is not specified, the system uses "#" as a replacement character.
    This addition can only be used in conjunction with addition 6.
    Addition 8
    ... IN CHAR-TO-HEX MODE
    Effect
    No character type fields are converted. For this you
    must create a field or structure that is identical to the exported field or exported structure, except that all character type fields must be replaced with hexadecimal fields.
    This addition, which is only allowed in programs with a set Unicode flag, allows you to import binary data disguised as single byte characters. This addition cannot be used in conjunction with additions 3, 4, 5, 6, and 7.
    Addition 9
    ... CODE PAGE INTO f1
    Effect
    The codepage of the exported data is stored in the
    character-type field f1 (for example, to be able to analyze the data imported with the addition IN CHAR-TO-HEX MODE).
    Addition 10
    ... ENDIAN INTO f2
    Effect
    The byte order (LITTLE or BIG) of the
    exported data is stored in the field f2 (for example, to be able analyze the data imported using the addition IN CHAR-TO-HEX MODE). The field f2 must be of type ABAP_ENDIAN, defined in type group ABAP. You must therefore include the type group ABAP in the ABAP program with a TYPE-POOLS statement.
    Variant 3
    IMPORT obj1 ... objn FROM MEMORY.
    Extras:
    1. ... = f (for each object to be imported) 2. ... TO f (for each object to be imported)
    3. ... ID key
    4. ... ACCEPTING PADDING
    5. ... ACCEPTING TRUNCATION
    6. ... IGNORING STRUCTURE BOUNDARIES
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See You Must Enter Identification and Cannot Use Implicit Field Names inClusters
    Effect
    Imports data objects obj1 ... objn (fields, structures, complex structures or tables) from a data cluster in the ABAP memory (see EXPORT). Reads in all data without an ID that was exported to memory with "EXPORT ... TO MEMORY.". In contrast to the variant IMPORT FROM DATABASE, it does not check that the structure matches in EXPORT and IMPORT.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because the ABAP memory was empty.
    The contents of all objects remain unchanged.
    Note
    You should always use the addition 3 (... ID key) with the statement. Otherwise, the effect of the variant is not certain (EXPORT statements in different parts of a program overwrite each other in the ABAP memory), since it exists only for reasons of compatibility with R/2.
    Additional methods for selecting and deleting data clusters in the ABAP memory are provided by the system class CL_ABAP_EXPIMP_MEM.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in field f.
    Addition 3
    ... ID key
    Effect
    Imports only data stored in ABAP memory under the ID key.
    Notes
    The key, key, must be a character-type data object (but not a string).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because an incorrect ID was used.
    The contents of all objects remain unchanged.
    Addition 4
    ... ACCEPTING PADDING
    Effect
    This addition allows you to append new fields to the end of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 5
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR field, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 6
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 3 (enlarge structure) or addition 4 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Related
    EXPORT TO MEMORY, DELETE FROM MEMORY, FREE MEMORY
    Variant 4
    IMPORT obj1 ... objn FROM SHARED MEMORY itab(ar) ID key.
    Extras:
    1. ... = f (for each object to be exported) 2. ... TO f (for each object to be exported)
    3. ... CLIENT g (before ID key)
    4. ... TO wa (after itab(ar) or ID key )
    5. ... ACCEPTING PADDING
    6. ... ACCEPTING TRUNCATION
    7. ... IGNORING STRUCTURE BOUNDARIES
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.
    See You Cannot Use Implicit Field Names in Clusters and You Cannot Use Table Work Areas.
    Effect
    Imports the data objects obj1 ... objn (fields, structures, complex structures, or tables) from shared memory. The data objects are read using the ID key from the area ar in the table itab - c.f. EXPORT TO SHARED MEMORY). You must use itab to specify a database table although the system reads from a memory table with the appropriate structure.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged. (In some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported. You may have used the wrong ID. The contents of all the objects remain unchanged.
    Notes
    The table dbtab named according to SHARED MEMORY must be declared using TABLES (except in addition 2).
    The structure of fields (field symbols and internal tables) to be imported must match the structure of the objects exported in the dataset. The objects must be imported under the same names as those under which they were exported. Otherwise, they will not be imported.
    The key length consists of: the client (3 digits, but only if tab is client-specific); area (2 characters); ID; and line number (4 bytes). It must not exceed 64 bytes - that is, the ID must not be longer than 55 characters, if the table is client- specific.
    The key, key, must be a character-type data object (but not a string).
    Additional methods for selecting and deleting data clusters in the shared memory are provided by the system class CL_ABAP_EXPIMP_SHMEM.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is stored in the field f.
    Addition 3
    ... CLIENT g (before ID key)
    Effect
    The data is imported from client g (provided the import/export table is tab client-specific). The client, g must be a character-type data object (but not a string).
    Addition 4
    ... TO wa (after itab(ar) or ID key)
    Effect
    You need to use this addition if user data fields have been stored in the application buffer and are to be read from there. The work area wa is used instead of the table work area. The target area must correspond to the structure of the called table tab.
    Addition 5
    ... ACCEPTING PADDING
    Effect
    This addition allows you to: append new fields to the end of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 6
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR fields, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 7
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 4 (enlarge structure) or addition 5 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Related
    EXPORT TO SHARED MEMORY, DELETE FROM SHARED MEMORY
    Variant 5
    IMPORT obj1 ... objn FROM SHARED BUFFER itab(ar) ID key.
    Extras:
    1. ... = f (for each object to be exported) 2. ... TO f (for each object to be exported)
    3. ... CLIENT g (before ID key)
    4. ... TO wa (last addition or after itab(ar))
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.
    See Cannot Use Implicit Fieldnames in Clusters und Cannot Use Table Work Areas.
    Effect
    Imports data objects obj1 ... objn (fields or
    tables) from the cross-transaction application buffer. The data objects are read in the application buffer using the ID key of the area ar of the buffer area for the table itab (see EXPORT TO SHARED BUFFER). You must use dbtab to specify a database table although the system reads from a memory table with an appropriate structure.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this means that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because an incorrect ID was used.
    The contents of all objects remain unchanged.
    Example
    Import two fields and an internal table from the application buffer with the structure INDX:
    TYPES: BEGIN OF ITAB3_LINE,
             CONT(4),
           END OF ITAB3_LINE.
    DATA: INDXKEY LIKE INDX-SRTFD VALUE 'KEYVALUE',
          F1(4),
          F2(8) TYPE P DECIMALS 0,
          ITAB3 TYPE STANDARD TABLE OF ITAB3_LINE,
          INDX_WA TYPE INDX.
    Import data.
    IMPORT F1 = F1 F2 = F2 ITAB3 = ITAB3
           FROM SHARED BUFFER INDX(ST) ID INDXKEY TO INDX_WA.
    After import, the data fields INDX-AEDAT and
    INDX-USERA in front of CLUSTR are filled with
    the values in the fields before the EXPORT
    statement.
    Notes
    You must declare the table dbtab, named after DATABASE using a TABLES statement.
    The structure of the fields, structures, and internal tables to be imported must match the structure of the objects exported to the dataset. Moreover, the objects must be imported with the same name used to export them. Otherwise, the import is not performed.
    The maximum total key length is 64 bytes. It must include: a client if the table is client-specific (3 characters); an area (2 characters); identification; and line counter (4 bytes). This means that the number of characters available for the identification of a client-specific table is 55 characters.
    The key, key, must be a character-type data object (but not a string).
    Additional methods for selecting and deleting data clusters in the cross-transaction application buffer are provided by the system class CL_ABAP_EXPIMP_SHBUF.
    Please consult Data Area and Modularization Unit Organization documentation as well.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in the field f
    Addition 3
    ... CLIENT g (after dbtab(ar))
    Effect
    Takes the data from the client g (if the import/export table dbtab is client-specific). The client g must be a character-type data object (but not a string).
    Addition 4
    ... TO wa (as the last addition or after itab(ar))
    Effect
    You need to use this addition if you want to save user data fields in the application buffer and then read them from there later. The system uses a work area wa instead of a table work area. The target area must have the same structure as the table tab.
    Example
    DATA: INDX_WA TYPE INDX,
          F1.
    IMPORT F1 = F1 FROM SHARED BUFFER INDX(AR)
                   CLIENT '001' ID 'TEST'
                   TO INDX_WA.
    WRITE: / 'AEDAT:', INDX_WA-AEDAT,
           / 'USERA:', INDX_WA-USERA,
           / 'PGMID:', INDX_WA-PGMID.
    Variant 6
    IMPORT obj1 ... objn FROM DATABASE dbtab(ar) ID key.
    Extras:
    1. ... = f (for each object to be imported)
    2. ... TO f (for each object to be imported)
    3. ... CLIENT g (before ID key )
    4. ... USING form
    5. ... TO wa (last addition or after dbtab(ar))
    6. ... MAJOR-ID id1 (instead of ID key)
    7. ... MINOR-ID id2 (with MAJOR-ID id1 )
    8. ... ACCEPTING PADDING
    9. ... ACCEPTING TRUNCATION
    10. ... IGNORING STRUCTURE BOUNDARIES
    11. ... IGNORING CONVERSION ERRORS
    12. ... REPLACEMENT CHARACTER c
    13. ... IN CHAR-TO-HEX MODE
    14. ... CODE PAGE INTO f1
    15. ... ENDIAN INTO f2
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Implicit Fieldnames in Clusters and Cannot Use Table Work Areas.
    Effect
    Imports data objects obj1 ... objn (fields, structures, complex structures, or tables) from the data cluster with ID key in area ar of the database table dbtab (see EXPORT TO DATABASE).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that not data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported, probably because an incorrect ID was used.
    The contents of all objects remain unchanged.
    Example
    Import two fields and an internal table:
    TYPES: BEGIN OF TAB3_TYPE,
              CONT(4),
           END OF TAB3_TYPE.
    DATA: INDXKEY LIKE INDX-SRTFD,
          F1(4), F2 TYPE P,
          TAB3 TYPE STANDARD TABLE OF TAB3_TYPE WITH
                    NON-UNIQUE DEFAULT KEY,
          WA_INDX TYPE INDX.
    INDXKEY = 'INDXKEY'.
    IMPORT F1   = F1
           F2   = F2
           TAB3 = TAB3 FROM DATABASE INDX(ST) ID INDXKEY
           TO WA_INDX.
    Notes
    You must declare the table dbtab, named after DATABASE, using the TABLES statement (except in addition 5).
    The structure of fields, field strings and internal tables to be imported must match the structure of the objects exported to the dataset. In addition, the objects must be imported under the same name used to export them. If this is not the case, either a runtime error occurs or no import takes place.
    Exception: You can lengthen or shorten the last field if it is of type CHAR, or add/omit CHAR fields at the end of the structure.
    The key, key, must be a character-type data object (but not a string).
    Additional methods for selecting and deleting data clusters in the database table specified are provided by the system class CL_ABAP_EXPIMP_DB.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in field f.
    Addition 3
    ... CLIENT g (before the ID key)
    Effect
    Data is taken from the client g (in client-specific import/export databases only). Client g must be a character-type data object (but not a string).
    Example
    DATA: F1,
          WA_INDX TYPE INDX.
    IMPORT F1 = F1 FROM DATABASE INDX(AR) CLIENT '002' ID 'TEST'
                   TO WA_INDX.
    Addition 4
    ... USING form
    Note
    This statement is for internal use only.
    Incompatible changes or further developments may occur at any time without warning or notice.
    Effect
    Does not read the data from the database. Instead, calls the FORM routine form for each record read from the database without this addition. This routine can take the data key of the data to be retrieved from the database table work area and write the retrieved data to this work area. The name of the routine has the format <name of database table>_<name of form>; it has one parameter which describes the operation (READ, UPDATE or INSERT). The routine must set the field SY-SUBRC in order to show whether the function was successfully performed.
    Addition 5
    ... TO wa (after key or after dbtab(ar))
    Effect
    You need to use this addition if you want to save user data fields in the cluster database and then read from there. The system uses the work area wa instead of a table work area. The target area entered must have the same structure as the table dbtab.
    Example
    DATA WA LIKE INDX.
    DATA F1.
    IMPORT F1 = F1 FROM DATABASE INDX(AR)
                   CLIENT '002' ID 'TEST'
                   TO WA.
    WRITE: / 'AEDAT:', WA-AEDAT,
           / 'USERA:', WA-USERA,
           / 'PGMID:', WA-PGMID.
    Addition 6
    ... MAJOR-ID id1 (instead of the ID key).
    Addition 7
    ... MINOR-ID id2 (with MAJOR-ID id1)
    This addition is not allowed in an ABAP Objects context. See Cannot Use Generic Identification.
    Effect
    Searches for a record the first part of whose ID (length of id1) matches id1 and whose second part - if MINOR-ID id2 is also declared - is greater than or equal to id2.
    Addition 8
    ... ACCEPTING PADDING
    Effect
    This addition allows you to append new fields to the end of structures, sub-structures, and internal tables. The IMPORT statement fills the additional fields with initial values; make existing fields (C, N, X, P, I1, and I2) longer; map character-type fields to STRING-type fields; or to map byte-type fields to XSTRING-type fields.
    Addition 9
    ... ACCEPTING TRUNCATION
    Effect
    This addition allows you to shorten the last CHAR fields, or to omit the last component at the top level. (Until Release 4.6, you could do this without using an addition).
    Addition 10
    ... IGNORING STRUCTURE BOUNDARIES
    Effect
    This addition means that only the fragment sequence is relevant - that is, that any sub-structures match. If you use this addition, the system ignores any alignment changes necessitated by Unicode - such as inserting named includes.
    You cannot use this addition with either addition 8 (enlarge structure) or addition 9 (shorten structure), since it specifies that structure and include boundaries are to be ignored.
    From Release 6.10 onwards, the include information is stored in datasets, so that the system can also check that includes match - that is, that sub-structures and includes (named or unnamed) are treated equally. When data is imported in a Release prior to 6.10, includes are not checked.
    Addition 11
    ...IGNORING CONVERSION ERRORS
    Effect
    This addition prevents the system from triggering a runtime error, if an error occurs when the character set is converted. '#' is used as a replacement character.
    Addition 12
    ... REPLACEMENT CHARACTER c
    Effect
    The replacement character is used if a particular character cannot be converted when the character set is converted. If you do not use this addition, '#' is used as a replacement character.
    This addition can only be used in conjunction with addition 11.
    Addition 13
    ... IN CHAR-TO-HEX MODE
    Effect
    All character-type fields are not converted. To convert a field, you must create a field (or structure) that is identical to the exported field or structure, except that all its character-type components must be replaced with hexadecimal fields.
    You can only use this addition in Unicode programs, to allow you to import camouflaged binary data as single-byte characters. Moreover, you cannot use this addition in conjunction with the additions 8, 9, 10, 11, and 12.
    Addition 14
    ... CODE PAGE INTO f1
    Effect
    The code page of the exported data is stored in the character-type field f1 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition.
    Addition 15
    ... ENDIAN INTO f2
    Effect
    The byte order(LITTLE or BIG) of the exported data is stored in the field f2 - for example, to analyze data that has been imported with the IN CHAR-TO-HEX MODE addition. The field f2 must have the type ABAP_ENDIAN, which is defined in the type group ABAP. For this reason, the type group ABAP must be included in the ABAP program using a TYPE-POOLS statement.
    Variant 7
    IMPORT obj1 ... objn FROM DATASET dsn(ar) ID key.
    This variant is not allowed in an ABAP Objects context. See Cannot Use Clusters in Files
    Note
    This variant is no longer supported and cannot be used.
    Variant 8
    IMPORT obj1 ... objn FROM LOGFILE ID key.
    Note
    This statement is for internal use only.
    Incompatible changes or further developments may occur at any time without warning or notice.
    Extras:
    1. ... = f (for each field f to be imported) 2. ... TO f (for each field f to be imported)
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Implicit Field Names in Clusters
    Effect
    Imports data objects (fields, field strings or internal tables) from the update data. You must specify the update key assigned by the system (with current request number) as the key.
    The key, key, must be a character-type data object (but not a string).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The existing data objects in the data cluster specified were imported. The rest remain unchanged (in some circumstances, this may mean that no data objects were imported).
    SY-SUBRC = 4:
    The data objects could not be imported. An incorrect ID may have been used.
    The contents of all objects remain unchanged.
    Addition 1
    ... = f (for each object to be imported)
    Addition 2
    ... TO f (for each object to be imported)
    Effect
    The object is placed in field f.
    Variant 9
    IMPORT DIRECTORY INTO itab FROM DATABASE dbtab(ar) ID key.
    Extras:
    1. ... CLIENT g (after dbtab(ar)) 2. ... TO wa (last addition or after dbtab(ar))
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Table Work Areas.
    Effect
    Imports an object directory stored under the specified ID with EXPORT TO DATABASE into the table itab. The internal table itab may not have the type HASHED TABLE or ANY TABLE.
    The key, key, must be a character-type data object (but not a string).
    The Return Code is set as follows:
    SY-SUBRC = 0:
    The directory was successfully imported.
    SY-SUBRC = 4:
    The directory could not be imported, probably because an incorrect ID was used.
    The internal table itab must have the same structure as the Dictionary structure CDIR (INCLUDE STRUCTURE).
    Addition 1
    ... CLIENT g (before ID key)
    Effect
    Takes data from the client g (only with client-specific import/export databases). Client g must be a character-type data object (but not a string).
    Addition 2
    ... TO wa (last addition or after dbtab(ar))
    Effect
    Uses the work area wa instead of the table work area. When you use this addition, you do not need to declare the table dbtab, named after DATABASE using a TABLES statement. The work area entered must have the same structure as the table dbtab.
    Example
    Directory of a cluster consisting of two fields and an internal table:
    TYPES: BEGIN OF TAB3_LINE,
             CONT(4),
           END OF TAB3_LINE,
           BEGIN OF DIRTAB_LINE.
             INCLUDE STRUCTURE CDIR.
    TYPES  END OF DIRTAB_LINE.
    DATA: INDXKEY LIKE INDX-SRTFD,
          F1(4),
          F2(8)   TYPE P decimals 0,
          TAB3    TYPE STANDARD TABLE OF TAB3_LINE,
          DIRTAB  TYPE STANDARD TABLE OF DIRTAB_LINE,
          INDX_WA TYPE INDX.
    INDXKEY = 'INDXKEY'.
    EXPORT F1 = F1
           F2 = F2
           TAB3 = TAB3
           TO DATABASE INDX(ST) ID INDXKEY " TAB3 has 17 entries
           FROM INDX_WA.
    IMPORT DIRECTORY INTO DIRTAB FROM DATABASE INDX(ST) ID INDXKEY
           TO INDX_WA.
    Then, the table DIRTAB contains the following:
    NAME     OTYPE  FTYPE  TFILL  FLENG
    F1         F      C      0      4
    F2         F      P      0      8
    TAB3       T      C      17     4
    The meaning of the individual fields is as follows:
    NAME:
    Name of stored object
    OTYPE:
    Object type (F: Field, R: Field string / Dictionary struc

  • Value 'KIRBYu00A0' of characteristic 0SORTL contains invalid characters

    hello experts!
    i am facing this error while activating 0vendor. data not available either in info object master neither in psa.
    Error Message: Value 'KIRBY ' (hex. '004B004900520042005900A0') of characteristic 0SORTL contains invalid characters
    Message no. BRAIN060
    Diagnosis
    Only the following standard characters are valid in characteristic values by default:
    !"%&''()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.
    Furthermore, characteristic values that only consist of the character # or that begin with ! are not valid.
    You are trying to load the invalid characteristic value 1. (hexidecimal representation 004B004900520042005900A0).
    Procedure for System Administration
    Try to change the invalid characters to valid characters.
    If you want values that contain invalid characters to be admitted into the system, make the appropriate setting in BW Customizing. Refer to the documentation describing the requirements for special characters and the possible consequences.
    For more information on the problems involved with valid and invalid characters, click here.
    regards
    vijay

    Hi Vijay,
    after KIRBY is a characteristic value which cannot be interpreted by BW properply / is not in the valid char list.
    KRIBY is hex value 004B0049005200420059
    the invalid char is hex value 00A0  -> online hex converter didn't found a ASCI match.
    To solve the problem you will need to fix the record in the source. Or you go to PSA -> delete all in teh field and re-enter KRIBY.
    Best regards,
    Axel

  • How do I display my pdf output on interactive form?

    Hi all,
    I use interactive form ui element and bind its pdf source property to my attribute 'SOURCE' typed xstring.
    I call my custom fm to process some data return me an itab which consist of lines of pdf binary data. I moved it to another itab which is lines of hexadecimal text. I have a big problem displaying my lt_xstring below on ineractive form. Either I get type not compatible or acess via null object reference error issues. Any idea anyone???
    TYPES: BEGIN OF ty_buffer,
             lv_buffer TYPE xstring,
           END OF ty_buffer.
    TYPES: BEGIN OF ty_string,
             lv_string TYPE string,
           END OF ty_string.
    TYPES: BEGIN OF ty_xstring,
             lv_xstring TYPE xstring,
           END OF ty_xstring.
    DATA lt_buffer TYPE STANDARD TABLE OF ty_buffer.
    DATA lt_string TYPE STANDARD TABLE OF ty_string.
    DATA lt_xstring TYPE STANDARD TABLE OF ty_xstring.
    DATA lw_buffer TYPE ty_buffer.
    DATA lw_string TYPE ty_string.
    DATA lw_xstring TYPE ty_xstring.
    DATA lw_pdf     TYPE soli.
    *EXPORT my_data = lv_string TO DATA BUFFER lv_buffer.
    *IMPORT my_data TO lv_xstring FROM DATA BUFFER lv_buffer IN CHAR-TO-HEX MODE.
    LOOP AT ltg_pdf INTO lw_pdf.
      lw_string-lv_string = lw_pdf-line.
      EXPORT my_data = lw_string-lv_string TO DATA BUFFER lw_buffer-lv_buffer.
      IMPORT my_data TO lw_xstring-lv_xstring FROM DATA BUFFER lw_buffer-lv_buffer IN CHAR-TO-HEX MODE.
      APPEND lw_xstring to lt_xstring.
      CLEAR lw_pdf.
      CLEAR lw_string.
      CLEAR lw_buffer.
    ENDLOOP.

    Hi Siong,
    If you are using web dynpro than whatever the values presents in the context will be displayed in the Form.
    in case of web dynpro you need to to perform any parsing or transformation.
    Just make sure than you are properly mapping the web dynpro context and Pdf context.
    check your web dynpro component, if you get the correct values in context, than these values will be displayed in fore also.
    Thanks & Regards,
    Arvind

  • Calling a smart form on click of a button in web dynpro abap

    Hi experts,
    I have a requirement like if I click a button in a view i need ti generate a PDF through smart form.
    Is this possible. If so please tell me the way..
    Thanks & Regards

    Hi Sharma,
    Create Interactive form in your view, create one node say PDF_SOURCE under this one attribute PDF_SOURCE of type XSTRING.
    Bind this to IF form Datasource and pdfsource.
    in your button action write code to call your smartform
    using SSF_FUNCTION_MODULE_NAME
    using FM  CONVERT_OTF and attach_file_to_response
    *convert to pdf
      call function 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_filesize          = lv_bytecount
        TABLES
          otf                   = ls_job_output_info-otfdata
          lines                 = lt_lines
        EXCEPTIONS
          err_conv_not_possible = 1
          err_bad_otf           = 2.
      loop at lt_lines into ls_line.
        lv_string = ls_line.
        export mydata = lv_string to data buffer lv_buffer.
        import mydata to l_xline from data buffer lv_buffer in char-to-hex
        mode.
        concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
      endloop.
      call method cl_wd_runtime_services=>attach_file_to_response
        EXPORTING
          i_filename      = 'ZWTY_PACKINGSLIP'
          i_content       = l_pdfstring
          i_mime_type     = 'BIN'
          i_in_new_window = abap_false
          i_inplace       = abap_false.
    also check this..
    http://abapcodexperiments.wordpress.com/2011/03/20/smartform-pdf-webdynpro-abap/
    Call smartform in web dynpro abap
    Cheers,
    Kris.

  • Call smartform in web dynpro abap

    hi guys,
          I am tring to create PDF from smartform but am getting sy-subrc = 1 error after call function LV_FNAM.
    I am attaching the code below. Am not using InteractiveForm UI Elemnt .
    data: lv_fnam type rs38l_fnam,
          ls_ssfctrlop type ssfctrlop,
          ls_ssfcompop type ssfcompop,
          ls_book type ppftbook,
          ls_job_output_info type ssfcrescl,
          ls_job_output_options type ssfcresop,
          lv_bytecount type i,
          lt_lines type table of tline,
          ls_line type tline,
          lv_string type string,
          lv_buffer type xstring,
          l_xline type xstring,
          l_pdfstring type xstring,
          it_add_rel type table of zprint_add_rel.
    *      p_pdf type xstring.
    data : wa_board type mara-matnr,
           plant type marc-werks.
    wa_board =  'SYPJ764'.
    plant = '2001'.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSSF_ADD_REL'
    importing
    fm_name = lv_fnam.
    ls_ssfctrlop-no_dialog = 'X'.
    ls_ssfctrlop-getotf  = 'X'.
    ls_ssfctrlop-preview = 'X'.
    ls_ssfcompop-tdnoprev = 'X'.
    ls_ssfcompop-tdtitle = 'X'.
    ls_ssfcompop-tdnewid = 'X'.
    call function lv_fnam
    exporting
    control_parameters = ls_ssfctrlop
    output_options = ls_ssfcompop
    *is_book = ls_book
    board = wa_board " 'SYPJ764'
    plant = plant " '2001'
    importing
    job_output_info = ls_job_output_info
    job_output_options = ls_job_output_options
    tables
    it_add_rel_i = it_add_rel
    exceptions
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    other = 5.
    if sy-subrc <> 0.
    endif.
    *convert to pdf
    call function 'CONVERT_OTF'
    exporting
    format = 'PDF'
    importing
    bin_filesize = lv_bytecount
    tables
    otf = ls_job_output_info-otfdata
    lines = lt_lines
    exceptions
    err_conv_not_possible = 1
    err_bad_otf = 2.
    loop at lt_lines into ls_line.
    lv_string = ls_line.
    export mydata = lv_string to data buffer lv_buffer.
    import mydata to l_xline from data buffer lv_buffer in char-to-hex mode.
    concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
    endloop.
    p_pdf = l_pdfstring.
    Please help me out with this error.
    Regards,
    Santosh

    Hi Santhosh,
    Please find the below code:
    FUNCTION ZP3088_NEW_JOINEE_ACT.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(PERNR) TYPE  PERSNO
    *"  EXPORTING
    *"     REFERENCE(L_DISPLAY_PDF) TYPE  NUM1
    *"     REFERENCE(L_DATA) TYPE  XSTRING
    *"  EXCEPTIONS
    *"      TRAINEE_PERNR
    * Tables declaration
      TABLES: NAST,PA0041.
    *   Type pools declaration
      TYPE-POOLS: SZADR.
    *   Internal table declaration
      DATA: L_PDF_LEN TYPE I,
            IT_PDF_LINES TYPE TABLE OF TLINE,
            JOB_OUTPUT_INFO TYPE  SSFCRESCL.
    *   Variables declaration
      DATA: G_RETCODE LIKE SY-SUBRC,
            G_FMNAME TYPE RS38L_FNAM.
      DATA: L_HIRE_DATE TYPE DATS,
            L_INCLUDE_DATE TYPE DATS,
            L_WEEK_DAYS TYPE P,
            IT_P0041 LIKE PA0041.
      DATA: DAR TYPE PA0041-DAR01,
            DAT TYPE PA0041-DAT01.
      DATA: L_DEVICE(30) TYPE C,
            LA_CTRL_FORM TYPE SSFCTRLOP,
            LA_OUTPUT_OPT TYPE SSFCOMPOP.
      data: l_persg type PA0001-persg. 
    * Start of Actual Code
      SELECT SINGLE persg
        from PA0001
        INTO l_persg
       where pernr eq pernr
         and endda eq '99991231'.
        if l_persg eq 'T' or
           l_persg eq 'W' or
           l_persg eq 'X'.
          raise trainee_pernr.
        endif.
      L_DISPLAY_PDF = 0.
      SELECT SINGLE * FROM PA0041 INTO IT_P0041
             WHERE PERNR EQ PERNR.
      IF SY-SUBRC = 0.
        DO 12 TIMES VARYING DAR FROM IT_P0041-DAR01
                                  NEXT IT_P0041-DAR02
                      VARYING DAT FROM IT_P0041-DAT01
                                  NEXT IT_P0041-DAT02.
          CASE DAR .
    *        WHEN '09'.          "Hiring Date
            WHEN '51'.          "Hiring Date
              L_HIRE_DATE = DAT.
              EXIT.
            WHEN ''.
              EXIT.
          ENDCASE.
        ENDDO.
      ENDIF.
    *To get the no. of weekdays between the hire date and current date excluding sat and sun
      IF NOT L_HIRE_DATE IS INITIAL.
        WHILE L_HIRE_DATE LE SY-DATUM.
          CALL FUNCTION 'BWSO_DATE_GET_FIRST_WEEKDAY'
            EXPORTING
              DATE_IN  = L_HIRE_DATE
            IMPORTING
              DATE_OUT = L_INCLUDE_DATE.
          DO 5 TIMES.
            " Making sure that it starts from the from date till to_date calculate before
            IF L_INCLUDE_DATE GE L_HIRE_DATE AND L_INCLUDE_DATE LE SY-DATUM.
              L_WEEK_DAYS = L_WEEK_DAYS + 1.
            ENDIF.
            L_INCLUDE_DATE = L_INCLUDE_DATE + 1.
          ENDDO.
          L_HIRE_DATE = L_INCLUDE_DATE + 2.
        ENDWHILE.
    IF L_WEEK_DAYS LE 30.
          L_DISPLAY_PDF = 1.         "Display the PDF document
        ELSE.
          L_DISPLAY_PDF = 0.         "Do Not Display the PDF document
        ENDIF.
      ENDIF.
      IF L_DISPLAY_PDF = 1.
    * Clear local variables
        CLEAR:   L_DEVICE,
                 LA_CTRL_FORM,
                 LA_OUTPUT_OPT.
    ** Spool Parameters
        LA_OUTPUT_OPT-TDIMMED = 'X'.
        LA_OUTPUT_OPT-TDDELETE = 'X'.
        LA_OUTPUT_OPT-TDLIFETIME = 'X'.
        LA_OUTPUT_OPT-TDDEST = 'LOCL'.
    * Get Smartform function module name
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            FORMNAME           = 'ZP3088_NEW_JOINEE_ACT_PDF'
          IMPORTING
            FM_NAME            = G_FMNAME
          EXCEPTIONS
            NO_FORM            = 1
            NO_FUNCTION_MODULE = 2
            OTHERS             = 3.
        IF SY-SUBRC <> 0.
          G_RETCODE = SY-SUBRC.
          SYST-MSGTY = 'E'.
        ELSE.
    * Parameters passes to get the output in PDF format
          LA_CTRL_FORM-NO_DIALOG = 'X'.
          LA_CTRL_FORM-PREVIEW = SPACE.
          LA_CTRL_FORM-GETOTF = 'X'.
          LA_CTRL_FORM-LANGU = NAST-SPRAS.
          LA_CTRL_FORM-DEVICE = 'PRINTER'.
    Edited by: wahid hussain syed on Nov 4, 2010 3:41 AM
    Edited by: wahid hussain syed on Nov 4, 2010 3:41 AM
    Edited by: Neil Gardiner on Nov 4, 2010 2:04 PM

Maybe you are looking for

  • Error: file not found

    Hello, I am using a labview program which already exists. The program inputs a file ( txt file with some numerical data) and gives the output file at the required location after performing some calculations to it. The problem is when I input my file

  • HR ABAP - PTM

    Hi friends, Im beginner in HR ABAP and need ur advise for TIme Management. My client are in implementing Time Management and Payroll functions....What i need here is, as an Abapper/technical cons, when my work will come into place whether it starts w

  • Is it possible to connect indesign with database/OOD...

    Hello fellow Indesign user, Not sure if this question belongs here or in scripting... I'm just a moderate user in ID CS4 and I got this daunting task to find/invest a way to use Indesign (our existing layout software) to create "brochures/instruction

  • EDI Message type issue

    Dear Friends, In my current project my issue is related to EDI Message type the problem is as below If I use output type (message type) NEU which is SAP standard and if I select this out put type (NEU) with medium EDI after saving this I can see all

  • Connecting MB Pro w/OS 10.8.4 to other network computers hangs

    I have updated my 2011 MB Pro to OS 10.8.4. I have an Airport Extreme network with 3 other desktop Macs connected - a Mac Pro, a G5, and an older iMac all runing a combination of Snow Leopard or Mountain Lion, but not the latest OS 10.8.4 update. I c