Tuesday, April 16, 2013

Select Options in Module Pool Program

We can make Select Option for input element in the module pool program. Following are the steps.

Step-1
Go to SE80 and create a program (here it is zsandip_mod).

Step-2
Create top include with naming convention.
Here the names are:

INCLUDE zsandip_top                             .  " global Data
INCLUDE zsandip_o01                             .  " PBO-Modules
INCLUDE zsandip_i01                             .  " PAI-Modules
INCLUDE zsandip_f01                             .  " FORM-Routines

Step-3
Create a screen that contains a number (here 9000).

Step-4
Inside the screen create a sub screen by using the sub screen tool bar. There is no need to create that sub screen separately.

Step-5
In the Top Include mention the select option like below:

TABLES mara.
DATA: ok_code TYPE sy-ucomm.

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECT-OPTIONS   s_matnr FOR mara-matnr.
SELECTION-SCREEN END OF SCREEN 100.

Step-6
Now write the code in the flow logic of the screen 9000. In PBO we are calling sub screen 'SEL' which is including the program name with the sub screen number '100'. After that we have to call sub screen 'SEL' at first in the PAI block. If here it is not declared then the Select Option will remain blank.

PROCESS BEFORE OUTPUT.
  MODULE status_9000.
  CALL SUBSCREEN sel INCLUDING sy-repid '100'.

PROCESS AFTER INPUT.
  CALL SUBSCREEN sel.
  MODULE user_command_9000.

Here in the Element List we have to declare the ok_code.

Step-7
After that create the GUI status and PF status in the PBO module.

Step-8
Next in PAI module mention the code shown below:

    CASE ok_code.
    WHEN 'BACK'.
      PERFORM leave.
    WHEN 'EXIT'.
      PERFORM leave.
    WHEN 'CANCEL'.
      PERFORM leave.
  ENDCASE.

Step-9
Next declare the subroutine in INCLUDE zsandip_f01 and mention the following code:

  LEAVE TO SCREEN 0.
  LEAVE LIST-PROCESSING.

Step-10
Finally create a transaction code (here zsr_mod) and run that by separately.

Layout is as follows (to view large click on the figure):



Output is as follows (to view large click on the figure):

20 comments:

David said...

In this Article Im not able to put
Select-options on Subscreen....
Its not invoking Select-optoons Declaration from Top_program...>
how...! Explain Clearly....!

SANDIP ROY said...

I think you have created a sub screen separately. Please create sub screen by Screen Painter (Layout button) with sub screen toolbar. I have mentioned a screen shot.

David said...

Yeah...Now i Got it...! :)

yektek training said...

nice post thanks for sharing from Swathi

Anonymous said...

The selection screen is getting refreshed each and every time i try to give an input and the range options dialog is also not displayed. What could be the problem??

Regards
Priscilla

lee woo said...

The more we exploit nature, The more our options are reduced, until we have only one: to fight for survival. See the link below for more info.


#options
www.ufgop.org

Silvia Jacinto said...

I am very happy to visit your site and i did like it. I was able to get some informative topics. keep it up and you can also visit my site for your reference. Thank you and have a good day.

n8fan.net

www.n8fan.net

piyush said...

Hi,
We are doing product development like add-on product. Can anyone tell me that how can I provide some exits and implicit/explicit enhancement point in our program so that later a developer/customer could enhance it by using that?

Anonymous said...

Thank you very much for this article! S.

Bhavya Kumar said...

Best blog.Got to learn new things.Thanks for this Blog SAP Success Factors Training in Chennai

Shalini said...


Hi, This is shalini from Chennai learned SAP Training in Chennai from mr.karthick. The training really was good and i got selected in leading mnc company as SAP Consultant.

You can contact 8122241286 for Best SAP Training in Chennai or reach www.thecreatingexperts.com

sanayamohit said...

SAP Success Factors Real Time Hands on Training in Chennai...

Don't always Depend on Training Institute Alone and so please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer over SAP Success Factors Means??? Please ready for an DEMO From the Trainer MR.Karthick
CONTACT:8122241286

Both Classroom/Online Training is Available!!!!!!

Shruti Ramalingam said...

From My search…Creating Experts provides Best SAP Training with real time projects assistance.

Most of the modules are equipped with advance level topics which the student can learn from the basics to the advance level stage.

They also provide placement assistance in leading MNC companies across the globe according to the current requirements.

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

And these are the Best SAP training institute which provides Real Time Hands on Training…

codedion Technologies-9003085882

creating Experts-8122241286

http://thecreatingexperts.com/sap-mm-training-in-chennai/

sushma said...

SAP Success Factors Real Time Hands on Training in Chennai…

Don’t always Depend on Training Institute alone.Please aware of Best Trainers too..

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

Unknown said...

Best SAP Success Factors Training Institute in Chennai
Best SAP MM Training in Chennai
Best SAP SD Training in Chennai
Best SAP ABAP Training in Chennai
Best SAP FICO Training in Chennai
Best SAP BASIS Training in Chennai

http://thecreatingexperts.com/sap-successfactors-training-in-chennai/
http://thecreatingexperts.com/sap-mm-training-in-chennai/
http://thecreatingexperts.com/sap-sd-training-in-chennai/
http://thecreatingexperts.com/sap-hr-training-in-chennai/
http://thecreatingexperts.com/sap-fico-training-in-chennai/
http://thecreatingexperts.com/sap-abap-training-in-chennai/
http://thecreatingexperts.com/sap-basis-training-in-chennai/

If You need a Best Trainer in SAP Success Factors??? Then be ready for a DEMO From the Trainer MR.Karthick
CONTACT:8122241286
http://thecreatingexperts.com/sap-mm-training-in-chennai/

Both Classroom/Online Training is Available!!!!!!

sanayamohit said...

Hi, I learned SAP Training in Chennai from THE CREATING EXPERTS. The training was good and i got selected in leading MNC company as SAP Consultant.

contact 8122241286

www.thecreatingexperts.com

ragu varan said...

Best SAP HANA Training in Chennai by leading HANA Consultant.
Reach at 9003085882
http://thecreatingexperts.com/category/sap-hana-training-in-chennai/

gilledashivani said...

The information provided here is of great use as I got to learn new things. Keep blogging.
SAP ABAP TRAINING IN HYDERABAD

James Fosten said...

?I used to be very pleased to search out this net-site.I needed to thanks on your time for this excellent learn!! I definitely enjoying every little bit of it and I've you bookmarked to check out new stuff you weblog post. mgm online casino

calfre services said...

thank you for sharing nyce information really very nice ..i am intrested ur sap course for more info sap hr abap online classes