Application Development 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: 

Previous and Next button to display records of table in selection screen

Former Member

How can I display previous and next records using two buttons? What is the syntax to set counter to display in such a manner?

Also, how can I align the previous and next button in one line?

Below is the code for button:

 if sscrfields-ucomm = 'BUT2'.

 select * from zstud1 into table it_zstud1.

 id = wa_zstud1-zstudid1.

 name = wa_zstud1-zstudname1.

 age = wa_zstud1-zstudage.

 address = wa_zstud1-zaddress.

 mobile = wa_zstud1-zmobile.

 company = wa_zstud1-zcompany.

 endif.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

To answer the question "how can I align the previous and next button in one line" [in a selection screen], place your code between SELECTION-SCREEN BEGIN OF LINE and SELECTION-SCREEN END OF LINE -> cf documentation.

4 REPLIES 4

Jelena
Active Contributor

What are you trying to do? I assume you don't actually mean selection screen as in the one defined using SELECTION SCREEN keyword because it's not meant to be used like that in the first place.

Is this just some random dynpro screen? Still, what in tarnation? This is such a confusing design for a screen... This whole layout and idea just seems plain wrong, sorry.

Sandra_Rossi
Active Contributor
0 Kudos

To answer the question "how can I align the previous and next button in one line" [in a selection screen], place your code between SELECTION-SCREEN BEGIN OF LINE and SELECTION-SCREEN END OF LINE -> cf documentation.

0 Kudos

Issue solved. Thanks.

kjyothiraditya
Participant
0 Kudos

I guess you want to display the table records in the same selection screen, also allowing the user to navigate using buttons. I think you can do this by using 1) fetch all data 2) loop at each record storing index 3)for next, increment index for prev, decrement index. You will have to do this by using module pool. I guess you have created a new custom screen to display the data as you will have to fetch data and do processing.It would be difficult if you are doing in the selection screen itself.