‎2008 Nov 11 1:21 PM
Hi Frens,
I am Shalem ,new to SAP as well as to this Forum, so please bear with me
I have just started Module pool programming..
my question is as follows:
I retrieved database table and i am able to display it on the screen.
=> I want to create a "next" button, so that when i click on " next" i should see the next record no matter whats the current record.
=> And is it possible to display the sy-tabix value on screen(screen painter),
Thanks in Advance..
Shalem Raj
‎2008 Nov 11 1:44 PM
MODULE USER_COMMAND_0100 INPUT.
.............................
CASE OK_CODE.
WHEN 'NEXT' .
TCTRL_PHONELIST-TOP_LINE = TCTRL_PHONELIST-TOP_LINE + 1.
OFFSET = LIN - LINES + 1.
IF TCTRL_PHONELIST-TOP_LINE > OFFSET.
TCTRL_PHONELIST-TOP_LINE = OFFSET.
ENDIF.
.................
ENDCASE
ENDMODULE
Here
1. LIN - Total no of lines in table control can be calculated using describe statement
eg, DESCRIBE TABLE ITAB_PHONELIST LINES LIN.
2. LINES - we can get
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
LOOP AT ITAB_PHONELIST .
MODULE EXTRACT_USERDATA.
ENDLOOP.
MODULE EXTRACT_USERDATA INPUT.
LINES = SY-LOOPC.
...............
ENDMODULE
‎2008 Nov 11 1:44 PM
MODULE USER_COMMAND_0100 INPUT.
.............................
CASE OK_CODE.
WHEN 'NEXT' .
TCTRL_PHONELIST-TOP_LINE = TCTRL_PHONELIST-TOP_LINE + 1.
OFFSET = LIN - LINES + 1.
IF TCTRL_PHONELIST-TOP_LINE > OFFSET.
TCTRL_PHONELIST-TOP_LINE = OFFSET.
ENDIF.
.................
ENDCASE
ENDMODULE
Here
1. LIN - Total no of lines in table control can be calculated using describe statement
eg, DESCRIBE TABLE ITAB_PHONELIST LINES LIN.
2. LINES - we can get
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
LOOP AT ITAB_PHONELIST .
MODULE EXTRACT_USERDATA.
ENDLOOP.
MODULE EXTRACT_USERDATA INPUT.
LINES = SY-LOOPC.
...............
ENDMODULE
‎2008 Nov 12 6:11 AM
Thanks a bunch Sree....
Hope i need your guidance in the near future too..
one more question which strikes is : how to display the retrieved row number on the screen....
thanks again!!!!
Edited by: shalem raj on Nov 12, 2008 7:12 AM
‎2008 Nov 12 12:18 PM
Post your next question as another question, rather than tacking onto this one. And in future please use a more meaningful subject for your questions.
Thank-you
matt