‎2008 Jun 16 2:43 PM
hi,
can anyone explain me the functionality of entering through keyboard in ALV.
code will be appreciated.
regards,
shivani
‎2008 Jun 16 2:55 PM
hi shivani,
ENTER on the KEYBOARD:
The ALV grid display on a container is not sensitive to the enter button on the keyboard. To make the ALV grid sensitive to the enter button we need to call the method REGISTER_EDIT_EVENT of the class CL_GUI_ALV_GRID.
The event ENTER (MC_EVT_ENTER) needs to be exported to the method.
When a grid is made sensitive to ENTER the event DATA_CHANGED of the class CL_GUI_ALV_GRID is triggered implicitly every time the enter button is pressed on the screen after making changes. The control comes out directly from the event handler of DATA_CHANGED to the display screen and the changed data needs to be added to the display internal table in the event handler. The method REFRESH_TABLE_DISPLAY needs to be called before displaying the modified table.
Text Editor
If the requirement is there for the user to enter some texts (example: before creating a Purchase Order or a Sales Order using BAPI the user needs to enter the Item text) a SAP text editor can be called on a screen using an instance of the class CL_GUI_TEXTEDIT.
A text editor needs to be created on a custom container on a screen. An instance of the class CL_GUI_CUSTOM_CONTAINER is used. To create a custom container instance, you need to place a custom control area on the screen.
Create an instance for the container in the PBO of the screen.
Example:
Data: <gw_cont> TYPE REF TO cl_gui_custom_container.
CREATE OBJECT <gw_cont>
EXPORTING
container_name = '<container name>'.
Create an instance for the editor in the PBO of the screen.
Example:
Data: <gw_editor> TYPE REF TO cl_gui_textedit.
CREATE OBJECT <gw_editor>
EXPORTING
parent = <gw_cont>
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = 70 "Length of text - word-wrap is triggered
wordwrap_to_linebreak_mode = cl_gui_textedit=>false
Commonly used methods:
1. GET_TEXT_AS_R3TABLE:
This method is called in the PAI of the screen to convert the text entered by the user into an R3 internal table of the type 'bapiqcline'. The text entered by the user is moved into the lines of the internal table.
2. DELETE_TEXT:
This method is called to delete all the text entered by the user on the editor.
reward if useful.
regards,
saipriya
‎2008 Jun 16 2:46 PM
Hello,
Please see this: [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5515] [original link is broken] [original link is broken] [original link is broken]; and [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ec31e990-0201-0010-f4b6-c02d876ce033].
Regards.
‎2008 Jun 16 2:46 PM
Hi,
Chk this standard program.
BCALV_GRID_EDIT
Regards
Sandeep Reddy
‎2008 Jun 16 2:50 PM
hi r u looking for the programs of 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
Link containing all the important PDFS. ( There is a PDF for ALV Grid in this link)
‎2008 Jun 16 2:53 PM
hi
go to website saptechnical.com>tutorial>alv uget code for alm,ost all funtionality of alv
Cheers
Snehi Chouhan
‎2008 Jun 16 2:55 PM
hi shivani,
ENTER on the KEYBOARD:
The ALV grid display on a container is not sensitive to the enter button on the keyboard. To make the ALV grid sensitive to the enter button we need to call the method REGISTER_EDIT_EVENT of the class CL_GUI_ALV_GRID.
The event ENTER (MC_EVT_ENTER) needs to be exported to the method.
When a grid is made sensitive to ENTER the event DATA_CHANGED of the class CL_GUI_ALV_GRID is triggered implicitly every time the enter button is pressed on the screen after making changes. The control comes out directly from the event handler of DATA_CHANGED to the display screen and the changed data needs to be added to the display internal table in the event handler. The method REFRESH_TABLE_DISPLAY needs to be called before displaying the modified table.
Text Editor
If the requirement is there for the user to enter some texts (example: before creating a Purchase Order or a Sales Order using BAPI the user needs to enter the Item text) a SAP text editor can be called on a screen using an instance of the class CL_GUI_TEXTEDIT.
A text editor needs to be created on a custom container on a screen. An instance of the class CL_GUI_CUSTOM_CONTAINER is used. To create a custom container instance, you need to place a custom control area on the screen.
Create an instance for the container in the PBO of the screen.
Example:
Data: <gw_cont> TYPE REF TO cl_gui_custom_container.
CREATE OBJECT <gw_cont>
EXPORTING
container_name = '<container name>'.
Create an instance for the editor in the PBO of the screen.
Example:
Data: <gw_editor> TYPE REF TO cl_gui_textedit.
CREATE OBJECT <gw_editor>
EXPORTING
parent = <gw_cont>
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = 70 "Length of text - word-wrap is triggered
wordwrap_to_linebreak_mode = cl_gui_textedit=>false
Commonly used methods:
1. GET_TEXT_AS_R3TABLE:
This method is called in the PAI of the screen to convert the text entered by the user into an R3 internal table of the type 'bapiqcline'. The text entered by the user is moved into the lines of the internal table.
2. DELETE_TEXT:
This method is called to delete all the text entered by the user on the editor.
reward if useful.
regards,
saipriya