‎2009 Jul 13 8:05 AM
Hi Experts
I am concatenating a line of more than 400 alphabets in a variable of length 1000 type char. But this variable does not store more than 255 characters.
The code is:
data: lv_url(1000) type c.
loop at i_tab into wa_tab.
concatenate lv_url i_tab-name '=' i_tab-values into lv_url.
endloop.
The table i_tab contains about 15 entries. After the 10th in i_tab entry when lv_url contains 255 characters the further entries are not concatenated.
Please let me know an alternative solution for the same.
Thanks in Advance.
‎2009 Jul 13 8:08 AM
‎2009 Jul 13 8:11 AM
Try using STRING instear of defining lv_url as character of length 1000.
DATA: lv_url type string.
‎2009 Jul 13 8:14 AM
Hi,
The CONCATENATE should work with variable of length 1000 type char.
Probably what you are concatenating contains several blank spaces and that the reason why you are not able to see it.
Check with offset if it contains the data in the end or try by using a variable of type string.
Regards,
Ankur Parab
‎2009 Jul 13 8:15 AM
hi,
> I am concatenating a line of more than 400 alphabets in a variable of length 1000 type char. But this variable does not store more than 255 characters.
>
> The code is:
> data: lv_url(1000) type c.
>
> loop at i_tab into wa_tab.
> concatenate lv_url i_tab-name '=' i_tab-values into lv_url.
> endloop.
>
> The table i_tab contains about 15 entries. After the 10th in i_tab entry when lv_url contains 255 characters the further entries are not concatenated.
>
In SAP you can concatenate only upto 255 Character..
Hope this helps
Regards
Ritesh j
‎2009 Jul 13 12:57 PM
Thanks Ritesh
I used 2 string variables in place of one and then always used them together. Thanks.
‎2009 Jul 13 8:18 AM
Hi,
There should not be any problem with the Concatenate statement. Check for:
1. loop at i_tab into wa_tab.
concatenate lv_url i_tab-name '=' i_tab-values into lv_url.
endloop.
Since you are filling wa_tab why do you use i_tab-values ?
2. How are you checking whether the values are getting concatenated in lv_url or not. If in debugging then check as lv_url+250(100) and see if you are able to view the values.
Revert.
‎2009 Jul 13 8:20 AM
Hi,
Define ur variable as type of string as said by other experts.
ur problem vil be resolved.
Regards,
Anil.
‎2009 Jul 13 8:24 AM
Hi,
In SAP a char type variable can only store upto 255 characters...so better to use the STRING as the data type.
Pooja
‎2009 Jul 13 8:32 AM
hello,
try using the datatype string instead of char and CONDENSE the varibles before concatenating, this will remove the extra spaces ion between .
Regards
geeta gupta
‎2009 Jul 13 8:33 AM
Hello,
Just wanted to kno....if CONDENSE removed leading spaces also or only in between spaces.
Regards,
Anil.
‎2009 Jul 13 8:39 AM
I think it removes in between spaces......leading spaces are removed using SHIFT <var name> LEFT/RIGHT DELETING LEADING/TRAILING.
hope this help you.
Pooja
‎2009 Jul 13 8:36 AM
This piece of code works just fine..
so no need to change your data type...
DATA lv_final(1000).
DATA lv_var(3).
Do 250 times.
lv_var = sy-index.
CONCATENATE lv_final lv_var INTO lv_final.
ENDDO.
WRITE:/ lv_final+0(10),
/ lv_final+250(10),
/ lv_final+500(10).
Revert if u need more.