Probelem with passing parameters to function module
hey i am facing a problem to pass the parameters to function module.let me explain.. we cant pass the parameters which we are using in the select option statements directly to a function module called...i just wanna know if there is any way so that i can pass those values to a fnc module while passing it from select options
Hi,
You have to create a table type in SE11..
Check this sample table type PDSMAINT_MATNR_RNG_T...
Then use that table type in the importing parameter of FM..
PT_MATNR TYPE PDSMAINT_MATNR_RNG_T..
For which field you have created select-options..I will check if there is any existing table type in se11..
Thanks,
Naren
Similar Messages
-
How to pass parameters to function module
Hello,
Can someone suggest how to pass parameter values to BAPI function module from a .NET client? I am using the BAPI_PO_GETDETAILS module and want to pass required parameters to get the item details. Also, please let me know which table should I refer to when retrieving the result. I am using sap .net connector 3.0.
Thanks in advanceHi unosino,
at http://www.se80.co.uk/sapfms/b/bapi/bapi_po_getdetail.htm you can see, that you have to pass po_header and po_address to the function.
You can do that with the nco3 like this:
IRfcFunction rfcFunction = destination.Repository.CreateFunction("BAPI_PO_GETDETAILS");
rfcFunction.SetValue("po_header", /* your value */);
rfcFunction.SetValue("po_address", /* your value */);
rfcFunction.Invoke(destination);
kind regards
christian
Edited by: chrislind on Nov 11, 2011 2:47 PM -
Hi
Im going to use FM: CS_BOM_EXPL_MAT_V2 and I want to only pass WERKS, but when I execute FM is gives exception as CALL_INVALID.
I saw all the Import parameters are Optional, but I think I need to pass more inputs to FM.
Please let me know what are MINIMUM input parameters required to run this FM
ThanksHi
In my requirement, there are range of WERKS and MATNR which has to be given from selection screen, where as In CS_BOM_EXPL_MAT_V2 function module I can only give single value for WERKS and MATNR.
Can any one guide me how can I implement this? -
Hello friends,
I am displaying values ie, amounts in the screen using write statements here i have to display the
sign left side , i am using Function module 'CLOI_PUT_SIGN_IN_FRONT'
Does anybody help me - How to pass paramter into this Function module.
Regards,
PhaneendraIf you look to the code of the function module, you can see it is condensing the value.
I would make a copy of this function, and remove the condense lines to give the result you want.
data: text1(1) type c.
search value for '-'.
if sy-subrc = 0 and sy-fdpos <> 0.
split value at '-' into value text1.
condense value.
concatenate '-' value into value.
else.
condense value.
endif. -
Passing values to function module
Hello Everybody!
I have defined a function group ZSUB_FGROUP1 and within that, I have defined a function module ZSUB_FMOD1. I wish to pass one set of values of following types:
VBELN, POSNR, MATNR, ARKTX, KWMENG, VRKME, NETWR from VBAP
and WAERK from VBAK.
from my main report ZSUB_REP1 to ZSUB_FMOD1, which will then print those values in the form of a list. When I processed the list from within the main report, I used regular methods like top-of-page and all. But, I am not sure how to handle things from within the function module. Please help!Hi...
When u create the function module , we generally provide the import and export parameters....
<b>Import parameters :</b> Which we pass to the function module ..
<b>Export parameters:</b> Which we receive from the function module...
<b>Tables parameters:</b> Tables to pass and to receive to and from the function module...
<b>Changing Parameters:</b> Which we pass to the function module and change these values in the function module and receive those from function module...
So define the fields
VBELN, POSNR, MATNR, ARKTX, KWMENG, VRKME, NETWR ,WAERK in the import parameters with LIKE declaration and corresponding type..
<b><u>Field || Type || Associated Type || Optional || Default ||</u></b>
vbeln || like || vbak-vbeln ||
<b>Optional : </b>If u check this then this field is not mandatory to receive the value..
If uncheck then we have to pass value to this field from the program !! otherwise it gives an error.
In the <b><u>source code</u></b> tab u can write the list output related code with these imported and exported parameters !!
To call the function module we use<b> PATTERN </b>which is present on the application tool bar of the SE38-Editor screen..
Click on this .. u will get a popup ..IN this check the <b>CALL FUNCTION</b> and in the input field of this,, give the function module name... and press enter ...Here u can give values for these imported fields...
reward if it helps u...
sai ramesh -
What are the input parameters for Function Module
Dear Experts,
I want to generate a Sales Tax returns report,those fields are not available in my existing Datasources.
For that i want to write a Generic Datasource with Function Module.
audat
bukrs
vkorg
vtweg
spart
aurat
auart
netwr
mwsbp
kschl zedp(consition type)
kschl zvat(condition type)
ksch zcst(condition type)
matkl material group
Here what are the Input parameters for Function Module.
Thanks in Advance.
Srinivasan.Srinivasan-
For creating a Generic extractor based on a FM, you first of all need to know what is going to be your structure.. i.e. what all fields you need to pull from what all tables. A functional consultant may help you identify the exact DB tables.
Once you know them, hand over the requirement and the pdf mentioned by Krishna to the ABAP guy, he would be able to take this up further.
Also decide 1st whether you would be using a full load or delta. There is a slight difference in the way they are built.
Let me know how it goes.
-Bhushan. -
Need of Changing Parameters in Function Module
Hi All,
Why we need sepearte Import and Export parameters in Function Module if the Changing Parameters
acts as both import and export parameters.
What is the use of using Changing Parametrs in Function Module.
Thanks in advance.
SundaresanHi,
EXPORT PARAMETERS: When u r passing some value to the function, and the parameter will not be changed in the function, we use export parameter. Example: u pass parameter (a : 10) to a function, even after the function has been executed, value of a will be 10 only.
IMPORT PARAMETER: When u require some value back from the function. u do not provide any initial value to the function. Example : u pass a parameter (b: <blank>) to the function, function returns the same import parameter as (b : 20).
CHANGING PARAMETER: When u pass some value to the function and that function may change that value inside function, then changing parameters are used. Example: u pass parameter ( c: 30) to the function as changing parameter and function modifies this variable and return ( c: 50).
Reward points if helpful.
Thanks & Regards
- Rishika Bawa -
What are the parameters of Function Module
Hi,
What are the parameters of Function Module?Function Modules are special external subroutine stored in a central library. The R/3 system provides numerous predefined function modules that you can call from the ABAP/4 programs.
All the function Modules are created under the Function Groups. Function Groups are nothing but the related group of function modules.
The function modules can be maintained through T.CodeSE37 and T.Code SE80.
In general the function module has the following components.
Documentation:
This is the place where you can find the discription/purpose of the function module.
Import & Export Parameters.
Import parameters correspond to the formal input parameters of subroutines. They pass data from the calling program to the function module.
Export parameters correspond to the formal input parameters of subroutines. They pass data from the function module back to the calling program.
Table Parameters.
Table parameters are internal tables. Internal tables are treated like changing parameters and are always passed by reference.
Exceptions.
Exceptions are used to handle error scenarios which can occur in the function modules. The function modules checks for any type of error and raise exception and returns SY-SUBRC value to the calling program.
Source Code:
the programming logic of the function module is written in this source code.
Rewards if useful. -
How to log input parameters for Function Modules?
Hi,
I need to create a Logging system to trace input parameters for function modules.
The log functionality could be done by developing a class method or a function module (For example 'write_log'), and calling it within each function module that I want to log. The 'write_log' code should be independent from the interface of the Function Module that I want to log.
For example, I'd like to write a function/class method that can log both these functions modules:
Function DummyA
Input parameters: A1 type char10, A2 type char10.
Function DummyB
Input parameters: B1 type char20, B2 type char20, B3 type char20, B4 type Z_MYSTRUCTURE
Now the questions...
- Is there a "standard SAP" function that provide this functionality?
- If not, is there a system variable in which I can access runtime all parameters name, type and value for a particular function module?
- If not, how can I loop at Input parameters in a way that is independent from the function module interface?
Thank you in advance for helping!check this sample code. here i am capturing only parameters (import) values. you can extend this to capture tables, changin, etc.
FUNCTION y_test_fm.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(PARAM1) TYPE CHAR10
*" REFERENCE(PARAM2) TYPE CHAR10
*" REFERENCE(PARAM3) TYPE CHAR10
DATA: ep TYPE STANDARD TABLE OF rsexp ,
ip TYPE STANDARD TABLE OF rsimp ,
tp TYPE STANDARD TABLE OF rstbl ,
el TYPE STANDARD TABLE OF rsexc ,
vals TYPE tihttpnvp ,
wa_vals TYPE ihttpnvp ,
wa_ip TYPE rsimp .
FIELD-SYMBOLS: <temp> TYPE ANY .
CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'
EXPORTING
funcname = 'Y_TEST_FM'
* INACTIVE_VERSION = ' '
* WITH_ENHANCEMENTS = 'X'
* IGNORE_SWITCHES = ' '
* IMPORTING
* GLOBAL_FLAG =
* REMOTE_CALL =
* UPDATE_TASK =
* EXCEPTION_CLASSES =
TABLES
exception_list = el
export_parameter = ep
import_parameter = ip
* CHANGING_PARAMETER =
tables_parameter = tp
* P_DOCU =
* ENHA_EXP_PARAMETER =
* ENHA_IMP_PARAMETER =
* ENHA_CHA_PARAMETER =
* ENHA_TBL_PARAMETER =
* ENHA_DOCU =
EXCEPTIONS
error_message = 1
function_not_found = 2
invalid_name = 3
OTHERS = 4
IF sy-subrc = 0.
LOOP AT ip INTO wa_ip .
MOVE: wa_ip-parameter TO wa_vals-name .
ASSIGN (wa_vals-name) TO <temp> .
IF <temp> IS ASSIGNED .
wa_vals-value = <temp> .
ENDIF .
APPEND wa_vals TO vals .
ENDLOOP .
ENDIF.
ENDFUNCTION. -
Difference between Import and Export parameters in Function Module
Hi All,
I am unclear about the import and export parameters, when i create a function module. Can anyone explain abt this. However when i call the function module in any program the import parameters in Function module are displayed as exporting in program amd the export parameters as importing.
Any help on this would be appericiated.
Shejal.HI,
Import parameter in FM is the value u provide to FM for processing.
export is the value u get from FM after processing.
when u call a FM in a progam the import parameter will appear as Export bcos u r giving value to the FM.
and u r getting value from FM in import parameter(bcos u r importing).
rgds,
latheesh
Message was edited by: Latheesh Kaduthara -
How to pass BI Query parameters from Function Module
Hi,
We are executing the BI queries using the Function Module "RS_VC_GET_QUERY_VIEW_DATA_FLAT" by passing the query name and the provider information.
Is there a way, to pass the filter parameter values also to the query by using this function module? I am not sure how the VC tool is using this Function Module to call the BI queries and passing the filter values.
Your help is appreciated.
Thanks
SuriSuryanarayana,
Are you trying to execute a query in batch?. If you want to execute try to look at WRITEQUERY - which is a standard SAP program. You can execute this program directly or you can customize it completely and produce the output in .CSV file.
Hope this helps. Award points if useful.
Goodluck,
Alex (Arthur Samson) -
Pass internal tables in Export Parameters of Function Module
Hi
How to pass internal tables through export parametes of the calling function module. i
think i can pass it by reference ....
if so can anyone suggest how to do it?Hi,
You can Export values of an Internal table in two ways, by :
1) specifying in Tables tab
(Not recommended since it's an obsolete in ECC 6.0)
If used, will reduce the performance of the FM
Tables are always passed by reference
2) specifying in Exports tab.
The parameter should be a Table type (created in se11)
having a Line type that refers to the structure of the data.
Pass by Value is not used for Normal Function modules.
Used usually for RFC enabled FMs.
Cheers,
Remi -
Interface parameters in Function Module -- Doubts
Hi,
We are developing a custom function group which will have 5-6 custom function module. When you create a function module and specify its Export/Import and table parameters, SAP mark them as "Local Interface".(You can look at the Function module source code's first line)
But if you goto the Menu and click Edit>Interface>Globalize parameter and it will change from "Local Interface" to "Global Interface". So now you can use these interface parameters (Export/Emport or tables) without passing them explicitly in perform statement. So in other words they are easily available in the function module.
My question are:
1. Whats the difference between Local interface and Global interface and when should we use which. (SAP normaly use Local interface in all there function modules).
2. If we use Global interface then is it possible that multiple instances (same fuction module called at same time with different or same data) will somehow mix the data from different calls and show unpredictable results.
Will appreciate if someone can help me understand it from conceptual point of view.
Thanks in advance.
JeetHi Jeet,
1). The difference between Local and GLobal are identified by the name itself. One makes the interface locally available and one makes it globally available. This means that, within the function group, you can access the function parameters in subroutines, as well as PBO and PAI modules.
When to use depends, if your function module consists huge code and does massive processing in such cases its better to write subroutines and split the code into smaller sections for parallel processing. In Such cases its better to use Global interface so that you dont have to pass the interface each and every time.
2). Yes it might affect the gloabl parameters as Unlike other global data, the contents of the global parameters of a function module are known only from the time of the call until you leave the module.
Due to this limitations SAP has come up with OOPS concept where the data integrity is maintained.
Cheers
VJ -
Printing options in parameters of function module of smartforms
HI experts,
i hav a loop inside driver program where for every loop it calls smartform and the printing is continuous. But can any one help me how to control this by not displaying LPD. So that directly i can see the preview after all loop passes
Advanced
thanks
KrishHi,
In this I suggest you to capture the data in the OTF format adn append the details after every LOOP pass and finally after ENDLOOP. Now use this OTF data to display the details in PDF where you have option to save the details and Print the form details.
Pass the below variable as 'X' in the control parameters of the Smartform.
ssfctrlop-getotf = 'X'.
Now capture the OTF data return from the Smartform Function Module in the Importing Parameter "job_output_info" as shown below.
data : wa_otf TYPE ssfcrescl,
it_otf type standard table of ssfcrescl with header line.
*ssfctrlop-getotf* = 'X'.
Loop you Internal_table.
*--Call the Smartform Function Module for Displaying the Details
CALL FUNCTION lv_fname
EXPORTING
control_parameters = wa_ssfctrlop
output_options = wa_ssfcompop
user_settings = k_space1
wa_output = p_details
IMPORTING
job_output_info = wa_otf
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
append wa_otf to it_otf.
Endloop.
*--To display the Smartform the PDF format where thr Printing the Form
*--can be done
CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
TABLES
otf_table = it_otf-otfdata. -
RFC hangs with a call to function module SSFC_PARSE_CERTIFICATE
Hello ,
We are working on BI 7.0 SP9 .
When we try to test the RFC connection from the WAS Abap to the portal ( WAS JAVA ) using SM59 , the test is hanging but we can read in the bottom of the screen 'Connexion bcv51sf2... OK' !!!
The test connection works sometimes .
But when its not working , with the debug mode , I can see that the program SAPLSSFG/LSSFGU19 is hanging in the function module SSF_GET_PARAMETER with a call to the function SSFC_PARSE_CERTIFICATE
CALL FUNCTION 'SSFC_PARSE_CERTIFICATE'
EXPORTING
CERTIFICATE = PABCERT
IMPORTING
SUBJECT = STR_PROFILEID
EXCEPTIONS
SSF_KRN_ERROR = 1
SSF_KRN_NOMEMORY = 2
SSF_KRN_NOSSFLIB = 3
SSF_KRN_INVALID_PAR = 4
OTHERS = 5.
ENDIF.
ENDIF.
ENDFUNCTION.
The variable STR_PROFILEID has the value of the field ID of the table SSF_PSE_H
STR_PROFILEID =CN=QWO, OU=XXXXX, O=YYYY, C=FR
Due to this error , we cant transport BI Web templates because at the end of the import in the method execution of the transport there is a call to the portal with the RFC. And the transport is hanging
Thanks in advance for you help .
Happy new year. Milan.Hi Frank ,
See below the result of the test :
Test for function group SSFG
Function module SSF_GET_PARAMETER
Export parameters
Value
APPFOUND
<SYST>
SSFTOOLKIT
SAPSECULIB
STR_FORMAT
PKCS7
STR_PAB
/usr/sap/QWO/DVEBMGS01/sec/SAPSYS.pse
STR_PAB_PASSWORD
STR_PROFILEID
CN=QWO, OU=XXXX, O=YYYY, C=FR
STR_PROFILE
/usr/sap/QWO/DVEBMGS01/sec/SAPSYS.pse
STR_PROFILEPW
STR_HASHALG
SHA1
STR_ENCRALG
DES-CBC
B_INCCERTS
X
B_DETACHED
B_DISTRIB
X
But my problem now , it's that 1 of the 2 RFC is working fine and the other one after 1 good rfc test , is hanging now at the end of the function 'CONVERSION_EXIT_ISOLA_OUTPUT' line 14 !!!
See below the ABAP stack just before the hanging .
1 FUNCTION CONVERSION_EXIT_ISOLA_OUTPUT.
2 *"----
3 ""Lokale Schnittstelle:
4 *" IMPORTING
5 *" VALUE(INPUT)
6 *" EXPORTING
7 *" VALUE(OUTPUT)
8 *"----
9 OUTPUT = SAVE_INPUT(1) = INPUT.
10 CHECK SAVE_INPUT(1) NA ' *'.
11 SELECT SINGLE * FROM T002 WHERE SPRAS = INPUT.
12 CHECK SY-SUBRC = 0.
13 OUTPUT = T002-LAISO.
14 ENDFUNCTION.
Stack Dep Event type Event Program Include Line
10 FUNCTION CONVERSION_EXIT_ISOLA_OUTPUT SAPLLANG LLANGU04 14
9 FORM CONVERSION_EXIT SAPCNVE SAPCNVE 107
8 EVENT SYSTEM-EXIT SAPLDSYA <SYSINI> 20
7 FUNCTION DOKU_OBJECT_EXIST SAPLDSYA LDSYAU09 43
6 FORM FILL_EXCL_TAB RSDBRUNT RSDBRUNT 5.664
5 FORM %_INIT_PBO_LAST RSDBRUNT RSDBRUNT 4.061
4 FORM INIT_PBO RSDBRUNT RSDBRUNT 3.666
3 FORM %_INIT_PBO_NEW RSRFCPIN RSRFCPIN 496
2 MODULE (PBO) %_INIT_PBO RSRFCPIN RSRFCPIN 496
1 EVENT SYSTEM-EXIT RSRFCPIN <SYSINI> 20
As i said in the first post , the RFC test is hanging sometimes but now it seems that it's not hanging everytime at the same line of the abap code , if i can trust the debugger !
...and after another RFC test , now all the RFC to the portal are working ...
It seems that when it's hanging , it's at the end of the functions ( SYSTEM_CALLSTACK
or CONVERSION_EXIT_ISOLA_OUTPUT or SSF_GET_PARAMETER ) .
A memory or OS problem ?
Best Regards. Milan.
Maybe you are looking for
-
Vertical ScrollBar in JScrollPane not working
Hey there chaps, I have set up a JScrollPane with a JTextArea but unfortunately find that when I type text past the vertical space - the scrollbar doesnt resize and the focus doesnt remain on the last line typed... Any ideas what i'm doing wrong? Cod
-
SOLVED iTunes freeze issue by DISABLING "NOW PLAYING" in IM client!!!
SOLVED (for me). I have been scouring posts/forums for three weeks trying to resolve this. I finally stumbled across a suggestion that WORKED! This sounds crazy--I disregarded it, but was willing to try anything... My IM client (Trillain & Gtalk) was
-
Hi Experts, What are the necessary configurations required in SAP New GL for integration with MM and SD modules. We used to do using OBYC and VKOA in old GL, is it the same in New GL also ? Regards Neel
-
EWM CIF Integration Model master data transfer Issue
Hi Gurus, I am not able to transfer the master data from ERP to EWM. When I excecute the transaction CFM1 and CFM2 integration model ,the material is not getting transferred. I am getting the below mentioned Error message. "Location does not exist fo
-
Users for searching catalogs - password problem
Hello all, we have separate generic users for searching through catalogs instead of adding role to each requestor. (if you remember on SRM260 this was one of the proposals, to use CATSEARCH user) This user is defined as Dialog and as company policy i