11-12-2010 12:23 PM
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
11-12-2010 12:43 PM
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.
11-12-2010 2:00 PM
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
11-15-2010 6:36 AM
Hi Sweety,
PFB..
TABLES vbap.
FIELD-GROUPS header.
START-OF-SELECTION.
INSERT vbap-vbeln INTO header.
INSERT vbap-vgbel INTO header.
Regards,
Pranjali
11-15-2010 6:43 AM
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.
11-15-2010 7:07 AM
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.
11-15-2010 7:14 AM
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
11-15-2010 10:22 AM