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

TABLE CONTROL IN MODULE POOL

Former Member
0 Likes
409

Hi,

I am very much new to module pool.I designed a screen in module pool.which has header data and item data.

when the user hits save button all the data which i enter should save in z table.

My current problem is after giving the data.when i hit save button data is geting refreshed and unable to get the data i entered

<<removed by moderator>>

Regards

Rasheed

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
386

Hi,

Check the below lines have you set your workareas to tables.

MOVE-CORRESPONDING <Workarea> TO <workarea of table>.

INSERT INTO <tablename> VALUES <workarea of table>.

Cheers!!

VEnk@

3 REPLIES 3
Read only

Former Member
0 Likes
386

Hi Rasheed,

The Data is getting refreshed because once you click the save button the control again goes back to the PBO of the same screen.

For avoiding this follow the code given below.

*********************Inside PBO *******

module SELECT output.

if var = 0.

DESCRIBE TABLE ITAB_BOOK LINES V_NUM.

TABCON-LINES = V_NUM.

IF SY-TCODE EQ 'Z754BOOK_DISPLAY' OR SY-TCODE EQ 'Z754BOOK_CHANGE' .

SELECT * FROM Z101754SBOOKDETL INTO CORRESPONDING FIELDS OF table ITAB_BOOK.

  • WHERE BOOKID = Z101754SBOOKHDR-BOOKID.

  • APPEND ITAB_BOOK .

ENDIF.

endif.

endmodule.

*****************Inside PAI

&----


*& Module MODIFY INPUT

&----


  • text

----


module MODIFY input.

var = 1.

MODIFY ITAB_BOOK from wa_itab_book INDEX TABCON-CURRENT_LINE.

endmodule. " MODIFY INPUT

The point in here is you need to declare a variable which should prevent the control to go back again to the PBO once the Save button is pressed.

Regards,

Amit .

Read only

Former Member
0 Likes
387

Hi,

Check the below lines have you set your workareas to tables.

MOVE-CORRESPONDING <Workarea> TO <workarea of table>.

INSERT INTO <tablename> VALUES <workarea of table>.

Cheers!!

VEnk@

Read only

former_member206439
Contributor