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

FM RS_REFRESH_FROM_SELECTOPTIONS

Former Member
0 Likes
747

Hi,

Is there any FM which do reverse of FM RS_REFRESH_FROM_SELECTOPTIONS.

Above FM returns data from selection screen in an internal table of type RSPARAMS.

My requiernmrnt is opposite of this.I have internal table of type RSPARAMS with data. How can i load this data on selection screen. Is there any FM ofr this.

<REMOVED BY MODERATOR>

Regards

Edited by: Alvaro Tejada Galindo on Feb 25, 2008 2:20 PM

Hi,

Is there any FM which do reverse of FM RS_REFRESH_FROM_SELECTOPTIONS.

Above FM returns data from selection screen in an internal table of type RSPARAMS.

My requiernmrnt is opposite of this.I have internal table of type RSPARAMS with data. How can i load this data on selection screen. Is there any FM ofr this.

<REMOVED BY MODERATOR>

Regards

Edited by: Alvaro Tejada Galindo on Feb 25, 2008 2:20 PM

4 REPLIES 4
Read only

Former Member
0 Likes
647

Hi,

You can do this in at selection-screen output event.

at selection-screen output.

Pass the values to selection screen parameters.

Thanks,

Sriram Ponna.

Read only

0 Likes
647

Yes correct but my problem is

I have an internal table with fields parameter name and parameter value .

Row1: P_A Value

Row2: P_B Value

How to proceed in this condition.

Read only

Former Member
0 Likes
647

Hi Ashish,

I couldn't find any standard function for that, unfortunately. So I created one, below. The only thing to be aware of, is that the report must be in memory when the function is called.

sandra

FUNCTION z_selectoptions_to_selscreen .
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(CURR_REPORT) LIKE  RSVAR-REPORT
*"  TABLES
*"      SELECTION_TABLE STRUCTURE  RSPARAMS
*"  EXCEPTIONS
*"      PROGRAM_NOT_LOADED
*"      NAME_NOT_IN_PROGRAM
*"      INVALID_KIND
*"      NAME_IS_NOT_A_SELECT_OPTIONS
*"----------------------------------------------------------------------

  DATA ls_selection TYPE rsparams.
  DATA l_fieldname TYPE fieldname.
  FIELD-SYMBOLS <l_any_selopt_itab> TYPE STANDARD TABLE.
  FIELD-SYMBOLS <l_any_selopt> TYPE ANY.
  FIELD-SYMBOLS <l_any_field> TYPE ANY.

  CONCATENATE '(' curr_report ')SY-REPID' INTO l_fieldname.
  ASSIGN (l_fieldname) TO <l_any_field>.
  IF sy-subrc NE 0.
    RAISE program_not_loaded.
  ENDIF.

  LOOP AT selection_table INTO ls_selection.
    CONCATENATE '(' curr_report ')' ls_selection-selname INTO l_fieldname.
    CASE ls_selection-kind.
      WHEN 'S'.
        CONCATENATE l_fieldname '[]' INTO l_fieldname.
        ASSIGN (l_fieldname) TO <l_any_selopt_itab>.
        IF sy-subrc NE 0.
          RAISE name_not_in_program.
        ENDIF.
        APPEND INITIAL LINE TO <l_any_selopt_itab> ASSIGNING <l_any_selopt>.
        IF sy-subrc = 0.
          ASSIGN COMPONENT 'SIGN' OF STRUCTURE <l_any_selopt> TO <l_any_field>.
          IF sy-subrc NE 0.
            RAISE name_is_not_a_select_options.
          ENDIF.
          <l_any_field> = ls_selection-sign.
          ASSIGN COMPONENT 'OPTION' OF STRUCTURE <l_any_selopt> TO <l_any_field>.
          IF sy-subrc NE 0.
            RAISE name_is_not_a_select_options.
          ENDIF.
          <l_any_field> = ls_selection-option.
          ASSIGN COMPONENT 'LOW' OF STRUCTURE <l_any_selopt> TO <l_any_field>.
          IF sy-subrc NE 0.
            RAISE name_is_not_a_select_options.
          ENDIF.
          <l_any_field> = ls_selection-low.
          ASSIGN COMPONENT 'HIGH' OF STRUCTURE <l_any_selopt> TO <l_any_field>.
          IF sy-subrc NE 0.
            RAISE name_is_not_a_select_options.
          ENDIF.
          <l_any_field> = ls_selection-high.
        ENDIF.
      WHEN 'P'.
        ASSIGN (l_fieldname) TO <l_any_field>.
        IF sy-subrc NE 0.
          RAISE name_not_in_program.
        ENDIF.
        <l_any_field> = ls_selection-low.
      WHEN OTHERS.
        RAISE invalid_kind.
    ENDCASE.
  ENDLOOP.

ENDFUNCTION.

Read only

uwe_schieferstein
Active Contributor
0 Likes
647

Hello Ashita

Not sure if this is helpful in your scenario but have a look at the documentation of ABAP statement SUBMIT:


SUBMIT  ... WITH SELECTION-TABLE rspar.

"If you specify this addition, parameters and selection criteria on the selection screen

are supplied from an internal table rspar. You must specify an internal table

with the row type RSPARAMS for rspar...."

Regards

Uwe