Includes in function module
hiya ,
do INCLUDES in the function module all shud be in the same function group??
what iam doing is ..copied the sap standard function module but when iam executing it says <function module cannot be found in the same group>
is it something to do with includes...
plz advise
thanks
Hi
No! U can insert an own you Z-INCLUDE or somethingelse, try to regenerate the index of the program.
Max
Similar Messages
-
Simple Examples on ABAP Objects without using include or function modules
Hi,
I am new to ABAP. I need simple example codes on ABAP Objects. It should not have Includes or Function Modules. Just simple codes, using local & global classes, interfaces etc. I searched the forum and even <<the site that shall not be mentioned>>, but did not find a solution. Kindly help please.
Regards,
Smruthi.
Edited by: Matt on Mar 1, 2009 1:20 PM - forbidden site reference removedHello Smruthi
If you go to the Forum Search and choose the forum ABAP Objects then serach for ZUS_SDN and you will find many of my simple sample reports.
These reports usually do not contain any includes but they may call function modules which makes perfectly sense. For example, if you are still doing a direct table SELECT instead of using an available BAPI (or class) to get a business object then this is a clear sign of poor (=non-ABAP-OO) programming.
Regards
Uwe -
What are the Includes in Function Module...? if the fuction group IS ZSJ_FC..?
How can I access SAP through Internet....?
Moderator Message: Interview-like question(s). Thread locked.
Edited by: Suhas Saha on Sep 30, 2011 11:14 AMHi
No! U can insert an own you Z-INCLUDE or somethingelse, try to regenerate the index of the program.
Max -
Creating Includes for Function Modules
Hi Experts,
Can you please let me know how to create includes for function modules.
I came across this in a standard include program, which was generated by a function library. The includes inside this program where linked to the function modules (when I double clicked on them).
Please let me know how to create it.
Thanks in advance !
Regards,
Anand Patil.Hi,
have a look at the code for better understanding
Declaration of Workareas *
DATA: lwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create,
lwa_data TYPE edidd, " Work area for IDOC
lwa_control TYPE edidc. " Work Area for control rec
Read the control data information of idoc.
loop at idoc_contrl INTO lwa_control Where mestyp = lc_mbgmcr.
Extract the data from the segments.
LOOP AT idoc_data INTO lwa_data
WHERE docnum = lwa_control-docnum and
segnam = lc_item_create.
*->> Set the tabix of the internal table
lv_index = sy-tabix.
Move the Material Document Item Segment data
MOVE lwa_data-sdata TO lwa_e1bp2017_gm_item_create.
Modify the material document item data internal table
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create.
*->> set the changed values to the IDOC SDATA
MOVE lwa_e1bp2017_gm_item_create TO lwa_data-sdata.
*->> Modify the table
MODIFY idoc_data FROM lwa_data index lv_index.
Clear the Work areas
CLEAR : lwa_data,
lwa_e1bp2017_gm_item_create.
ENDLOOP. "LOOP AT t_idoc_data
Call the BAPI function module to create the
appropriate Material Document
CALL FUNCTION 'BAPI_IDOC_INPUT1'
EXPORTING
input_method = input_method
mass_processing = mass_processing
IMPORTING
workflow_result = workflow_result
application_variable = application_variable
in_update_task = in_update_task
call_transaction_done = call_transaction_done
TABLES
idoc_contrl = idoc_contrl
idoc_data = idoc_data
idoc_status = idoc_status
return_variables = return_variables
serialization_info = serialization_info
EXCEPTIONS
wrong_function_called = 1
OTHERS = 2.
IF sy-subrc = 1.
RAISE wrong_function_called.
ENDIF.
endloop.
ENDFUNCTION.
here when we write the statment
PERFORM sub_modify_idocdata changing lwa_e1bp2017_gm_item_create and double click on sub_modify_idocdata .
it will create a include with the name "LZDTSINT052F_GPOMS_GMF01 ".
now we can write the FORM ..END FORM In this inculde.like this.
***INCLUDE LZDTSINT052F_GPOMS_GMF01 .
*& Form sub_modify_idocdata
Modify the material document item data internal table
FORM sub_modify_idocdata
CHANGING pwa_e1bp2017_gm_item_create TYPE e1bp2017_gm_item_create.
contant declaration
CONSTANTS: lc_261(3) TYPE c VALUE '261'.
DATA : lv_aplzl LIKE resb-aplzl,
lv_aufpl LIKE resb-aufpl,
lv_subrc LIKE sy-subrc,
lv_charg LIKE resb-charg,
lv_uom LIKE pwa_e1bp2017_gm_item_create-entry_uom.
CLEAR: pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
*->> Get SAP storage bin & Storage type from the Z table
SELECT lgtyp lgpla
INTO (pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin)
UP TO 1 ROWS
FROM zdtsint050_sttyp
WHERE zstorage_typ = pwa_e1bp2017_gm_item_create-stge_type
AND zstorage_bin = pwa_e1bp2017_gm_item_create-stge_bin.
ENDSELECT.
IF sy-subrc NE 0.
CLEAR: pwa_e1bp2017_gm_item_create-stge_type,
pwa_e1bp2017_gm_item_create-stge_bin.
ENDIF.
PERFORM get_oper CHANGING pwa_e1bp2017_gm_item_create.
Get the Reservation number and Reservation item number
basing on the idoc data.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = pwa_e1bp2017_gm_item_create-batch
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
Start of insertion for R31K993797
CLEAR lv_charg.
SELECT rspos werks lgort
INTO (pwa_e1bp2017_gm_item_create-res_item,
pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
UP TO 1 ROWS
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no
AND matnr = pwa_e1bp2017_gm_item_create-material
AND charg = lv_charg
AND aufnr = pwa_e1bp2017_gm_item_create-orderid
AND vornr = pwa_e1bp2017_gm_item_create-activity
AND ( splkz = 'X' or
splkz = space )
AND bwart = lc_261.
ENDSELECT.
IF sy-subrc <> 0.
End of insertion for R31K993797
SELECT SINGLE werks lgort
INTO (pwa_e1bp2017_gm_item_create-plant,
pwa_e1bp2017_gm_item_create-stge_loc)
FROM resb
WHERE rsnum = pwa_e1bp2017_gm_item_create-reserv_no.
CLEAR : pwa_e1bp2017_gm_item_create-reserv_no,
pwa_e1bp2017_gm_item_create-res_item.
ENDIF.
ENDIF.
get SAP UOM
SELECT SINGLE zsap_uom
INTO lv_uom
FROM zca_uom_conv
WHERE zext_uom = pwa_e1bp2017_gm_item_create-entry_uom.
IF sy-subrc = 0.
pwa_e1bp2017_gm_item_create-entry_uom = lv_uom.
ENDIF.
ENDFORM. " sub_modify_idocdata
*& Form get_oper
Get the operation
<--P_PWA_E1BP2017_GM_ITEM_CREATE_RE Segment
FORM get_oper CHANGING p_pwa_e1bp2017_gm_item_create TYPE
e1bp2017_gm_item_create.
DATA : l_aufpl LIKE afko-aufpl,
l_aplzl LIKE afvc-aplzl.
REFRESH : i_op.
UNPACK p_pwa_e1bp2017_gm_item_create-orderid TO
p_pwa_e1bp2017_gm_item_create-orderid.
Get the reservation and routing number for the order
SELECT SINGLE
rsnum
aufpl
FROM afko
INTO (p_pwa_e1bp2017_gm_item_create-reserv_no,
l_aufpl)
WHERE aufnr = p_pwa_e1bp2017_gm_item_create-orderid.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_NUMCV_INPUT'
EXPORTING
input = p_pwa_e1bp2017_gm_item_create-activity
IMPORTING
output = p_pwa_e1bp2017_gm_item_create-activity.
ENDIF.
ENDFORM. " get_oper
Regards,
nagaraj -
How to find an include's function module
Hi all,
How can we find the fm of an include?
Thanks.Hi..
You can find the FM name using the Include name in this way..
For EG:
INCLUDE<b> LSBDCU14.</b> "BDC_OPEN_GROUP
In this SBDC is the Name of the Function Group.
So in SE37 Open this Function Group SBDC and Check the Include where all the Function modules are stoted.
Now u can find the Include . Double click on this to see the FM.
<b>reward if Helpful.</b> -
Dear Gurus,
Could you explain me why is an include generated for a function module?
After I write a function module, to use this function module, how should I use the generated include?
Regards
SuzieHi,
The FM code is stored in the INCLUDES.
go to SE37- give the FM
u can c the code of the FM.
There u will get the import and export parameters.
if you know the import paramaters u can run the program there itself and test the ouput.
hope u got an idea
Rgds
Anver -
Chang Include by function module
Hi,
Is there any function modules to change an existing 'Include' 'File' in ABAP? I am seeking for the way to control the function pool or abap programm totally by programming.
Thanks !<b>No</b>, this is not support by SAP. You need to manually change the include.
-
Top include in Function module
Hi All,
I have written a select statment in a FM.I want to retain the values selected so that it is available even when the FM is executed next time.Is it possibe to retain values selected by declaring the internal table in the TOP include?
Thanks,
Rakesh.hi Rakesh,
if you declare the internal table in the TOP include, that only means it will be avaliable for each FM in the function group. The internal table will be avaliable, not the data (which is filled with the SELECT statement)!
The question is when do you execute the FM next time? It it's only a while, you can export the data into the memory, import by the next FM call and you don't need to select again. but it only works if it is still the same user, same session. can you enlight the scenario?
thanks
ec -
Syntax error on include of Function Module (user exit) EXIT_SAPLRSAP_002
When I do a syntax check in the a routine within inlude ZXRSAU02 of FM EXIT_SAPLRSAP_002, I get an error. This object has been in production so I must be doing the syntax check incorrectly. The error is 'Field i_t_data is unknown. It is neither in one of the specified tatble nor defined by a 'DATA' statement. This is strange because this field is defined in main body of this user exit. Please advise the correct way to do syntax check.
Thank you.Hi,
The reason for this might be, though it is used in main body- check the main body is not in the routine. Check the field is declared globally, if not try to check the field assigned to what type, & try to re-assign to same one(like your target place where to update the values, continue to Declare& add accordingly.)
- Dileep .C -
Required help on Function Modules and Bapis
Web portal publishing of ERS invoice letters. This involves modification in the BAPI screens to show the invoice PDF instead of printing??
can anyone help me in fixing this issue.hi Anjaneyulu,
open the t-code --> and go to menu system->status-->select the program and open the program-->
selct the tree structure----in the left side the includes screen and function module everthing will show..
or
open the t-code --> and go to menu system->status-->select the program and open the program-->
go to attributes and select the Package..
next----
go to se80--> enter the package --> and dispalay it shows the list of Program , include transaction function modules and bapi's under the pakage
Regards,
Prabhudas -
Function modules and BAPIs for a transactio code
Hi friends,
How i can find the List of function modules and BAPIs being used for a particular transaction code?
for example: I would like to find List function modules and BAPIs being used for the Transaction code
"FBRA"(Reset cleared items)?
Any sort of help on this will be helpful.
Thanks,
Punjaalahi Anjaneyulu,
open the t-code --> and go to menu system->status-->select the program and open the program-->
selct the tree structure----in the left side the includes screen and function module everthing will show..
or
open the t-code --> and go to menu system->status-->select the program and open the program-->
go to attributes and select the Package..
next----
go to se80--> enter the package --> and dispalay it shows the list of Program , include transaction function modules and bapi's under the pakage
Regards,
Prabhudas -
How to get no. of lines in a function module
Dear Experts,
I want to get the no. of lines present in a function module. How can I do it.
For reports/ include I did like
read report 'rep name' into itab.
describe table itab lines wa_line.
But I am not able to do the same for function module. Is there any function module to find the no. of lines?
or is there any other way?
Thanks and regards,
VenkatHI,
In Se37, enter your FM name display,
now Goto --> Mainprogram --> you can see include for function modules
eg: include lalfauxx. " Function Modules
double click the include
you can see the function module names includes
Eg:
THIS FILE IS GENERATED BY THE FUNCTION LIBRARY. *
NEVER CHANGE IT MANUALLY, PLEASE! *
include lalfau01. "CONVERSION_EXIT_ALPHA_INPUT
include lalfau02. "CONVERSION_EXIT_ALPHA_OUTPUT _
double click your functipon module name
eg :lalfau02.
you can follow the same as you did for the report
read report 'rep name' into itab.
describe table itab lines wa_line
This is the Include program name for your function module.
Basically FM is a include program.
eg:
data: begin of itab occurs 0,
text type char2000,
end of itab.
data wa_line type syindex.
read report 'lalfau02' into itab.
describe table itab lines wa_line.
write wa_line.
output 13.
regards,
Nazeer -
Function Module to do "Where-used-list"
Dear sirs,
Please could anyone help me? I'd like to know if there is any FM which I can pass the name of an abap object (program, include, table, function module, etc) and returns the where used list of it in an internal table.
I need to map all transactions that call a report or are using an include.
Thank you in advance,
Fabio PurcinoYou can use the Function Module
RS_EU_CROSSREF
Read the Documentation of the same.
there is one example. -
Se10 : transporting functiongroups and function modules
We have a function group ZGROUP. In this group we have several function modules.(ZXX,ZXX1,ZXX2, etc)
Now we have to make some changes :
One Abap consultant (A) is changing one function module(ZXX) in the group zgroup.
Another Abap consultant(B) is making an new function module(ZYY) in the group zgroup.
In the transport organizer (se10) .
for Consultant A : request(1) with function module ZXX
for Consultant B : request(2) with function group ZGROUP (because he is adding a new module in the group ZGROUP)
Now Consultant(B) has finished with his new function module(ZYY) and is transporting request(2) to the test system.
What happens: The whole functiongroup ZGROUP is transported to the test system including the function module ZXX of the Consultant(A).
Consultant(A) was still working on his changes , but his module (ZXX) was also transported to the test system.
How can we monitoring this.
When consultant(B) is saving his new module there is now warning or message
that another Consultant(A) is changing a function module in the same group.
Greetings,
HarryHi,
Actually there will be no message or warrning. Untill unless import the transport it will not reflect the changes. i.e. as per your example B transport sent to another system also you will not find the changes made by A.
Thanks
Chandra -
Regarding Function module exits
Hi,
function module exit :EXIT_SAPLAFAR_002
include in function module exit :ZXAFAU02
include exit is implemented :LAFARF70
Main Program :SAPLAFAR
Please help me how to execute this funcion moduel exit, and how to work on it, I could not find out any transaction for it, and provide me some links to understand the use of function module exits.
Thanks & Regards,
vinesh.Hi,
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a function module. The code for the function module is written by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is:
EXIT_<program name><3 digit suffix>
The call to a functionmodule exit is implemented as:
CALL CUSTOMER.-FUNCTION <3 digit suffix>
To find a Exit.
Goto Transaction -- Find The Package
SMOD >f4>Use the Package here to Find the Exits In the Package.
Else if you Want to search by Application Area wise ,
There is one more tab to find the Exits in the Respective Application Area.
Implementing the Exit-- CMOD Create ProjectsAssgn your Component .
Now Run ur Transaction to Check if it Triggers.
Thats it..
Suppose you need to find out all the user exits related to a tcode.
1. Execute the Tcode.
2. Open the SAP program.
3. Get the Development Class.
4. Execute Tcode SE84.
5. Open the Node 'Envir. -> Exit Techniques -> 'Customer Exits -> Enhancements'
6. Enter the Development class and execute.
Check out this thread..
The specified item was not found.
1. Type the transaction : system->status-> <PROG. NAME>
2 open SE37 , type EXIT<PROG NAME> and press F4 to get the list of function exits available.
3. Open CMOD utilities->SAP enhancements
EDIT->All selections
4.type the function module name obtained in step 2, in fields 'component name' in 'additional selections' block. and execute.
5. The displayed list contains the enhancements names for the transaction You were looking for.
6. Create a project in CMOD and the code in default include->activate.
http://www.erpgenie.com/sap/abap/code/abap26.htm
which gives the list of exits for a tcode
http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm
For information on Exits, check these links
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
http://www.easymarketplace.de/userexit.php
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sappoint.com/abap/userexit.pdfUser-Exit
http://www.planetsap.com/userexit_main_page.htm
User-Exits
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sap-img.com/ab038.htm
http://www.planetsap.com/userexit_main_page.htm
http://www.sap-basis-abap.com/sapab013.htm
http://sap.ittoolbox.com/documents/popular-q-and-a/user-exits-for-the-transaction-code-migo-3283
These links will help you to learn more on user exits.
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm
http://www.planetsap.com/userexit_main_page.htm
http://www.allsaplinks.com/user_exit.html
www.sap-img.com/abap/what-is-user-exits.htm
Also please check these threads for more details about user exits.
Re: Screen exit
user exit and customer exit
user exit
1. Document on UserExits in FI/CO
http://www.ficoexpertonline.com/downloads/User%20ExitsWPedit.doc
2. Finding User Exits...
http://sap.ionelburlacu.ro/abap/sap2/Other_Useful_Tips.html#Finding_User_Exits
3. List of all User Exits...
http://www.planetsap.com/userexit_main_page.htm
Reward if Helpful.
Maybe you are looking for
-
Does the Calendar extension pack 2.0.6 work in CS3 or CS4?
I downloaded the Calendar extension pack 2.0.6 from the Dreamweaver exchange site and installed it in CS4 with no success. Can't find it anywhere and its supposed to be in Server behaviours > Dreamlettes > ASP Events Calendar Did the same in CS4 - sa
-
Which Apple MacBook Pro has the most RAM and HDD memory?
I would like to know this because I plan on buying a MacBook Pro and I just want to make sure I'm buying the one with the most RAM and HDD memory and not some other one. Why do I need specifically this? Because I'm a gamer; I like playing games. I'm
-
File datalog type conflict???
Bonjour, j'ai quelques soucis sur Labview dont je n'arrive pas a résoudre!!! J'ai réaliser un vi qui permet de lire des données dans un fichier .rdt. Par contre, j'ai le code d'erreur 71 "File datalog type conflict" qui s'affiche et je ne sais pas co
-
Hi All, I displayed data in Grid by using ALV. My requirement is when i double click on any column then i have to call other transaction. How to do this ? Pls help me. Best Regards, praveena.
-
Mail on OSX10.7.3 rejects my pswrd with the following message " iCloud IMAP server "p02-imap.mail.me.com" rejected the password for user xx." This has started this morning. The account on OSx10.7.3 had been working with no problems before today. The