Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in dealing with xstrings

Former Member
0 Kudos

Hi,

I am trying to read database field of type 'LRAW' (Length 32000) into a workarea of same data type by executing below statement:

SELECT SINGLE bsegment FROM wbtrbseg INTO ls_wbblob

WHERE clid = '123'.

Here, bsegment and ls_wbblob both are of assigned to same data Element of Data type 'LRAW'.

The problem is that value is not getting copied.

Am i missing something ?

I tried to give target field type as 'RAWSTRING' also but with no use.

Any sort of help is really appreciated.

Best Regards,

Sourabh

1 ACCEPTED SOLUTION

0 Kudos

HI,

WHen you want to select a field of type LCHR or LRAW then you have to inlcude its length field in the select.

In any table if there is LRAW then there will be a field before this field which defines its length.

So you need to select first the legnth field then this field.

SELECT LENGTH_LRAW LRAW_FILED FROM TABLE INTO....

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

6 REPLIES 6

0 Kudos

HI,

WHen you want to select a field of type LCHR or LRAW then you have to inlcude its length field in the select.

In any table if there is LRAW then there will be a field before this field which defines its length.

So you need to select first the legnth field then this field.

SELECT LENGTH_LRAW LRAW_FILED FROM TABLE INTO....

Regards,

Sesh

Message was edited by:

Seshatalpasai Madala

Former Member
0 Kudos

Hi Seshatalpasai,

I have tried that also but unfortunately it doesn't work.

I tried below statement where ls_wbblob is modified accordingly:

SELECT SINGLE bseglen bsegment FROM wbtrbseg INTO ls_wbblob

WHERE clid = '123'.

SELECT SINGLE * FROM wbtrbseg INTO ls_wbblob

WHERE clid = '123'.

In both the cases, i just get '00000' sequence in my target ls_wbblob-bsegment field.

Regards,

Sourabh

0 Kudos

Hi,

Are you sure that there is data for the condition you have entered in the query may be try and see with out WHERE clause if you can get any data.

Regards,

Sesh

0 Kudos
DATA:  ls_wbblob TYPE standard table of wbtrbseg occurs 0.

SELECT  *
             FROM wbtrbseg
             INTO TABLE ls_wbblob
             WHERE clid = '123'.

Former Member
0 Kudos

Thanks Sesh and Judith !

May be i can explain my main problem :

I have hexdecimal data in LRAW data type field in database table.

This data is passed to internal table with same data type (with your help).

Now i am passing this internal table for XML Transformation to get the XML.

CALL TRANSFORMATION ....

But the problem is that Transformation truncates any trailing zeros from the Hexdecimal data which comes in LRAW data type and this i do not want.

So, my question is that:

can you suggest some data type where LRAW data can be copied ?

I tried to copy it into RAWSTRING but compiler gives incompatibitliy error

TYPES:BEGIN OF target_struc,

ls_clid TYPE wbkey,

ls_blobno TYPE wbint,

ls_bsegno TYPE wbint,

ls_bseglen TYPE wbint2,

ls_bsegment TYPE smoj_bin, <--- smoj_bin has RAWSTRING datatype

END OF target_struc.

DATA: lt_wbtrbseg TYPE TABLE OF target_struc.

SELECT *

FROM wbtrbseg

INTO TABLE lt_wbtrbseg

WHERE clid = '123'.

0 Kudos

use this FM to convert the LRAW to Xstring and then use it with call transofrmation.

SCMS_BINARY_TO_XSTRING

Raja