10-14-2008 2:35 PM
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.
10-15-2008 3:43 AM
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 -
10-14-2008 7:40 PM
Hi Bharath,
Are you using Table control?
let me know so that i can give you proper solution.
Cheers
Sharat.
10-15-2008 3:43 AM
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 -
10-15-2008 4:29 AM
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
11-24-2008 9:13 AM