Hi,
I have 100 records in a table, how to read every 7Th record
each in that...
Answers were Sorted based on User's Feedback
Answer / vamshi reddy chaduvu
Try this sample code..........
REPORT ZHGSL__TEST.
DATA: IT_KNA1 TYPE STANDARD TABLE OF KNA1,
IT_KNA2 TYPE STANDARD TABLE OF KNA1,
WA_KNA1 LIKE LINE OF IT_KNA1.
DATA: T TYPE I.
SELECT * FROM KNA1 INTO TABLE IT_KNA1 UP TO 100 ROWS.
DO .
T = SY-INDEX * 7.
READ TABLE IT_KNA1 INTO WA_KNA1 INDEX T .
IF SY-SUBRC EQ 0.
APPEND WA_KNA1 TO IT_KNA2.
ELSE.
EXIT.
ENDIF.
ENDDO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-CPROG
I_STRUCTURE_NAME = 'KNA1'
TABLES
T_OUTTAB = IT_KNA2
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Is This Answer Correct ? | 37 Yes | 1 No |
Answer / bala
LOOP AT IT_KNA1 INTO WA_KNA1.
T = SY-TABIX / 7.
IF T EQ 0.
APPEND WA_KNA1 TO IT_KNA2.
ENDIF.
ENDLOOP.
Is This Answer Correct ? | 7 Yes | 10 No |
How many types of tables exists and what are they in data dictionary?
Event handling in oops
Is Multiple Inheritance possible in ABAP ? If Yes How ,If no How ?
How to see the error message if we use call transaction method in BDC ??
What is system-land-scape of your project?
What is the exactly definition of Foreign key 2.what is the exactly definition of Value Table. 3)What is the exactly definition of Data element and Domain.Please give the exactly definitions of all above questions without fail....Thanku
What event is trigger wen screen is displayed?Before displaying Initailization and Pressing enter At selection- Screen..............But at the selection displayed and we are entering values naa that time?
we can use internal table with help of user define data types if possible or not
What is Field group?
how to validate either processing view is already exist or not?
1 Answers Bristle Cone, Cap Gemini, HP, Satyam, Wipro,
layout conversion?
Where the payroll results are stored