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

problem in scrolling the table control in module pool

Former Member
0 Likes
1,470

I have created a Table Control with Wizard. My aim is to fetch the data from database then make updation in database table.For this I have created two Function Modules,one for Fetch other for Update.I am calling the FETCH func.mod. in the PBO and UPDATE in PAI.

When data is displayed if I make any changes to any updatable field and scroll down the Table in the screen then as soon as the mouse is clicked for scrolling the updated changes are lost.

Please help me out!!!!!!!!!!!

10 REPLIES 10
Read only

Former Member
0 Likes
1,064

Check In PAI event.

There will be a module modify in chain ...endchain.

there you do some coding..

eg: MODIFY G_TC1_ITAB

FROM G_TC1_WA

INDEX TC1-CURRENT_LINE.

Read only

0 Likes
1,064

Mr.Shaikh,

The code which you have suggested is already generated by the Table Control Wizard.

Still the problem is there.....

Is there any other way out????

Read only

Former Member
0 Likes
1,064

Have u assigned Transaction Code for your prog?

Read only

0 Likes
1,064

OffCourse!!!!!!!

the transaction code is there..

Read only

Former Member
0 Likes
1,064

when are you updating the data to database table...have u provided button to update or it is updating once the change is made in the table control...

Check the code you have written in PBO for fetching the data...debug and see whether it is replacing the updated data or not.

or send PBO & PAI code

Read only

0 Likes
1,064

PROCESS BEFORE OUTPUT.

MODULE INITIALIZE.

*&spwizard: pbo flow logic for tablecontrol 'TBLALLOC_CYC'

module TBLALLOC_CYC_change_tc_attr.

*&spwizard: module TBLALLOC_CYC_change_col_attr.

loop at GT_NEW_ALLOC

into GT_NEW_ALLOC_WA

with control TBLALLOC_CYC

cursor TBLALLOC_CYC-current_line.

module TBLALLOC_CYC_get_lines.

*&spwizard: module TBLALLOC_CYC_change_field_attr

endloop.

MODULE STATUS_9003.

PROCESS AFTER INPUT.

  • MODULE USER_COMMAND_9003.

*MODULE USER_COMMAND_9003.

*&spwizard: pai flow logic for tablecontrol 'TBLALLOC_CYC'

loop at GT_NEW_ALLOC.

chain.

field GT_NEW_ALLOC_WA-/BIC/ZALLOCCYC.

field GT_NEW_ALLOC_WA-/BIC/UFACT_FLG.

field GT_NEW_ALLOC_WA-CHANGEDBY.

field GT_NEW_ALLOC_WA-CH_ON.

field GT_NEW_ALLOC_WA-/BIC/ECHAT.

module TBLALLOC_CYC_modify on chain-request.

endchain.

endloop.

  • module TBLALLOC_CYC_user_command.

*&spwizard: module TBLALLOC_CYC_change_tc_attr.

*&spwizard: module TBLALLOC_CYC_change_col_attr.

module TBLALLOC_CYC_user_command.

MODULE USER_COMMAND_9003.

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

MODULE INITIALIZE OUTPUT.

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

  • At the time of initialization of the screen data is to be displayed

  • by calling Function Module ZUFACTS_FETCH_ALLOC_CYC.

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

CALL FUNCTION 'ZUFACTS_FETCH_ALLOC_CYC'

TABLES

T_ALLOC = GT_NEW_ALLOC

.

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

  • Pass the value displayed in Internal Table GT_OLD_ALLOC.

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

GT_OLD_ALLOC[] = GT_NEW_ALLOC[].

MOVE GT_OLD_ALLOC TO GT_OLD_ALLOC.

*****Initialize the ok_code.

CLEAR OK_CODE .

ENDMODULE. " INITIALIZE OUTPUT

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

MODULE USER_COMMAND_9003 INPUT.

CASE : OK_CODE.

WHEN 'SAVE'.

CALL FUNCTION 'ZUFACTS_UPDATE_ALLOC_CYC'

TABLES

T_OLD_ALLOC = GT_OLD_ALLOC

T_NEW_ALLOC = GT_NEW_ALLOC

EXCEPTIONS

NO_FIELD_UPDATED = 1

UNSUCCESSFUL_UPDATION = 2

OTHERS = 3

.

IF SY-SUBRC = 1.

MESSAGE I005 .

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF SY-SUBRC = 2.

MESSAGE E006.

ENDIF.

WHEN 'CANCEL' OR 'BACK' OR '%EX' OR 'RW'.

LEAVE TO SCREEN 0.

ENDCASE.

CLEAR OK_CODE.

ENDMODULE. " USER_COMMAND_9003 INPUT

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

I have provided a 'SAVE' button to save the changes.

But the problem is before selecting 'SAVE'.

Read only

0 Likes
1,064

hi,

check this help document...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table control in abap.pdf

regards

vijay

Read only

0 Likes
1,064

whais the logic in

module TBLALLOC_CYC_get_lines.

Read only

0 Likes
1,064

module TBLALLOC_CYC_get_lines output.

g_TBLALLOC_CYC_lines = sy-loopc.

endmodule.

This is the logic generated while using table control wizard..

Read only

Former Member
0 Likes
1,064

You just modify the initialisation code as below.

Data: g_copied.

if g_copied is initial.

CALL FUNCTION 'ZUFACTS_FETCH_ALLOC_CYC'

TABLES

T_ALLOC = GT_NEW_ALLOC

g_copied = 'X'.

ENDIF.