Use of text elements in wirte_form function module.
Hi guru's,
Could any one tell me what is the use of text elements in write_form functional module SAP SCRIPTS. As per my knowledge text elements are used for multi language purpose is there any other advantage other than that.
Thanks in advance.
Vardhan.
Hello.
A text element is a block in script that can be written several times in your document. You can put fixed texts, variables, include texts, images, etc etc
When you see WRITE_FORM, element 'X', you know that everything that is inside element /E X of your script is writen. It's very usefful to organize your script, and it eases to construct a very complex script.
It's also usefull to translations in SE63.
Best regards.
Valter Oliveira.
Edited by: Valter Oliveira on May 27, 2008 10:05 AM
Similar Messages
-
Use of text element in function module
hi friends what is the use of text element i.e list headings, selection texts,text symbols in a function module. where a can see these things after giving some text into it and activated.
kumar.hi
<b>Text Symbols</b>
A text symbol is a named data object that is generated when you start the program from the texts in the text pool of the ABAP program. It always has the data type c. Its field length is that of the text in the text pool.
Text symbols, along with the program title, list headings, and selection texts, belong to the text elements of a program. Text elements allow you to create language-independent programs. Any text that the program sends to the screen can be stored as a text element in a text pool. Different text pools can be created for different languages. When a text element is changed or translated, there is no need to change the actual program code. Text elements in an ABAP program are stored in the ABAP Editor (see Text Element Maintenance).
In the text pool, each text symbol is identified by a three-character ID. Text symbols have a content, an occupied length, and a maximum length.
Examples for text symbols in an ABAP program:
ID
Contents
Occupied length
Maximum length
010
Text symbol 010
15
132
030
Text symbol 030
15
100
AAA
Text symbol AAA
15
15
In the program, you can address text symbols using the following form:
text-###
This data object contains the text of the text symbol with ID ### in the logon language of the user. Its field length is the same as the maximum length of the text symbol. Unfilled characters are filled up with spaces. You can address text symbols anywhere in a program where it is also possible to address a variable.
If there is no text symbol ### in the text pool for the logon language, the name text-### addresses the predefined data object space instead.
You can also address text symbols as follows:
... 'textliteral'(###) ...
If the text symbol ### exists in the text pool for the logon language, this is the same as using text-###. Otherwise, the literal 'textliteral' is used as the contents of the text symbol. This is only possible at positions in the program where a variable can occur. You can create a text symbol for any text literal by double-clicking the literal in the ABAP Editor and replacing the literal with the text symbol.
You should use text symbols in your program whenever they need to be language-specific - for example, in a WRITEstatement.
If you program a list whose layout depends on field lengths, you should be careful, since the field length of text symbols will be different in different languages. You should therefore set the maximum field length of the field symbol so that there is enough space to translate it into other languages. For example, the English word 'program' has seven letters, but its equivalent German translation 'Programm' has eight.
The following example shows the use of text symbols in WRITE statements.
SET BLANK LINES ON.
WRITE: text-010,
/ text-aaa,
/ text-020,
/ 'Default Text 030'(030),
/ 'Default Text 040'(040).
If the text symbols of the above screen shots are linked to this program, the output looks as follows:
Text symbols 020 and 040 have no text symbols. For text symbol 020, the system displays a space. This is only displayed in this case because the blank line suppression has been turned off (see Creating Blank Lines).
regards
ravish
<b>plz reward if helpful</b> -
Hi all,
I have created a window and giving text elements in that window.Now i m Adding a lin of type /E in change editor to use text element.i needed it it to specify text elements in SPRO transaction.
So for that i want to add text elements in Form in SPRO transaction.
Also want to know that is it possible to use condiitons in Text elements?
Suggess me it's Urgent for implement.
<b><REMOVED BY MODERATOR></b>
Thanks
Sanket sethi
Message was edited by:
Alvaro Tejada GalindoHi
Text elements in SAPscript are the individual text components of a form. In the different windows, you can define text elements with different attributes. For printout, the print program accesses them. Text elements can also contain variables (symbols) and SAPscript control statements.
In simple words, Text Elements are the only way to transfer the data from report program to FORM using WRITE _FORM FM.
Check this link(Very Helpful) :
http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db38b494511d182b70000e829fbfe/frameset.htm
You can define the text elements in sap script to group the texts that you want to display...like a condition..
Ex..
/E TEXT1
P1 This is a first text element..
Then use WRITE_FORM function module to call the text element
CALL FUNCTION 'WRITE_FORM'
ELEMENT = 'TEXT1'.
You can also call the write_form function module within a loop..
Check this link(Very Helpful) :
http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db38b494511d182b70000e829fbfe/frameset.htm -
What is the use of text elements in scripts
pls tell me what is text element?can we use this in any window or only in main window ?
pls explain briefly with some coading .and onbe more question what is the lement that is used in our abap editor<b><a href="http://help.sap.com/saphelp_47x200/helpdata/EN/images/locate.gif">Text Elements of a Form</a></b>
SAPscript calls the individual text components of a form text elements. To achieve good structuring and readability, you assign a fixed name to each text element in the form. The print program then uses these names to access the elements. This name applies also for translated versions of a text element, while the contents of the text elements depend on the language.
Text elements are related to a window, that is, a print program can call for each window only those text elements that exist in this window. They are used in main and other windows.
The variables used within '&...&' are replaced by the system at output time
/E <element name>
UL &fieldnam& text text
Named element are written when driver program use
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'BOOKING'
TYPE = 'BODY'
WINDOW = 'MAIN'
Unnamed element are written once in MAIN windows, and each time in other windos.
Regards -
Can i use fp_job_open, fp_job close in one function module to get hex pdf
Hello All,
Can anyone help me here.
I am trying to use function modules FP_JOB_OPEN, FP_JOB_CLOSE,FP_FUNCTION_MODULE_NAME and call generated function modules in one function module and try ing to get hex string of pdf.
But hex string of pdf is not coming.Should i do any setting in any of the parameter so that the function module using all these function module gets the pdf hex string.
Regards,
Menaka.H.BHello,
do you want to get the PDF out of the printing program to use it elsewhere? (Portal, GOS etc.)
You need to work with the CALL FUNCTION fm_name part where the output parameter of the generated function module is XSTRING type (if i remember well) and that´s a place to start. You can convert from xstring to binary and back using SCMS_XSTRING_TO_BINARY and BIN_2_SCMS.
Also do not forget to set fp_outputparams-GETPDF = 'X'. to get the hex.
Regards, Otto -
How to use the structure in the EXIT_SAPMM06E_013 function module
Hello Experts,
Please guide me how to use the structure defined in function modules under table tab in the driver program for smart form to fetch the data. Please post some sample code if available.
Best Regards,
Sandesh.SreyamshCan you please elaborate little bit more what is the actual requirement?
-
Hi all ,
could anyone tell me what is the use of following two Export parameters in function module CONVERT_TO_LOCAL_CURRENCY and why they are used for ,
1. FOREIGN_FACTOR (Factor for the foreign currency units) and
2. LOCAL_FACTOR ( Factor for the local currency units ) .Hi Ramya ,
Thanks for your reply . But i would like to know what is the use of those two parameters and in what calculation it is used.
The value which is to be converted is passed through 'foreign_amount ' parameter and it is returned after convertion by
'local_amount ' parameter in the function module 'CONVERT_TO_LOCAL_CURRENCY' . Other than this if we want to change the currency of another variable which is not passed to this function module how can i do it ? Is it enough if i multiply that variable with the FIXED_RATE parameter which is returned by this function module as its value is same as exchange rate or do i need to
use FOREIGN_FACTOR and LOCAL_FACTOR also for this calculation?
Edited by: archana_nayak on Apr 25, 2010 9:52 AM -
Use of exporting parameter VIA_T777D in function module RH_READ_INFTY
Hi,
Can any one explain me the use of exporting parameter VIA_T777D in the function module RH_READ_INFTY.
Regards,
AravindClosing.
-
What is the main use of text elements in program.
Hi Experts,
Can any body please explain, why we have to maintain text elements in program.
is it only for avoiding hot coding or else any thing.
Please explain.And why we have to avoid hot coding with text elements.
regards,
developer.Hi,
Text elements are used to store text , the basic purpose of using this is that the same program can be run in diffrent languages and so the titles/headers must be in the language the program is execued , if you hardcode it in the program this will not work , so we use a text elemnt and the system selects the language for the text element based on the language in which the user has logged in.
You can search in forums, you will get lots of answers
Type your key word in sarch text box and press enter, if not found relevant answer, select datae range to all...
answers from other forums.
Hi
They are useful when the program is used in other languages.
So that they are automatically converted to that language.
So define the texts in the text elements and use their ID's like (TXT-05) in the code
don't sue the complete texts in the program.
regards,
nazeer
Edited by: N a z e e r on Jan 15, 2009 4:33 PM -
Trigger Idoc by using the Output type in Z function module
My requirement is when I run Z function module then Idoc should be send which is configured in Output Type.
Means when ever i run the Functional module that Output type should be triggered.?
Does any one have solution??Hi,
Remove the Material Class from Importing Tab and Place the same under Tables Parameter.
Regards,
SRinivas -
How to use a Logical Database in Function Module.
Hi Experts,
I want to use a logical database in a Function Module to fetch data from a standard SAP table into a Internal table for certain filter conditions.
How can I get get this done????
I called LDB_PROCESS FM in my FM, but I could not figure out how to store the extract in my IT table since we cant use GET in FM.
Please provide me a sample code if possible.
Thanks in Advance,
Alex.Hi,
i had an example program like this ,in this i want to get the data using pnp logical database with 5 fields in an interface program.
data: begin of it_final occurs 0,
pernr like pa0002-pernr,
vorna like pa0002-vorna,
nachn like pa0002-nachn,
usrid like pa0105-usrid,
usrid_long like pa0105-usrid_long,
end of it_final.
get pernr.
clear : p0000,p0002,p0105.
rp-provide-from-last p0000 space p_date p_date.
if p0000-stat2 = '3'.
v_pernr = pnppernr-low.
else.
reject.
endif.
*---Get employee pernr, First name ,Last name into final table
rp-provide-from-last p0002 space p_date p_date.
if pnp-sw-found = '1'.
it_final-pernr = p0002-pernr.
it_final-vorna = p0002-vorna.
it_final-nachn = p0002-nachn.
else.
*---Error message if not infotype 0002 maintained
T_ERROR-PERNR = pnppernr-low.
CONCATENATE TEXT-EMI '0002'
INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
APPEND T_ERROR.
CLEAR T_ERROR.
endif.
**--Get SYSTEM USERNAME to final table
rp-provide-from-last p0105 0001 p_date p_date.
if pnp-sw-found = '1'.
it_final-usrid = p0105-usrid.
else.
*---Error message if not SYSTEM USERNAME maintained
T_ERROR-PERNR = pnppernr-low.
CONCATENATE TEXT-003 '0105'
INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
APPEND T_ERROR.
CLEAR T_ERROR.
endif.
**--Get Email ID to final table
rp-provide-from-last p0105 0010 p_date p_date.
if pnp-sw-found = '1'.
it_final-usrid_long = p0105-usrid_long.
else.
*---Error message if not Email ID maintained
T_ERROR-PERNR = pnppernr-low.
CONCATENATE TEXT-004 '0105'
INTO T_ERROR-MESSAGE SEPARATED BY SPACE.
APPEND T_ERROR.
CLEAR T_ERROR.
endif.
append it_final.
clear it_final.
reward points if useful,
venkat. -
How to use the text module in script
hi,
i script how to use the text modules and how to write the code in layout of the script?Hi,
You canr use text modules in script. You have to use standard texts .
Standard text are maintained in SO10 transaction.
you can create translation text for other languages also . So based on logon language it will print translation text.
go to SO10
give textname it say Ztextname id as ST and language as EN
say create, then you will get editor there maintain your text and save it . then come back . Now change language (say for german DE) say create and eneter translation text and save it.
so now you have created a text called ztextname which you can use in your script.
Inorder to insert the texts in your script do as below
go to any window editor and select path
Insert->texts->symbols->standard symbols
then you will get popup in which you have to mention all the parameters that you have created earlier.
after inserting just change language EN to sy-langu
Reward points if useful
About text elements Sravan already given some informatiomn
Regards,
Nageswar -
Function module used for formatting alv
hi gurus,
which function module is uesd to format alv?Hi
see the following
ABAP List Viewer
The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
This helps us to implement all the features mentioned very effectively.
Using ALV, We can have three types of reports:
1. Simple Report
2. Block Report
3. Hierarchical Sequential Report
There are some function modules which will enable to produce the above reports without much effort.
All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
1. SIMPLE REPORT.
The important function modules are
a. Reuse_alv_list_display
b. Reuse_alv_fieldcatalog_merge
c. Reuse_alv_events_get
d. Reuse_alv_commentary_write
e. Reuse_alv_grid_display
A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
The important parameters are :
I. Export :
i. I_callback_program : report id
ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
iii. I_callback_user_command : routine where the function codes are handled
iv. I_structure name : name of the dictionary table
v. Is_layout : structure to set the layout of the report
vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
II. Tables :
i. t_outtab : internal table with the data to be output
B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
The Important Parameters are :
I. Export :
i. I_program_name : report id
ii. I_internal_tabname : the internal output table
iii. I_inclname : include or the report name where all the dynamic forms are handled.
II Changing
ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
declared in the type pool SLIS.
C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
Parameters :
I. Import :
Et_Events : The event table is returned with all possible CALLBACK events
for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
II. Export :
I_List_type :
0 = simple list REUSE_ALV_LIST_DISPLAY
1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
3 = hierarchical-sequential block list
REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
Parameters :
I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
This internal table has three fields :
Typ : H header, S selection , A - action
Key : only when typ is S.
Info : the text to be printed
E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
Parameters : same as reuse_alv_list_display
This is an example for simple list.
2. BLOCK REPORT
This is used to have multiple lists continuously.
The important functions used in this report are:
A. REUSE_ALV_BLOCK_LIST_INIT
B. REUSE_ALV_BLOCK_LIST_APPEND
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
D. REUSE_ALV_BLOCK_LIST_DISPLAY
A. REUSE_ALV_BLOCK_LIST_INIT
Parameters:
I. I_CALLBACK_PROGRAM
II. I_CALLBACK_PF_STATUS_SET
III. I_CALLBACK_USER_COMMAND
This function module is used to set the default gui status etc.
B. REUSE_ALV_BLOCK_LIST_APPEND
Parameters :
Export :
I. is_layout : layout settings for block
II. it_fieldcat : field catalog
III. i_tabname : internal table name with output data
IV. it_events : internal table with all possible events
Tables :
i. t_outtab : internal table with output data.
This function module adds the data to the block.
Repeat this function for all the different blocks to be displayed one after the other.
C. REUSE_ALV_BLOCK_LIST_HS_APPEND
This function module is used for hierarchical sequential blocks.
D. REUSE_ALV_BLOCK_LIST_DISPLAY
Parameters : All the parameters are optional.
This function module display the list with data appended by the above function.
Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
3. Hierarchical reports :
Hierarchical sequential list output.
The function module is
A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
Parameters:
I. Export:
i. I_CALLBACK_PROGRAM
ii. I_CALLBACK_PF_STATUS_SET
iii. I_CALLBACK_USER_COMMAND
iv. IS_LAYOUT
v. IT_FIELDCAT
vi. IT_EVENTS
vii. i_tabname_header : Name of the internal table in the program containing the
output data of the highest hierarchy level.
viii. i_tabname_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
ix. is_keyinfo : This structure contains the header and item table field
names which link the two tables (shared key).
II. Tables
i. t_outtab_header : Header table with data to be output
ii. t_outtab_item : Name of the internal table in the program containing the
output data of the lowest hierarchy level.
slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using REUSE_ALV_FIELDCATALOG_MERGE.
Important Attributes :
A. col_pos : position of the column
B. fieldname : internal fieldname
C. tabname : internal table name
D. ref_fieldname : fieldname (dictionary)
E. ref_tabname : table (dictionary)
F. key(1) : column with key-color
G. icon(1) : icon
H. symbol(1) : symbol
I. checkbox(1) : checkbox
J. just(1) : (R)ight (L)eft (C)ent.
K. do_sum(1) : sum up
L. no_out(1) : (O)blig.(X)no out
M. outputlen : output length
N. seltext_l : long key word
O. seltext_m : middle key word
P. seltext_s : short key word
Q. reptext_ddic : heading (ddic)
R. ddictxt(1) : (S)hort (M)iddle (L)ong
S. datatype : datatype
T. hotspot(1) : hotspot
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
Check the program in the following link:
http://sap-img.com/abap/display-secondary-list-using-alv-grid.htm
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
13. Top-of-page in ALV
selection-screen and top-of-page in ALV
14. ALV Group Heading
http://www.sap-img.com/fu037.htm
How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
15. ALV output to PDF conversion
It has an example code for PDF Conversion.
http://www.erpgenie.com/abap/code/abap51.htm
converting the output of alv in pdf
Go thru these programs they may help u to try on some hands on
ALV Demo program
BCALV_DEMO_HTML
BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
BCALV_GRID_DEMO Simple ALV Control Call Demo Program
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO
BC_ALV_DEMO_HTML_D0100
Regards
Anji -
Using select option and function module in single view
Hi All,
I Have a requirment ,using service call i get a function module and bind to specified UI elements with low and high attributes to input fileds which i designed in my view . And i have to keep range for input values using select options for those input values and clicking on submit i have to display data in VC but it's going to dump
the bug is
Adapter error in INPUT_FIELD "SALEDOC_TXT" of view "ZSD_ORDERSTATUS.MAIN": Context binding of property VALUE cannot be resolved: Node COMPONENTCONTROLLER.1.ZSD_ORDER_STATUS.1.CHANGING.1.S_VBELN does not contain any elements
can any one get me out of this.
Thank U,
MadhanHi,
Call FM using CALL FUNCTION, if you want to pass selectoptions type values to FM..
Try like this...
DATA : delivery TYPE TABLE OF RVBELN,
wa_delivery TYPE RVBELN,
wa_delivery-sign = 'E'.
wa_delivery-option = 'BT'.
wa_delivery-low = lv_FROM_DELIVERYNO.
wa_delivery-high = lv_TO_DELIVERYNO.
APPEND wa_delivery to delivery.
CLEAR wa_delivery.
Pass Delivery to FM.
Cheers,
Kris. -
What are the function modules used in interactive ALV and parameters?
what are the function modules used in interactive ALV and parameters?
hi sunil
check these links,
About ALV:
http://www.geocities.com/mpioud/Abap_programs.html
ALV Group Heading
http://www.sap-img.com/fu037.htm
and few more,
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
also run the folowing code and see
check this sample code.you will be well versed with all the events of a interactive alv report.mark points if useful.
*& Report ZALV4_INTERACTIVE *
*& interactive alvs *
REPORT ZALV4_INTERACTIVE NO STANDARD PAGE HEADING
MESSAGE-ID ZMSG
LINE-COUNT 37(3)
LINE-SIZE 134.
TYPE-POOLS : SLIS.
TABLES DECLARATION ********************
TABLES : VBRK, " BILLING MASTERS TABLE
VBRP. " BILLING ITEM TABLE
TYPES DECLARATION ********************
TYPES : BEGIN OF TY_VBRK, " types for billing masters table
VBELN TYPE VBRK-VBELN, " billing document
WAERK TYPE VBRK-WAERK, " document currency
VKORG TYPE VBRK-VKORG, " sales organization
FKDAT TYPE VBRK-FKDAT, " billing date
BUKRS TYPE VBRK-BUKRS, " company code
BUTXT TYPE T001-BUTXT, " company name
NETWR TYPE VBRK-NETWR, " net currency value
LINE_COLOR(4) TYPE C,
END OF TY_VBRK.
TYPES : BEGIN OF TY_VBRP, " types for billing document item data
POSNR TYPE VBRP-POSNR, " billing item
FKIMG TYPE VBRP-FKIMG, " actual invoiced quantitty
VRKME TYPE VBRP-VRKME, " sales unit
NETWR TYPE VBRP-NETWR, " net currency value
MATNR TYPE VBRP-MATNR, " material number
ARKTX TYPE VBRP-ARKTX, " short text for sales order item
END OF TY_VBRP.
FIELD CATALOG ********************
DATA : WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
LAYOUT DECLARATION ********************
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
WA_LAYOUT1 TYPE SLIS_LAYOUT_ALV.
EVENTS DECLARATION ********************
DATA : TY_EVENTS TYPE SLIS_ALV_EVENT,
IT_EVENTS TYPE SLIS_T_EVENT.
PF STATUS ********************
DATA : PF_STATUS TYPE SLIS_FORMNAME VALUE 'SET_PF_STATUS'.
USER COMMAND ********************
DATA : USER_COMMAND TYPE SLIS_FORMNAME VALUE 'SET_USER_COMMAND',
R_UCOMM LIKE SY-UCOMM.
INTERNAL TABLES ********************
DATA : IT_VBRK TYPE TABLE OF TY_VBRK, "internal table for billing master
IT_VBRP TYPE TABLE OF TY_VBRP, "internal table for billing item
*internal table for field catalog
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
WORK AREA ********************
DATA : WA_VBRK LIKE LINE OF IT_VBRK, "work area for billing master
WA_VBRP LIKE LINE OF IT_VBRP. "work area for billing item
VARIABLE DECLARATION ********************
DATA : V_DATE TYPE SY-DATUM, " variable to store date values
V_VBELN TYPE VBRK-VBELN, " variable for billing document
V_FKDAT TYPE VBRK-FKDAT, " variable for billing date
V_FLAG(1). " variable for flag
SELECTION SCREEN ********************
SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN , " Billing document
S_FKDAT FOR VBRK-FKDAT, " Billing date
S_MATNR FOR VBRP-MATNR. " Material number
PARAMETERS : R1 RADIOBUTTON GROUP G1, "whole item details
R2 RADIOBUTTON GROUP G1. "selected item details
INITIALIZATION ********************
INITIALIZATION.
V_FLAG = 'X'.
V_DATE = SY-DATUM - 20.
S_FKDAT-SIGN = 'I'.
S_FKDAT-OPTION = 'EQ'.
S_FKDAT-LOW = V_DATE.
S_FKDAT-HIGH = SY-DATUM.
APPEND S_FKDAT.
SELECTION SCREEN VALIDATION ********************
AT SELECTION-SCREEN.
PERFORM CONVERSION. " performs data conversion for input
PERFORM VBELN_VALIDATE. " validating the billing document
PERFORM FKDAT_VALIDATE. " validating the billing date
START OF SELECTION ********************
START-OF-SELECTION.
SET TITLEBAR 'AAAA'.
PERFORM VBRK_POPULATE. " populating the billing master detais
PERFORM FIELDCATALOG. " designing the field catalog
PERFORM EVENTS. " performing the events for top of page
PERFORM DISP_BASICLIST." displaying the basic list
*& Form VBELN_VALIDATE
text validating the billing document
--> p1 text
<-- p2 text
FORM VBELN_VALIDATE .
IF S_VBELN IS INITIAL.
MESSAGE E000 WITH 'Make entries in all required fields'.
ELSE.
SELECT SINGLE VBELN
FROM VBRK
INTO V_VBELN
WHERE VBELN IN S_VBELN.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'BILLING DOCUMENT DOESNT EXIST'.
ENDIF.
ENDIF.
ENDFORM. " VBELN_VALIDATE
*& Form FKDAT_VALIDATE
text validating the billing date
--> p1 text
<-- p2 text
FORM FKDAT_VALIDATE .
SELECT SINGLE FKDAT
FROM VBRK
INTO V_FKDAT
WHERE FKDAT IN S_FKDAT.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH 'BILLING DATE DOESNT EXIST'.
ENDIF.
ENDFORM. " FKDAT_VALIDATE
*& Form VBRK_POPULATE
text populating the billing master details
--> p1 text
<-- p2 text
FORM VBRK_POPULATE .
DATA : LD_COLOR(1) TYPE C.
LD_COLOR = 5.
SELECT VBRK~VBELN
VBRK~WAERK
VBRK~VKORG
VBRK~FKDAT
VBRK~BUKRS
VBRK~NETWR
T001~BUTXT
FROM VBRK INNER JOIN T001
ON VBRKBUKRS = T001BUKRS
INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
WHERE VBRK~VBELN IN S_VBELN AND
VBRK~FKDAT IN S_FKDAT.
LOOP AT IT_VBRK INTO WA_VBRK.
LD_COLOR = LD_COLOR + 1.
IF LD_COLOR = 8.
LD_COLOR = 1.
ENDIF.
CONCATENATE 'C' LD_COLOR '10' INTO WA_VBRK-LINE_COLOR.
MODIFY IT_VBRK FROM WA_VBRK.
ENDLOOP.
ENDFORM. " VBRK_POPULATE
*& Form CONVERSION
text data conversion to take leading zeroes into account
--> p1 text
<-- p2 text
FORM CONVERSION .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = S_VBELN
IMPORTING
OUTPUT = S_VBELN.
ENDFORM. " CONVERSION
*& Form DISP_BASICLIST
text displaying the basic list
--> p1 text
<-- p2 text
FORM DISP_BASICLIST .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = PF_STATUS
I_CALLBACK_USER_COMMAND = USER_COMMAND
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'X'
IS_VARIANT =
IT_EVENTS = 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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBRK
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.
ENDFORM. " DISP_BASICLIST
*& Form FIELDCATALOG
text designing the field catalog
--> p1 text
<-- p2 text
FORM FIELDCATALOG .
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-SELTEXT_L = 'BILLING DOCUMENT'.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-EMPHASIZE = 'C610'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'WAERK'.
WA_FIELDCAT-SELTEXT_L = 'DOCUMENT CURRENCY'.
WA_FIELDCAT-COL_POS = 2.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'VKORG'.
WA_FIELDCAT-SELTEXT_L = 'SALES ORGANIZATION'.
WA_FIELDCAT-EMPHASIZE = 'C610'.
WA_FIELDCAT-COL_POS = 3.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'FKDAT'.
WA_FIELDCAT-SELTEXT_L = 'BILLING DATE'.
WA_FIELDCAT-COL_POS = 4.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'BUKRS'.
WA_FIELDCAT-SELTEXT_L = 'COMPANY CODE'.
WA_FIELDCAT-COL_POS = 5.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'BUTXT'.
WA_FIELDCAT-SELTEXT_L = 'COMPANY NAME'.
WA_FIELDCAT-COL_POS = 6.
WA_FIELDCAT-OUTPUTLEN = 25.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-TABNAME = 'IT_VBRK'.
WA_FIELDCAT-FIELDNAME = 'NETWR'.
WA_FIELDCAT-SELTEXT_L = 'NET CURRENCY VALUE'.
WA_FIELDCAT-COL_POS = 7.
WA_FIELDCAT-OUTPUTLEN = 20.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_LAYOUT-ZEBRA = 'X'.
WA_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
ENDFORM. " FIELDCATALOG
*& Form SET_PF_STATUS
text set the pf status
FORM SET_PF_STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'Z50658_PFSTATUS' EXCLUDING EXTAB.
ENDFORM. "SET_PF_STATUS
*& Form SET_USER_COMMAND
text set the user command
FORM SET_USER_COMMAND USING R_UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN 'CLICK'.
IF R1 = 'X'.
IF NOT IT_VBRK IS INITIAL.
SELECT POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO CORRESPONDING FIELDS OF TABLE IT_VBRP
FOR ALL ENTRIES IN IT_VBRK
WHERE VBELN = IT_VBRK-VBELN.
IF SY-SUBRC <> 0.
MESSAGE I000 WITH ' NO BILLING DETAILS FOUND'.
ELSE.
IF V_FLAG = 'X'.
PERFORM DET_FIELDCATALOG.
V_FLAG = ''.
ENDIF.
PERFORM DET_LISTDISPLAY.
ENDIF.
ENDIF.
ENDIF.
IF R2 = 'X'.
READ TABLE IT_VBRK INTO WA_VBRK INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SELECT SINGLE POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
FROM VBRP
INTO CORRESPONDING FIELDS OF WA_VBRP
WHERE VBELN = WA_VBRK-VBELN.
ENDIF.
APPEND WA_VBRP TO IT_VBRP.
ENDIF.
IF V_FLAG = 'X'.
PERFORM DET_FIELDCATALOG. "designing the field catalog for items
V_FLAG = ''.
ENDIF.
PERFORM DET_LISTDISPLAY. "displaying the secondary list
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'UP'.
LEAVE TO SCREEN 0.
WHEN 'CANCEL'.
CALL TRANSACTION 'SE38'.
ENDCASE.
ENDFORM. "SET_USER_COMMAND
*& Form DET_FIELDCATALOG
text designing the field catalog for item details
--> p1 text
<-- p2 text
FORM DET_FIELDCATALOG .
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'POSNR'.
WA_FIELDCAT1-SELTEXT_L = 'BILLING ITEM'.
WA_FIELDCAT1-COL_POS = 1.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'FKIMG'.
WA_FIELDCAT1-SELTEXT_L = 'INVOICE QUANTITY'.
WA_FIELDCAT1-COL_POS = 2.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'VRKME'.
WA_FIELDCAT1-SELTEXT_L = 'SALES UNIT'.
WA_FIELDCAT1-COL_POS = 3.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'NETWR'.
WA_FIELDCAT1-SELTEXT_L = 'NET CURRENCY VALUE'.
WA_FIELDCAT1-COL_POS = 4.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'MATNR'.
WA_FIELDCAT1-SELTEXT_L = 'MATERIAL NUMBER'.
WA_FIELDCAT1-COL_POS = 5.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-TABNAME = 'IT_VBRP'.
WA_FIELDCAT1-FIELDNAME = 'ARKTX'.
WA_FIELDCAT1-SELTEXT_L = 'SALES ORDER ITEM'.
WA_FIELDCAT1-COL_POS = 6.
WA_FIELDCAT1-OUTPUTLEN = 20.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_LAYOUT1-ZEBRA = 'X'.
ENDFORM. " DET_FIELDCATALOG
*& Form DET_LISTDISPLAY
text displaying the secondary list
--> p1 text
<-- p2 text
FORM DET_LISTDISPLAY .
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT = WA_LAYOUT1
IT_FIELDCAT = IT_FIELDCAT1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = 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
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_VBRP
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.
CLEAR IT_VBRP[].
ENDFORM. " DET_LISTDISPLAY
*& Form EVENTS
text
--> p1 text
<-- p2 text
FORM EVENTS .
CLEAR TY_EVENTS.
TY_EVENTS-NAME = SLIS_EV_TOP_OF_PAGE.
TY_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND TY_EVENTS TO IT_EVENTS.
ENDFORM. " EVENTS
*& Form TOP_OF_PAGE
text
FORM TOP_OF_PAGE.
SKIP.
ULINE.
WRITE :/2 ' DATE :', SY-DATUM,
45 'INTELLIGROUP ASIA PVT LTD',
110 'TIME :', SY-UZEIT.
WRITE : /3 'USER :', SY-UNAME,
45 'TITLE :', SY-TITLE,
110 'PAGE :', SY-PAGNO.
ULINE.
SKIP.
ENDFORM. "TOP_OF_PAGE
Cheers
navjot
Reward with points if it is helpful
Message was edited by:
navjot sharma
Maybe you are looking for
-
Dreamweaver CS3 no longer opens files
Greetings, I am not sure where to post this, so I will post here - already have a question open on the Dreamweaver forums. I have run into an unusual problem. I can no longer open files either on my local machine or remote server without Dreamweaver
-
How to use AppleScript to set "character fill color" in Pages 5.2?
For Pages 5.2 on OSX 10.9.3, what is the correct applescript for changing the "character fill" of text in pages. If you highlight text, you do this via your mouse in the inspector by clicking "style," "advanced option (the gear wheel to the right of
-
How do I upload pictures to my blog from time capsule?
Hi, I just started using Time machine, or time capsule (not sure what the difference is). I had to back up my laptop because I only have 185 GB on my computer. I'm a photographer so I take tons of pictures. I started backing up my computer to the tim
-
What is Field services and examples of field services in SAP
Please can u tell me what is meant by field service in SAP and what are field services available in SAP. Best Regards KishoreKumar.T
-
Hi All, We have a scenario with reservations in make to order: I have a Sale order1 for material A: 100 Kgs (Confirmed Qty) Sale order2 for material A: 200 Kgs (Confirmed Qty) I have created delivery document number 50kgs for sale order 1 and saved.