Module Pool with Selection Screen
I have a module pool in which I've created a sub screen to accommodate select-options.
SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
select-options: r_matnr for mara-matnr.
selection-screen end of screen 1010.
I've put this selection screen in an include of the module pool.
Now I can't seem to see my variable, r_matnr, in the program. How to I pass the value to the program and what have I done wrong. Perhaps where I placed the selection-screen.
Any help would be appreciated.
PS... I can see my screen but when I put the debug on, no value is in r_matnr.
Thanks Marianne
Hi Mariane,
Placing the selection screen declarations in an include does not make any issues. Can you please check your code. For your reference, I am placing a simple piece of code, in which I am also calling a selection screen from within a module pool and displaying the output of the select options. Execute this code and check what is the difference between your code and this.
REPORT zabi_test04.
INCLUDE zabi_test04_i001.
INCLUDE zabi_test04_i002.
START-OF-SELECTION.
CALL SCREEN 9000.
*& Module STATUS_9000 OUTPUT
* text
MODULE status_9000 OUTPUT.
SET PF-STATUS 'STAT9000'.
SET TITLEBAR 'TL1'.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9000 INPUT
* text
MODULE user_command_9000 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE PROGRAM.
WHEN '&SELECT'.
lv_dynnr = '1001'.
CALL SCREEN 9001.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module STATUS_9001 OUTPUT
* text
MODULE status_9001 OUTPUT.
SET PF-STATUS 'STAT9001'.
SET TITLEBAR 'TL2'.
ENDMODULE. " STATUS_9001 OUTPUT
*& Module USER_COMMAND_9001 INPUT
* text
MODULE user_command_9001 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 0.
WHEN '&EXECUTE'.
WRITE s_matnr-low.
LEAVE TO LIST-PROCESSING.
ENDCASE.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Include ZABI_TEST04_I001
TABLES : mara.
DATA : ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm,
lv_dynnr TYPE sy-dynnr VALUE '1001'.
*& Include ZABI_TEST04_I002
SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.
*PARAMETERS p_werks TYPE t001w-werks.
SELECT-OPTIONS s_matnr FOR mara-matnr.
SELECTION-SCREEN END OF SCREEN 1001.
Regards,
Abijith
Similar Messages
-
Module Pool with select options
Hi,
I have created select-option and radio button in Module pool. My req is that I when the user enters any value and click on the radio button the respective programs should be executed.
Thanks
HariHi Hariharan,
I would recommend you to use primarily use push button and then after SUBMIT statement, and also the example for the same is provided below:
*Code used to execute a report
SUBMIT Zreport.
*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
seltab_wa like line of seltab.
seltab_wa-selname = 'PNPPERNR'.
seltab_wa-sign = 'I'.
seltab_wa-option = 'EQ'.
* load each personnel number accessed from the structure into
* parameters to be used in the report
loop at pnppernr.
seltab_wa-low = pnppernr-low.
append seltab_wa to seltab.
endloop.
SUBMIT zreport with selection-table seltab
via selection-screen.
*Code used to populate 'parameters' & execute report
SUBMIT zreport with p_param1 = 'value'
with p_param2 = 'value'.
Please validate the same at your end as well, please come back, if inputs are required.
BR/Thanks
Pranav Agrawal -
MODULE POOL and selection screen
Hello Friends,
I need some help in ABAP. Please give me the overview, how to go about it?
My scenerio is:
I want to write an ABAP code which will display drop down list(list will have few years mentioned in it) on the first screen.
Thn after selecting the year I would like to display months corresponding to that year(it can be in the same screen or some other screen). Now when the user enters some details as per the months, he should het some output after execution(on the same screen or the other).
Please help me with it, so that I can proceed with my deelopment.
Looking forward for your reply.
Regards,
Lokesh
Edited by: LOKESH_SAP on Mar 9, 2010 10:48 AM
Edited by: LOKESH_SAP on Mar 9, 2010 10:48 AMHi,
Use this link, simple steps to learn to display data in ALV Grid.
https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/learn%252bto%252bdisplay%252bdata%252bin%252balv%252bgrid
That was a basic sample code to display data in first alv, now follow the below steps to make it interactive.
When you double-click on any cell of alv grid, use this code to fetch the data of the line that you currently clicked, its working:-
When you double click on the ALV grid line, you will have sy-ucomm = '&IC1'.
So when you define a i_callback_user_command for the FM reuse_alv_grid_display, and create it as:-
FORM command USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
DATA : ok_code TYPE sy-ucomm.
ok_code = ucomm.
CASE ok_code.
WHEN '&IC1'. "for double click on alv grid line
" your code
ENDCASE.
ENDFORM.
As you have used selfield TYPE slis_selfield, the field selfield will hold all the values.
To know on which row you have clicked and to retain that line, use code:-
Suppose you are currently displaying data from internal table itab and corresponding to it you have work area wa.
Now to know the field name that you clicked, use:-
selfield-fieldname " will fetch you the name of field that you clicked
Now using the work-area and the name of field that you clicked, you can easily make out the details of the field i.e., field name and field value and you can code as per your requirement.
Now here you can create a new field catalog and call another FM 'REUSE_ALV_GRID_DISPLAY' to display further information in the next grid based on the value obtained when user double clicks a cell.
Hope this helps you.
Thanks & Regards,
Tarun Gambhir -
Sort up and sort Down push buttons in module pool with table control wizard
hi,
i have created 2 buttons for Sort up and sort Down push buttons in module pool with table control wizard
please any one can help me.
regardsHi
Following code is to enable and disable the tbl control using two buttons. Just alter the code and for each button write the sort code.
REPORT YJAN27_SCREEN .
TABLES: SFLIGHT, YFLIGHT_28.
TYPES: BEGIN OF struct1,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
END OF struct1.
CONTROLS TBL1 TYPE TABLEVIEW USING SCREEN 2700.
DATA: OK_CODE LIKE SY-UCOMM,
CARRID LIKE SFLIGHT-CARRID, "cols in tbl ctrl
CONNID LIKE SFLIGHT-CONNID,
FLDATE LIKE SFLIGHT-FLDATE,
itab TYPE TABLE OF STRUCT1 WITH HEADER LINE,
cols like line of TBL1-COLS,
FLAG TYPE I.
FLAG = 1.
CALL SCREEN 2700.
*& Module STATUS_2700 OUTPUT
* text
MODULE STATUS_2700 OUTPUT.
SET PF-STATUS 'BACK'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_2700 OUTPUT
*& Module USER_COMMAND_2700 INPUT
* text
MODULE USER_COMMAND_2700 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'DIS'. "write code for sort up
loop AT TBL1-COLS INTO COLS.
COLS-SCREEN-INPUT = 0.
MODIFY TBL1-COLS FROM COLS.
ENDLOOP.
FLAG = 2.
WHEN 'ENA'. "write code for sort down
loop AT TBL1-COLS INTO COLS.
COLS-SCREEN-INPUT = 1.
MODIFY TBL1-COLS FROM COLS.
ENDLOOP.
FLAG = 1.
ENDCASE.
ENDMODULE. " USER_COMMAND_2700 INPUT
*& Module GET_DATA OUTPUT
* text
MODULE GET_DATA OUTPUT.
select carrid connid fldate from SFLIGHT into table itab.
ENDMODULE. " GET_DATA OUTPUT
*& Module POPULATE_TBL OUTPUT
* text
MODULE POPULATE_TBL OUTPUT.
MOVE-CORRESPONDING ITAB TO SFLIGHT.
ENDMODULE. " POPULATE_TBL OUTPUT
*& Module CHANGE_SCREEN OUTPUT
* text
MODULE CHANGE_SCREEN OUTPUT. " use this module if you want to hide the other button
CASE FLAG.
WHEN 1.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_ENA'.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_DIS'.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN 2.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_DIS'.
SCREEN-INVISIBLE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'B_ENA'.
SCREEN-INVISIBLE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDCASE.
ENDMODULE. " CHANGE_SCREEN OUTPUT
PROCESS BEFORE OUTPUT.
MODULE STATUS_2700.
MODULE CHANGE_SCREEN. " use this if you want to display one button at a time
MODULE GET_DATA.
loop at itab WITH control TBL1.
MODULE POPULATE_TBL. " populate tbl ctrl
endloop.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_2700. " do the sort operations
loop at itab.
endloop.
Hope this helps
Regards,
Jayanthi.K -
How to create tcode for modulepool program with selection screen?
hi,
How to create tcode for modulepool program with selection screen?
thanks,
sagarHi,
We need to goto SE80.
In our program we right click on object name and goto create
-> transaction. Enter the module pool program and screen number and save and activate.
Or by SE93 also we can create a transaction code for our program.
Hope ths helps.
plz reward if useful.
thanks,
dhanashri..
Edited by: Dhanashri Pawar on Jul 22, 2008 8:29 AM -
Module pool with object oriented programming
can anyone send me links for module pool with object oriented programming.
hi,
some helful links.
Go through the below links,
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
<u>Sample std pgms.</u>
ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
Rgds
Reshma -
Submit program with selection screen parameters - getting blank values
Hi, I'm submitting a program with selection screen parameters. when I pass '000' (I_TPLSCN )value for Planning Scenario and when this goes to selection screen then I don't see value for Planning scenario as '000'(I_TPLSCN ) but the value is blank in selection screen. I'm using the below code for this.
SUBMIT RMCPAMRP WITH MATNR_GL EQ I_MATNR SIGN 'I'
WITH WERKS_GL EQ I_WERKS SIGN 'I'
WITH PLSCN EQ I_TPLSCN SIGN 'I'
via selection-screen AND RETURN.
Could anyone please help me how to display value '000' rather than blanks.
thanks in advance.If I_MATNR, I_TPLSCN and I_WERKS are variable then try with
SUBMIT rmcpamrp
WITH matnr_gl = i_matnr
WITH plscn = i_tplscn
WITH werks_gl = i_werks
via selection-screen
AND RETURN .
If I_MATNR, I_TPLSCN and I_WERKS are of type range then try with
SUBMIT rmcpamrp
WITH matnr_gl IN i_matnr
WITH plscn IN i_tplscn
WITH werks_gl IN i_werks
via selection-screen
AND RETURN
Edited by: Pawan Kesari on Dec 24, 2009 3:33 PM -
How to fill internal table with selection screen field.
Hi all,
i am new to sap . pls tell me how to fill internal table with selection screen field.Hi,
Please see the example below:-
I have used both select-options and parameter on the selection-screen.
Understand the same.
* type declaration
TYPES: BEGIN OF t_matnr,
matnr TYPE matnr,
END OF t_matnr,
BEGIN OF t_vbeln,
vbeln TYPE vbeln,
END OF t_vbeln.
* internal table declaration
DATA : it_mara TYPE STANDARD TABLE OF t_matnr,
it_vbeln TYPE STANDARD TABLE OF t_vbeln.
* workarea declaration
DATA : wa_mara TYPE t_matnr,
wa_vbeln TYPE t_vbeln.
* selection-screen field
SELECTION-SCREEN: BEGIN OF BLOCK b1.
PARAMETERS : p_matnr TYPE matnr.
SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
SELECTION-SCREEN: END OF BLOCK b1.
START-OF-SELECTION.
* I am adding parameter value to my internal table
wa_mara-matnr = p_matnr.
APPEND wa_mara TO it_mara.
* I am adding select-options value to an internal table
LOOP AT s_vbeln.
wa_vbeln-vbeln = s_vbeln-low.
APPEND wa_vbeln TO it_vbeln.
ENDLOOP.
Regards,
Ankur Parab -
How to create a Drop down with values in Module Pool for a screen field.
Hi all,
I have created a Screen on which one field is created Say Bank Name. I would like to give some spcific value for this fileld where user can select only seeing in drop down cann't enter.
Can anyone tell how can we do it ?Hi,
The selected value key will be stored in the parameter.
eg: Refer below code. Here if i select Vinod then po_name will be 1. After this read i_values WITH this key and get the actual value.
PARAMETERS: po_name(30) TYPE c VISIBLE LENGTH 20 AS LISTBOX.
TYPE-POOLS: VRM.
DATA: i_values TYPE vrm_values,
wa_values LIKE LINE OF i_values.
AT SELECTION-SCREEN OUTPUT.
wa_values-key = '1'.
wa_values-text = 'Vinod'.
APPEND wa_values TO i_values.
wa_values-key = '2'.
wa_values-text = 'Kumar'.
APPEND wa_values TO i_values.
wa_values-key = '3'.
wa_values-text = 'Reddy'.
APPEND wa_values TO i_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'PO_NAME'
values = i_values
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
START-OF-SELECTION.
READ TABLE i_values INTO wa_values WITH KEY key = po_name.
MOVE wa_values-text TO w_name. " This will be ur actual value.
Thanks,
Vinod.
Edited by: Vinod Reddy Vemuru on Jul 8, 2008 4:16 PM -
Select-option in module pool with table Control
HI,
How to use the select-option in Module Pool and how Can i use the Table control in it.
Can any body give me some Clues.
with rgds
RanjithHi ..
PBO.
LOOP at <table contriol>
module --- Inside the module
DATA: g_uti TYPE REF TO cl_fobu_input_util.
if rollname <> space.
CREATE OBJECT g_uti
EXPORTING typename =rollname.
*....convert to external pattern
CALL METHOD g_util->output_convert
EXPORTING
field_value_int = p_value " This is Tablecontrol-low
IMPORTING
field_value_ext = p_value. " Retrun value for Low
ENDLOOP.
lly you have code in PAI
DATA: g_util_1 TYPE REF TO cl_fobu_input_util.
if rollname <> space.
CREATE OBJECT g_util_1
EXPORTING typename = rollname.
*....convert to internal pattern
CALL METHOD g_util_1->input_convert
EXPORTING
field_value_ext = p_value
IMPORTING
field_value_int_c = p_value.
The above code should be written for tablecontrol-high aswell..
you can also refer: Inlcude LSE16NF10 line no 341 & 434 (SE16n)
Nag -
Exporting Module pool with screen
Hi,
I want to export module pool that I created to a file and import it back later. I could find a SAP Program RSTXSCRP to export SAPscript but no success in exporting a function module. Please help.
Regards,
NikhilHi Nikhil!
If you just want to do this once, you can use transaction SE80 and menu point Utilities - More utilities - download (for each include / component).
Otherwise a special program is easier to use, take e.g. this one:
http://www.members.tripod.com/abap4/Upload_and_Download_ABAP_Source_Code.html
Regards,
Christian
P.S.: or these one:
... or this one:
http://sap.ittoolbox.com/code/d.asp?d=1623&a=s
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/finding your code in bsp applications.article
http://www.geocities.com/rmtiwari/Resources/Utilities/WebViewer.html
Message was edited by: Christian Wohlfahrt -
Module pool ( call multiple screens )
hi abapers,
in module pool program ,
iam call one screen into another screen .
ex : screen no . 100
iam designed table control with some column fields .
iam call one of column field of table control into another screen,
at that time last record value of that field will comes to the other screen.
but i want, what of the selected value of field value comes to the other call screen number.Hi Raj,
Use GET CURSOR FIELD FNAME VALUE FVAL.
Whis is a syntax for system can identify yhe record i.e we can able to select one record from screen 100 is transferred to screen 120.
FNAME ---> Field Name
FVAL----->Value Which is selected from that Value (screen 100)..
Regards
Ranga -
Issue with selection screen element on At slection scree
Hi All,
I am facing an issue with a checkbox which is present within the subscreen of a standard selection screen.
The issue is that the value of the combobox get toggled by itselfon the event mentioned below. I am unable to find out how this combo box value gets changed by itself on the screen events.I tried clear statemetns etc nothing is helping. I debugged with a watch point on this screen element and found this to happen.It just changes the value of the element to a previously held state.I m trying to clear the combobox but this event puts back the tick mark.How can I stop this.
AT SELECTION-SCREEN ON COL_FROM. "COL_FROM is another screen element diffrent from the combobox
ThanksHi Vighneswaran CE,
This event corresponds to the PAI module of the COL_FROM field. So, it gets executed each time you press any valid function code on the screen (unless there was an error in a previous field). Nothing abnormal here.
That's difficult to help you on that topic, you'd better tell us exactly what report it is, where you have added your code (and what code) to change the checkbox, ...
Best regards,
Sandra -
Call a report with selection screen as subscreen.
Hi all,
i need to Submit And Return a Report having some parameters and Select options, from a Function Module.
all i want that the Selection Scrren of Report should appeared as Subscreeen, so that Calling Screen sould be visible in Background.
Is this Possible , if yes then How ?
thanks in advance,
NitinRunning new report means opening new internal session. This can't be embeded within the current internal session where your function group (function module specifically) runs. So there is no such a way which you could run a report inside a subscreen area.
If you however want only selection screen of the report to be embeded inside your subscreen area (not run) you can use
"report Z_SUBSCREEN_REPORT
SELECTION-SCREEN BEGIN OF SCREEN 0200 as SUBSCREEN.
PARAMETERS pa type c.
SELECTION-SCREEN end of SCREEN 0200.
"main screen's flow logic in function group with subscreen area
PROCESS BEFORE OUTPUT.
call SUBSCREEN area INCLUDING 'Z_SUBSCREEN_REPORT '0200'.
Regards
Marcin -
Module pool with table controlls
Hi all.
I have an Issue in module pool program.
I am developing it to update a d/b table.in that I have
a total of 40 fields are there.in those 10 are to be entered and save.
I am using table controlls.Can any body help me to solve
1.the manual entry fields are date fields.I am getting those from my internal table.I want f4 help for those date filds.it is not comming here.
but in the d/b table fot that corresponding field it is comming.
2.in the attributes of the table controll ,it is giving the option to freeze the number of columns.but this numbering is from left to right.
but I want to freeze coloumns in between.
is it possible.
3.can any body tell me the logic for table controll to update the d/b table.Because there is no row selection(left side pushbuttons to the table controll).
how to capture the data what I entered in the rows.
Thanks in advance,
Regards,
Eswarvenkat,
We cannot freeze the columns in the middle.
Check for F4 what attribute is set for the field in screen layout. ( field attributes programs tab->Poss. entries)
Refer this example for tablecontrol
http://www.sappoint.com/abap/dptc1.pdf
Regds
Man
Maybe you are looking for
-
Updating array data in sql database
HI, Im facing problems in updating array data in SQL database. As of now, i am able to write an "insert" query and insert array data in an image datatype field. Im using image datatype because the array size is very big(around 80,000 x and y values).
-
How can I get the ibooks onto a 2nd generation ipod touch since it requires 5.0 and the version on the ipod is only 4.2.1? Surely, I should be able to read books on the 2nd generation ipod, right?
-
Biege G3 won't boot with OS 9.2
I purchased a biege G3 MT with OS 8.6 on eBay. Unfortunately, the OS is in French. I upgraded that to OS 9.2 and now it won't boot. No chime and it stops after the first icon during startup. It won't boot with extensions off nor with the CD. I tried
-
"HTTP error: 501 Not Implemented" error while uploading emp photo
Hi, While uploading employee photo getting error "HTTP error: 501 Not Implemented" this error i am getting while linking employee photo to SAP. pls suggest me how to solve. thanx in advance
-
I have a Macbook Pro 15" intel Core Duo bought last year. I wanted to use the Bootcamp to install the Windows XP SP2. I was able to partition the disk and start the Windows instalation. However, when the installation finishes loading all the drivers,