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: 

CL_SQL_STATEMENT - Query problems

arthur_fuscella
Participant
0 Kudos

Hello all,

I doing some tests on SQL classes and I'm having some problems to select data from countries table. The SQL query is not working and I don't know why, please find the sql query below. I did the same sql query on mySQL and it works.

I'm trying to get the country code with texts even without the entry on T005T.

 
DATA:
result     TYPE REF TO cl_sql_result_set ,
stmt       TYPE REF TO cl_sql_statement .

*   set query
me->set_qury( qury ) .

me->result  = stmt->get_stmt( )->execute_query( me->get_qury( ) ) . 

* content of variable qury

            qury  = `SELECT land1, `  &&
                           `spras, `  &&
                    `(SELECT landx FROM T005T `  &&
                                   `WHERE spras = 'EN' `  &&
                                     `AND land1 = ? ), `  &&
                    `(SELECT natio FROM T005T `   &&
                                   `WHERE spras = 'EN' `  &&
                                     `AND land1 = ? )`  &&
                      `FROM T005 `  &&
                      `WHERE mandt = '` && sy-mandt && `' `  &&
                        `AND land1 = ? `  &&
                      `GROUP BY land1, spras` .

Best regards,

Arthur Silva

Edited by: arthurfuscella on Dec 29, 2011 11:36 PM

3 REPLIES 3

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

See my answer in your other thread:

Former Member
0 Kudos

If your question is answered, please mark it as solved.

Rob