Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Hi,

I have 100 records in a table, how to read every 7Th record
each in that...

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a structure and an append structure?

1072


A field containing currency amounts (data type curr) must be assigned to a reference table and a reference field. Explain?

1427


what is user specific parameter?

2046


What are the objects of the abap dictionary or what types of objects can be created in the abap dictionary? : abap data dictionary

949


Explain lsmw?

1061


Power is interrupted while transferring data from internal table to application server. How will you determine many records are transferred in session method and call transaction method? : abap bdc

1246


What are system variable in abap?

1082


In events, start-of-selection is a default event. When we have to use this event explicitly? Why?

1018


In which time constraint does the infotype records depend on the subtype ? : abap hr

1070


Explain the use of table maintenance allowed?

991


What are your ways to performance optimization?

1367


What are internal tables? How do you get the number of lines in an internal table? How to use a specific number occurs statement?

1061


What is sap abap data dictionary?

1100


What is the major difference between pool tables and transparent tables?

1075


What is the first thing you do after vendor setup is complete?

1420