Select-option parameter passed to function module
hi,
I have passed the select-option parameter as a table to my function module,
suppose i have passed it as date(it contains field date-high and date-low)
In my function module while i am looping the table and selecting the data according to date_low,it is going to select only the data according to date_low.
since the table contains only one row.
loop at date.
select the data according to date_low.
date_low = date_low +1.
modify date_low.
endloop.
how can i select all the data from date_low and date_high?
Hi,
there is issue design of ur FM .
You have to put 2 table parametrs or 2 import paremeters in the FM ,after that with in the Function module fill the internal table of type ranges (say itab).
After filling the ranges internal table, this can be used in ur select stament just as select option ( select ...where podat in itab)
revrt back if any issues.
regards,
Naveen
Similar Messages
-
HOW TO PASS SELECT-OPTIONS PARAMETER TO A FUNCTION MODULE.
Hi friends.
HOW DO U PASS A SELECT-OPTIONS PARAMTER TO A FUNCTION MODULE AS ITS IMPORT PARAMETER(IN MY CASE rfc fM) .
Really urgent!!!
thanks to one and allHi,
If you are passing a single value, its better you take it from s_option-low or s_option-high (select options).
Else if you are passing values to the FM in a loop for all select option values, then better you declare an internal table with type <b>WSELKUNNR</b>.
get low & high fields from each row & pass them.
It will make you clear when you check out your select options in debug mode by entering different combinations of inputs. -
Select options values pass to function module
Hi all,
I want to pass the values entered in the select options to the function module. How should my function module interface be declared for passing the select options
I tried declaring like
t_range type data in the tables tab. But this throws error.
Please let me know how to pass select option values back to function modules.
Thanks,Hi,
Check this code.
data: node_flights type ref to if_wd_context_node.
data: rt_carrid type ref to data.
data: rt_connid type ref to data.
data: isflight type table of sflight.
data: wsflight type sflight.
field-symbols: <fs_carrid> type table,
<fs_connid> type table.
Retrieve the data from the select option
rt_carrid = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'S_CARR_ID' ).
if rs_carrid is not initial. Here you can check that if rs_carrid is no initial then assign value of field symbol
Assign it to a field symbol
assign rt_carrid->* to <fs_carrid>.
endif.
Retrieve the data from the select option
rt_connid = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'S_CONN_ID' ).
if rt_connid is not initial. Here you can check that if rt_connid is no initial then assign value of field symbol
Assign it to a field symbol
assign rt_connid->* to <fs_connid>.
endif.
if <fs_connid> is not initial and <fs_carrid> is not initial.
Retrieve that data from the database. Normally it is suggested to
encapsulate the data retrieval in a separate class.
For simplicity, the SELECT statement has been implemented here.
clear isflight. refresh isflight.
select * into corresponding fields of table isflight from sflight
where carrid in <fs_carrid>
and connid in <fs_connid>.
endif.
Bind the data to the context
node_flights = wd_context->get_child_node( name = `FLIGHTS` ).
node_flights->bind_elements( isflight ).
Hopes this will helps you.
Regard
Manoj Kumar
Edited by: Manoj Kumar on Mar 16, 2009 10:41 AM -
Enabling Select-options in an RFC function module
Hi Abaper's,
I am using BAdi definition NOTIF_EVENT_SAVE for sending mail notification to user.
Under CHANGE_DATA_AT_SAVE method I have called an RFC enabled function module and written code here for mail notification.I used cl_bcs class for sending file.On executing this I am getting a mail box wherein we can enter user id and send mail.But I don't want to use cl_bcs for sending mail now.So I modified the code by including SO_NEW_DOCUMENT_SEND_API1 function.
My requirement is I want to enable select-options in this function module so that user can get a popup wherein he can select user name from master.On activating I am getting following error:
Local SELECT-OPTIONS are not allowed (FORM routine or GET event is active).
Can any one help me how to resolve this error?
I am using this customized function module for mail notification.If I hardcode mail id,notification is working properly.
Regards,
Samsam24 wrote:>
> My requirement is I want to enable select-options in this function module so that user can get a popup wherein he can select user name from master
Hi Sam,
in the function groups TOP include, you can define a selection-screen:
SELECTION-SCREEN BEGIN OF SCREEN 9786 [TITLE title].
select-options: s_uname for ...
SELECTION-SCREEN END OF SCREEN 9786.
and in the function use
CALL SELECTION-SCREEN dynnr
[STARTING AT col1 lin1
[ENDING AT col2 lin2]]
Everything declared in the function body source code is local.
But you must make sure that CHANGE_DATA_AT_SAVE is not processed in update task.
Regards,
Clemens
Edited by: Clemens Li on Jan 16, 2011 7:36 PM -
Select option how to pass in Function Module
Hi Friends
how to pass direct select-option values in a Function Module and later how to retrive the values from FM as well ?
Regards
MeetaHello Meeta
You may use a generic table type like RSELOPTION or RSDSSELOPT_T. However, this requires that you shuffle the data from twice from your specific select-options to this generic select-option and vice versa.
A much simpler way is to import the name of the report from which you want to retrieve its select-options into the function module and within the fm just call fm RS_REFRESH_FROM_SELECTOPTIONS.
Regards
Uwe -
Populating select-option, parameter simultaneously
Hi All,
I have a select option and a parameter on the selection screen. The parameter is disabled for input and enabled for output. The F4 for the the select option has a numeric value and a corresponding text (comes from a standard function module). When I select a value from F4, the numeric value should go to the select-option and the text should go to the input disabled parameter.
At the moment, I am having to press an enter after choosing F4, for the text to reflect in the parameter field. I need both of them displayed at the same time, without having to press an enter.
Please guide me about how I could achieve this.
Thanks and Regards,
Vidya.use this code in your F4 Help of Select Option after F4 Help Function Module .
DATA SCR_FIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE.
SCR_FIELDS-FIELDNAME = ur parameter Name.
SCR_FIELDS-FIELDVALUE = ur parameter value(ur Text Field)
APPEND SCR_FIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = PROG_name
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = SCR_FIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
UNDEFIND_ERROR = 7
OTHERS = 8.
So you need not have to press Enter
Regards,
Alpesh
Edited by: Alpesh on Mar 14, 2009 11:44 AM -
How to pass multi value selection parameter to SAP Function Module?
Hi ,
Anyone know how to pass CR multi value parameter - array to SAP Function module ?
eg multi selection of customer in CR
and then pass to Function module
in SAP FM, the SQL select these customer only
How should the import parameter / table of SAP Function module designed?
and how should CR pass the data to SAP FM
thx
JohnMoved to Integration Kit forum
-
Passing select option parameter to a procedure
Hello, i need to know pass a select option parameter to a procedure. I tried the following
For eg if i have a select option called so_belnr & i call the procedure using the following
PERFORM VALIDATE_DOCUMENT TABLES SO_BELNR USING GJAHR BUKRS , i still cannot use the
select option paramter in the called procedure.
Pls help.Hi,
in topinclude...
data: lr_belnr type RNG_BELNR.
at start-of-sel.....
move so to range..
refresh: lr_belnr.
lr_belnr[] = so_belnr[].
PERFORM VALIDATE_DOCUMENT TABLES lr_belnr USING GJAHR BUKRS .
in form:
... tables lr_belnr like structure of RNG_BELNR.
reason(my definietion): perfom doesn´t know if the select-options is availible.....
bestreg
Robert -
Passing Message number as an parameter in a Function module
Hi all,
I have to pass the Message number(sy-msgno) as an parameter into an function module
and that Message should be like "PO NUMBER ####### is deleted"
This Funtion module is an loop and PO number changes for every loop
How to define this Message in the Message class.
Regards
AjayHi,
Message definition SE91 should be like below.
PO NUMBER & is deleted.
Here & is the place holder where u can pass one value dynamically. If u want to pass 2 dynamic values then u have to use 2 place holder and so on.
eg: PO NUMBER & is deleted by user &.
When u call this message it will display like
PO NUMBER 12345 is deleted by user user1.
Thanks,
vinod. -
Is it necessary to pass RETURN parameter in bapi function module
Hai All,
Is it necessary to pass structure to RETURN parameter in bapi_transaction_rollback function module. If it is not necessary then how can it gives return value. Please give me the answer for this one. some sample code below...
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
IMPORTING
RETURN = i_return.
LOOP AT i_return into wa_return WHERE type EQ c_error.
wa1_out-postdoc = wa_return-message.
ENDLOOP.
Thanks & Regards.
Laxman.Phi
bapi should never throw an error as it might be called for mass data proceessing
and it is prefferred not to hault the proceess bcoz of one or two errors.
that's why the error or success messages are caught and returned in return table.
in bapi_transaction_rollback the return parameter is not necessary as it will work without that as well.
the purpose of rollback bapi is just to undo whatever done before that.
regards
vijay
<b>reward points if helpful</b>
Message was edited by:
vijay sharma -
Wt parameters to pass in function module for particular kunnr fld
wt parameters to pass in function module f4if_int_table_value_request which is mostly preferred in reports instead of search help
for eg i use select-options s_kunnr for kna1-kunnr & prepare i internal table it_kna1.
den how 2 pass s_kunnr fld & it_kna1 in dat above FM for creating f4 functionality for particular s_kunnr fld on selection-screen.
plz send me d code urgentlyCheck below code....
SELECT carrid carrname
FROM scarr
INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF. -
Option to mass migrate function modules in a function group to new SAP box
Hi All,
We have a requirement wherein we have to move all the existing function modules to a new SAP box.
I heard that there is an option to download all function modules in a function group to text files and upload them to a new system at once without much progamming.
Please let me know if anyone knows how to do this.
Thank you,
VasuHi Vasu,
why don't you just use CTS?
Create a transport that contains the objects you want to move. Then. assuming the target system is not in the same CTS landscape, move the files to the transport directory of the target system. Then in STSM goto the Import Queue and select Extras->Other Requests-Add to add your transport to the queue. Then import it as normal.
Cheers
Graham Robbo -
How to use offset for select-option parameter ?
Hi experts
could anybody please let me know how to use offset for select-option parameter. i can able to use offset for table fields, variabiles and all , but don't know how to use for parameters.
following is my code
SELECT-OPTIONS: s_prctr FOR vbsegs-prctr OBLIGATORY.
here "prctr" length is 10.
i'm using two tables 1. vbsegd-bupla
2. vbsegs-prctr
here prctr+6(4) = bupla.
"Bupla" length is 4
SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND bupla IN s_prctr.
the above statement is not working as prctr and bupla lenths are different. here i want to use offset.
SELECT belnr gjahr bukrs prctr sgtxt buzei FROM vbsegs INTO CORRESPONDING FIELDS OF TABLE it_vbsegs FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND prctr IN s_prctr.
this is working as prctr and s_prctr lengths are equal.
could anybody please help me out in this.
Thanks in advance.
regards
satishBelow code will work for you.
SELECT-OPTIONS: s_prctr FOR vbsegs-prctr OBLIGATORY.
RANGES: s_bupla FOR vbsegd-bupla.
s_bupla[] = s_prctr[].
DELETE ADJACENT DUPLICATES FROM s_bupla.
SELECT belnr gjahr bukrs bupla sgtxt buzei FROM vbsegd INTO CORRESPONDING FIELDS OF TABLE it_vbsegd FOR ALL ENTRIES IN it_vbkpf
WHERE belnr = it_vbkpf-belnr
AND gjahr = it_vbkpf-gjahr
AND bukrs = it_vbkpf-bukrs
AND bupla IN s_bupla. -
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?
ShakrHi,
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. -
How to pass value to select-option parameter using SET PARAMETER Command
Hi,
Am passing values to selection-screen fields in report RV13A004 ( used in VK11, VK12 and VK13). using below statement but material number is select-option in this report. am able to pass MATERIAL FROM using SET PARAMETER ID, can i know how to pass values MATERIAL TO range in select-options fields using SET PARAMETER Command ??
Passing values to parameter id
set parameter id 'VKS' field kschl.
set parameter id 'VKO' field vkorg.
set parameter id 'VTW' field vtweg.
set parameter id 'KDA' field erdat.
set parameter id 'MAT' field matnr_from.
Change condition price.
call transaction 'VK12' and skip first screen.
Thanks in advance.
Regards,
Balamurugan.Hi,
instead of using set parameters and dden call transaction use this..........
submit RV13A004 WITH SELECTION-TABLE rspar
Effect
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. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
SELNAME (length 8),
KIND (length 1),
SIGN (length 1),
OPTION (length 2),
LOW (length 45),
HIGH (length 45).
To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
Notes
In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display.
Cheers
Will.
Maybe you are looking for
-
Infinite loop at db_open
Hi! There is another problem on multi-process env. $ pstack 17778 #0 0x0057cc62 in memcmp () from /lib/tls/libc.so.6 #1 0x088652e0 in ?? () #2 0x08291bf6 in __env_setup () #3 0x081ad39e in __db_open () #4 0x082a5639 in __db_open_pp () #5 0x0814dc2c i
-
Change Tracker Authorization error
Dear All, We have set up MDM change tracking application in SAP MDM 7.1 SP6. Inspite of having all Admin authorizations rights in the portal, I receive error : You do not have the authorization to use MDM Change tracker application. Where are the au
-
I did upload CC PS on my wondow 7 pc , it only stays open for 30 sec and geta message and it shuts down
-
Can't load TWAIN plug ion on CS5 photoshop
I have a new Mac Pro OS 10.10 and loaded Photoshop CS5. I went to use my Epson Scanner and the TWAIN didn't show up. I downloaded TWAIN from Epson and it went fine. Opened PS and still no TWAIN. Tried to do the PS Update and it fails to finish, comes
-
I would like to document my Reports for the other developers on the staff and I'd like to know if anyone have tried the 'Report on Reports' functionality within Oracle Report Builder. Is it any good? I have not installed the Report builder tables in