Hello SAP Experts,
I can select records from mara using select statement (ernam and matnr), I want to insert these rec to my table ( ie I created using se11----that contain only 2 fields =matnr and ernam ).
please help
Updated May 18, 2018
Hello SAP Experts,
I can select records from mara using select statement (ernam and matnr), I want to insert these rec to my table ( ie I created using se11----that contain only 2 fields =matnr and ernam ).
please help
Comments
insert ztable from table itab.
ztable = table name
itab = internal table
--------- --------- --------- --------- --------- --------- --------- --------- --------- ---------
INSERT ZTABLE from TABLE itab ACCEPTING DUPLICATE KEYS.
IF sy-subrc = 0.
MESSAGE 'Records Save into Database table' TYPE 'S'.
ENDIF.
--------- --------- --------- --------- --------- --------- --------- --------- --------- ---------
Working with Internal Table
--------- --------- --------- --------- --------- --------- --------- --------- --------- ---------
ZINTERNAL_INSERT
REPORT ZINTERNAL_INSERT.
TYPE: BEGIN OF TY_STUD,
SID TYPE I,
SNAME(10) TYPE C,
SMARKS TYPE I,
END OF TY_STUD.
DATA: IT_STUD TYPE TABLE OF TY_STUD,
WA_STUD TYPE TY_STUD,
WA_STUD-SID=1.
WA_STUD-NAME='ABCD'.
WA_STUD-MARKS=54.
INSERT WA_STUD INTO TABLE IT_STUD.
STUD-SID=2.
WA_STUD-NAME='XYZ'.
WA_STUD-MARKS=44.
INSERT WA_STUD INTO TABLE IT_STUD.
STUD-SID=3.
WA_STUD-NAME='DFDFS'.
WA_STUD-MARKS=33.
INSERT WA_STUD INTO TABLE IT_STUD.
STUD-SID=4.
WA_STUD-NAME='RAMM'.
WA_STUD-MARKS=78.
INSERT WA_STUD INTO TABLE IT_STUD INDEX 3.
LOOP ATIT_STUD IN_STUD INTO WA_STUD.
WRITE: /WA_STUD-SID, WA_STUD-SNAME, WA_STUD-SMARKS.
ENDLOOP.
--------- --------- --------- --------- --------- --------- --------- --------- --------- ---------