Thursday, November 6, 2014

ABAP queries with dynamic WHERE clause

     DATA l_where(100) OCCURS 0 WITH HEADER LINE.
   
     APPEND 'laufd = p_laufd' TO l_where.
     APPEND ' and ' TO l_where.
     APPEND 'laufi = p_laufi' TO l_where.

     SELECT * FROM reguh INTO CORRESPONDING FIELDS OF TABLE it_reguh
     WHERE (l_where).  // Dynamically generate the WHERE clause

1 comment:

  1. Thanks for sharing these. It’s always useful to get pointers to the good blogs out there.
    SAP ERP Users Email List offered by Parana Impact will help your organization fill in the blanks in your databases.

    ReplyDelete