2007 Apr 04 4:59 PM
In a sorted table how to add a record without using indexes
if there are 10 records insert a record at 5th position. how?
2007 Apr 04 5:07 PM
Hi,
Why you want to insert record without index. With index, it is one line statement. Otherwise you have to loop at internal table and insert record when sy-tabix = 5.
With index.
-
INSERT itab2 INTO itab1 INDEX 5.Without index
-
LOOP AT itab1.
IF sy-tabix = 5.
INSERT itab2 INTO itab1.
ENDIF.
ENDLOOP.Please mention clearly what you want to do.
Regards,
RS
Hi,
Why you want to insert record without index. With index, it is one line statement. Otherwise you have to loop at internal table and insert record when sy-tabix = 5.
With index.
-
INSERT itab2 INTO itab1 INDEX 5.Without index
-
LOOP AT itab1.
IF sy-tabix = 5.
INSERT itab2 INTO itab1.
ENDIF.
ENDLOOP.Please mention clearly what you want to do.
Regards,
RS
2007 Apr 04 5:01 PM
2007 Apr 04 5:07 PM
Hi,
Why you want to insert record without index. With index, it is one line statement. Otherwise you have to loop at internal table and insert record when sy-tabix = 5.
With index.
-
INSERT itab2 INTO itab1 INDEX 5.Without index
-
LOOP AT itab1.
IF sy-tabix = 5.
INSERT itab2 INTO itab1.
ENDIF.
ENDLOOP.Please mention clearly what you want to do.
Regards,
RS
2007 Apr 04 5:16 PM
This link has given an example:
http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb361f358411d1829f0000e829fbfe/content.htm
Regards,
Ravi
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |