Application Development and Automation 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: 
Read only

SQL- Statement: for all entries, where

Former Member
0 Likes
1,001

Hi all, I have a Statement


         SELECT * FROM ltak 
           INTO TABLE lt_help for all entries in gt_tree 
           WHERE bdatu = gt_tree-node_key.

It doesnt want to compile, because the field bdatu is not of the same type like my field node_key.

How can I process this statement, or how can I convert it ?

Thanks,

Regards,

HProkoph

Edited by: Rob Burbank on Dec 17, 2009 9:26 AM

1 ACCEPTED SOLUTION
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
952

Hi,

Just declare one additional field of same length of BDATU as in gt_tree.

Before passing it in for all entries, change the field ias required inside the loop and modify the table.

Then use the new modified field further in for all entries.

6 REPLIES 6
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
953

Hi,

Just declare one additional field of same length of BDATU as in gt_tree.

Before passing it in for all entries, change the field ias required inside the loop and modify the table.

Then use the new modified field further in for all entries.

Read only

0 Likes
952

SOrry, but if I loop over the table gt_tree and then do the "select for all entries in" inside the loop,

I have a very bad performance.

Or do I misunderstand you?

Regards,

HProkoph

Read only

0 Likes
952

Hello,

This is what you were suggested before



"Add a extra field in the internal table gt_tree

data: begin of gt_tree occurs 0,
           ,,,,,,,
           ,,,,,,,
         bdatu1 like ltak-bdatu,
        end of gt_tree.

"before the select statement

loop at gt_tree.
gt_tree-bdatu1 = gt_tree-node_key.
modify gt_tree.
endloop.

SELECT * FROM ltak 
           INTO TABLE lt_help for all entries in gt_tree 
           WHERE bdatu = gt_tree-bdatu1.

Vikranth

Read only

former_member209217
Active Contributor
0 Likes
952

What is the data type of variable node_key?

BDATU is of type DATS 8.

It won' be possible in your select statement with different data type .Declare it as like SY-DATUM

Read only

Former Member
0 Likes
952

Sorry, Jayanthi,

I think I misunderstand your help.

How do I cange the table inside some loop?

That is my question.

The data type of node_key is char(12)

Thanks,

Regards,

Hprokoph

Read only

0 Likes
952

Thank you for replying me, now I understand, what to do.

Thanks,

Regards,

HProkoph