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: 

TABLE CONTROL : Values in itab not changing even after editing fields

Former Member
0 Kudos

Dear Friends

I have createda table control and i have the fields in it associated with

the internal table.

so the fields of table control looks some thing like

itab-name

itab-age

itab-salary etc.,

I am making some changes to these fields.

In the PAI, i am trying to loop on the internal table to see if

i can see the changes to these records in the internal table

but it is not seeing the changes at all.

What ever data was there in the internal table before putting it

into table control still shows the same values, even though I have

entered new values in the internal table's fields.

Has anybody seen this kind of a problem before? Any feed back will

be greatly appreciated.

Thanks

Ram

1 ACCEPTED SOLUTION

Former Member

Hi,

You have to modify the internal table..

Example..

PROCESS AFTER INPUT.

LOOP AT ITAB.

MODULE UPDATE_DATA.

ENDLOOP.

MODULE UPDATE_DATA.

MOVE-CORRESPONDING SCREEN_FIELD TO ITAB.

  • Modify the current line..where TC will be the table control name..

MODIFY ITAB INDEX TC-CURRENT_LINE.

IF SY-SUBRC <> 0.

  • If no record found then insert the record to the internal table.

APPEND ITAB.

ENDIF.

ENDMODULE.

Thanks,

Naren

6 REPLIES 6

Former Member
0 Kudos

In other words

When I click on update it is not updating the fields. So i went to debug mode in PAI and saw that none of the changes were seen. Still the same old values are there. So when I update, it is updating with the same values but not the ones that I had entered in the table control before clicking on UPDATE.

Thanks

Ram

Former Member

Hi,

You have to modify the internal table..

Example..

PROCESS AFTER INPUT.

LOOP AT ITAB.

MODULE UPDATE_DATA.

ENDLOOP.

MODULE UPDATE_DATA.

MOVE-CORRESPONDING SCREEN_FIELD TO ITAB.

  • Modify the current line..where TC will be the table control name..

MODIFY ITAB INDEX TC-CURRENT_LINE.

IF SY-SUBRC <> 0.

  • If no record found then insert the record to the internal table.

APPEND ITAB.

ENDIF.

ENDMODULE.

Thanks,

Naren

Former Member
0 Kudos

hi

this is sample code .we must modify internal table from workarea.

PAI

****************************

LOOP AT it_distpdts.

MODULE update_ordertable.

ENDLOOP.

MODULE update_ordertable INPUT.

is_distpdts-quantity = tx_quantity."this is field in screen which is passed to work area

MODIFY it_distpdts

FROM is_distpdts

INDEX c_tc2-current_line.

ENDMODULE.

**************************

Hope this will help u

Regards

shinu

Former Member
0 Kudos

Hi

You must pass data from internal table to the table control in pbo and back in pai.

check this program :

BCALV_FULLSCREEN_GRID_EDIT

Regards,

Prasanth

  • reward all heplful replies

Former Member
0 Kudos

See the following ex:

PROCESS AFTER INPUT.

*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC1'

*BREAK POINT.

LOOP AT G_TC1_ITAB.

CHAIN.

FIELD ZFG_SRNO-ZSRNO.

MODULE TC1_MODIFY ON CHAIN-REQUEST.

  • MODULE TC1_MODIFY.

ENDCHAIN.

MODULE MESSAGE .

MODULE DELETE_RECORD.

ENDLOOP.

MODULE TC1_MODIFY INPUT.

MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_WA.

MODIFY G_TC1_ITAB

FROM G_TC1_WA

INDEX TC1-CURRENT_LINE.

ENDMODULE.

Former Member
0 Kudos

thanks to every one for the responses. I appreciate it.

Ram