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: 

SELECT statement dynamic

f_allocca
Participant
0 Kudos

Hello experts,

I have to make a program that extracts fields according to a select options, my select already extracts two static fields (fieldA fieldB) and I should add the fields of the select-options in input

example

select-options = 1 - 3

SELECT fieldA fieldB field1 field2 field3

How can I it?

thanks

1 ACCEPTED SOLUTION

ClausB
Active Participant

should help

  DATA lt_sflight type TABLE OF sflight.
  DATA lt_column TYPE TABLE OF char32.

  lt_column = VALUE #( ( 'CARRID' )
                       ( 'CONNID' )
                       ( 'FLDATE' )
                       ( 'PRICE' ) ).

  SELECT (lt_column) FROM sflight INTO CORRESPONDING FIELDS Of TABLE lt_sflight.
3 REPLIES 3

sergey_muratov
Participant

Hi.

May be this link help you.

ClausB
Active Participant

should help

  DATA lt_sflight type TABLE OF sflight.
  DATA lt_column TYPE TABLE OF char32.

  lt_column = VALUE #( ( 'CARRID' )
                       ( 'CONNID' )
                       ( 'FLDATE' )
                       ( 'PRICE' ) ).

  SELECT (lt_column) FROM sflight INTO CORRESPONDING FIELDS Of TABLE lt_sflight.

raymond_giuseppi
Active Contributor
0 Kudos

Press F1 on SELECT statement and look for 'column' in the documentation.