02-08-2007 11:45 AM
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
02-08-2007 11:59 AM
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
02-08-2007 11:59 AM
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
02-08-2007 12:35 PM
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
02-08-2007 12:44 PM
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
02-08-2007 12:51 PM
DATA: ls_wbblob TYPE standard table of wbtrbseg occurs 0.
SELECT *
FROM wbtrbseg
INTO TABLE ls_wbblob
WHERE clid = '123'.
02-08-2007 1:23 PM
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'.
02-11-2007 8:12 AM
use this FM to convert the LRAW to Xstring and then use it with call transofrmation.
SCMS_BINARY_TO_XSTRING
Raja