Application Development and Automation 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: 
Read only

how to update dbtab from table control?

Former Member
0 Likes
1,105

Hi experts,

I have a table control (ZCTRL) which was created manually (not by the wizard). ZCTRL-TEXT is an input field, but when I enter some data and try to save it, it did not update the database table. Actually when I debugg it, I cannot see that the value entered into ZCTRL-TEXT is appearing. What could be the problem?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,066

Hi,

LOOP AT <itab> INTO <wa_itab> WITH CONTROL <ctrl_name>. This statement processes a loop through the lines of the table on the screen

If the fields on the screen have the same structure and name as of the table control , you must return data from the work area to the body of the table itself. You do this using <ctrl_name>-current_line

But, if this is not the case, then it is done programmitically by using MOVE-CORRESPONDING sdyn_conn to <wa_itab>

Try like this.

Amresh

Hi experts,

I have a table control (ZCTRL) which was created manually (not by the wizard). ZCTRL-TEXT is an input field, but when I enter some data and try to save it, it did not update the database table. Actually when I debugg it, I cannot see that the value entered into ZCTRL-TEXT is appearing. What could be the problem?

6 REPLIES 6
Read only

Former Member
0 Likes
1,067

Hi,

LOOP AT <itab> INTO <wa_itab> WITH CONTROL <ctrl_name>. This statement processes a loop through the lines of the table on the screen

If the fields on the screen have the same structure and name as of the table control , you must return data from the work area to the body of the table itself. You do this using <ctrl_name>-current_line

But, if this is not the case, then it is done programmitically by using MOVE-CORRESPONDING sdyn_conn to <wa_itab>

Try like this.

Amresh

Read only

Former Member
0 Likes
1,066

g_ytab_c3_wa-spart = ysmk_scaleoption-spart.

g_ytab_c3_wa-varcond = ysmk_scaleoption-varcond.

g_ytab_c3_wa-vctext = ysmk_scaleoption-vctext.

g_ytab_c3_wa-datab = ysmk_scaleoption-datab.

g_ytab_c3_wa-datbi = ysmk_scaleoption-datbi.

g_ytab_c3_wa-kstbw = ysmk_scaleoption-kstbw.

g_ytab_c3_wa-waers = ysmk_scaleoption-waers.

MODIFY g_ytab_c3_itab

FROM g_ytab_c3_wa

INDEX ytab_c3-current_line.

Read only

Former Member
0 Likes
1,066

I think this topic has been discussed hundreds of times already, so you will get lots of threads if you search the forum.

Do have a habit of Searching the forum before posting a question.

Regards

Karthik D

Read only

0 Likes
1,066

Hello Karthik,

I have read lots of them, but I'm still having the problem since I didn't found the solution yet.

Edited by: mrwhite on Nov 13, 2008 1:48 PM

Read only

Former Member
0 Likes
1,066

I'm using this piece of code, but I cannot see in i_zctrl what I enter on the table control

PROCESS BEFORE OUTPUT.

MODULE status_0200.

LOOP AT i_zctrl

WITH CONTROL zctrl

CURSOR zctrl-current_line.

MODULE set_screen_fields.

ENDLOOP.

Read only

Former Member
0 Likes
1,066

Hi,

Hope the following Threads will help you regarding your problem

Thanks.

Nitesh