07-02-2007 8:50 AM
the statement have the question:
stxh-tdname length 70
itab-vbeln length 10
select tdobject into table it_stxh
from stxh
for all entries in itab
where ( tdid = 'Z006' and tdspras = 'E' and tdname+0(10) = itab-vbeln and tdobject = 'VBBK' ).
tdname+0(10) = itab-vbeln ???
07-02-2007 9:32 AM
07-02-2007 8:52 AM
the code checks if
the first ten char in tdname match the field itab-vbeln
Regards,
Aparna
07-02-2007 8:56 AM
any variable of char/string type can be accessed char wise..
char_variable+x(w)
this means we are refering to w characters from the xth character
if char_variable = 'APARNA'
then char_variable+0(3) = 'APA'
Regards,
Aparna
07-02-2007 9:08 AM
When you define the first Internal Table ITAB, define vbeln as the same type of stxh-tdname.
Eg.
data: begin of itab occurs 0,
vbeln like STXH-TDNAME,
erdat like vbak-erdat,
end of itab.
START-OF-SELECTION.
Select VBELN
ERDAT
from vbak
into CORRSPONDING FIELDS of table itab.
Then you can directly use this ITAB in the next query
select tdobject into table it_stxh
from stxh
for all entries in itab
where ( tdid = 'Z006' and tdspras = 'E' and tdname = itab-vbeln
and tdobject = 'VBBK' ).
Pls reward it if it is useful.
07-02-2007 9:12 AM
Hi,
This selcts works when the First 10 charecters of the field TDANME should be equals to the VBELN
Regards
Sudheer
07-02-2007 9:19 AM
i dont think it is possible with for all entries ... you can do like this..
data : vtdname(11).
loop at itab.
concatenate itab-vbeln '%' into vtdname.
select single tdobject into it_stxh
from stxh
where ( tdid = 'Z006' and tdspras = 'E' and tdname like vtdname and tdobject = 'VBBK' ).
append it_stxh.
endloop.
regards
shiba dutta
07-02-2007 9:32 AM
07-02-2007 10:55 AM
Hi ,
Please reward with points if the answer was helpful in solving your quesry