‎2008 Jan 18 9:04 AM
Hi Every one
Can any one send me the detailed material for ALVs Like how to write a program using ALV s ...
Thanx & Regards,
PHANINDER GOLLAPUDI
‎2008 Jan 18 9:06 AM
Hi,
Check the following link:
http://www.sapbrainsonline.com/TUTORIALS/TECHNICAL/ALV_tutorial.html
http://sap-img.com/abap-function.htm
Regards,
Bhaskar
‎2008 Jan 18 9:12 AM
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
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
Reward points if useful.
‎2008 Jan 18 9:13 AM
Sample ALV Report
&----
*& Report ZUK_WIP04_REPORT4
*&
&----
*&
*&
&----
REPORT ZUK_WIP04_REPORT4 NO STANDARD PAGE HEADING MESSAGE-ID ZMSG44
LINE-SIZE 120 LINE-COUNT 65(3) .
TABLES : ZCRICKET.
TYPE-POOLS : SLIS.
DATA : V_REPID LIKE SY-REPID.
DATA : IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
work areas
DATA : W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
W_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV,
W_EVENTS TYPE SLIS_ALV_EVENT,
W_EVENTS1 TYPE SLIS_ALV_EVENT.
LAYOUT
DATA : I_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : I_LAYOUT1 TYPE SLIS_LAYOUT_ALV.
table bodys
DATA : I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
I_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
I_EVENTS TYPE SLIS_T_EVENT,
I_EVENTS1 TYPE SLIS_T_EVENT,
I_LISTHEADER TYPE SLIS_T_LISTHEADER.
itab
DATA : ITAB LIKE ZCRICKET OCCURS 0 WITH HEADER LINE.
DATA : ITAB1 LIKE ZCRICKET OCCURS 0 WITH HEADER LINE.
*************************************************************************
Data Declerations
*************************************************************************
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R2 RADIOBUTTON GROUP G1 .
SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
SELECT-OPTIONS : S_RANK FOR ZCRICKET-RANK OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B2.
***********************************************************************************
initialization
***********************************************************************************
INITIALIZATION.
V_REPID = SY-REPID.
S_RANK-LOW = 1.
S_RANK-HIGH = 10.
APPEND S_RANK.
CLEAR S_RANK.
PERFORM BUILD-LAYOUT.
PERFORM BUILD-FIELDCAT.
***************************************************************************************
at selection-screen
***************************************************************************************
AT SELECTION-SCREEN.
SELECT SINGLE *
FROM ZCRICKET
INTO ZCRICKET
WHERE RANK IN S_RANK.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Enter valid rank no'.
ENDIF.
***************************************************************************************
start-of-selection
***************************************************************************************
START-OF-SELECTION.
IF R1 = 'X'.
PERFORM DATA-RETREIVAL.
PERFORM GRID-DISPLAY.
ENDIF.
IF R2 = 'X'.
PERFORM DATA-RETREIVAL1.
PERFORM LIST-DISPLAY.
ENDIF.
&----
*& Form DATA-RETREIVAL
&----
text
-
--> p1 text
<-- p2 text
-
FORM DATA-RETREIVAL .
SELECT RANK
NAME
COUNTRY
RUNS
WICKETS
FROM ZCRICKET
INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE RANK IN S_RANK.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Query failed--Honey!'.
ENDIF.
ENDFORM. " DATA-RETREIVAL
FORM DATA-RETREIVAL1 .
SELECT RANK
NAME
COUNTRY
RUNS
WICKETS
FROM ZCRICKET
INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE RANK IN S_RANK.
IF SY-SUBRC NE 0.
MESSAGE I999 WITH 'Query failed--Honey!'.
ENDIF.
ENDFORM. " DATA-RETREIVAL1
&----
*& Form BUILD-LAYOUT
&----
text
-
--> p1 text
<-- p2 text
-
FORM BUILD-LAYOUT .
I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
I_LAYOUT-ZEBRA = 'X'.
ENDFORM. " BUILD-LAYOUT
&----
*& Form BUILD-FIELDCAT
&----
text
-
--> p1 text
<-- p2 text
-
FORM BUILD-FIELDCAT .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME =
I_STRUCTURE_NAME = 'ZCRICKET'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = I_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
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. " BUILD-FIELDCAT
&----
*& Form GRID-DISPLAY
&----
text
-
--> p1 text
<-- p2 text
-
FORM GRID-DISPLAY .
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
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 = 'Cricket details'
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = I_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 = ITAB
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. " GRID-DISPLAY
&----
*& Form LIST-DISPLAY
&----
text
-
--> p1 text
<-- p2 text
-
FORM LIST-DISPLAY .
V_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = I_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
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
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. " LIST-DISPLAY
‎2008 Jan 19 4:44 AM
Hi,
if u can gv ur emailid,then i wl send some examples on ALV's and ppt.
Thank you.
Chandu
‎2008 Jan 19 4:49 AM
‎2008 Jan 21 4:44 AM
Hi Chandu...
U can send me the info regarding ALVs to [email protected]
Thanx & Regards,
PHANINDER GOLLAPUDI
‎2008 Jan 19 4:57 AM
Hi
Check the below link:
http://wiki.ittoolbox.com/index.php/FAQ:What_is_module_pool_program_in_abap%3F
http://help.sap.com/saphelp_46c/helpdata/en/35/26b1aaafab52b9e10000009b38f974/content.htm
http://sap.mis.cmich.edu/sap-abap/abap09/sld011.htm
http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
http://www.sapgenie.com/links/abap.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
You can also check the transaction ABAPDOCU which gives you lot of sample programs.
Also you can see the below examples...
Go to se38 and give demodynpro and press F4.
YOu will get a list of demo module pool programs.
One more T-Code is ABAPDOCU.
YOu can find more examples there.
See the prgrams:
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
http://www.geocities.com/ZSAPcHAT
http://www.allsaplinks.com/files/using_table_in_screen.pdf
ALV
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
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
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
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
1->go to Screen Painter, choose the column which you need to make as drop down.
2->Click F2 to go tothe properties screen.
3->Select Listbox or Listbox with Key for the DROPDOWN field (3rd field in properties tab)
4->give value for the FCODE field also, to track the actions in SY_UCOMM when the user selects the value.
5->in the ABAP code, you need to include the logic to populate values for this drop down. You can use the function module VRM_SET_VALUES to populate the listbox in each line of the table control. The fucntion module has to be called in the PBO module, which is defined inside the loop...endloop statement in the flow logic.
6->for changing the values based on user selection, you can include the code in the PAI module, checking SY_UCOMM or OK_CODE.
check this link:
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCDWBTUT/BCDWBTUT.pdf
http://help.sap.com/saphelp_40b/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/applet.htm
Have a look at these good links-
http://www.allsaplinks.com/dialog_programming.html
http://sap.mis.cmich.edu/sap-abap/abap09/
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://help.sap.com/saphelp_webas630/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
http://sap.mis.cmich.edu/abap-00/
http://www.allsaplinks.com/files/using_table_in_screen.pdf
http://help.sap.com/saphelp_46c/helpdata/en/08/bef2dadb5311d1ad10080009b0fb56/content.htm
http://www.sapgenie.com/links/abap.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c9/5472fc787f11d194c90000e8353423/frameset.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sapgenie.com/abap/example_code.htm
http://help.sap.com/saphelp_47x200/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
http://www.allsaplinks.com/dialog_programming.html
http://www.sapbrain.com/TUTORIALS/default.html
http://www.sappoint.com/abap/spmp.pdf
http://www.sap-img.com/abap.htm
http://sap.ittoolbox.com/code/archives.asp?i=10&t=450&a=t
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sapdevelopment.co.uk/dialog/dialoghome.htm
http://www.sappoint.com/faq/faqdiapr.pdf
http://www.allsaplinks.com/dialog_programming.html
http://www1.sapdesignguild.org/resources/MiniSG/3_Managing/3_Overview_Tree_Variants.htm
http://www1.sapdesignguild.org/resources/MiniSG/3_Managing/3_Design_Layout.htm
Check this demo program:
SAPCOLUMN_TREE_CONTROL_DEMO
Sample code:
http://www.geocities.com/victorav15/sapr3/utilities/zvvooa3.txt
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
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
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
chk these 2 useful links
http://www.sap-img.com/abap-function.htm
http://www.geocities.com/mpioud/Abap_programs.html
check this...
http://sapbrain.com/TUTORIALS/TECHNICAL/ALV_tutorial.html
ALV WITH TWO CONTAINER ON ONE PAGE
Look at the below threads ...
ALV in webdynpro
Reward if useful.
Regards,
Chandru
‎2022 Aug 01 2:12 PM
Dear Praninder.
Please use below simple ALV Program.
**********************************************************
*&---------------------------------------------------------------------*
*& Report ZSALESORDER_REPORT2
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZSALESORDER_REPORT2.
TYPES: BEGIN OF TY_VBAP,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
MATWA TYPE VBAP-MATWA,
CHARG TYPE VBAP-CHARG,
NETPR TYPE VBAP-NETPR,
END OF TY_VBAP.
TYPES:BEGIN OF TY_FINAL,
VBELN TYPE VBAP-VBELN,
POSNR TYPE VBAP-POSNR,
MATNR TYPE VBAP-MATNR,
MATWA TYPE VBAP-MATWA,
CHARG TYPE VBAP-CHARG,
NETPR TYPE VBAP-NETPR,
END OF TY_FINAL.
*-----------------------------------------------------------------------------*
*D E C L A R A T I O N S
*-----------------------------------------------------------------------------*
DATA:IT_SALES TYPE TABLE OF TY_VBAP,
WA_SALES TYPE TY_VBAP.
DATA:IT_FINAL TYPE TABLE OF TY_FINAL,
WA_FINAL TYPE TY_FINAL.
DATA: IT_SLIS TYPE SLIS_T_FIELDCAT_ALV,
WA_SLIS TYPE SLIS_FIELDCAT_ALV.
DATA:LS_LAYOUT TYPE SLIS_LAYOUT_ALV.
*-------------------------------------------------------------------------------*
*S E L E C T I O N S C R E E N
*-------------------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_ORDER FOR WA_SALES-VBELN.
SELECTION-SCREEN END OF BLOCK B1.
*-------------------------------------------------------------------------------*
*S T A R T O F S E L E C T I O N
*------------------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM PROCESS_DATA.
PERFORM FIELDCATE.
PERFORM DISPLAY.
FORM GET_DATA.
SELECT VBELN
POSNR
MATNR
MATWA
CHARG
NETPR
FROM VBAP
INTO TABLE IT_SALES
WHERE VBELN IN S_ORDER.
ENDFORM.
FORM PROCESS_DATA.
LOOP AT IT_SALES INTO WA_SALES.
WA_FINAL-VBELN = WA_SALES-VBELN.
WA_FINAL-POSNR = WA_SALES-POSNR.
WA_FINAL-MATNR = WA_SALES-MATNR.
WA_FINAL-MATWA = WA_SALES-MATWA.
WA_FINAL-CHARG = WA_SALES-CHARG.
WA_FINAL-NETPR = WA_SALES-NETPR.
APPEND WA_FINAL TO IT_FINAL.
CLEAR:WA_FINAL.
ENDLOOP.
ENDFORM.
FORM FIELDCATE.
WA_SLIS-FIELDNAME = 'VBELN'.
WA_SLIS-TABNAME = 'IT_FINAL'.
WA_SLIS-SELTEXT_S = 'Order number'.
APPEND WA_SLIS TO IT_SLIS.
CLEAR:WA_SLIS.
WA_SLIS-FIELDNAME = 'POSNR'.
WA_SLIS-TABNAME = 'IT_FINAL'.
WA_SLIS-SELTEXT_S = 'Order number'.
APPEND WA_SLIS TO IT_SLIS.
CLEAR:WA_SLIS.
WA_SLIS-FIELDNAME = 'MATNR'.
WA_SLIS-TABNAME = 'IT_FINAL'.
WA_SLIS-SELTEXT_S = 'Order number'.
APPEND WA_SLIS TO IT_SLIS.
CLEAR:WA_SLIS.
WA_SLIS-FIELDNAME = 'MATWA'.
WA_SLIS-TABNAME = 'IT_FINAL'.
WA_SLIS-SELTEXT_S = 'Order number'.
APPEND WA_SLIS TO IT_SLIS.
CLEAR:WA_SLIS.
WA_SLIS-FIELDNAME = 'CHARG'.
WA_SLIS-TABNAME = 'IT_FINAL'.
WA_SLIS-SELTEXT_S = 'Order number'.
APPEND WA_SLIS TO IT_SLIS.
CLEAR:WA_SLIS.
WA_SLIS-FIELDNAME = 'NETPR'.
WA_SLIS-TABNAME = 'IT_FINAL'.
WA_SLIS-SELTEXT_S = 'Order number'.
APPEND WA_SLIS TO IT_SLIS.
CLEAR:WA_SLIS.
WA_SORT-SPOS = 1.
WA_SORT-FIELDNAME = 'POSNR'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR:WA_SORT.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form FIELD_CAT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> P_
*& --> P_
*& --> P_
*&---------------------------------------------------------------------*.
FORM DISPLAY.
LS_LAYOUT-ZEBRA = 'X'.
LS_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_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_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 = LS_LAYOUT
IT_FIELDCAT = IT_SLIS
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = '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 =
* O_PREVIOUS_SRAL_HANDLER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_FINAL[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDFORM.
Thanks,
Nagaraj.
‎2022 Aug 01 2:15 PM
The author of this question is inactive so they will not be able to reply to your answer. I'd recommend asking a new question instead, find tips on how here: https://answers.sap.com/questions/ask.html
You should also check out our tutorial to learn more about asking and answering questions in the community: https://developers.sap.com/tutorials/community-qa.html
Many thanks!