‎2013 Jun 10 12:13 PM
Hi All,
I have designed a table control with wizard and when i enter the input and press ENTER the cursor should move to the next column automatically .
Kindly share your ideas!
Regards,
Pradeep.
‎2013 Jun 10 12:33 PM
Hi Pradeep,
you can use GET CURSOR and SET CURSOR command.
TYPES: BEGIN OF CURSOR_TYPE,
NEXT_CUCOL TYPE SY-CUCOL,
NEXT_CUROW TYPE SY-CUROW,
CURSORFIELD(30),
POS_CUCOL TYPE SY-CUCOL,
POS_CUROW TYPE SY-CUROW,
END OF CURSOR_TYPE.
DATA : CURSOR TYPE CURSOR_TYPE.
* to get the cursor position.
GET CURSOR FIELD CURSOR-CURSORFIELD
OFFSET CURSOR-POS_CUCOL
LINE CURSOR-POS_CUROW.
* to set the cursor position.
SET CURSOR FIELD CURSOR-CURSORFIELD
OFFSET CURSOR-POS_CUCOL
LINE CURSOR-POS_CUROW.
also see the documentation for GET/SET CURSOR.
Regards,
Mordhwaj
‎2013 Jun 10 12:41 PM
Hi Pradeep,
Just look in to the Table Control's code created by wizard, it also uses Cusrors, Current Line etc.
BR,
Ankit.
‎2013 Jun 10 1:01 PM
‎2013 Jun 11 4:44 PM
‎2013 Jun 12 5:17 AM
Hi Pradeep,
Do as suggested by Mordhwaj/Karthik i.e.
In PAI
use Get Cursor
and
In PBO
use SET Cursor.
Eg :-
GET CURSOR FIELD '<Work_Area-Field>' LINE 1.
SET CURSOR FIELD '<Work_Area-Field>' LINE 1.
BR,
Ankit.
‎2013 Jun 11 9:44 PM
Hi Pradeep,
In PAI you should use GET CURSOR statement to get the row and column the cursor is currently in. Then in PBO use the SET CURSOR statment to set the cursor to the next field. Obviously you should know the order of the field in the table control to set the cursor to the following field. Also keep in mind the SY-UCOMM for Enter button is SPACE. It will help you in PAI User command event.
Hope this helps. Try and post your code for further troubleshooting.
Regards,
Karthik
‎2013 Jun 12 5:26 AM
Hi Pradeep
At PBO you can set the cursor on a specific field of a specific row of a table control.
<b>SET CURSOR FIELD <f> LINE <lin> [OFFSET <off>]</b>
FOR MORE DOCUMENTATION ON THIS PLEASE GO THROUGH THE LINK
<a href="http://72.14.203.104/search?q=cache:AJJ3D7y_NFYJ:help.sap.com/saphelp_nw04/helpdata/en/9f/dbac9f35c1...SetcursortoTablecontrolField+ABAP&hl=en&gl=in&ct=clnk&cd=1">Cursor Position on Table Controls</a>
<a href="http://72.14.203.104/search?q=cache:eNQbEfxNJTUJ:help.sap.com/saphelp_nw04/helpdata/en/9f/dbac0b35c1...SETCURSORFIELDABAP&hl=en&gl=in&ct=clnk&cd=2">Setting the Cursor Position</a>
Regards
Suganya