Tip

Describe Select-Options

Describe Select-Options

Excerpted from Matt Wong's SAP Basis site.


When printing a report, you can print the search conditions or report parameters that the user entered. For instance, if a report output was restricted to plants between 1011 and 1501, you may want to print "Plants Between 1011 and 1501" on the report. This procedure describes the selected parameters.

select-options: sel_opt for sy-datum.
    .
    .
    .
loop at sel_opt.   
  perform describe_select_options using 'Date'
                                        sel_opt-sign
                                        sel_opt-option
                                        sel_opt-low
                                        sel_opt-high
                                  changing datedesc.
  write: / datedesc.
endloop.
    .
    .
    .
*&---------------------------------------------------------------------*
*&      Form  DESCRIBE_SELECT_OPTIONS
*&---------------------------------------------------------------------*
form describe_select_options using 
                             field_name type c   "name to describe field (e.g. "Date")
                             sel_opt_sign like sel_opt-sign
                             sel_opt_option like sel_opt-option
                             sel_opt_low like sel_opt-low
                             sel_opt_high like sel_opt_high 
                             changing descline type c.   "line that will hold
 the one-line description
  if sel_opt_sign = 'i'.
    concatenate 'Include' field_name into descline separated by space.
  else.
    concatenate 'Exclude' field_name into descline separated by space.
  endif.
  case sel_opt_option.
    when 'EQ'.
      concatenate descline '=' sel_opt_low into descline
                  separated by space.
    when 'BT'.
      concatenate descline 'between' sel_opt_low 'and' sel_opt_high
             into descline separated by space.
    when 'NB'.
      concatenate descline 'not between' sel_opt_low 'and' sel_opt_high
             into descline separated by space.
    when 'NE'.
      concatenate descline '!=' sel_opt_low into descline
                  separated by space.
    when 'GE'.
      concatenate descline '>='

    Requires Free Membership to View

sel_opt_low into descline separated by space. when 'LE'. concatenate descline '<=' sel_opt_low into descline separated by space. when 'GT'. concatenate descline '>' sel_opt_low into descline separated by space. when 'LT'. concatenate descline '<' sel_opt_low into descline separated by space. endcase. endform. " describe_select_options

Did you like this tip? If so (or if not) let us know. Send an email to sound off. Or go to our tips page and rate this, and other, tips, or send us one of your own.


This was first published in February 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.