Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR ::"TABLENAME" is not a field group

Former Member
0 Kudos

Hi,

I need to insert data into Database Table. I created BAPI/FUNCTION MODULE. In the FM I am getting this error.

can anyone help me rectify this error....

"ITABLE_INS" is not a field group

ITABLE_INS is the Table name I have created in the Tables TAB

Sweety

7 REPLIES 7

Former Member
0 Kudos

Hi,

You need to declare your table ITABLE_INS as a field group rather than as a Table.

FIELD-GROUPS: ITABLE_INS1.

INSERT: field1 field2 INTO ITABLE_INS1 .

Regards,

Srini.

0 Kudos

Hi,

I am getting errors even if i declare field groups......

Can you explain how to use insert command in Function Module to insert into Database..

Sweety

Former Member
0 Kudos

Hi Sweety,

PFB..

TABLES vbap.

FIELD-GROUPS header.

START-OF-SELECTION.

INSERT vbap-vbeln INTO header.

INSERT vbap-vgbel INTO header.

Regards,

Pranjali

Former Member
0 Kudos

Hi Sweety,

Do you want to insert the data into database table? Or you want to insert the data using logical database?

INSERT command on field group is used in case of logical database insert. But if you want to simply insert the data into database table, then you can use following code :

*insert record into database table from internal table

DATA : it_tab TYPE STANDART TABLE OF dbtab.

INSERT dbtab FROM TABLE it_tab.

deepak_dhamat
Active Contributor
0 Kudos

Hi ,

When you create FM ... with tables parameter then you have to create one structure of table which you want to update or modify . and assign that structure to table .

see below code where

p_taB IS TABLE DECLARED AS PARAMETER IN TABLES TAB WITH STRUCTURE TYPE ZGRR_CLR WHICH is same as zgrr_clear .

then you can use like this

LOOP AT p_tab .


    SELECT SINGLE * FROM zgrr_clear
                   WHERE mblnr = p_tab-mblnr
                   AND   matnr = p_tab-matnr
                   AND   zeile = p_tab-zeile .


    IF sy-subrc = 0.

      zgrr_clear-acpt_flg = p_tab-acpt_flg .
      zgrr_clear-rej_flg  = p_tab-rej_flg  .
      zgrr_clear-rejqty   = p_tab-rejqty   .
      zgrr_clear-remark   = p_tab-remark   . 
      zgrr_clear-debt_amt = p_tab-debt_amt .
 
      IF p_tab-rej_flg <> '' OR p_tab-acpt_flg <> ''.
        zgrr_clear-clr_date = sy-datum .       
       zgrr_clear-clr_time = sy-uzeit .
      ENDIF.


      MODIFY zgrr_clear.

      CLEAR zgrr_clear .


    ENDIF .

  ENDLOOP .

Regards

Deepak.

Former Member
0 Kudos

can you share the peice of code where you are getting this error, i hope you must be getting it on syntax-check.

Regards

Munish Garg

0 Kudos

HI,

Thank you... errors are gone

Sweety