2013 May 27 9:47 AM
Hi All,
I have a table control in my screen and the table control will update the Database table . When i enter the value in the table control and i press enter the values i entered is not in the screen . Its simply reset. I am using the table control with wizard. i know that i need to write some code in the automated code. can you please share some code sample.
Thanks,
Pradeep.
Hi All,
I have a table control in my screen and the table control will update the Database table . When i enter the value in the table control and i press enter the values i entered is not in the screen . Its simply reset. I am using the table control with wizard. i know that i need to write some code in the automated code. can you please share some code sample.
Thanks,
Pradeep.
2013 May 27 10:12 AM
Hi Pradeep
when you click enter button
in PBO BUTTON
write you code in module_user_command_<scrno>
by default this will be commented
uncomment and write your code
be sure that you are not refreshing the internal table before you update the table.
module user_command_<scrno>
if sy-ucomm = 'ENTER'
UPDATE sflight(db table) FROM TABLE sflight_tab(internal table) .
ENDIF.
endmodule
refer to below document
http://saptechnical.com/Tutorials/ABAP/TableControl/Wizard.htm
2013 May 27 10:21 AM
Look in the PAI of the screen, there must be a module between the LOOP/ENDLOOP on the table control, usually the last one, in this module insure you read and modify the internal table in the program. Look at this sample in sap documentation : Table Control with Modifications
Regards,
Raymond
2013 May 27 11:40 AM
Raymond,
Thanks for the input . I tried and i am getting an error in the flights-lines = lines statement.
2013 May 27 12:05 PM
In the PAI you should have something like
* Flow logic
PROCESS AFTER INPUT.
LOOP AT itab.
MODULE read_itab.
field dynpro-fieldname.
MODULE modify_itab.
ENDLOOP.
* include of PAI
MODULE read_itab INPUT.
READ TABLE itab INDEX control-current_line.
ENDMODULE. " task_210_read INPUTs
MODULE modify_itab INPUT.
itab-fieldname = dynpro-fieldname.
MODIFY itab INDEX control-current_line.
ENDMODULE.
Don't confuse control name and itab/work area name
Regards,
Raymond
2013 May 27 12:53 PM
I debugged the code and when i enter the value in the table control screen and i press enter the cursor came in line no 3. there my itab is initial so the line no 09 and 013 fails.
2013 May 27 1:46 PM
HI All,
I have to use the current line . describe table lines statement to fix this issue. but i don't know exactly where to write the code.
2013 May 27 10:24 AM
Hi,
As suggested please check your PAI event as all the updates happen there you must be refreshing or clearing tables or variable.
Cheers,
Arindam
2013 May 27 3:09 PM
2013 May 27 11:57 AM
Assign Function Code 'CHECK' for standard toolbar(Tick Mark)
In PBO...
LOOP WITH CONTROL TBLCTRL .
MODULE DISPLAY_DATA.
ENDLOOP.
In PAI...
LOOP WITH CONTROL TBLCTRL .
CHAIN.
FIELD WA_DATA-FIELD1.<=Table Control Table Fields
FIELD WA_DATA-FIELD2.
FIELD WA_DATA-FIELD3.
MODULE VALIDATE_DATA ON CHAIN-INPUT.
MODULE MODIFY_TBL_INPUT.
ENDCHAIN.
ENDLOOP.
*****************MODULE DISPLAY_DATA.****************
READ TABLE IT_DATA INTO WA_DATA INDEX TBLCTRL-CURRENT_LINE.
MOVE-CORRESPONDING WA_DATA TO TBLCTRL.
*****************MODULE VALIDATE_DATA.****************
IF SY-UCOMM = 'CHECK' .
IF IT_DATA-FIELD1 EQ SPACE.
SET CURSOR FIELD 'WA_DATA-FIELD1' LINE TB_LN.
MESSAGE E0xx(xx).
ELSEIF...................
*This will make cursor to move on the field on ENTER key.
ENDIF.
ENDIF.
*****************MODIFY_TBL_INPUT****************
MODIFY IT_DATA FROM WA_DATA INDEX TBLCTRL-CURRENT_LINE.
Hope It will help you.
Regards,
Amrendra
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |