2012 Jun 14 9:36 AM
Hi,
I would like to store bits in a xstring. Notice that the xstring has a variable length. The length can not be predefined.
To set the bit "1" at position "100" for example, I wrote the following code :
DATA : lw_x TYPE xstring.
set bit 100 of lw_x.
It does not work :after execution, my xstring has a length "0" and the 100th bit is not set.
Could you please advise ?
Regards,
G.
2012 Jun 14 10:58 AM
Hi,
DATA lw_x(200) TYPE x.
set bit 100 of lw_x.
Then you can assign that to the XSTRING variable.
Not tested it though.
Please check.
Thanks,
Shambu
2012 Jun 14 12:24 PM
Thanks Shambu for your anwer. Your solution works but it does not match my need :
I'd like to avoid to initiate my variables with a "Max fixed size" (I will deal with huge amount of data and I would like my program to be as performant as possible in term of memory comsumption).
In your suggestion, I allocate 200 bits in memory but only the first 100 bits are relevant.
Regards,
G.