Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

module pool

Former Member
0 Likes
372

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
349

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

3 REPLIES 3
Read only

Former Member
0 Likes
350

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

Read only

Former Member
0 Likes
349

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

Read only

matt
Active Contributor
0 Likes
349

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