Skip to Content

Exception in dynamic where clause in inner join

Hi

Can I use dynamic where clause in inner join. I am getting exception cx_sy_dynamic_osql_semantics .

Thanks

Madhu

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 22, 2015 at 02:19 AM

    Hi Madhumati,

    Sure, dynamical sql should works for inner join,

    SELECT mara~matnr INTO TABLE it_mara

    FROM mara

    INNER JOIN marc

    ON mara~matnr = marc~matnr

    WHERE (' mara~matnr = ''000000000000000023''').

    You`d better paste your code here.

    regards,

    Archer

    Add comment
    10|10000 characters needed characters exceeded

  • May 23, 2015 at 08:37 AM

    Hi,

    View this link.

    Dynamic where clause - ABAP Development - SCN Wiki

    REPORT ytest1.

    tables: mara.

    DATA:gt_params TYPE TABLE OF rsparams,

    gt_ranges TYPE rs_t_rscedst,

    gs_ranges TYPE rscedst,

    gs_params LIKE LINE OF gt_params,

    gv_where TYPE string,

    itab type table of mara.

    select-options: matnr for mara-matnr,

    mtart for mara-mtart.

    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

    EXPORTING

    curr_report = sy-repid

    TABLES

    selection_table = gt_params.

    LOOP AT gt_params INTO gs_params.

    IF gs_params-sign IS INITIAL AND

    gs_params-option IS INITIAL AND

    gs_params-low IS INITIAL AND

    gs_params-high IS INITIAL.

    CONTINUE.

    ENDIF.

    gs_ranges-fnam = gs_params-selname.

    gs_ranges-sign = gs_params-sign.

    gs_ranges-option = gs_params-option.

    gs_ranges-low = gs_params-low.

    gs_ranges-high = gs_params-high.

    APPEND gs_ranges TO gt_ranges.

    ENDLOOP.

    CALL FUNCTION 'RSDS_RANGE_TO_WHERE'

    EXPORTING

    i_t_range = gt_ranges

    IMPORTING

    e_where = gv_where.

    start-of-selection.

    select * from mara into table itab where (gv_where).

    Hope it helpful,

    Regards,

    Venkat.V

    Add comment
    10|10000 characters needed characters exceeded