DYNAMIC SELECTION SCREEN uisng FREE_SELECTIONS_INIT
Hi,
I am facing a problem regarding the dynamic selection screen using FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG .After entering the values in Dynamic Selections on pressing Enter, the values are getting distorted.For example if i gave the purchase order no as 0099994434 it is getting truncated to four digits no like 0099.
Its a bit urgent .Can any body help me out in resolving this isuue.
Hi,
You may refer this http://help.sap.com/saphelp_47x200/helpdata/en/9f/db996135c111d1829f0000e829fbfe/frameset.htm
Raja T
Message was edited by:
Raja T
Similar Messages
-
Specific criteria in dynamic selection screen.
Hi experts.
I have a requirement to build dynamic selection screen fields. For these I would like to use FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG function modules.
The problem is that all fields could be single field or as a range... Is there any chance to make specific fields (DATS) as a single field and others as a range ?
Thanks a lot.
Daniel.yes
you need to pass fields in parameter FIELDS_TAB of function FREE_SELECTIONS_DIALOG
in this structure you have the field type P or S -
How to create dynamic selection-screen
Hi all,
I want to create dynamic selection-screen.in that dynamic selectio-screen i want to display date fields based on table name given in the selection-screen.
Regards,
BillaHi Billa,
Look into the function group SSEL, this has some SAP standard functions to work with dynamic selection screens.
Below is sample FM, I wrote making use of standard FM from the above. This FM will take table name as input and will display a screen with all the fields within that table for selection. This can also be customized to restrict the fields for display.
Hope this helps,
Sumant.
FUNCTION y_ss_test_dynamic_selection.
""Local interface:
*" IMPORTING
*" REFERENCE(TABNAME) LIKE DD02L-TABNAME
*" EXPORTING
*" REFERENCE(DS_CLAUSES) TYPE RSDS_WHERE
*" EXCEPTIONS
*" TABLE_NOT_VALID
*" OTHER_ERROR
DATA texpr TYPE rsds_texpr.
DATA twhere TYPE rsds_twhere.
DATA trange TYPE rsds_trange.
DATA BEGIN OF qcat. "Selections View for
INCLUDE STRUCTURE rsdsqcat. "Free Selectoptions
DATA END OF qcat.
DATA BEGIN OF tabs OCCURS 10.
INCLUDE STRUCTURE rsdstabs.
DATA END OF tabs.
DATA BEGIN OF fields OCCURS 10.
INCLUDE STRUCTURE rsdsfields.
DATA END OF fields.
DATA BEGIN OF efields OCCURS 10.
INCLUDE STRUCTURE rsdsfields.
DATA END OF efields.
DATA selid LIKE rsdynsel-selid.
DATA actnum LIKE sy-tfill.
DATA title LIKE sy-title VALUE 'Selection Screen'.
DATA: maxnum LIKE sy-subrc VALUE '69'.
CLEAR tabs.
tabs-prim_tab = tabname.
COLLECT tabs.
DATA: position LIKE dd03l-position.
DATA: keyflag LIKE dd03l-keyflag.
CLEAR fields.
fields-tablename = tabname.
fields-sign = 'I'.
DATA: step LIKE sy-subrc.
SELECT fieldname keyflag position
INTO (fields-fieldname, keyflag, position)
FROM dd03l
WHERE tabname = tabname
AND fieldname NOT LIKE '.INCLU%'
AND datatype NE 'CLNT'
ORDER BY position.
ADD 1 TO step.
CHECK step LE maxnum.
IF keyflag <> 'X'.
efields = fields.
APPEND efields.
ENDIF.
APPEND fields.
ENDSELECT.
IF sy-subrc <> 0.
RAISE table_not_valid.
ENDIF.
CALL FUNCTION 'FREE_SELECTIONS_INIT'
EXPORTING
expressions = texpr
kind = 'F'
IMPORTING
selection_id = selid
expressions = texpr
where_clauses = twhere
field_ranges = trange
number_of_active_fields = actnum
TABLES
tables_tab = tabs
fields_tab = fields
fields_not_selected = efields
EXCEPTIONS
fields_incomplete = 01
fields_no_join = 02
field_not_found = 03
no_tables = 04
table_not_found = 05
expression_not_supported = 06
incorrect_expression = 07
illegal_kind = 08
area_not_found = 09
inconsistent_area = 10
kind_f_no_fields_left = 11
kind_f_no_fields = 12
too_many_fields = 13.
IF sy-subrc = 0.
CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
EXPORTING
selection_id = selid
title = title
IMPORTING
where_clauses = twhere
expressions = texpr
field_ranges = trange
number_of_active_fields = actnum
TABLES
fields_tab = fields
EXCEPTIONS
internal_error = 01
no_action = 02
no_fields_selected = 03
no_tables_selected = 04
selid_not_found = 05.
IF sy-subrc = 0.
CLEAR ds_clauses.
MOVE tabname TO ds_clauses-tablename.
READ TABLE twhere WITH KEY ds_clauses-tablename INTO ds_clauses.
IF sy-subrc <> 0.
RAISE other_error.
ENDIF.
ELSE.
RAISE other_error.
ENDIF.
ELSE.
RAISE other_error.
ENDIF.
ENDFUNCTION. -
Problems creating dynamic selection screen
Hi all,
i'm trying to dynamically generate a selection screen and show it as subscreen using the two function modules FREE_SELECTIONS_INIT and FREE_SELECTIONS_DIALOG. I call the function modules in the PBO of the therefor defined subscreen. The FREE_SELECTIONS_DIALOG fm has the two import parameter "as_subscreen" and "as_window". If i use the "as_window" parameter the selection screen comes up as popup. If i use the "as_subscreen" parameter, i can't see anything in my defined subscreen.
Any suggestions ?
Thanks in Advance
DirkHi,
The above requirement is not possible without using logical database.
The reason is that the compiler identifies the below syntax only inside a LDB program .
SELECTION-SCREEN DYNAMIC SELECTIONS
FOR {NODE|TABLE} node [ID id].
The above syntax creates a subscreen container on the standard selection screen of the program during generation
and we are able to view the dynamic selections icon on the selection screen.
Hence it is not possible to use the FM 'FREE_SELECTIONS_DIALOG' as a subscreen without using a
logical database of the relevant table.
However if you dont want to create a new LDB for each table, there is a trick which needs to be performed
once in your SAP system and all custom programs can use this FM to create a dynamic selection screen
as a subscreen of the standard selection screen.
The prerequisite steps are as follows:
1: Create a dummy / test database table in SE11 with a single field i.e. for example mandt , matnr
2: Create a new logical database program for this table in SE36. Save and activate.
This will create dynamic selections for the fields of the table created in step 1.
Steps to be followed in the required custom ABAP program to create the dynamic selection screen as a subscreen.
A: Include the LDB program created in step 2, in the attributes of the custom ABAP program.
Now when you execute the program, you can see the dynamic selection icon for the dummy table created in step 1.
B: In your custom program we need to suppress the icon for 'Dynamic Selections' from the standard selection screen.
We need to perform this action, because the 'Dynamic Selections' icon always triggers a call to the
dynamic selection screen of the included LDB progam. ( In our case a dummy table created in step 1 ).
Whereas we want to trigger a call of the dynamic selection screen of our desired table.
Logic is as follows:
In 'AT SELECTION-SCREEN OUTPUT' event call the FM RS_SET_SELSCREEN_STATUS to exclude the fcode 'DYNS'.
C: Add a pushbutton / checkbox on your selection screen to trigger a call to the FM 'FREE_SELECTIONS_INIT' &
'FREE_SELECTIONS_DIALOG' in the 'AT SELECTION-SCREEN' event.
D: When the user clicks the pushbutton / checkbox for dynamic selections call the above 2 FM for the desired table
with the AS_SUBSCREEN flag of FREE_SELECTIONS_DIALOG = 'X'
Result: Your dynamic selections screen will be created as a subscreen of the standard selection screen and not as a pop-up.
Advantage: With the creation of the single custom table & LDB, you are now able to create dynamic selections as subscreen
in any program in the system. All we need to do is follow the steps A, B & C in each program.
Note: Your other restrictions with dynamic selection screen ie. submit in background , save as variant still remain and
you need to handle them accordingly.
let me know if you need sample code.
Regards,
Bhawit Kumar -
How to deal with dynamic selection screen elements when macros are used?
Hello experts,
This is regarding the dynamic selection screen elements. Actually the requirement is to modify the existing standard report program RFUMSV00 by copying it into a Z report, adding a few selection screen elements and new fields in the output. I actually did everything required except for the one thing that is going out of my reach.
There are a certain fields which are coming when they are not supposed to get displayed. I don't understand the code because of its obsoleteness. Neither can I debug it because it is just data declaration.
This is the code where there is a fault. If I copy the entire code into a new Z report, I'm getting new fields like Entry Date, Document Type, Reference Transaction, Reference key, Logical system.
DEFINE selection_screen_line.
selection-screen: begin of line.
parameters &3 like &4 default 'X' modif id mc4.
selection-screen: comment (30) &1 for field &3 modif id mc4.
selection-screen: comment pos_low(10) text-019
for field &2 modif id mc4. "neu
parameters &2 like rfums_alv-variante modif id mc4.
selection-screen:
position pos_high.
selection-screen: pushbutton (15) text-028
user-command &5 modif id mc4.
selection-screen end of line.
END-OF-DEFINITION.
Kindly, suggest me the right solution.In the program attributes ( SE38 > RFUMSV00 > GOTO > Properties ), you will find a logical database BRF declared. The include DBBRFSEL is part of the selection screen of this logical database.
The selection screen is actually the selection screen of this logical database.
Under the Logical Database field, there is a Selection screen field where you can input which selection screen of the logical database to be used.
But, this is just to change the selection screen that is displayed. To completely suppress it you need to remove logical database declaration from the properties of the program and call it inside your program through function module.
You cannot just remove it from the declaration because many of its variables are used in the program.
So call it using function module as the first step in INITIALIZATION section of the program.
The syntax and function module to call it in your program can be found in the following thread :
How to hide the selection screen of a Logical datebase?
Regards,
Ashish -
How to add a new Field in the Dynamic Selection screen section.
HI,
There is a requirement in which I need to add a field in existing program of dynamic selections.
I need to add a field KNKK-DBRTG (Customer Rating) in dynamic selections screen of some existing report
which has a dynamic selection screen with other fields like customer account, company code etc. Along with this i need to add Customer rating field also in the selection screen.
I have used GET KNKK statement to select this in the Dynamic selection screen. But I need to make it appear
on the screen.
LDB used is the Customer Database.
I have added GET KNKK statement after GET KNA1 statement.
Can any one help me how we can make this rating field appear in the selection screen.
With the GET statement Credit control area Fields can be selected in the selection screen but I have to permanantly add the field in the selection screen.
Regards
Prashant PrabhuHi,
So you need that this new field have data in old records?
1.- If you are in BI 7.0 and the logic or data for that New field are in the same Dimension, you can use a Remodeling to fill it. I mean if you want if you want to load from a Master Data from other InfoObject in the same Dim.
2.- If condition "1" is not yours.
First add the new field, then create a Backup Cube (both cubes with the new field) and make a full update with all information in the original Cube. The new field willl be empty in both cubes.
Create an UR from BackUp_Cube to Original_Cube with all direct mapping and create a logic in the Start Routine of the UR (modiying the data_package) you can look for the data in the DSO that you often use to load.
To do that both cubes have to be Datasources ( right click on Cube-> aditional function-> and I think is "Extract Datasource")
Hope it helps. Regards, Federico -
Exclude one field from Logical Database's dynamic selection screen
Hi Guru,
I have a requirement to amend a program to exclude the document number field (bsik-belnr) from the dynamic selection-screen of the logical database KDF(Vendor Database) so that the program will not filter according to the document number.
I have use the below syntax in my zprogram.
selection-screen exclude select-options: doc-no.
However I get syntax error "The addition EXCLUDE is only allowed in INCLUDE DBKDFSEL".
Please advice.
Best Regards,
FungThe selection part of the logical database defines input fields for selecting data.
The runtime environment displays these on the selection screen when you run an executable program linked to the logical database.
Include called DB<ldbname>SEL.
SELECTION-SCREEN BEGIN OF VERSION ver TEXT-xxx.
SELECTION-SCREEN EXCLUDE ... .
SELECTION-SCREEN END OF VERSION ver.
Defines a selection screen version (with a three-character name ver ). Between BEGIN OF VERSION and END OF VERSION , you can exclude selection screen objects for the version ver , i.e. remove them from the selection screen with SELECTION-SCREEN EXCLUDE.
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE dbtab
If one of these tables is active in the report (i.e. it is declared under TABLES or lies somewhere on the path from the root of the database hierarchy to a table declared with TABLES ), a pushbutton called 'Dynamic selections' appears on the selection screen. -
Need to disable one of the select-options in dynamic selection screen
Hi,
we have copied the Standard program: RFDOPR00 into Z, my requirement is to disable one of the select-options in dynamic selection screen for ex: Reason code(User shouldnot able to enter anything in it).
Can anyone please tell me the procedure to do it... I had tried using at selection-screen but it doesnt work as it in 'LOOP AT SCREEN', i am not able to capture the Parameter name(screen-name).
Thanks,
RaviHi,
Get inside your selection screen, by executing your program.
Now type /h in the field where you enter transaction code and press enter.
Now again press enter, this will take you debugger starting from your Selection screen.
You might be knowing this, still if you are not aware of this, this might be a valuable tip.
From here , you can trace your Parameter name. -
How to use dynamic selection screen inputs in main program
hi all,
its a report where in it calls one dynamic selection screen( user need to enter the parameters here) after that i need to use those inputs for some check, can any buddy help how to use/ get that input parameters into main program.
regards,
vara..Hi,
i think u have created that dynamic selection screen in seperate program and calling to ur main program.instead of that u just create that synamic selection screen program as include program and include it in ur main program.
or u need to use set/get parameter id concept.
rgds,
bharat. -
How to retrieve values from Dynamic Selection screen while using LDB - PSJ
I am having problem in PSJ Logical database. In a custom report which is using PSJ LDB, we are using PROJ and PRPS_R tables.
When I run program it displays one dynamic selection screen, there we are giving selection criteria for PRPS (Master data WBS element) - Created on (giving some range like 2011/01/01 to 2011/01/31).
So I want to display all WBS element which are created during the period (2011/01/01 - 2011/01/31).
How do I retrieve the select-option low and high value of the field Created on Of WBS element if we Select data from any table based on this condition.
Please help me.
Thanks.in fact you don't have to get the values, you only need to tell to the program to take them into account :
GET PRPS.
CHECK SELECT-OPTIONS. -
Passing values to a dynamic selection screen via a report
Hi,
I have the following problem and need to seek your expertise urgently.
In my program, I need to call another report by passing in parameters to the selection screen of other report. However, I could not pass values into a dynamic selection screen. I tried to use submit (report) with free selection but do not know how it works.
Currently, I tried calling the function RS_REFRESH_FROM_DYNAMICAL_SEL and FREE_SELECTIONS_RANGE_2_EX. Using the object the first function has returned to me, I tried to append values such as fieldname etc to it. However, I realised the field names of a dynamic selection screen keeps changing. So I would not know how to pass a particular value to a selection field.
Appreciate any help given.
Thanks,
CKHello CK,
Are you using logical database in your selection screen program attributes? If it is, look at include file DBxxxSEL for parameter named xxxDYNSE where xxx = logical database. Debug the program that has that dynamic selection, and look at field xxxDYNSE. This should give you a hint on how to populate the parameter when you submit the program. -
Dynamic selection-screen parameters
Hi All,
Is it possible to create a dynamic selection-screen checkbox parameters at runtime. My requirement is :
I have Object parameter on the selection-screen, based on this it has to fetch the info structures and display it with checkboxes on the same selection-screen, so that the user can select which info structures to be processed and can save it as a variant.
Thanks,
Satya Priyaas per ur requirment....execute it and see
tables :DD02L,t002t,t002.
data : begin of itab occurs 0,
tabname like DD02L-TABNAME,
end of itab.
data : tabname1 like DFIES-TABNAME,
RSSELTEXTS1 type table of RSSELTEXTS with header line.
data : begin of RSSELTEXTS2 occurs 0,
RSSEL type RSSELTEXTS,
initial type c,
end of RSSELTEXTS2.
data : begin of imakt occurs 0 .
include structure t002.
data : end of imakt.
data : begin of ipara occurs 0,
name(132) type c,
text(132) type c,
end of ipara.
data :srch_str(10) TYPE c,
tot type i,
ind type sy-tabix.
select-options : s_lang for t002-spras.
*PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
PARAMETERS showall1 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall2 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall3 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall4 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall5 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall6 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall7 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall8 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showall9 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal10 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal11 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal12 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal13 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal14 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal15 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal16 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal17 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal18 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal19 AS CHECKBOX USER-COMMAND flag modif id sd.
PARAMETERS showal20 AS CHECKBOX USER-COMMAND flag modif id sd.
initialization.
at selection-screen output.
if s_lang ne ' '.
select * from t002 into table imakt where spras in s_lang.
describe table imakt lines tot.
loop at screen .
if screen-group1 = 'SD'
and screen-group3 = 'PAR'.
ipara-name = screen-name.
ind = screen-group4.
read table imakt index ind.
ipara-text = imakt-laiso.
append ipara.
clear ipara.
endif.
endloop.
endif.
loop at ipara.
RSSELTEXTS1-name = ipara-name.
RSSELTEXTS1-kind = 'P'.
RSSELTEXTS1-text = ipara-text.
append RSSELTEXTS1.
clear RSSELTEXTS1.
endloop.
CALL FUNCTION 'SELECTION_TEXTS_MODIFY'
EXPORTING
PROGRAM = sy-repid
TABLES
SELTEXTS = RSSELTEXTS1
EXCEPTIONS
PROGRAM_NOT_FOUND = 1
PROGRAM_CANNOT_BE_GENERATED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if s_lang ne ' '.
loop at screen .
if screen-group1 = 'SD'
and screen-group3 = 'PAR'
and screen-group4 > tot.
screen-input = '0'.
screen-active = '0'.
modify screen.
endif.
endloop.
endif.
if s_lang = ' '.
loop at screen .
if screen-group1 = 'SD'.
screen-input = '0'.
screen-active = '0'.
modify screen.
endif.
endloop.
endif. -
Hello all,
I have a requirement to create a 'dynamic' selection screen with 2 sections(vertical).
The first section contains set of selection options for which the type comes from the values stored in the internal table(populated at runtime). The second section contains checkbox corresponding to each selection option generated/created in the first section mentioned above.
So the number of fields and checkboxes to be created are identified only at the runtime.
Note: I already tried to use FMs FREE_SELECTIONS* but it is not serving my purpose.
Looking forward to your inputs.
Thanks & Regards,
Rajat
Edited by: rajat.sap123 on Feb 7, 2012 7:18 PMWhy don't you use the At selection-screen output event.
As i have understood your scenario you have two sections. with the first one containing the select-options. The second will change on basis of the first section selection.
Hope it helps you.
Elaborate a bit more so i can paste a code. -
Adding new table dynamic selection screen of transaction FBL5N (LDB DDF).
Hi,
I have a requirement to add SEGMENT (CEPC-SEGMENT) field on the dynamic selection screen of transaction FBL5N (LDB DDF).
Please let me know how can I meet this requirement
ThanksI did not find any screen exits for this Tcode, may be you need to use enhancement spots.
-
PF status in dynamic selection screen
Hi,
I am creating a dynamic selection screen ,it is having the default PF_status .But now i want to give a different PF_status in that dynamic selection screen.
Like if i press the back button it should take me to the previous screen,but now it is going to next screen.So,Please help to change the functionality of the BACK button.
thanks in advance
SravanthiHi Sravanthi,
Set your PF status in event 'At selection-screen output' of your dynamic selection screen.
Handle Back operation in event 'At selection-screen'.
AT SELECTION-SCREEN OUTPUT.
SET PF-STATUS 'TEST'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'BACK'.
" Ur code
ENDCASE.
Thanks,
Maybe you are looking for
-
Brochure template I created myself is responding terribly to editing and manipulation. I'm thinking it could have been a problem with the amount of layers I added on PS elements 12, but I compressed the file and I'm still was having this extremely s
-
EA 6500 Media Server Drops Out
Media server works great until I get "Connection Lost" It requires a restart of the AE6500. I have tried stopping the media server and restarting then rescaning but this usually does not help. The FTP function does ot have this issue while streaming
-
Switched from Internet Explorer because seemed slow. Firefox was fast at first. Then upgraded to Firefox 4 and frequently have trouble opening. Sometimes page doesn't open, or is very slow. If I try to open again I will get Mozilla Firefox Unresponsi
-
Stop Parking same document twice
Hi, How to restrict parking of same invoice twice against a Purchase Order. Please advice. Thanks
-
Elantech Touchpad Detected As PS/2 Elantech Mouse (Dell Vostro 3560)
Dear community, I am facing troubles with my Dell Vostro 3560's Elantech Touchpad. It gets detected as PS/2 Elantech mouse. [acs@einherij ~]$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave poin