Skip to Content
0
Former Member
Nov 14, 2005 at 05:21 AM

fill the default value in ranges internal table

5454 Views

ranges: rg_ord for vbap-vbeln.

      REFRESH rg_ord[].
      SELECT vbeln AS low
      INTO CORRESPONDING FIELDS OF TABLE rg_ord
      FROM vbap
      WHERE vbeln . . . . some condition.

      IF rg_ord[] IS NOT INITIAL.
        LOOP AT rg_ord.
          rg_ord-sign = 'I'.
          rg_ord-option = 'EQ'.
          MODIFY rg_ord TRANSPORTING sign option.
        ENDLOOP.
        CONCATENATE cond_syntax ' vbap~vbeln in rg_ord'
        INTO cond_syntax SEPARATED BY space.
      ENDIF.

<b>IS there anyway i can avoid the loop</b>. I can think of modifying the sql like this

     SELECT 
      vbeln AS low 
      'I' as sign 
      'EQ' as option
     INTO CORRESPONDING FIELDS OF TABLE rg_ord
     FROM vbap
     WHERE vbeln . . . . some condition.

but regrettably open sql is not allowing literals into the select list.