03-15-2007 6:30 PM
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
03-15-2007 6:46 PM
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
03-15-2007 6:37 PM
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
03-15-2007 6:46 PM
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
03-16-2007 9:06 AM
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
03-16-2007 9:11 AM
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
03-16-2007 9:14 AM
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.
03-16-2007 1:09 PM