‎2014 May 26 12:18 PM
Hi experts,
I have created Table control. There are 4 push button Display, Delete, Exit, Insert.
Now all push buttons are working but Insert button is not working. When I click display button I get records from database table in
my table control. What I need is when I put record in my table control and click Insert push button I want table record to be inserted in
my database table.
Regards,
Sandeep.
‎2014 May 26 12:58 PM
Hi sandeep ,
Are you getting the records in table control or not ?
Plz. check it
and then
add COMMIT WORK. after the insert statement
Regards ,
Yogendra Bhaskar
‎2014 May 26 12:39 PM
Hi Sandeep,
I guess you want to update the selected records in table control, to database. For this:
1. Assign a function code for INSERT button.
2. Write a logic within CASE-ENDCASE for that function.
WHEN 'INSERT'.
LOOP AT i_tc INTO w_tc WHERE sel = 'X'.
MODIFY/INSERT/UPDATE dbtab FROM w_tc.
CLEAR: w_tc.
ENDLOOP.
NOTE: considered SEL as the column name for selecting entries in table control, i_tc is your internal table and w_tc is work area for the same.
Regards,
Anubhab
‎2014 May 26 12:45 PM
Hi anubhab,
I have already tried this logic. It inserts blank row in DB table.
‎2014 May 26 12:50 PM
Hi Sandeep,
Did you check in debugger if you are getting desired values in PAI while looping at the internal table?
And also if you are directly updating the DB table from work area, are both of them compatible with each other?
Did you check the sy-subrc value after INSERT/MODIFY/UPDATE statement?
Regards,
Anubhab
‎2014 May 26 12:53 PM
Hi Sandeep,
First you insert rows into the internal table behind your table control. Then you update your database table with the newly inserted rows in the internal table.
Regards,
Abijith
‎2014 May 26 12:58 PM
Hi sandeep ,
Are you getting the records in table control or not ?
Plz. check it
and then
add COMMIT WORK. after the insert statement
Regards ,
Yogendra Bhaskar
‎2014 May 26 1:23 PM
In pbo I have written MOVE-CORRESPONDING INT_TAB TO DB TABLE.
While inserting record in table control internal table shows blank..
‎2014 May 26 1:34 PM
Hi Sandeep ,
You have to code in PAI
Does this code include in your PAI :
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC'
LOOP AT INT_TAB.
CHAIN.
FIELD INT_TAB-FIELD1.
FIELD INT_TAB-FIELD2.
FIELD INT_TAB-FIELD3.
FIELD INT_TAB-FIELD4.
MODULE TC_MODIFY ON CHAIN-REQUEST.
endchain.
ENDLOOP.
Regards
Yogendra Bhaskar
‎2014 May 27 6:26 AM
I do not understand where I am doing wrong.. Tried this logic also, still not working..
‎2014 May 27 6:35 AM
‎2014 May 27 6:38 AM
Hi Sandeep ,
Could you paste the code used in PAI with modules ?
Regards,
Yogendra
‎2014 May 27 6:46 AM