Skip to Content
avatar image
Former Member

select options passed to function module

Hey

I would like to know how r the select-options of a program passed to the function module that is called internally in that program? I want to use this select-options in the function module to fetch frm the database tables?

Shakr

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 20, 2008 at 06:00 AM

    Hi,

    Use ranges in function modules. You can declare in import/export/ changing or tables parameters

    Example of ranges:

    ERDAT_RAN

    ERDAT_RAN

    SHP_R_ERZET

    RVBELN

    ERNAM_RAN

    Please see them in se11.

    Pass the select options in the report to these ranges or use below coding:

    DATA: wa_cmfre LIKE erdat_ran,

    wa_erdat LIKE erdat_ran,

    wa_erzet LIKE shp_r_erzet,

    wa_vbeln LIKE rvbeln,

    wa_ernam LIKE ernam_ran.

    SELECT-OPTIONS: s_erdat FOR vbak-erdat, s_erzet FOR vbak-erzet NO-EXTENSION,

    s_cmfre FOR vbak-cmfre OBLIGATORY ,

    s_vbeln FOR vbak-vbeln NO-EXTENSION,

    s_auart FOR vbak-auart OBLIGATORY, s_bsark FOR vbak-bsark.

    wa_cmfre-sign = s_cmfre-sign.

    wa_cmfre-option = s_cmfre-option.

    wa_cmfre-low = s_cmfre-low.

    wa_cmfre-high = s_cmfre-high.

    IF NOT s_erdat[] IS INITIAL.

    wa_erdat-sign = s_erdat-sign.

    wa_erdat-option = s_erdat-option.

    wa_erdat-low = s_erdat-low.

    wa_erdat-high = s_erdat-high.

    ENDIF.

    IF NOT s_erzet[] IS INITIAL.

    wa_erzet-sign = s_erzet-sign.

    wa_erzet-option = s_erzet-option.

    wa_erzet-low = s_erzet-low.

    wa_erzet-high = s_erzet-high.

    ENDIF.

    IF NOT s_vbeln[] IS INITIAL.

    wa_vbeln-sign = s_vbeln-sign.

    wa_vbeln-option = s_vbeln-option.

    wa_vbeln-low = s_vbeln-low.

    wa_vbeln-high = s_vbeln-high.

    ENDIF.

    IF NOT s_ernam[] IS INITIAL.

    wa_ernam-sign = s_ernam-sign.

    wa_ernam-option = s_ernam-option.

    wa_ernam-low = s_ernam-low.

    wa_ernam-high = s_ernam-high.

    ENDIF.

    you can pass these work areas to function module.

    Thanks,

    Shravan G.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      define the field as ranges and pass the values dynamically

      Ex:

      ranges: gv_range for vbak-vbeln.

      pass

      gv_range-low, gv_range-high ..............

      Regards,

      Ajay

  • avatar image
    Former Member
    Feb 20, 2008 at 06:01 AM

    Hi,

    in the FM in tables option declare a table of type ACE_S_RANGE_TABLE.....

    in program pass ur sel-option table to dat table of fm...

    Cheers,

    jose.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 20, 2008 at 06:09 AM

    Better you can use Ranges instead of select-options.

    Regards,

    ajay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 20, 2008 at 06:18 AM

    Hi,

    FKKCORRR_LAUFD and FKKCORRR_LAUFI

    use these ranges.

    Thanks,

    Shravan G.

    Add comment
    10|10000 characters needed characters exceeded