2013 Oct 09 12:12 PM
Hi,
I am working on the module pool program, I have created one screen with certain fields from database table .
I have to give functionality to the user that when the user enters first record on the screen and press ENTER the cursor must move to next field. I this way user must fill all the fields on the screen and after saving all the data using SAVE on the standard toolbar screen must be cleared for next entry.
If anybody have any idea how to achieve this please share it with me.
Thanks
Avadhut
2013 Oct 11 11:42 AM
You should use a combination of GET CURSOR (in PAI) and SET CURSOR (in PBO).
in PAI
GET CURSOR FIELD l_cursor l_cursor_line.
in PBO
CASE l_cursor.
WHEN 'FIELD1'.
SET CURSOR FIELD 'FIELD2'.
WHEN 'FIELD2'.
SET CURSOR FIELD 'FIELD3'.
and so on..
if you wish to move down a line in a table control, when you reach the last field in the preceeding line ADD 1 TO L_CURSOR_LINE.
2013 Oct 09 12:18 PM
Hi Avadhut,
Refer these links. They may help you to achive the functionality you specified.
http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dba47e35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbac0b35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabf135c111d1829f0000e829fbfe/content.htm
Regards,
Anoop
2013 Oct 09 12:32 PM
2013 Oct 11 9:25 AM
Hi Avadhut,
You can set the cursor field by using the stmt SET CURSOR FIELD <fld> in the PBO.
Regards,
Ashish Kumar.
2013 Oct 11 11:42 AM
You should use a combination of GET CURSOR (in PAI) and SET CURSOR (in PBO).
in PAI
GET CURSOR FIELD l_cursor l_cursor_line.
in PBO
CASE l_cursor.
WHEN 'FIELD1'.
SET CURSOR FIELD 'FIELD2'.
WHEN 'FIELD2'.
SET CURSOR FIELD 'FIELD3'.
and so on..
if you wish to move down a line in a table control, when you reach the last field in the preceeding line ADD 1 TO L_CURSOR_LINE.