String with Trailing Space in a 4.7 / Basis 620 system

Hi
My customer is using SAP 4.7(Enterprise Management Version) / SAP BASIS Release 6.20 (Kernel 640).
We have a requirement to print a product label using a 2D Datamatrix barcode following HIBC standards.  We are using a custom development object (Z function module) that builds the barcode string (variable length string) using a Mod43 calculated check digit as the last character of the string.  One of the valid check digits is a "space" character as the last character of this barcode string.
Everything in our solution is working fine, except for the situation of the "space" check digit character at the end.  We are running into an ABAP syntax limitation when we are trying to concatenate the calculated check digit onto the barcode string.
For example, we have a barcode value "+M53210250 " (within the quotes).  This string ends with a SPACE character at the end.  We are calculating the barcode value (some fixed elements + SAP material number, batch, etc.), then calculating the check digit, and concatenating the check digit onto the end of the initial barcode string value.
I have tried this in a higher version system and am able to make it work by using the statement CONCATENATE RESPECTING BLANKS.  This syntax is not available with WebAS 620 however.
Here are the attempts we have made:
*Get HIBC 2D Barcode String
  CONCATENATE E_HIBC_2D_BC L_CHECK_DIGIT INTO E_HIBC_2D_BC.
IF L_CHECK_DIGIT = SPACE.
The following attempts does not work
CONCATENATE with SPACE at end
Concatenate HIBC SPACE and a dummy variable like 'TEST' into HIBC builds a space in between the dummy and HIBC
and then when i split it the space is lost again.
Insert SPACE in the beginning bulding a new variable with 0(1) space followed by HIBC and then SHIFT CIRCULAR BY 1 place
It will work only if moved to a variable of length which is exactly HIBC + 1 char in length then by default the last char is SPACE.
Use a replacement variable which is not a HIBC Check Digit like # & ! ? ^ or other for SPACE
ECC 5.0 and HIGHER
*CONCATENATE {dobj1 dobj2 ...}|{LINES OF itab}
           INTO result
           [IN {BYTE|CHARACTER} MODE]
           [SEPARATED BY sep]
           [RESPECTING BLANKS].
*4.7 Version *
*CONCATENATE f1 ... fn INTO g.
*1. ... SEPARATED BY h
*2. ... IN BYTE MODE
*3. ... IN CHARACTER MODE
Having the customer upgrade to ECC 5.0 is not feasible to solve this.
If anyone has any alternative ideas on how to manage this variable length string and respect the trailing space, I would appreciate it.
I have searched the forums but the only solutions that are close deal with outputting to a file during a download or FTP, or else mention the newer syntax of CONCATENTATE with the option RESPECTING BLANKS, but that is not available in this release.

If you could predict how long the string is (assuming you might determine whether the last element length is shorter than the db length), you could try to insert your check digit based upon fieldname+your_calculated_length(1) = checkdigit.
for example if batch is 3 cahr and you have '50' in the data, you could calculate as lv_len = strlen( the value ) .
lv_len = lv_len + 1.
move checkdigit to barcodefield+lv_len(1).
Perhaps something like this would allow you to work around.  At any rate, if you can figure out if there's supposed to be one or ?? blanks on the end, specifying the position by +offset(columns) should do the trick, instead of the concatenate.

Similar Messages

  • How to find string with trailing space

    Hi,
    I need to search a word instead of string from another string.
    I tried below code and expected that FIND will not search 'weeds' but it seems FIND ignores trailing spaces of string zstr and thus finds word 'weeds'.
    DATA: zstr type string value 'we ',
              lv_string type string value 'These are weeds',
              result_tab TYPE match_result_tab.
    FIND FIRST OCCURRENCE OF regex zstr IN lv_string
                          IGNORING CASE
                          RESULTS result_tab.
    Please consider that zstr is runtime variable with no fixed length.
    If anybody has the solution, reply back fast !
    Regards,
    Sourabh

    Hi,
    Hi,
      DATA STRING(30) VALUE 'This is a little sentence.'.
    WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
    ULINE /1(26).
    SEARCH STRING FOR 'X'.
    WRITE: / 'X', SY-SUBRC UNDER 'SY-SUBRC',
                   SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR 'itt '.
    WRITE: / 'itt   ', SY-SUBRC UNDER 'SY-SUBRC',
                       SY-FDPOS UNDER 'SY-FDPOS'
    SEARCH STRING FOR '.e .'.
    WRITE: / '.e .', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR '*e'.
    WRITE: / '*e ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    SEARCH STRING FOR 's*'.
    WRITE: / 's* ', SY-SUBRC UNDER 'SY-SUBRC',
    SY-FDPOS UNDER 'SY-FDPOS'.
    Hope it will solve your problem..
    Pls. reward if useful...

  • How to replace a character in a string with blank space.

    Hi,
    How to replace a character in a string with blank space.
    Note:
    I have to change string  CL_DS_1===========CM01 to CL_DS_1               CM01.
    i.e) I have to replace '=' with ' '.
    I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
    Its not working.

    Hi,
    Try with this..
    call method textedit- >replace_all
      exporting
        case_sensitive_mode = case_sensitive_mode
        replace_string = replace_string
        search_string = search_string
        whole_word_mode = whole_word_mode
      changing
        counter = counter
      exceptions
        error_cntl_call_method = 1
        invalid_parameter = 2.
    <b>Parameters</b>      <b> Description</b>    <b> Possible values</b>
    case_sensitive_mode    Upper-/lowercase       false Do not observe (default value)
                                                                       true  Observe
    replace_string                Text to replace the 
                                         occurrences of
                                         SEARCH_STRING
    search_string                 Text to be replaced
    whole_word_mode          Only replace whole words   false Find whole words and                                                                               
    parts of words (default                                                                               
    value)
                                                                               true  Only find whole words
    counter                         Return value specifying how
                                        many times the search string
                                        was replaced
    Regards,
      Jayaram...

  • Download IDOC with Trailing spacs

    I have a requirement like when I download an IDOC data into a text file, I need the dataline and the trailing spaces. This is required in EDI where it interprets the SDATA as 1000 charcter string and actual case we have actula data less than 1000 character in sap. So we need to append the remaining spaces to each data record which in turn fills the segment pad field in EDI map tool and read the next line correcly
    Any Idea pls share

    HI ,
    My requiremrnt is i want to download IDOC to local PC...but if i use /nzdown transaction i am not getting EDI_DC40 header in the downloaded file...
    Regards
    Venkatesh

  • External material number with trailing spaces

    Hi ,
    One of our users created a material number(external number range) by copying it  from a spreadsheet. The value he copied had trailing spaces and when he copied it on to material number field the trailing spaces were not removed by SAP conversion routines . But when we deliberately type in trailing spaces the system removes them. Has anyone faced this kind of problems before? If so what is the solution.
    Thanks,
    Veera

    Any Input??????

  • How to split a string with a space in between?

    Hi ABAP Guru's,
    Can you please help me out? How can I split a string into two which has a space in between?
    For example: lets suppose the string is 'LA CA USA'. How can I split this string? I have to dynamically determine the number of characters before the space therefore I cannot use number constant such as 2 or 3.
    With best regards,
    Ketan

    Hi
    Try like this
    DATA : opbal TYPE p DECIMALS 2 VALUE 0.
        SELECT * FROM zs_mkpf_mseg
                        into corresponding fields of table it_opbal
                        WHERE werks =  itmat-werks
                        AND matnr = itmat-matnr
                        AND budat = s_budat-low.
      *  sort  it_opbal by budat.
      loop at it_opbal.
    read table it_opbal.
          IF it_opbal-shkzg = 'S'.
            opbal = opbal + it_opbal-menge.
          ELSEIF it_opbal-shkzg = 'H'.
            opbal = opbal + it_opbal-menge * -1.
          ENDIF.
      endloop.
        append opbal TO itab-opbal.
      ENDFORM.                    " opbal_data
    you can also use thi s
    DATA: NAMES(30)    TYPE C VALUE 'Charly, John , Peter',
          NAMES2       TYPE STRING,
          ONE(10)      TYPE C,
          TWO(10)      TYPE C,
          THREE        TYPE STRING,
          FOUR(4)      TYPE C VALUE 'FOUR',
          DELIMITER(2) VALUE ','.
    SPLIT NAMES AT DELIMITER INTO ONE TWO.
    *     ONE contains 'Charly' and TWO contains 'John , Pet'.
    *     SY-SUBRC is 4, because TWO was not large enough to
    *     accommodate the whole of the remaining string
    SPLIT NAMES AT ',' INTO ONE TWO THREE.
    *     ONE contains 'Charly', TWO contains ' John',
    *     THREE contains ' Peter'.
    SPLIT NAMES AT ', ' INTO ONE THREE TWO.
    *     ONE contains 'Charly', THREE contains 'John',
    *     TWO contains 'Peter'.
    CONCATENATE NAMES '' INTO NAMES2 SEPARATED BY SPACE.
    SPLIT NAMES2 AT DELIMITER INTO ONE TWO THREE FOUR.
    *     ONE contains 'Charly', TWO contains 'John',
    *     THREE contains 'Peter ', FOUR is empty.
    SPLIT NAMES2 AT DELIMITER INTO ONE FOUR THREE.
    *     ONE contains 'Charly', FOUR contains 'John',
    *     THREE contains 'Peter', SY-SUBRC is 4, since
    *     FOUR was not large enough (spaces are significant
    *     characters!)
    Reward all helpfull answers
    Regards
    Pavan

  • Replacing inconsistant spacing with single space in a string

    is it possible to replace multiple spaces within a string with one space only. Number of spaces is different all the time.
    say one field contains strings with imbedded spaces
    I need to replace all these values so that there will be only one space between words.
    For Eg.
    Input                             Expected Result
    aaa    bbb                       aaa bbb
    ww                vv             ww vv
    ww ss      kk                    ww ss kk
    [/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    user11253970 wrote:
    I am in Oracle 9i :( I can not use reg exp
    Assuming strings do not contain CHR(0) (character with ascii code 0):
    SQL> SELECT  'aaa          bbb  aaa bbb' str,
      2          replace(replace(replace('aaa          bbb  aaa bbb',' ',' ' || CHR(0)),CHR(0) || ' '),CHR(0)) new_str
      3    FROM  dual
      4  /
    STR                                 NEW_STR
    aaa          bbb  aaa bbb           aaa bbb aaa bbb
    SQL> SY.

  • How to concatenate a string with spaces

    Dear experts,
    I would like to concatenate a string with three spaces, for example,
    CONCATENATE 'X' SPACE SPACE SPACE 'Y' INTO LV_RESULT.
    However, the result I got from executing the above statement is not 'X   Y' as I want, but rather 'XY'.
    I did try
    CONCATENATE 'X' '***' 'Y' INTO LV_RESULT.
    REPLACE '***' with '   ' INTO LV_RESULT.
    still doesn't work.
    How can I write ABAP code to archive such a result?
    Any idea would be appreciated.
    Vitthavat A.

    dear  Oliver Hütköper and koolspy,
    I tried your solutions, and it works.
    so i awarded points to you.
    anyway, while trying the 'respecting blanks', i got an error:
    "".", "IN BYTE MODE", "SEPARATED BY ..." or "IN CHARACTER MODE" expected"
    not sure what it means. but it's ok. the problem has been solved.
    thanks again.

  • Trim trailing spaces in Numbers '09

    I have tried to use Trim to delete trailing spaces. Which it does, but then if I copy and paste the value of the cell with the trim formula, I get the original value with the trailing space.
    I have a large messy spreadsheet with lots of cells with trailing spaces which makes using reference formulas harder for me since I can't find exact matches (due to the trailing spaces)
    How do I copy the string without the trailing space?

    If you copy/pasted that text from A2 into your post, the final character is not a space. I copy/pasted from your post to a table and the last character is code 160 (A0 hex) which looks like a space but is not. TRIM will not remove that.
    Try this
    =SUBSTITUTE(A2,CHAR(160),"")
    If that removes other "spaces" in your string that you want to keep, try this instead
    =TRIM(SUBSTITUTE(A2,CHAR(160)," "))

  • Read Key(String).vi and spaces

    Hello all,
    I am having some trouble with the Read Key(String).vi. One of the strings I am reading in ends in spaces. This vi seems to want to truncate any trailing spaces. I don't want it to do that. Is there anyway of modifing the vi to not truncate spaces? Or should I not allow spaces to be written?
    Thanks in advance,
    Glen

    I haven't dug very far into the config file VIs but the easiest thing to do is to enclose all of your strings with quote marks ("). If you do that, key values with trailing spaces are read correctly.

  • Trailing space in char field

    Hello there,
    I am a BW developer and I am currently having an issue with trailing spaces in an ABAP routine.
    This is the situation (example... In real life I use larger char fields):
    - From a source I get a text line that is let's say max. 60 characters long.
    - In BW I split this line into 3 parts and save those in the short text fields of 3 different InfoObjects. Short text is defined as CHAR 20.
    - Later on I can display the text line I just split up as one line of text again. I need to do this because BW can only store texts with acertain length.
    - Now it is possible that the text line I get has a blank at position 20. I need to keep this blank in the first of my 3 parts. But since it is a character field, the blank is ignored and only the first 19 characters are saved.
    Question:
    How can I manage to save all first 20 characters in the first of the three CHAR 20 fields, including any trailing blanks?
    The fields have to be defined as CHAR because that is the definition of text fields in BW. (data type RSTXTSH, to be exact)
    Example:
    Incoming text line (Notice, the character at position 20 is a blank):
    "blabla1111blabla111 blabla2222blabla2222blabla3333blabla3333"
    After splitting it into three parts, I get this:
    Part 1: "blabla1111blabla111" (no trailing blank)
    Part 2: "blabla2222blabla2222"
    Part 3: "blabla3333blabla3333"
    What I need is this:
    Part 1: "blabla1111blabla111 " (with trailing blank)
    Part 2: "blabla2222blabla2222"
    Part 3: "blabla3333blabla3333"
    Any help will be greatly appreciated
    Thanks and regards,
    Stefan

    Hi Stefan,
    As Stefan Seeburger already said you can use RESPECTING BLANKS to get that.
    DATA: i_input TYPE c LENGTH 60,
           e_part1 TYPE c LENGTH 20,
           e_part2 TYPE c LENGTH 20,
           e_part3 TYPE c LENGTH 20,
           v_space   TYPE c LENGTH 1,
           e_partfull TYPE c LENGTH 60.
    i_input = 'blabla1111blabla111 blabla2222blabla2222blabla3333blabla3333'.
    SPLIT i_input AT v_space INTO: e_part1 e_part2 e_part3.
    e_part1 = i_input(20).
    e_part2 = i_input+20(20).
    e_part3 = i_input+40(20).
    DATA: lv_length TYPE i.
    lv_length = STRLEN( e_part1 ).
    CONCATENATE e_part1 e_part2 e_part3 INTO e_partfull RESPECTING BLANKS.
    DATA: lv_length2 TYPE i.
    lv_length2 = STRLEN( e_partfull ).
    BREAK-POINT.
    Cheers!

  • Trailing spaces problem with OracleDataAdapter

    Hi,
    I have a char(60) column in the database which i cant change to nvarchar. I am using a ref cursor with the ODP.NET dataadapter to populate the dataset. The dataset has defined this column as a string. When I fill the dataset, the data for this column contains trailing spaces (to make it 60 characters).
    Situation: Stored Procedure returns a ref cursor that is used to fill the dataset using a dataadapter
    Problem: Trailing spaces in all char columns
    Attempts:
    1) Returning Trim(column_name) from the SP. This time the dataset column gets null values. Doesn't the trim work with the dataadapter.
    2) Tried returning length(trim(column_name)) from the SP. The dataset got all 0 values
    3) Tried returning length(column_name) from the SP. Returns 60 because the column is char(60)
    Any idea what is going on? Is this a bug? Is there a solution ?
    Thanks
    Nishith

    Got it !!! :D
    My query in the SP was SELECT TRIM(column_name) ... so it was trying to populate it into the "TRIM(column_name)" column of the dataset which is not there ... no have changed it to SELECT TRIM(column_name) as column_name ... works :)
    But is there an easier way ?
    Nishith

  • Use REGEXP_INSTR to find a text string with space(s) in it

    I am trying to use REGEXP_INSTR to find a text string with space(s) in it.
    (This is in a Function.)
    Let's say ParmIn_Look_For has a value of 'black dog'. I want to see if
    ParmIn_Search_This_String has 'black dog' anywhere in it. But it gives an error
    Syntax error on command line.
    If ParmIn_Look_For is just 'black' or 'dog' it works fine.
    Is there some way to put single quotes/double quotes around ParmIn_Look_For so this will
    look for 'black dog' ??
    Also: If I want to use the option of ignoring white space, is the last parm
    'ix' 'i,x' or what ?
    SELECT
    REGEXP_INSTR(ParmIn_Search_This_String,
    '('||ParmIn_Look_For||')+', 1, 1, 0, 'i')
    INTO Position_Found_In_String
    FROM DUAL;
    Thanks, Wayne

    Maybe something like this ?
    test@ORA10G>
    test@ORA10G> with t as (
      2    select 1 as num, 'this sentence has a black dog in it' as str from dual union all
      3    select 2, 'this sentence does not' from dual union all
      4    select 3, 'yet another dog that is black' from dual union all
      5    select 4, 'yet another black dog' from dual union all
      6    select 5, 'black dogs everywhere...' from dual union all
      7    select 6, 'black dog running after me...' from dual union all
      8    select 7, 'i saw a black dog' from dual)
      9  --
    10  select num, str
    11  from t
    12  where regexp_like(str,'black dog');
           NUM STR
             1 this sentence has a black dog in it
             4 yet another black dog
             5 black dogs everywhere...
             6 black dog running after me...
             7 i saw a black dog
    5 rows selected.
    test@ORA10G>
    test@ORA10G>pratz
    Also, 'x' ignores whitespace characters. Link to doc:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm#i1048942
    Message was edited by:
    pratz

  • XI 3.0: Preserve trailer spaces with JMS Adapter

    Hi everybody
    Does anybody knows how it is possible to preserve the trailing spaces in a message coming from JMS adapter?
    I have a fixed-length field that is filled with a left space trailer, but the space is removed by (i think) the adapter.
    Does exists something similar to "whitespace=preserve" for the datatypes???
    Thanks in advance.

    If somebody is interested, just add the
    xml.<structname>.fieldContentFormatting = nothing to the module configuration params.
    I derived this one from the configuration guide of the File Adapter

  • How to pad a string with space or other character

    length 14 string '00000000000155' turn to length 25 string '00000000000155         ' ,use space to pad string trail.
    using following function:
    CONCATENATE '00000000000155' '         ' into lv_string
    but result is the lv_string ='00000000000155',the spaces were not added the string trail.
    how to achieve this purpose padding string.
    pls help me.
    thank you.

    Hi ,
    Not sure what exactly you require, But in my understanding you need to add one more spave after the doknr no. Please refer this code which could be more useful.
    data: lv_objkt like aeoi-OBJKT,
          lv_doknr like draw-doknr,
          lv_dokar like draw-dokar,
          lv_doktl like draw-doktl,
          lv_dokvr like draw-dokvr,
          lv_slen type i.
    lv_dokar = 'DRW'.
    lv_doknr = '00000000000155'.
    lv_doktl = '000'.
    lv_dokvr = '-'.
    CONCATENATE lv_dokar lv_doknr INTO lv_objkt.
    lv_slen = STRLEN( lv_objkt ).
    lv_slen = lv_slen + 1.
    lv_objkt+lv_slen(3) = lv_doktl.
    CONCATENATE lv_objkt lv_dokvr INTO lv_objkt.
    WRITE: lv_objkt.

Maybe you are looking for

  • Sound Blaster Instability - Are you affected? (Stability Test for "Squealing", et

    I've created a test that works on my Sound Blaster Audigy 2 ZS with my particular hardware configuration as a proof of concept of the instability ( "high-pitched squealing" ) issues I have. (I have an ASUS P5N-E SLI motherboard.) I am seeking to find

  • PO not generated at backend in classic scenario

    Hi, I am working with SRM 5.0 in classic scenario. 1) I have defined No. ranges for SC and follow-on documents in SPRO. No. range PO is defined for backend (classic) POs. (Checkbox -External is not marked) PO - From 3005000000  to 3008000000 2) I hav

  • Iphone 4s really low sound

    Hello, From some months I experience the problem with the sound of the iPhone 4s. The sound is really low. You can only hear it if you put your ear very near to the speakers. I've tried everything. Settings -> Sounds to max. Restarting the iPhone. On

  • BDC for s_alr_87019080

    Hi Friends, My requirement : As we do vendor changes in xk02, the critical data like bank details, name and address are to be confirmed. so my client want, the changes done in address should not got to confirmation, so I want to do BDC recording for

  • Downloading of video

    but how to unzip the downloaded files. there is no option on screen