‎2008 Mar 31 12:53 PM
Hello gurus ,
Hw can I create select-option in a module pool prog , is there any way , plz help .
I m waiting for your rply .
Thanks in advance .
Regards ,
Joy Chakravorty .
‎2008 Apr 02 8:08 AM
Joy,
That day i just tried to explain what Byju said. Now i am coming with solution for your requirement. Please go through that.
It is possible to create select-option on the screen using modulepool program.
1.
Define the selection-screen as subscreen in the top include of module pool program.
create modulepool program SAPMZ_SELOPT
Place the below code.or u can define that in top include.
2.
Goto garphical layout editor, drag Subscreen and drop on screen means define Subscreen area on the screen.
Place the below code in the PBO.
REPORT SAPMZ_SELOPT.
TABLES :pa0001.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS: p_bukrs FOR pa0001-bukrs.
SELECTION-SCREEN END OF SCREEN 100.
Its working fine. We can write code like that as well.
I hope that your problem is solved
Regards,
Venkat.O
process before output.
" MODULE STATUS_1001.
call subscreen sub_area including 'SAPMZ_SELOPT' '100'.
process after input.
" MODULE USER_COMMAND_1001.
‎2008 Mar 31 1:53 PM
Hello Joy,
The main idea of module pool is to create screens and put fields in them....but select options can also be used to take initial data from the user and do processing accordingly..some sample code is given below....
create a program in se38 and create screen 100 for it.
in the screen 100 put some fields using the screen painter.
and in the main program copy the code.
data : int_vbap type table of vbap with header line.
Select-options: S_ABC for VBELN_VA.
start-of-selection.
Select * from VBAP into table int_vbap where
VBELN in S_ABC.
if sy-subrc = 0.
call screen 100.
else.
Message 'Invalid data' type 'I'.
Exit.
endif.
so if the sy-subrc fails..it gives a message...then it will not go to the next screen 100...so we did use select-options in a module pool program...we can use select options in the same way we do for a report provided they are used for the initial screen in a module pool
You can use select-options to replace initial screen which can be created using a screen separately in the module pool meant to fetch data from user for further processing.
If you have a specific requirement pls mention that
Reward if helpful
Regards
Byju
‎2008 Mar 31 2:08 PM
thanks , but I m nt getting where 2 write that code in pbo or in pai .
‎2008 Mar 31 2:41 PM
Hi joy, Select-option creation is not possible to be frankly on the screen by module pool. But what Byju trying to say is that Create one report with Selection-screen by giving Select-Option and call another Screen by using statement CALL SCREEN 100. when you double click on screen 100. screen 100 displayed and do whatever u want on the 100. Is that right Byju ?? Regards, Venkat.O
‎2008 Apr 02 8:08 AM
Joy,
That day i just tried to explain what Byju said. Now i am coming with solution for your requirement. Please go through that.
It is possible to create select-option on the screen using modulepool program.
1.
Define the selection-screen as subscreen in the top include of module pool program.
create modulepool program SAPMZ_SELOPT
Place the below code.or u can define that in top include.
2.
Goto garphical layout editor, drag Subscreen and drop on screen means define Subscreen area on the screen.
Place the below code in the PBO.
REPORT SAPMZ_SELOPT.
TABLES :pa0001.
SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS: p_bukrs FOR pa0001-bukrs.
SELECTION-SCREEN END OF SCREEN 100.
Its working fine. We can write code like that as well.
I hope that your problem is solved
Regards,
Venkat.O
process before output.
" MODULE STATUS_1001.
call subscreen sub_area including 'SAPMZ_SELOPT' '100'.
process after input.
" MODULE USER_COMMAND_1001.