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
1,098

hi guys,

I am writing an normal report in se38

in which i am calling an functional module..

Functional module works like this below

wil get list of input through tables and generates output in tables

my requirement is:

I have to pass the values in report which i am getting in selction options

to functional module and print the output of the functional module in the

report.

I am not able to pass the selection option values which i am getting in

report to the functional module

i have to use ranges i guess?

can i have the code for this how to proceed further?

senthil

5 REPLIES 5
Read only

Former Member
0 Likes
934

hi

ssume that you want to import your select-options into your function module(s). Since select-options are, by default, itabs with header lines you have to pass your select-options as following:

CALL FUNCTION 'Z_...'

TABLES

it_selopt = s_akont[].

The TABLES parameter it_selopt could be of type ANY or better of type TABLE.

If you want to use generic select-option structure you can use RSDSSELOPT and the table type TT_RSDSSELOPT. In this case you would need to copy your select-options from s_akont to a generic type s_generic (of type RSDSSELOPT).

Regards

Uwe

Read only

Former Member
0 Likes
934

Hi,

Its simple.

Use

SELECT-OPTIONS <seltab> FOR <f>.

And in the select query check the values using where condition and retrieve the data.

Try this.

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
934

TABLES:ekko.

TYPE-POOLS sscr.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME .

SELECT-OPTIONS :s_ebeln FOR ekko-ebeln .

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

PARAMETERS: r1 RADIOBUTTON GROUP rad1 DEFAULT 'X',

r2 RADIOBUTTON GROUP rad1,

r3 RADIOBUTTON GROUP rad1.

SELECTION-SCREEN END OF BLOCK b2.

DATA wf_dest TYPE gsval.

data: zs_ebeln type zst_ebeln occurs 0.

TYPES: BEGIN OF ty_ebeln,

s_ebeln TYPE ekko-ebeln,

END OF ty_ebeln.

DATA: int_ebeln TYPE TABLE OF ty_ebeln WITH HEADER LINE,

wa_ebeln TYPE ty_ebeln.

DATA: int_sel TYPE TABLE OF rsdsselopt,

wa_sel TYPE rsdsselopt.

*----


  • -------------select-options--------------------

*----


LOOP AT s_ebeln INTO wa_sel.

IF s_ebeln-high IS INITIAL.

wa_ebeln-s_ebeln = wa_sel-low.

APPEND wa_sel-low TO int_ebeln.

ELSEIF s_ebeln-low IS INITIAL.

DO.

wa_sel-high = wa_sel-high.

wa_sel-high = s_ebeln-high.

APPEND wa_sel TO int_ebeln.

CLEAR wa_sel.

ENDDO.

ENDIF.

ENDLOOP.

*s_ebeln[] = int_ebeln[].

*LOOP AT int_ebeln into wa_ebeln.

zs_ebeln[] = int_ebeln[].

CALL FUNCTION 'YSMP_SERVICE_MASTER_UPDATE'

TABLES

S_KONNR = zs_ebeln[]

output = int_update.

Read only

Former Member
0 Likes
934

Hi,

Use the following function module for the same.

call function 'COMPLEX_SELECTIONS_DIALOG'

exporting

text = 'Some text'

tables

range = lr_datum

exceptions

cancelled = 0

others = 1.

if not sy-subrc is initial.

clear: lr_datum, lr_datum[].

endif.

thanks,

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

former_member404244
Active Contributor
0 Likes
934

Hi,

U have to go for tables paramater in ur function module..

CALL FUNCTION <function module name>

TABLES

it_selopt = s_selopt.

now in the source code of the function module u can write

select matnr from mara into table it_selopt where matnr in s_matnr.

now u will get the data into table it_selopt,whcih u can use in the program after the FM..

<b><REMOVED BY MODERATOR></b>

Regards,

Nagaraj

Message was edited by:

Alvaro Tejada Galindo