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

SELECT statement dynamic

f_allocca
Participant
0 Likes
1,028

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
Read only

ClausB
Active Participant
930

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
Read only

sergey_muratov
Participant
930

Hi.

May be this link help you.

Read only

ClausB
Active Participant
931

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.
Read only

RaymondGiuseppi
Active Contributor
0 Likes
930

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