‎2008 Feb 06 2:53 PM
Hi,
I have the below requirement. I require a table control where the data is input using a barcode scanner. The requirement is after the last line is entered the table control should have an automatic page down. Could anyone please help me if i can do this requirement.
Best Regards,
Pradeep.
‎2008 Feb 06 2:56 PM
Hello,
Add this code in PAI of the screen.
WHEN 'P--' OR "top of list
'P-' OR "previous page
'P+' OR "next page
'P++'. "bottom of list
PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
L_OK.
*-BEGIN OF LOCAL DATA--------------------------------------------------*
DATA L_TC_NEW_TOP_LINE TYPE I.
DATA L_TC_NAME LIKE FELD-NAME.
DATA L_TC_LINES_NAME LIKE FELD-NAME.
DATA L_TC_FIELD_NAME LIKE FELD-NAME.
FIELD-SYMBOLS <TC> TYPE CXTAB_CONTROL.
FIELD-SYMBOLS <LINES> TYPE I.
*-END OF LOCAL DATA----------------------------------------------------*
* DESCRIBE TABLE IT_TC01 LINES G_TC01_LINES.
ASSIGN (P_TC_NAME) TO <TC>.
* get looplines of TableControl
CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
ASSIGN (L_TC_LINES_NAME) TO <LINES>.
* <TC>-LINES = G_TC01_LINES.
* is no line filled? *
IF <TC>-LINES = 0.
* yes, ... *
L_TC_NEW_TOP_LINE = 1.
ELSE.
* no, ... *
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
ENTRY_ACT = <TC>-TOP_LINE
ENTRY_FROM = 1
ENTRY_TO = <TC>-LINES
LAST_PAGE_FULL = 'X'
LOOPS = <LINES>
OK_CODE = P_OK
OVERLAPPING = 'X'
IMPORTING
ENTRY_NEW = L_TC_NEW_TOP_LINE
EXCEPTIONS
* NO_ENTRY_OR_PAGE_ACT = 01
* NO_ENTRY_TO = 02
* NO_OK_CODE_OR_PAGE_GO = 03
OTHERS = 0.
ENDIF.
* get actual tc and column *
GET CURSOR FIELD L_TC_FIELD_NAME
AREA L_TC_NAME.
IF SYST-SUBRC = 0.
IF L_TC_NAME = P_TC_NAME.
* set actual column *
SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
ENDIF.
ENDIF.
* set the new top line *
<TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
ENDFORM. " COMPUTE_SCROLLING_IN_TC
Cheers,
Vasanth
‎2008 Feb 06 3:22 PM
Hi,
Would the code you mentioned get triggered automatically without page down or page up.
Best Regards,
Pradeep.
‎2008 Jun 12 12:50 PM
Hi pradeep
if u got the answer for ur question can u please tell me,even i am having same requirement.
Rgds.
mngowda