‎2009 Mar 12 8:54 AM
Hi all ,
i'm using the below query in which ebeln lenght is 10 and tdnam field lenght is 70.
so its giving error so how to fetch values.
select TDOBJECT TDNAME TDID TDSPRAS
from stxh into corresponding fields of table it_stxh
for all entries in it_ekpo
where TDNAME = it_ekpo-ebeln and
spras = 'en'.
if i don't use for all entries also still its not fetching values
Regards
Suprith
‎2009 Mar 12 9:09 AM
Hi Suprith,
Create an internal table just like it_ekpo, say it_new_ekpo. The onlu difference will be ebeln field in it_new_ekpo will be of type stxh-TDNAME.
Before the select for all entries. Do as below.
loop at it_ekpo into wa_ekpo.
Move-corresponding wa_ekpo into wa_new_ekpo.
wa_new_ekpo-ebeln = wa_new-ebeln.
append wa_new_ekpo into it_new_ekpo.
endloop.
select TDOBJECT TDNAME TDID TDSPRAS
from stxh into corresponding fields of table it_stxh
for all entries in it_new_ekpo
where TDNAME = it_new_ekpo-ebeln and
spras = 'en'.Hope this helps,
Murthy.
‎2009 Mar 12 8:57 AM
take one more internal table and that table should be same as your it_ekpo.
only change in that table should be the VBELN FIELD should be of same type and length which is there in STXH table.
then copy all data of IT_EKPO into new created internal table.
Then fire select Query you will get the result.
‎2009 Mar 12 8:57 AM
For SELECT statement with FOR ALL ENTRIES IN ITAB type and length of field
in WHERE clause should be same.
Create anothe internal table with field TDNAME and move all the data from field it_ekpo-ebeln into target field of new itab and write the SELECT query.
‎2009 Mar 12 8:59 AM
Hi,
Just try the below code...
1) add one more field (ebeln2) in it_ekpo of type tdname.
2) Pass all the data from it_ekpo-ebeln to it_ekpo-ebeln2.
3) Use
select TDOBJECT TDNAME TDID TDSPRAS
from stxh into corresponding fields of table it_stxh
for all entries in it_ekpo
where TDNAME = it_ekpo-ebeln*2* and
spras = 'en'.Since i dont have sap access, could not able to check.
‎2009 Mar 12 9:00 AM
Hi Suprith,
If you are using the Forall entries..the field type should be equal other wise it will give the error..
so take one more filed name tdnam_ebeln at the end of the internal table it_ekpo of type TDNAME at the end of that internal table
do below.
loop at it_ekpo into wa_ekpo
wa_ekpo-tdnam_ebeln = wa_ekpo-ebeln.
modify it_ekpo from wa_ekpo index sy-tabix tranporting tdnam_ebeln.
endloop.
select TDOBJECT TDNAME TDID TDSPRAS
from stxh into corresponding fields of table it_stxh
for all entries in it_ekpo
where TDNAME = it_ekpo-tdnam_ebeln and " here compare with the modified field
spras = 'en'.now it works
Thanks!
Edited by: Prasanth on Mar 12, 2009 2:31 PM
‎2009 Mar 12 9:00 AM
Hello,
You have no option but to make the field ebeln as CHAR70.
You can make the field EBELN of IT_EKPO as CHAR70 & try the select from EKPO.
If the select fails try like this: Select data from EKPO into table IT_EKPO & then loop on IT_EKPO move the all corresponding EBELN to a new table IT_EKPO_CONV which has a field of char70.
Use the table IT_EKPO_CONV to select from STXH.
BR,
Suhas
‎2009 Mar 12 9:07 AM
You''ve given Fieldname SPRAS in the where_clause, but STXH hasn't.
use it as TDSPRAS
where TDNAME = it_ekpo-ebeln and
TDSPRAS = 'en'. " see herethanks|
Mahesh
‎2009 Mar 12 9:09 AM
Hi Suprith,
Create an internal table just like it_ekpo, say it_new_ekpo. The onlu difference will be ebeln field in it_new_ekpo will be of type stxh-TDNAME.
Before the select for all entries. Do as below.
loop at it_ekpo into wa_ekpo.
Move-corresponding wa_ekpo into wa_new_ekpo.
wa_new_ekpo-ebeln = wa_new-ebeln.
append wa_new_ekpo into it_new_ekpo.
endloop.
select TDOBJECT TDNAME TDID TDSPRAS
from stxh into corresponding fields of table it_stxh
for all entries in it_new_ekpo
where TDNAME = it_new_ekpo-ebeln and
spras = 'en'.Hope this helps,
Murthy.
‎2009 Mar 16 4:32 AM
Hey,
Instead use FM READ_TEXT to ready any standard text from STXH table.
Regards
Saravanan