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

Edit and save data in module pool in table control

former_member233553
Active Participant
0 Likes
6,407

Actually once I am going to edit data in Table control it does not hold on screen, but showing in internal table, I am using this code :

MODIFY I_EKPO INDEX TC-CURRENT_LINE. please suggest me. I have attached also a screen shot of debugging of I_ekpo after entering data.

Message was edited by: Matthew Billingham - fixed title. Do not use all CAPITALS please, as it can lead to your posting being rejected.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,599

Hi,

Try this one.

CONTROLS TC TYPE TABLEVIEW USING SCREEN 9000.

DATA COLS LIKE LINE OF TC-COLS. "TO MODIFY COLUMNS

MODULE USER_COMMAND_9000 INPUT.

  CLEAR OK_CODE.

  OK_CODE = SY-UCOMM.


  CASE OK_CODE.

    WHEN 'EDIT'.


      LOOP AT TC-COLS INTO COLS.

        COLS-SCREEN-INPUT = '1'.

        MODIFY TC-COLS FROM COLS INDEX SY-TABIX.

      ENDLOOP.

  ENDCASE.


ENDMODULE.                 " USER_COMMAND_9000  INPUT


13 REPLIES 13
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,599

Check

- PBO did you correctly read the internal table and map fields from program to screen

- PAI did you correcrly map fields from screen to program and then modify internal table

or give more information.

Regards,

Raymond

Read only

0 Likes
3,599

Hi, Raymond,

Yes I have mapped my internal table using loop, and also put a loop PAI. ,after editing internal table holds the entry but Table control does not hold the changes.

Read only

0 Likes
3,599

Can you paste most important part of code in the two LOOP : in PBO and in PAI

Regards,

Raymond

Read only

Former Member
0 Likes
3,599

Hi,

please check PBO when filling internal table.
put a varialble to fill internal table once in PBO.

IF l_mark EQ space.
* fill internal table here i_ekpo
  l_mark = 'X'.
ENDIF.

Read only

Former Member
0 Likes
3,600

Hi,

Try this one.

CONTROLS TC TYPE TABLEVIEW USING SCREEN 9000.

DATA COLS LIKE LINE OF TC-COLS. "TO MODIFY COLUMNS

MODULE USER_COMMAND_9000 INPUT.

  CLEAR OK_CODE.

  OK_CODE = SY-UCOMM.


  CASE OK_CODE.

    WHEN 'EDIT'.


      LOOP AT TC-COLS INTO COLS.

        COLS-SCREEN-INPUT = '1'.

        MODIFY TC-COLS FROM COLS INDEX SY-TABIX.

      ENDLOOP.

  ENDCASE.


ENDMODULE.                 " USER_COMMAND_9000  INPUT


Read only

Arun_Prabhu_K
Active Contributor
0 Likes
3,599

Hi Kumar Krishna Sen,

     Ensure that the screen field attribute "Output field" is ticked.

Regards.

Read only

former_member182379
Contributor
0 Likes
3,599

Hi,

   What code you have in your PBO? May be aftre editing and press enter your internal table is getting modify , but are you selecting the actual saved data from DB in the PBO which is again getting appear on the screen..

regards,

zafar

Read only

Former Member
0 Likes
3,599

Hi Kumar,

You use PAI event to do this operation.put a break point and check what it is happening after pressing the save button.

Let me know if any clarification/help required.

Thanks & Best Regards.

Pavan Neerukonda.

Read only

Former Member
0 Likes
3,599

Hi kumar,

Check in PBO weather the modified data is passing from internal table to screen.

Regards,

Satishreddy.

Read only

0 Likes
3,599

Hi Pavan,

I have used this code in PBO of Table control screen.

loop at i_ekpo with CONTROL tc

         CURSOR tc-current_line. for mapping the TC should I need something more codes, if yes please help me out.

Read only

Sudhakargadde
Participant
0 Likes
3,599

Hi kumar,

i think you changed the code that wizard generated, check the pbo-->loop-->

MODULE tc_enable_screen. if their check the modify statement is their or not,

thanks and regards

Sudhakar

Read only

Former Member
0 Likes
3,599

Hi Krishna,

The flow logic in Module pool will be PBO--->PAI----->PBO.

So the PBO will trigger two times......

Whenever your are updating internal table try to pass this same internal table in PBO...so that data changes wil be reflected in Table control....

Read only

Former Member
0 Likes
3,599

Hi.

IF you use table control wizard to display table control in module pool then it will automatically edit it..

Also check if you are clearing  work area corresponding to internal table  in PBO of screen..