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: 

Displaying records one by one in Screen Painter

Former Member
0 Kudos

Hai Experts,

I have one internal table which contains 5 records. If i click save button (Screen Painter) in Process After Input (PAI) then first record should be displayed. Again if i click save button then the second record should be displayed one by one by replacing the first record. Likewise all records should be displayed one by one

for every save action. Help me with this issue.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Bharath Padmanabhan,

If you are displaying data in a I/O field, as follows READ it and

explicitly assign to those fields. Else you can declare those fields

as the WORK AREA hyphen FIELD NAME.



CASE SY-UCOMM.
  WHEN 'SAVE'.
    IF CNT_REC_NO < CNT_TOT_REC.
      ADD 1 TO CNT_REC_NO.
    ELSE.
      CNT_REC_NO = 1.
    ENDIF.
    READ TABLE IT_TC_TCODE INTO WA_TC_TCODE INDEX CNT_REC_NO.

Before this just have the count of TOTAL records using DESCRIBE

statement as follows.



  DESCRIBE TABLE IT_TC_TCODE LINES CNT_TOT_REC.

Here, once LAST record reached, again fron FIRST record it will

displayed.

If you use TABLE CONTROL, after READ statement, just append it to the INTERNAL TABLE displayed in TABLE CONTROL, provided delete the content of this internal table.

Regards,

R.Nagarajan.

-


We can -


4 REPLIES 4

Former Member
0 Kudos

Hi Bharath,

Are you using Table control?

let me know so that i can give you proper solution.

Cheers

Sharat.

Former Member
0 Kudos

Hi Bharath Padmanabhan,

If you are displaying data in a I/O field, as follows READ it and

explicitly assign to those fields. Else you can declare those fields

as the WORK AREA hyphen FIELD NAME.



CASE SY-UCOMM.
  WHEN 'SAVE'.
    IF CNT_REC_NO < CNT_TOT_REC.
      ADD 1 TO CNT_REC_NO.
    ELSE.
      CNT_REC_NO = 1.
    ENDIF.
    READ TABLE IT_TC_TCODE INTO WA_TC_TCODE INDEX CNT_REC_NO.

Before this just have the count of TOTAL records using DESCRIBE

statement as follows.



  DESCRIBE TABLE IT_TC_TCODE LINES CNT_TOT_REC.

Here, once LAST record reached, again fron FIRST record it will

displayed.

If you use TABLE CONTROL, after READ statement, just append it to the INTERNAL TABLE displayed in TABLE CONTROL, provided delete the content of this internal table.

Regards,

R.Nagarajan.

-


We can -


Former Member
0 Kudos

Hi,

Try like this.

data: count type i, lin type sy-index.

At user-command.

Case sy-ucomm.

When 'SAVE'

Describe table itab lines count.

lin = count.

IF lin <= count .

read table itab into wa index lin.

lin = lin + 1.

assign the wa fields to corresponding screen fields .

ELSE.

clear: lin.

Message 'No records to save' type 'E'.

ENDIF.

If useful.................

Regards,

S.Senthil kumar

Former Member
0 Kudos

answered.