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

[PERSISTENCE CLASS] SELECT OPTION in WHERE statement

Former Member
0 Likes
628

Hi Gurus,

I would like to know how could I code the WHERE statement with a SELECT OPTION, in Persistence Class ?

Currenlty, I would like to code this kind of request :

          DELETE FROM      ziTab

                         WHERE   zdate IN so_date.      

Do you know, how could I code it ?

Many thx for helps.

Best regards.

Rachid.

Hi Gurus,

I would like to know how could I code the WHERE statement with a SELECT OPTION, in Persistence Class ?

Currenlty, I would like to code this kind of request :

          DELETE FROM      ziTab

                         WHERE   zdate IN so_date.      

Do you know, how could I code it ?

Many thx for helps.

Best regards.

Rachid.

3 REPLIES 3
Read only

former_member201275
Active Contributor
0 Likes
574

How about something like this:

data: ziTab2 like ziTab.

SELECT * from ziTab

appending table ziTab2

WHERE zdate IN so_date.

ziTab[] = ziTab2[]

Read only

0 Likes
574

Sorry Glen,

Unfortunately, I am trying to find the correct syntax to use a SELECT OPTION in a Query Request of Persistence Class:

Something like that:


SELECT-OPTIONS so_date     FOR    sy-datum                      .
DATA lo_query_manager TYPE REF TO if_os_query_manager           .
DATA lo_query         TYPE REF TO if_os_query                   .
DATA lo_agent         TYPE REF TO zca_persistence_zint_rsbankinv.
DATA lo_base          TYPE REF TO zcb_persistence_zint_rsbankinv.
DATA lo_rsbankinv     TYPE REF TO zcl_persistence_zint_rsbankinv.
DATA lo_table         TYPE        osreftab                      .
DATA ls_table         TYPE REF TO zcl_persistence_zint_rsbankinv.
DATA ls_tmp           TYPE REF TO object                        .
DATA lv_string        TYPE        string                        .
DATA lo_exception     TYPE REF TO cx_root                       .
TRY .

   lo_agent    = zca_persistence_zint_rsbankinv=>agent.

* Create Query
   lo_query_manager = cl_os_system=>get_query_manager( ).
   lo_query         = lo_query_manager->create_query( i_filter     = 'ZEXDAT IN PAR1' ).

   lo_table         =
   lo_agent->if_os_ca_persistency~get_persistent_by_query(
   i_query = lo_query
   i_par1  so_date
   ).

   LOOP AT lo_table INTO ls_tmp.
     ls_table ?= ls_tmp        .
     lv_string = ls_table->zget_all_fields( ).
     WRITE lv_string.
   ENDLOOP.


CATCH cx_root INTO lo_exception.
   lv_string = lo_exception->get_text( ).
   WRITE lv_string.
ENDTRY.

But I have an error message :

Syntax error when parsing a query : Excepected symbol 'IN' (row: O, column: 7)

Any idea ?

Read only

0 Likes
574

Hi, I think I already answered this here:

Cheers,

Custodio