‎2008 Oct 29 8:54 AM
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
‎2008 Oct 29 11:15 AM
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@
‎2008 Oct 29 9:29 AM
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 .
‎2008 Oct 29 11:15 AM
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@
‎2008 Oct 29 1:02 PM
http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
You can refer to this link