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

table control modification

Former Member
0 Likes
1,258

Hi,

This is my situation.

In my table control if i select a row and click modify it wil go to another screen with all the fields of te selected row in input/output field. My query is in which variable will the contents of the selected row be held? How to populate the records in the next screen. Kindly help me on this.

1 ACCEPTED SOLUTION
Read only

former_member196299
Active Contributor
0 Likes
1,238

Hi Harini ,

The answer to your querry is :The selected records values will be stored in the header ( if u have used an itab with header line ) or any workarea to fill the table control . If you have not refreshed this record at the end of programming for the screen1 , the values will be stored in the workarea itself and you can use the same to fill the next screen field values .

If you need further clarification then you can revert to me .

Regards,

Ranjita

13 REPLIES 13
Read only

Former Member
0 Likes
1,238

hi,

u ned to make one module in PAI....

LOOP AT itab.

CHAIN.

FIELD itab-xblnr.

FIELD itab-bldat.

FIELD itab-rmwwr.

field itab-cputm.

ENDCHAIN.

FIELD itab-mark

MODULE tab1_mark ON REQUEST.

*module itab_modify

.* ENDLOOP.

MODULE itab_modify INPUT.

GET CURSOR FIELD xblnr VALUE bill_no.

ENDMODULE. " itab_modify INPUT

MODULE user_command_1000 INPUT.

CASE ok_code.

WHEN 'BACK' OR 'UP' OR 'CANC'.

LEAVE PROGRAM.

WHEN 'SV'.

WHEN 'INFO'.

CALL SCREEN 1001.

ENDCASE.

ENDMODULE. " USER_COMMAND_1000 INPUT

here i am calling another screen for displaying data of selected row...

and in PBO make one module...

PROCESS BEFORE OUTPUT.

module fetch_data1.

module fetch_data1 output.

SELECT SINGLE xblnr bldat rmwwr cputm FROM rbkp INTO

corresponding fields of itab2

WHERE xblnr = bill_no.

APPEND itab2.

endmodule. " fetch_data1 OUTPUT

reward if useful...

Read only

former_member196299
Active Contributor
0 Likes
1,239

Hi Harini ,

The answer to your querry is :The selected records values will be stored in the header ( if u have used an itab with header line ) or any workarea to fill the table control . If you have not refreshed this record at the end of programming for the screen1 , the values will be stored in the workarea itself and you can use the same to fill the next screen field values .

If you need further clarification then you can revert to me .

Regards,

Ranjita

Read only

0 Likes
1,238

hi,

i tried as u said...

but was unable to get the output.

is there anyother way to get the cursor position.?

Read only

0 Likes
1,238

hi,

i think in module pool u can get cursor value only by get cursor.....

I have same report and i ma getting output...

Can u explain me whta u have done in ur report?

Read only

0 Likes
1,238

i have populated the values of a database table in my table control. when the user selects a row and clicks on modify button it call another screen where all the values are populated in an input output box. and the user can modify the value and click save . the vales are then populated in the database.

i want to read the selcted row which am unable to do.

Read only

0 Likes
1,238

ok

when u write GET CURSOR......r u getting any value?

Read only

0 Likes
1,238

ya .. it shows the last value in the database

Read only

0 Likes
1,238

it should display the value which u select......

have u put it into loop endloop in PAI?

and one other option with get cursor is

GET CURSOR LINE line_no.

here u will get selected line so u can use this line_no...

Read only

0 Likes
1,238

GET CURSOR LINE l_line .

Now read the table which is populated in table control with INDEX,l_line.

Edited by: Bushara Bai on Dec 27, 2007 11:05 AM

Read only

Former Member
0 Likes
1,238

hi i tried using the line

READ TABLE itab INDEX table-current_line

but by default only the last line in the table control gets stored in the current_line.

what should i do to get the selected line?

Read only

0 Likes
1,238

hi,

have u tried with my code?

Read only

0 Likes
1,238

no am yet to try.....

isnt there any other way to find the cursor position?

Read only

Former Member
0 Likes
1,238

Hello Harini,

If you set the selColumn attribute in the layout editor of the table control you can easily identify which row was selected. For example I have a screen with a financial projection table and in the control I added the selColumn option and set the field equal to flag. Flag is a field that is in the internal table definition. I then loop at the table where Flag = 'X' and call the next screen to modify passing only those values.

Regards.

Jereme

Edited by: Jereme Ebaugh on Dec 27, 2007 11:19 AM