‎2006 Nov 23 7:50 AM
Hello Friends, I am Goli Pradeep, new to this Community...
I have a doubt in Function Modules...
Program--
types: begin of tw_vbak,
vbeln type vbeln_va,
vkorg Type vkorg,
vtweg type vtweg,
end of tw_vbak,
tt_vbak type standard table of tw_vbak.
data: lw_vbak type tw_vbak,
lt_vbak type tt_vbak,
lf_vbeln type vbeln_va.
selection-screen begin of block b1 with frame title text-001.
<b>*select-options: so_vbeln for lf_vbeln.</b>
selection-screen end of block b1.
start-of-selection.
call function 'z_somefunction'
exporting
lm_vbeln = so_vbeln.
tables
ta_vbak = lt_vbak.
......................................................
...................................................... "REST OF THE PROGRAM CONTINUES
In the above program marked with '*', there generally we declare as
<b>parameters: so_vbeln type vbeln_va.</b>
but I want to pass the range of values to function which is possible through "select-options" only
I came to know that Global data in Function Modules is used for such programs...
Here my intension is to pass the select option value to the function module which contains a range of value, so now in that function module i have to fetch records from database table VBAP in that range...
so friends please guide me to solve this problem...
Message was edited by:
Pradeep Goli
‎2006 Nov 23 7:58 AM
Please check this:
data: vbeln_i type vbeln_va.
select-options: s_vbeln for (vbeln_i).
Kind Regards
Eswar
‎2006 Nov 23 7:52 AM
hi,
u can create a range for that.
Define a range:
Ranges: r_field for <table>.
if not field1 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field1.
append r_field.
endif.
if not field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
r_field-option-low = field2.
append r_field.
endif.
if field1 is initial and field2 is initial.
r_field-sign = 'I'.
r_field-option = 'EQ'.
append r_field.
endif.
select * from <table> where field1 in r_field.rgds
anver
‎2006 Nov 23 7:54 AM
hi Pradeep,
WELCOME TO SDN ...
Use Ranges ..
RANGES:r_balance FOR oiuh_rv_gl-gl_trans_am,
r_prevbal FOR oiuh_rv_cyc-yc_acct_perd_dt,
r_currbal FOR oiuh_rv_cyc-yc_acct_perd_dt.
Regards,
Santosh
‎2006 Nov 23 7:55 AM
Hi,
you can declare "lm_vbeln" import parameter in the function module, of the type 'RSPARAMS' and pass the select option to it.
Parameter needs to be declared as a table.
This u can use it further in the program.
Thanks,
Rashmi.
‎2006 Nov 23 7:58 AM
Please check this:
data: vbeln_i type vbeln_va.
select-options: s_vbeln for (vbeln_i).
Kind Regards
Eswar