How to activate a function module programatically?
How to activate a function module programatically?
Hi,
You can try the following function module:
RS_FUNCTION_ACTIVATE
Thanks and regards,
S. Chandra Mouli.
Similar Messages
-
Activate/implement function module
Hi,
How to activate/implement function module?
Thx.
Anirudh,hi,
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
Function Modules are Global ABAP programs created by SAP for reusable purpose. They have IMPORT, EXPORT and TABLE parameters, and EXCEPTIONS to through when error occurs.
You can create them from TCode SE37.
Go through the following doc:
Function modules are cross-program, reusable procedures that are organized into function groups, and whose functions are implemented between the statements FUNCTION and ENDFUNCTION. Function modules and their interfaces are created in the Function Builder.
Function Module Interfaces
The parameter interface of a function module is defined in the Function Builder. It includes the definition of interface parameters and the specification of exceptions that can be triggered by a function module. The Function Builder automatically generates comment lines below the FUNCTION statement in the source code of the function module, which represent the interface of the function module with the following syntax:
Syntax
... [IMPORTING parameters]
[EXPORTING parameters]
[CHANGING parameters]
[TABLES table_parameters]
[{RAISING|EXCEPTIONS} exc1 exc2 ...]
The syntax and semantics of IMPORTING, EXPORTING, CHANGING, RAISING, and EXCEPTIONS mainly correspond to the definition of method interfaces with [CLASS-]METHODS. The additional option of defining table parameters using TABLES is obsolete.
Interface parameters
The interface parameters are defined on the relevant tab pages in the Function Builder.
IMPORTING parameters are input parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input parameter. The content of the actual parameter is passed to the input parameter when the call is made. The content of an input parameter for which 'pass by reference' is defined cannot be changed in the function module.
EXPORTING parameters are output parameters. When the function module is called, a suitable actual parameter can be specified for every output parameter. The content of an output parameter that is defined for 'pass by value' is transferred to the actual parameter if the function module is completed without errors. An output parameter that is defined for pass by reference is not initialized when the function module is called.
CHANGING parameters are input and output parameters. When the function module is called, a suitable actual parameter must be specified for every non-optional input or output parameter. When the function module is called, the content of the actual parameter is passed to the input/output parameter, and when the function module is completed, the content of the input/output parameter is passed to the actual parameter.
TABLES parameters are table parameters. Table parameters are obsolete CHANGING parameters that are typed as standard tables with a header line. If an internal table without a header line or a table body is passed as an actual parameter to a formal parameter of this type, an empty local header line is generated in the function module. If an internal table with a header line is used as an actual parameter, both the table body and the header line are passed to the function module. Pass by value is not possible in formal parameters defined using TABLES. Formal parameters defined with TABLES can be replaced by formal parameters defined with CHANGING. A local work area can be created for the internal table in the function module by using the addition LIKE LINE OF itab of the DATA statement.
Exceptions
The exceptions of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception is defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
CALLING A FUNCTION MODULE:
1)In U ABAP Editor --> Click "Patter" ---> Selection Option Button "Call Function"
--> Write the Corresponding FM name --> Hit Enter
2)The appropriate import ,export Parameters will be displayed in ur editor
3)Pass the Values Here.
Check this link:
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db988735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/d94b78ebf811d295b100a0c94260a5/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
regards,
rewards point. -
How to call a function module in VC
Hi,
I want to call a function module for an addition formula which shall calculate and infer the value.
eg. quantities of 5 different characteristics (of numeric data) is to be summed up and inferred against the 6th characteristic.
I want to know the detailed process to create a Variant Function and use it in a dependency.
Request to please advise the steps, type of dependency and its code.
Regards,
Rajesh MohapatraDear Rajesh,
I also wanted to learn how to do that, your post motivated me to use a bit of freetime and investigate on the subject. I finally made my function work, so here are the tips.
The example is very simple, just a variant function with two inputs and which multiplies inside the input values and transfer that result to the output ( 3 x 4 => 12 ).
Deducting how to add five values or any other logic would be easier starting from there.
STEP 1: Create Variant Class for the product. I imagine you already have that. In my case its name is ZVC_CLASS, you have already a material assigned to the class, a configuration profile, etc....
STEP 2: Create Three Characteristics Z_NUM_CH_1,Z_NUM_CH_2,Z_NUM_CH_3 the three of numeric type
STEP 3: Assign characteristics from step 2 into class ZVC_CLASS
STEP 4: Create the function module with the code given below. I put the name ZVC_FUN_TEST
FUNCTION ZVC_FUN_TEST.
""Interfase local
*" IMPORTING
*" REFERENCE(GLOBALS) TYPE CUOV_00
*" TABLES
*" QUERY STRUCTURE CUOV_01
*" MATCH STRUCTURE CUOV_01
*" EXCEPTIONS
*" FAIL
*" INTERNAL_ERROR
*- Inicializar los valores.
DATA:
GV_VALOR_FINAL TYPE CUOV_01-ATFLV,
GV_VALOR_NUM1 TYPE CUOV_01-ATFLV,
GV_VALOR_NUM2 TYPE CUOV_01-ATFLV.
CLEAR:
gv_valor_final,
gv_valor_num1,
gv_valor_num2.
CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'
EXPORTING
ARGUMENT = 'Z_NUM_CH_1'
IMPORTING
VTYPE = P_VTYPE1
SYM_VAL = P_VALOR_SYM1
NUM_VAL = gv_valor_num1
IO_FLAG =
TABLES
QUERY = QUERY
EXCEPTIONS
ARG_NOT_FOUND = 01.
IF SY-SUBRC <> 0.
RAISE INTERNAL_ERROR.
ENDIF.
CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'
EXPORTING
ARGUMENT = 'Z_NUM_CH_2'
IMPORTING
VTYPE = P_VTYPE1
SYM_VAL = P_VALOR_SYM1
NUM_VAL = gv_valor_num2
IO_FLAG =
TABLES
QUERY = QUERY
EXCEPTIONS
ARG_NOT_FOUND = 01.
IF SY-SUBRC <> 0.
RAISE INTERNAL_ERROR.
ENDIF.
*- Calculate final value
gv_valor_final = gv_valor_num1 * gv_valor_num2. "Especifico de c/u.
DATA: VTYPE TYPE CUOV_01-ATFOR.
VTYPE = 'NUM'.
CALL FUNCTION 'CUOV_SET_FUNCTION_ARGUMENT'
EXPORTING
ARGUMENT = 'Z_NUM_CH_3'
VTYPE = VTYPE
NUM_VAL = gv_valor_final
TABLES
MATCH = MATCH
EXCEPTIONS
EXISTING_VALUE_REPLACED = 01.
IF SY-SUBRC <> 0.
RAISE INTERNAL_ERROR.
ENDIF.
ENDFUNCTION.
STEP 5: Activate the function module for Variant Configuration in transaction CU65, put there your function module, release int and in button characteristics write Z_NUM_CH_1,Z_NUM_CH_2,Z_NUM_CH_3. Flag the first two lines as they are inputs.
STEP 6: Create a Dependency ZVC_PROC_TEST of type Procedure to call the function with this code:
000010 Function ZVC_FUN_TEST
000020 (Z_NUM_CH_1 = $root.Z_NUM_CH_1,
000030 Z_NUM_CH_2 = $root.Z_NUM_CH_2,
000040 Z_NUM_CH_3 = $self.Z_NUM_CH_3)
STEP 7: Lets say I want to calculate the multiplication only upon the selection of another characteristic "Calculate" YES/NO. For this I create a characteristic in CT04 Z_CALCULATE type CHAR 1 with possible values Y or N. For the value Y y add the procedure ZVC_PROC_TEST so that formula only activates on Y.
STEP 8: Add characteristic Z_CALCULATE to class ZVC_CLASS
STEP 9: VA01, it should work -
How to debug mapping function module during delta extraction?
Hi experts,
Somehow our delta is not working properly, and i would like to debug our mapping function module. How can i debug it during a delta extraction?
Some info:
Our source system is CRM and our extractor is extracting one order document (contracts in this case). I know that when we modify a contract, a bdoc is generated and then passed throught the mapping function then the extracted data to the delta queue. I just need to debug when the bdoc is being mapped to see what's wrong with the extracted data.
Thanks in advance,
VanHi,
Since you are using a Function Module for the Extraction. Edit the Function Module and give "BREAK-POINT" before the loop command. Check and activate the Function Module.
Now Extract the datasource using RSA3. Now you can debug it. After checking remove the "BREAK-POINT" from the function module. Also Check and activate the same.
Regards
Jayaram M -
How to test a function module?
how to test a function module?
hi there,
ur query is quite old and i think some1 may hav answers it but still i feel this might help you if ur query is still unanswered.
its a total description of how to create a fuction module and executre the same
its a simple example and might help you to understand what and how the things are happening.
see this might be of some help.
to create function module you have to create a a function group.
and then you create function module.
in function module you have to give IMPORT , EXPORT PARAMETER and EXCEPTION.
and also the SOURCE CODE without which the function module will be sytaxtically correct but you will get processing error.
here is the procedure of creating Function Group and Function Module
FOR Group
goto SE37
move to GOTO and the to function groups and create .
just fill the fields poped up.
FOR Module
now in the se37 screen put the name of the function module you want to create and press create .
there will be a pop asking for function group name now here put you function group name which you have created.
now after pressing save you will have a screen in which you have to enter the import, export,exception and the source code.
in import parameter you can put this(for example)
parameter type associate type
num1 type i
num2 type i
export parameter
parameter type associate type
res type i
exception
parameter type associate type
not a valid entry.
source code
res = num1+num2.
if num1 eq 0
raise not a valid entry.
end if
save activate .
and exicute(press8)
award pionts only if helpful
anuj -
How to keep multiple function modules under one Web service
Hi Experts,
I have Three RFC function modules and i need to create one web service for these three RFC function modules. I know How to crearte a web service for one function module.
please suggest me How to keep multiple function modules under one Web service.
Thanks in advance
LakshminarayanaHi Lakshmi,
The best way to do it is to assign all the three RFC Enabled FM's to one function group. Later on the top menu in Utilities you get an option to Create a Webservice from a Function Group.
You can create one single Webservice using all the the 3 FM's.
I hope this helps.
Thanks,
Manu -
How to use read_text function module
Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
thanks,
MaheDear,
Use below code.
DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
V_TDNAME LIKE THEAD-TDNAME.
V_TDNAME = PO_NUMBER.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'F01'
LANGUAGE = 'EN'
NAME = V_TDNAME
OBJECT = 'EKKO'
TABLES
LINES = IT_LINE.
Thanks and Regards, -
How to develope custom function modules in SAP R/3 system to maintain c...
How to develope custom function modules in SAP R/3 system to maintain cross
referencing tables for sales order number.Hi Raja,
Steps to crate FM..
Follow these steps..
Go to the T: code SE37
First You Create Function Group
On That u specify
Function Group Name..............
Short Text..............................
save...
Go to SE 37
Specify the Function Module Name: Eg: Z_Bapi_Materialmaster
Short Text.......
Save...
Next Go to Attributes..
Select Radio button : Remote enabled model
Go to Parameters..
Click Import...
Give Parameter Type Associate type S.t
next Click Export...
Give Parameter Type Associate type S.t
Next Click Tables Button..
Specify tables..
Next click source code button..
Write Source code here..
Eg : Select statements Etc..
Finally we should be select the Radio button Enable remorely
https://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action?pageId=39728
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/abap/bapi%2bstep%2bby%2bstep
Hope this information is useful to you..
Reward points if it is usefulll....
Thanks ,
Satya Kumar.. -
How to use these function modules
Hi all,
can anyone help that how to use these Function modules to update the status of a task, what are all the inputs i required to proceed
1. FC_USER_AUTHORITY_CHECK
<b>2. FC_USER_STATUS_CHECK
3. FC_USER_STATUS_UPDATE</b>
4. FC_USER_GET_CACTI
5. FC_USER_CHECK_FOR_OUTPUT
Thanks in Advance
GaneshHi Rob,
thanks for ur reply,
but they are not clear what they are meant to be, I understood there are some flags needed to run the Function Modules 2 & 3 which are in bold...
but how do i populate them.. i am not getting that..
thanks
ganesh -
How to use BAPI_MATERIAL_AVAILABILITY Function Module at batch level?
How to use BAPI_MATERIAL_AVAILABILITY FM to check material available at batch level?
And another question is what's the meaning of 'CHECK_RULE' in this FM. Thanks!Field name : PRREG
fcheck more details on f1 help...
check_group defines the checking procedure to be used for availability check in individual applications.
along with the checkg group, checking rule specifies the final procedure for chkg..
eg:
ST for stock transport order
AQ for SD order project srock
also chk this help doc.
http://help.sap.com/saphelp_470/helpdata/en/cf/70124adf2d11d1b55e0000e82de178/content.htm
search the forum for sample code..
How to use BAPI_MATERIAL_AVAILABILITY Function Module.... -
How to use BAPI_MATERIAL_AVAILABILITY Function Module....
Hi Experts,
I want to know actual free available quantity (ATP Qty.) for mass materials,
How to use BAPI_MATERIAL_AVAILABILITY function module ?
I have select all material from MARA and inserted in itab.
LOOP AT ITAB.
CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
EXPORTING
PLANT =
MATERIAL =
UNIT =
CHECK_RULE =
STGE_LOC =
BATCH =
CUSTOMER =
DOC_NUMBER =
ITM_NUMBER =
WBS_ELEM =
STOCK_IND =
DEC_FOR_ROUNDING =
DEC_FOR_ROUNDING_X =
READ_ATP_LOCK =
READ_ATP_LOCK_X =
IMPORTING
ENDLEADTME =
AV_QTY_PLT =
DIALOGFLAG =
RETURN =
TABLES
WMDVSX =
WMDVEX =
I dont know how to use it.
pl. guide us.
YusufHi,
data: iwmdvsx type table of bapiwmdvs with header line,
iwmdvex type table of bapiwmdve with header line.
parameters: p_matnr type mara-matnr,
p_werks type marc-werks,
p_meins type mara-meins.
call function 'BAPI_MATERIAL_AVAILABILITY'
exporting
plant = p_werks
material = p_matnr
unit = p_meins
CHECK_RULE =
STGE_LOC =
BATCH =
CUSTOMER =
DOC_NUMBER =
ITM_NUMBER =
WBS_ELEM =
STOCK_IND =
IMPORTING
ENDLEADTME =
AV_QTY_PLT =
DIALOGFLAG =
RETURN =
tables
wmdvsx = iwmdvsx
wmdvex = iwmdvex.
check sy-subrc = 0.
Text
ATP information
Functionality
Using this function module, you can determine the receipt quantity still available for a particular material in a certain plant according to ATP logic (MRPII).
The availability check is carried out on transferring the material number, the plant and the input table (WMDVSX). The scope of the check, that is, which stocks, receipts and issues are to be included in the check is defined by the combination of checking group (material master) and cheking rule. In the function module, the system uses the checking rule defined in Sales & Distribution (A). You can overrule this checking rule by using an interface or a user-exit (exit_saplw61v_001). A similar procedure is also valid for the plant parameters. The customer number in the user-exit means that the plant selection can be controlled via the customer. If no plant parameters are given via the interface, the system uses the parameter 'WRK' saved in the user's fixed values.
The results of the availability check are recorded in the output table (WMDVEX). This table contains dates and available receipt quantities (ATP quantities). The results of the check depends on the following entries:
If no date and no quantity is transferred, the system displays the ATP situation from today's date into the future as the result.
If only a date and no quantity is transferred, the system displays the ATP situation from the corresponding date as the result.
If both a date and a quantity are transferred, the system calculates the availability situation for the quantity specified.
In the last two cases, the parameter 'DIALOGFLAG' is supplied. This can result in the following:
' ' (blank) <=> quantity completely available
'X' <=> only partial quantity available or not available at
all
'N' <=> Material not included in the availability check
(Material not relevant to the availability check)
The system also displays the end of the replenishment lead time (ENDLEADTME).
regards -
How to use SO_OBJECT_SEND function module
Hi friends,
how to use SO_OBJECT_SEND function module in 4.0B Server .hi
good
check this code
REPORT ZTSAPMAIL.
DATA: X_OBJECT_TYPE LIKE SOOD-OBJTP.
DATA: BEGIN OF X_OBJECT_HD_CHANGE.
INCLUDE STRUCTURE SOOD1.
DATA: END OF X_OBJECT_HD_CHANGE.
DATA: BEGIN OF X_OBJCONT OCCURS 10.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJCONT.
DATA: BEGIN OF X_OBJHEAD OCCURS 0.
INCLUDE STRUCTURE SOLI.
DATA: END OF X_OBJHEAD.
DATA: BEGIN OF RAW_HEAD.
INCLUDE STRUCTURE SORH.
DATA: END OF RAW_HEAD.
DATA: BEGIN OF X_RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF X_RECEIVERS.
PARAMETERS: RECEIVER LIKE X_RECEIVERS-RECNAM. " Name
*BUILD MESSAGE HEADER
MOVE 'Sort field goes here' TO X_OBJECT_HD_CHANGE-OBJSRT. " Sort field
MOVE 'Name of the object goes here' TO X_OBJECT_HD_CHANGE-OBJNAM. " Name
MOVE 'Document title goes here' TO X_OBJECT_HD_CHANGE-OBJDES. " Title
MOVE 'F' TO X_OBJECT_HD_CHANGE-OBJSNS. " Functional OBJECT
MOVE 'E' TO X_OBJECT_HD_CHANGE-OBJLA. " Language
Object type of the new document
MOVE 'RAW' TO X_OBJECT_TYPE.
CLEAR X_OBJCONT.
MOVE 'Contents of mail' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
CLEAR X_OBJCONT-LINE. APPEND X_OBJCONT.
MOVE 'More contents' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
MOVE 'Still more contents'
to x_objcont-line.
APPEND X_OBJCONT.
MOVE ' ' TO X_OBJCONT-LINE.
APPEND X_OBJCONT.
Specific header (Dependent on the object type, here RAW)
REFRESH X_OBJHEAD.
DESCRIBE TABLE X_OBJCONT LINES RAW_HEAD-RAWSIZ.
MOVE RAW_HEAD TO X_OBJHEAD.
APPEND X_OBJHEAD.
*RECEIVERS table
CLEAR X_RECEIVERS.
REFRESH X_RECEIVERS.
MOVE RECEIVER TO X_RECEIVERS-RECNAM. " Name
MOVE 'B' TO X_RECEIVERS-RECESC. " Receiver type
MOVE 'X' TO X_RECEIVERS-SNDCP. " Send as a copy
MOVE 'X' TO X_RECEIVERS-SNDEX. " EXPRESS DOCUMENT
APPEND X_RECEIVERS.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
folder_id = 'OUTBOX'
forwarder = x_forwarder
object_fl_change = x_object_fl_change
OBJECT_HD_CHANGE = X_OBJECT_HD_CHANGE
object_id = x_object_id
OBJECT_TYPE = X_OBJECT_TYPE
OUTBOX_FLAG = 'X'
OWNER = SY-UNAME
store_flag = x_store_flag
importing
object_id_new = x_object_id_new
sent_to_all = x_sent_to_all "May need to use
TABLES
OBJCONT = X_OBJCONT
OBJHEAD = X_OBJHEAD
objpara = x_objpara
objparb = x_objparb
RECEIVERS = X_RECEIVERS.
reward point if hlepful.
thanks
mrutyun^ -
How to use ADD_MAINTAIN_COMPLETE function module
how to use ADD_MAINTAIN_COMPLETE function module
please help me.
by using the above function module
how can i change the ADRT table REMARK fieldhow to use ADD_MAINTAIN_COMPLETE function module
please help me.
by using the above function module
how can i change the ADRT table REMARK field -
How to use the function module 'HR_ES_FEATURE_BACKFIELD'
Hi,
How to use the function module 'HR_ES_FEATURE_BACKFIELD'?
I need the usage from both technical as well as functional point of view.
What is the use of this function module and technically how it is to be used to retrieve a feature for a particular employee.hey iam from functional side can u be little bit clear of that feature
thanks
sikindar -
How to identify Which function modules are used in the planning area?
Hi all,
there are couple of function module derviation is used to derive the calendar year, month, fiscal period etc.
But how to identify which function module is used in which planning area?
I cant find out from the where used list from function modules?
Thanks
poojaHi Pooja,
Go to characteristic relationship tab,click on detail icon on extreme left of the derivation,there you will get the name and the details of function module used for derivation.
Regards,
Indu
Maybe you are looking for
-
I have an iPhone 4S, with the latest OS, 5.01 I believe it is. Most everything is great except everytime I have updates to download and install through the app store, I get a message saying "cannot install livingsocial and 6 other apps." The issue is
-
How to select the data from DB and write into File?
Hi Experts, Can any one please help me, I want to write the data from a table "T1" from Data Base to one file in windows. This functionality i need to achive in SSIS package through script component and Execute SQL task if it's passible. If any other
-
After installing the new version of Firefox on an Windows xp computer I cannot use the internet. There is no address bar for entering a URL, there's not back up arrow, I can't get away from the Firefox add-on screne.
-
Help with a hangman class with Gui
Gah, so I'm creating a Java Hangman program using a gui program. Everything was working fine till I started adding the program to the gui. I'm hopelessly confused, and I can't seem to get it working. Help appreciated! Thanks guys... I'm really bad at
-
CS5 trial installation - Preparing to install
I've tried to install the new Photoshop CS5 Extended trial on my laptop but I just can't seem to get it installed. When I start the installer nothing happens (PDapp.exe appears in my task manager though) until I go to my task manager and remove the t