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-OPTIONS

Former Member
0 Likes
667

How can I pass SELECT-OPTIONS to function module generated by SMARTFORM?

1 ACCEPTED SOLUTION
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
644

Hi,

What you can do is FOR the function module DO NOT mention any TYPE that is use GENERIC type like ANY.

And inside the function module you can use RANGES statement of TYPE RANGE OF statement to create a structure that is similar to the structure that a SELECT-OPTION will have.

SIGN, OPTION, LOW and HIGH are the fields of the structure that a SELECT-OPTION will create same kind of structre can be created using TYPE RANGE OF as follows.


TABLES: SPFLI.
SELECT-OPTIONS: sel_crit for SPFLI-CARRID. " 

DATA: range_crit TYPE RANGE OF SPFLI-CARRID. " This is same as above.

Regards,

Sesh

5 REPLIES 5
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
645

Hi,

What you can do is FOR the function module DO NOT mention any TYPE that is use GENERIC type like ANY.

And inside the function module you can use RANGES statement of TYPE RANGE OF statement to create a structure that is similar to the structure that a SELECT-OPTION will have.

SIGN, OPTION, LOW and HIGH are the fields of the structure that a SELECT-OPTION will create same kind of structre can be created using TYPE RANGE OF as follows.


TABLES: SPFLI.
SELECT-OPTIONS: sel_crit for SPFLI-CARRID. " 

DATA: range_crit TYPE RANGE OF SPFLI-CARRID. " This is same as above.

Regards,

Sesh

Read only

Former Member
0 Likes
644

1st convert system genereted FM to ur own FM then pass the select-option

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSMARTFORM'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

FM_NAME = FM_NAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

if sy-subrc <> 0.

WRITE: / 'ERROR 1'.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

call function FM_NAME

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

GS_MKPF = INT_MKPF

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

if sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

Read only

Former Member
0 Likes
644

Hi,

i have some questions to understand your problem. Is the calling program a standard report or is it written in customer namespace? Is your Smart Form a standard Smart Form or a self written one?

Regards

Mark-André

Read only

Former Member
0 Likes
644

Hi,

you can create a "table type" in abap dictionary (tcode se11). There you can hit the menu "Edit->Define as ranges table type" and you get an select-options table. This table type can now be used as an import parameter of your Smart Form.

Regards

Mark-André

Read only

varma_narayana
Active Contributor
0 Likes
644

hii

You can use the Data type DDSHSELOPT (structure in DDIC ) to Declare a parameter under TABLEs to Declare this in Smartforms.

<b>Reward if Helpful</b>