SAP ABAP Program to insert multiple records in a custom table at once.

Program: 



REPORT ZSM_ID_TWO.


TYPESBEGIN OF ty_str,
         client   TYPE mandt,
         id       TYPE int4,
         name     TYPE char10,
         phone    TYPE int4,
         location TYPE char10,
       END OF ty_str.

DATAit TYPE STANDARD TABLE OF ty_str,
      wa TYPE ty_str.

SELECT-OPTIONSs_id     FOR wa-id.
SELECT-OPTIONSs_name     FOR wa-name.
SELECT-OPTIONSs_phone     FOR wa-phone.
SELECT-OPTIONSlocation     FOR wa-location.

INSERT zsm_tables FROM wa.

IF sy-subrc 0.

WRITE:'success'.

ELSE.
  WRITE:'not inserted'.
ENDIF.


Output: 










 

Post a Comment

0 Comments