‎2008 Dec 11 2:24 PM
Hello,
I have my selection screen with two fields p_charg and p_vbeln. Both these values can be populated either by scanning a bar code or by manual entry. The only tweak here is, after we scan barcode in first field (p_charg), which is 10 chars long, the cursor should jump (tab) to next field (p_vbeln). Same with manual entry, once we enter 10 chars in p_charg the cursor should tab to p_vbeln. Please share your ideas....
Note : scanner we are using is a simple scanner connected to a PC thru USB port which just reads the barcode content and passes to the PC.
‎2008 Dec 11 2:59 PM
Hey man, yes I have had this issue before at my previous company, people wanted to scan into SAPgui, and have it auto tab to the next field, and also wanted to type into the field and at the end, auto tab to the next. Back then it was NOT possible to handle that. Now there is, but you must have a newer release of SAPgui, and this is not a global setting, so any computer which is running your transaction for scanning, and wants the auto tab must have this setting set explicitly on that machine.
Click on the last icon in the toolbar of SAPgui. Choose u201COptionsu201D from the menu, click on the u201CCursoru201D tab. And check the checkbox for u201CAutomatic Tabbing at End of Fieldu201D.
Setting this will allow both the manual typing and the scanning to advance to the next field. But the field must be filled completely, so your barcode must fill it. For example, for P_VBELN, you must have a barcode that is 10 characters long, so if your sales document as not that long, it must be padded with leading zeros, same for if you are manually typing it in.
Regards,
Rich Heilman
‎2008 Dec 11 2:28 PM
Hi Jack,
I dont think such functionality is available in SAP, coz focus gaining & loosing for input fields can be handled by windows, not by SAP.
-Sujatha
‎2008 Dec 11 2:31 PM
hi
check whether the first field is initial or not and then
use
SET CURSOR { { FIELD field [LINE line] [[DISPLAY] OFFSET off] }
| { col lin } }.
i guesss this will resolve your question
‎2008 Dec 11 2:48 PM
You need to use TAB move the cursor
or
check this program logic , it have 1 sec wait to move cursor to different field. may be u can use functionality of TIMER
report zars no standard page heading
line-size 170
line-count 65(4).
initialization.
data : interval type i value 2.
*----------------------------------------------------------------------*
* CLASS lcl_receiver DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_receiver definition.
public section.
methods:
handle_finished for event finished of cl_gui_timer.
endclass. "lcl_receiver DEFINITION
data:
test type i,
receiver type ref to lcl_receiver,
timer type ref to cl_gui_timer,
counter type i.
create object timer.
create object receiver.
set handler receiver->handle_finished for timer.
timer->interval = interval.
* call method timer->run.
parameters : field1(2) type c memory id fld1,
field2(2) type c.
*----------------------------------------------------------------------*
* CLASS lcl_receiver IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcl_receiver implementation.
method handle_finished.
add interval to counter.
if not field1 is initial.
set cursor field 'FIELD2'.
endif.
call method timer->run.
endmethod. "handle_finished
endclass. "lcl_receiver IMPLEMENTATION
at selection-screen.
call method timer->run.
a®
‎2008 Dec 11 2:59 PM
Hey man, yes I have had this issue before at my previous company, people wanted to scan into SAPgui, and have it auto tab to the next field, and also wanted to type into the field and at the end, auto tab to the next. Back then it was NOT possible to handle that. Now there is, but you must have a newer release of SAPgui, and this is not a global setting, so any computer which is running your transaction for scanning, and wants the auto tab must have this setting set explicitly on that machine.
Click on the last icon in the toolbar of SAPgui. Choose u201COptionsu201D from the menu, click on the u201CCursoru201D tab. And check the checkbox for u201CAutomatic Tabbing at End of Fieldu201D.
Setting this will allow both the manual typing and the scanning to advance to the next field. But the field must be filled completely, so your barcode must fill it. For example, for P_VBELN, you must have a barcode that is 10 characters long, so if your sales document as not that long, it must be padded with leading zeros, same for if you are manually typing it in.
Regards,
Rich Heilman
‎2008 Dec 11 3:03 PM
Oh wow this is making SAP gui.. similar to web pages where we enter the user name and password rather than hitting tab in between.
‎2008 Dec 11 3:07 PM
Thanks Rich,
I also have the same problem for long time. tried with TIMER class, but it not worked properly
Your solution worked perfectly for me .
Here is sap documentation related to this
http://help.sap.com/saphelp_erp2004/helpdata/en/73/69eb4b55bb11d189680000e829fbbd/content.htm
Once again thanks
a®
‎2008 Dec 11 3:19 PM