ALV sorce codes and function modules
Hi Experts,
Can anyone please send me the ALV source codes,the various fuction modules used in it.
Regards,
Narresh
alv is abap list viewer where in u can eliminate the pain of writing the source code
for all manipulations of data on the list.
u have all predifned sort of keys where u can manipulate by using those buttons....
also u can display the list in grid format...
have a look at the most commonly used alv's in these sites..
http://help.sap.com/saphelp_nw04/helpdata/en/66/bc7aab43c211d182b30000e829fbfe/frameset.htm
http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf
hope this helps u...
with regards,
sampath
*award all helpful answers
Similar Messages
-
Processing code and Function Module for IDOC
hi forum,
i m trying to make a file to IDOC scenario,
the IDOC is being sent to a R/3 system,
for the purpose, in R/3 i need to make a inbound processing code, can u tell me how to make a processing code and link it with a Function Module.......
can u guide me....sudheer,
If you are using standard idoc then you do not need to create new processing code.
There would be standard processing code available. You need to set input partner profile with processing code.
Let us know which idoc type you are using for inbound posting.
Anyway..TC for Creating processing code is : WE41(Outbound) and WE42 (Inbound)
Nilesh -
Enhance sorce code in Function module option
Dear Expets ,
Please let me the advantage of the button - enhance source code in the menu bar of the standard function module.
Can i write my own logic there .
I am planning to modify the function module - CK_F_INTERNAL_ACTIVITY_VAL - based on certain condition.
Thanks,
DevHi,
The option mentioned is a part of the enhancement framework provided by SAP to write Implict enhancements
Search for Keyword "Implict enhancements" in SDN and elsewhere to get a brief idea
Using this we can write codes in specific areas of the code as indicated by SAP.
To view these locations -> click on the " enhance source code " button and then go to EDIT->Enhancement Operations -> show Implicit Enhancements ...SAP will highlight the areas where code can be written.
Right Click on the area required->Enhancement Impelemtation -> Create
It asks for a "Enhancement Implementation" as a table control pop-up -> Creata a new one using the "create Icon" and give a suitable name .Your enhancement code will be save under this.
In case you plan to undo the changes,go to the spot created Right Click ->Enhancement Impelemtation -> Undo
Always use the "Where -used list" to analyse the impact of the changes when the function module code is changed and use this "Implict enhancement" only as the last option to edit source code.Implicit options may not always be available for all source codes and at all locations desired.
Hope it helps!
Regards
Byju -
Printing ALV Report output through Function Modules
Hi All,
I want to print my ALV Grid output through function modules/statement (not through print option in menu).
This is because, i am generating a PDF from spool when user clicks on a button. If any changes happened in the ALV output layout, they will be captured in spool through printing it.
So can you please tell me how to print the ALV Output through FMs or sending the ALV output to spool.
Thanks & Regards,
Senthil.
Edited by: senthil nathan on May 17, 2010 2:49 PMHi Dev,
Thanks for the reply.
I want to print the ALV when the user clicks on a button in toolbar. Lets say the user has made some changes to the layout, (E.g hiding a field) and when i print that output it should use the changed layout, If i use the FM suggested by you, i cant acheive this.
If you try to print this manually, the system uses the changed layout and not the original. Thats why i want to know FMs/statement to print.
Regards,
Senthil. -
Difference between bapi and function module
Can you guys tell me what are the differences in calling bapis and function modules?
I see we are calling both as the same way we call function modules. May be for bapis, we need to be careful in declaring and passing those exact structures. Can you please make it clear reg. the differences between them?
I appreciate it.
Thanks!HI,
See these links on help.sap.com
<b>For BAPI:</b>
The data entered in the Internet is transferred to the R/3 System via BAPIs (Business Application Programming Interfaces).
Data in the R/3 System is accessed via BAPIs as well.
A Good Site for BAPI's
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://help.sap.com/saphelp_erp2005/helpdata/en/7c/3ce38765ba11d395fe00a0c94260a5/frameset.htm
<b>For Function Module:</b>
The important use of functional module is it is used by Enhancements.
SAP Enhancements are used to expand the standard functionality within SAP.
Enhancements use function modules and are called from the standard SAP code.
http://help.sap.com/saphelp_erp2005/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm
List of functional modules ( Good Site)
http://www.geocities.com/victorav15/sapr3/abapfun.html
Hope it helps!!!!
Thanks
Sudheer -
What is the difference between subroutine and function module?
What is the difference between subroutine and function module?
Hi,
they can both return values.
FMs are mainly used when a routine is to be performed by many programs.
Subroutines (forms) are generally only executed within one program.
You can perform routines from other programs, but it's not often done.
both forms and FMs are reusable modularization units.
To distinguish we generally say that forms are used for internal modularization and
FMs are used for external modularization.
To decide on which to implement, consider whether you need the content to be used just for a limited program
or wheteher it can be called from many independent programs.
For the first purpose it is better to implement a form whereas for the second we implement an FM.
However, ABAP does not isolate the usage context.
That is; you can call a form from another program within whose code the form is not actually implemented.
However, this requires attention since the form may utilize global variables.
The same issue holds for FMs.
FMs are encapsulated in function groups and function groups may have global variables that can be globally
used by all FMs inside it.
Thanks,
Reward If Helpful. -
Function Groups and Function Modules
Hi,
Can anyone give me the detail steps for creating Function Group and then from that function group creation of function module with example?
Regards,
ChandruHi,
Function Group creation -
A function group is a program that contains function modules. With each R/3 system, SAP supplies more than 5,000 pre-existing function groups.
In total, they contain more than 30,000 function modules. If the functionality you require is not already covered by these SAP-supplied function modules, you can also create your own function groups and function modules.
We can put all the relevant function modules under one function group and all the global variables can be declared in this FG.
FG Creation:
1) Function group can be created in SE80. There choose the 'Function Group' from the list of objects.
2) Then give a name for ur function group (starts with Y or Z) and press ENTER.
3) The click 'YES' in the create object dialog box and give a short desc. for this FG and save.
Function Module:
A function module is the last of the four main ABAP/4 modularization units. It is very similar to an external subroutine in these ways:
Both exist within an external program.
Both enable parameters to be passed and returned.
Parameters can be passed by value, by value and result, or by reference.
The major differences between function modules and external subroutines are the following:
Function modules have a special screen used for defining parameters-parameters are not defined via ABAP/4 statements.
tables work areas are not shared between the function module and the calling program.
Different syntax is used to call a function module than to call a subroutine.
Leaving a function module is accomplished via the raise statement instead of check, exit, or stop.
A function module name has a practical minimum length of three characters and a maximum length of 30 characters. Customer function modules must begin with Y_ or Z_. The name of each function module is unique within the entire R/3 system.
Defining Data within a Function Module
Data definitions within function modules are similar to those of subroutines.
Within a function module, use the data statement to define local variables that are reinitialized each time the function module is called. Use the statics statement to define local variables that are allocated the first time the function module is called. The value of a static variable is remembered between calls.
Define parameters within the function module interface to create local definitions of variables that are passed into the function module and returned from it (see the next section).
You cannot use the local statement within a function module. Instead, globalized interface parameters serve the same purpose. See the following section on defining global data to learn about local and global interface parameters.
Defining the Function Module Interface
To pass parameters to a function module, you must define a function module interface. The function module interface is the description of the parameters that are passed to and received from the function module. It is also simply known as the interface. In the remainder of this chapter, I will refer to the function module interface simply as the interface.
To define parameters, you must go to one of two parameter definition screens:
1) Import/Export Parameter Interface
2) Table Parameters/Exceptions Interface
Then in the FM interface screen, give the following
1) Import parameters
2) Export parameters
3) Changing parameters
Then give
1) Define internal table parameters
2) Document exceptions
You enter the name of the parameter in the first column and the attributes of the parameter in the remaining columns. Enter one parameter per row.
Import parameters are variables or field strings that contain values passed into the function module from the calling program. These values originate outside of the function module and they are imported into it.
Export parameters are variables or field strings that contain values returned from the function module. These values originate within the function module and they are exported out of it.
Changing parameters are variables or field strings that contain values that are passed into the function module, changed by the code within the function module, and then returned. These values originate outside the function module. They are passed into it, changed, and passed back.
Table parameters are internal tables that are passed to the function module, changed within it, and returned. The internal tables must be defined in the calling program.
An exception is a name for an error that occurs within a function module. Exceptions are described in detail in the following section.
Syntax for the call function Statement
The following is the syntax for the call function statement.
call function 'F'
[exporting p1 = v1 ... ]
[importing p2 = v2 ... ]
[changing p3 = v3 ... ]
[tables p4 = it ... ]
[exceptions x1 = n [others = n]].
where:
F is the function module name.
p1 through p4 are parameter names defined in the function module interface.
v1 through v3 are variable or field string names defined within the calling program.
it is an internal table defined within the calling program.
n is any integer literal; n cannot be a variable.
x1 is an exception name raised within the function module.
The following points apply:
All additions are optional.
call function is a single statement. Do not place periods or commas after parameters or exception names.
The function module name must be coded in uppercase. If it is coded in lowercase, the function will not be found and a short dump will result.
Use the call function statement to transfer control to a function module and specify parameters. Figure 19.9 illustrates how parameters are passed to and received from the function module.
sample FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab =
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Example
1 report ztx1905.
2 parameters: op1 type i default 2, "operand 1
3 op2 type i default 3. "operand 2
4 data rslt type p decimals 2. "result
5
6 call function 'Z_TX_DIV'
7 exporting
8 p1 = op1
9 p2 = op2
10 importing
11 p3 = rslt.
12
13 write: / op1, '/', op2, '=', rslt.
Regards,
Shanthi.P
Reward points if useful ****
Edited by: shanthi ps on Jan 26, 2008 12:03 PM -
To use SubRoutines and function modules and include
Hellow Friends ,
Can any body suggest me at waht situations we have to use SubRoutines and function modules and include in an abap report and also i need the standards in an abap program.Hi Rajesh,
You use create subroutines within your programs for those block of codes which are used often within the scope of the development. Function modules are like global subroutines , hence any number programs which might want to use the functionality within the function module can do so.
Creating includes is a good programming prctise, e.g. one for data declerations , one for subroutines, so that it makes the code more reader friendly and also helps in modularizing the program. Also once you put a subroutine in an include, you can use the same subroutine in other programs by referring to the include with the INCLUDE statement in your other programs.
Hence basically they are used for :
1. Reusability
2. Modularization of code (make it more readable)
Hope this is of some help.
Regards,
Aditya -
IDOC message type and message code and function?
Hai...
anyone can explain with example what is IDOC message type and message code and function? how it is used?
regards,
prabakaranHi
An IDoc type can be implemented for various "logical" messages; one message can also be assigned to different IDoc types (m:n relationship).
The message is defined by the values for message type (required), message code (optional) and message function (optional). These three fields belong to the key fields in the partner profiles, which are used, for example, to determine inbound processing. If the 'Message type' field is not maintained (e.g. in the case of a control record from Release 2.1, in which MESTYP did not exist), the IDoc Interface uses the value from STDMES (EDI message type).
If possible, the descriptions of the message type should be linked to the corresponding EDI message type.
The message ORDERS (= message type) identifies purchase orders (outbound) and sales orders (inbound).
Message code or Process Code for Inbound Processing
Code which identifies a process type.
The process type determines which process is used to convert an IDoc to an SAP document.
Process code for outbound processing
Code which identifies the type of data which is to be sent via the IDoc interface.
Using the process code, the IDoc interface finds the application selection module which converts the SAP document into an IDoc.
The process code is only used with applications which perform outbound processing via Message Control (NAST).
Thanks & Regards
Kishore -
RE:Idoc type and function module
HI All
What are the generic IDoc types and function modules used for the following objects ??We are on SAP R/3 4.7.
Invoice Release (inbound)
Payments (outbound)
Purchase Orders (outbound)
Goods Receipts (outbound)
Cost Centers (outbound)
GL Codes (outbound)
Internal Orders (outbound)
WBS (outbound)
Materials (outbound)
Invoices (inbound)
Invoices Blocked (outbbound)
And How do i judge which IDOC types and function module fit my requirement( I mean what are the things i have to keep in mind while choosing idoc types and function modules)?
Any help will be very much appreciated
Thank you
SteveHi Steve...
You can find the IDOC types in Tcode WE30 , WE60.
Invoice Release (inbound)
INVOIC03
Payments (outbound)
Purchase Orders (outbound)
ORDERS03
Goods Receipts (outbound)
ACC_GOODS_MOVEMENT02
Cost Centers (outbound)
GL Codes (outbound)
Internal Orders (outbound)
WBS (outbound)
Materials (outbound)
MATMAS04
Invoices (inbound)
ACC_INVOICE_RECEIPT03
Invoices Blocked (outbbound)
<b>REWARD IF HELPFUL.</b> -
Diff b/w BAPI and Function Module.
What is the difference between BAPI and Function Module....
By Interface programming do we mean posting data thru BAPI,BDC....Hi Alex,
BAPI: Standard Interface in the R/3 system that allows the system to communicate with components of other business suites.
FM: These are the procedures that are defined in the Function Groups and can be called from any ABAP Program. FM allow you to encapsulate and reuse global functions int he R/3 system.
The main basic difference between BAPI and FM are
1) All BAPIs are FM but not all FMs are BAPIs
2) BAPIs are remote enabled
3) BAPIs interface will not have a changing and exceptions. They can not be used to have use dialog.
Interface programs can post data to SAP either through a BDC, BAPI, IDOC etc. It depends on the type of requirement.
Hope this solves your question.
Enjoy SAP
Rajasekhar -
Standard Macro and Functional Module in HR -Programming.
Hi friends,
Could i know the difference between a standard macro and a function module in hr programming.
how do we have to use that and what are the different std macro's and functional modules used in HR-Programming...
Thanks in Advance..
Regards
ShivaYou will find the macros in table TRMAC .
Macros are set of pre defined instructions .
You can define your own macros in the program using 'definition' command or use standard macros.
you will find most of the HR function module starting with HR* or RH * .
You can get Macro definition / its fundamental difference with function module on web .
Hopw this is helpful -
Tracing Form and Function modules using SE30
Hi,
I want to trace only the Forms and function modules that are executed by a program using SE30. I have tried setting the variants in different ways but it still gives lot of junk information which i dont need. How can I set up the variant so that it only traces Forms and function modules executed by a program?
Will give points to right answer. Thanks for readingHi Srikrishna,
First of all create a vraian tin SE30. While creating the variant, in th Tab 'Duratn/Type' select the radio buton 'NONE'. Now execute yur program and then analyse.Select 'GROUP HIT LIST' Icon which gives Function Modules,Subroutines etc.
Regards,
Srinivas. -
Assigning of process code to function module
hi all,
please let me know where to go for assigning teh process code to function module. i am unable to get the function module from the process code(we42). please let me know
thank you
chanIn WE42 itself we can assign the process code to a FM.
select new entries.
Enter a process code name & description.
Enter Ur FM in Identification Field.
Now select Processing by Function module in Processing type.
Save it.
For outbound do the same thing in WE41 tcode -
I need to know thelist of bapi's and function modules used for transaction
I need to know thelist of bapi's and function modules used for transaction in order to use these FM or BAPI in reading some fields of equipment master and functional loocation.Can any one suggest me some methods...or do i need to write a report for the same.
Steps to find the BAPI/function modules used in a transaction
1) Find the package of the transaction thro' SE93.
For example the package for the transaction VA03 is VA
2) Go to Se80, key-in the package (say VA)
3) You can see the function modules under the folder finction group and
you can see the BAPI's under the folder Business Engineering-> Business Objects-> double click on the released methods of the Business Objects
Maybe you are looking for
-
Apple TV External Hard Drive (again)
I realize that there have been a TON of questions about hooking up an external hard drive to an Apple TV. Much of what I've read says that it can't be done without unsupported 3rd party software. I've also read that you need to have iTunes running on
-
Hi, can somebody help me with the prerequisite steps for Extraction like - assigning logical system and RFC destination for BW and R/3. also the step-by-step for all types of Generic and Business content... extraction steps. thanks.
-
Crazy MacBook wont boot up...help!
My friend has brought her intel macbook to me to fix (i am her personal Apple care repairman!) and we have the following problem... 1. She installed the Firmware update (she thinks) 2. At start up there is only the grey screen, apple logo and the spi
-
Printing issue when converting an .indd file to .pdf
All, I have two .indd files that loose color when printing after .pdf conversion. The first file looses all color and changes the text font. The second file prints correctly on the first page but not the second. The seond .indd file looses it's color
-
Apple TV 3 - Very small subtitles
Hello, I just bought an Apple TV 3 and had it updated to the latest version 5.2 I then tried to play an M4V on my iTunes 11 and airplay it on the Apple TV. The subtitles are really small, up to a point that I can not view the movie properly. I myself