To create selection screen dynamically
Hi All,
I need to create dynamic selection screens based on the table for which report will run.
Can anyone help me on this.
thanks
Hello Palak,
The best you can get on Dynamic Selection Screen: [/people/horst.keller/blog/2009/09/03/abap-geek-13--interactive-dynamic-where-clauses|/people/horst.keller/blog/2009/09/03/abap-geek-13--interactive-dynamic-where-clauses]
Straight from the "Guru"
Enjoy !!
Suhas
Similar Messages
-
How to create the selection screen dynamically
Hi,
I have a requirement to create the selection screen Dynamically. All the fields that should appear on the selection screen will be available in a custom table. So, based on the entries available in the Z tables, the selection screen should be built. Eg. If there are 10 records available in the Z table, the selection screen should consist of 10 fields. If there are 100 entries, the Selection screen should contain 100 fields. and the logic to build this selection screen should be carried out dynamically in the program.
Could anyone of you please share the valuable inputs on this. If anyone has the sample code to do this, please share.
Thanks in advance.
Regards,
Paddu.Hi,
Kindly go through this sample program below:
DEMO_LIST_FORMAT_INPUT *and
check this function module:
FREE_SELECTIONS_DIALOG *.
Hope it helps
Regards
Mansi -
Creating Selection Screen version in Logical Database
Hi,
I want to design my own Selection screen while creating a report with Logical Database. My requirement is not to show the Standard Selection screen of LDB.
Can it be achieved by creating Selection Screen Version in SE36 and using that version in Attribute of the Report?
If yes, then how can it be created?You can change the Selection Include to include your selection screen version.
Go to SE36
Select "Selections"
Change
Create a new version like:
SELECTION-SCREEN BEGIN OF VERSION 904 TEXT-904.
SELECTION-SCREEN EXCLUDE PARAMETERS: KD_STIDA.
SELECTION-SCREEN EXCLUDE SELECT-OPTIONS: KD_GJAHR, KD_BUDAT, KD_AUGDT,
KD_ZUONR, KD_UMSKZ.
SELECTION-SCREEN END OF VERSION 904.
Regards,
Naimesh Patel -
How to create selections-screens to display PO using module pool program
All,
I'm new to module pool programming. Can any one please provide me where to create selections screens to display existing purchase orders using the below selection criteria in thr module pool program.,
SELECT-OPTIONS : S_LIFNR FOR EKKO-LIFNR,
S_BSART FOR EKKO-BSART,
S_BUKRS FOR EKKO-BUKRS,
S_WERKS FOR EKPO-WERKS OBLIGATORY,
S_BEDAT FOR SY-DATUM,
S_EINDT FOR EKET-EINDT,
S_EBELN FOR EKKO-EBELN,
S_MATNR FOR EKPO-MATNR.
provide me step by step to do this.Hi,
Thanks for the reply can you please let me know.
How can I create the ranges
like low and high in the selection.
Using se51 i was able to do only one i,e
example I need
purchase order number----
f4 -
f4
Can please tell me how to do this -
Modifying Selection screen dynamically
Hi guyz
herez another question
Can we modify selection-screen dynamically as we do in case of screen
What i want to do is
I want to display one parameter as checkbox and when user ticks this box I want to display another one
If we are defining two checkboxes earlier and making one invisible than can we modify selection screen to display another check box
Thanks in advanceTake a look at this example.
REPORT EVENT_DEMO.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
R2 RADIOBUTTON GROUP RAD1,
R3 RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',
R5 RADIOBUTTON GROUP RAD2,
R6 RADIOBUTTON GROUP RAD2.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
IF R1 = 'X'.
MESSAGE W040(HB).
ENDIF.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.
IF R4 = 'X'.
MESSAGE W040(HB).
ENDIF. -
Selection-screen dynamic selections for dtab
Hey experts,
when I add this to my code
selection-screen dynamic selections for zbr_t_autori
and I want activate it, it writes out an error
The addition "DYNAMIC_SELECTIONS" is only allowed in INCLUDE DB__SSEL.
and I don't know how to solve it, what is that include db__ssel?
Can anybody help me.
Regards,
RobertCheck this:
Structure of Logical Databases - ABAP Programming (BC-ABA) - SAP Library
Where are you using this code?
selection-screen dynamic selections for zbr_t_autori
It should be in the include reserved for your LDB selection: -
Adding fields on selection screen dynamically
Hi all,
Can we add some fields to selection screen dynamically on pushbutton click?
Regards,
Dnyaneshjust have look below code
REPORT zrsdvsr1
LINE-SIZE 220
LINE-COUNT 65(5).
TYPE-POOLS : slis.
TABLES
TABLES: vbak.
DATA DECLARATIONS
Ranges
RANGES: r_posnr FOR vbap-posnr.
DATA: BEGIN OF t_veramt OCCURS 0,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
netwr TYPE vbap-netwr,
mwsbp TYPE vbap-mwsbp,
END OF t_veramt.
DATA: BEGIN OF t_disamt OCCURS 0,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
matnr TYPE vbap-matnr,
netwr TYPE vbap-netwr,
mwsbp TYPE vbap-mwsbp,
netwr_v TYPE vbap-netwr,
mwsbp_v TYPE vbap-mwsbp,
disc_val TYPE vbap-mwsbp,
END OF t_disamt.
*& ALV FIELDS
DATA : alv_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
alv_layout TYPE slis_layout_alv.
SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_ver RADIOBUTTON GROUP g1 USER-COMMAND rad DEFAULT 'X',
p_sab RADIOBUTTON GROUP g1 .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln NO INTERVALS MODIF ID gr1.
PARAMETERS: p_dwfile TYPE rlgrap-filename
DEFAULT 'C:\test1.txt' MODIF ID gr2, "#EC NOTEXT
p_upfile TYPE rlgrap-filename
DEFAULT 'C:\test.txt' MODIF ID gr3. "#EC NOTEXT
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upfile.
**************F4 Help For Input File Name****************************
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'C:\'
IMPORTING
file_name = p_upfile.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dwfile.
**************F4 Help For Input File Name****************************
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = 'C:\'
IMPORTING
file_name = p_dwfile.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_sab = 'X'.
IF screen-group1 = 'GR1' OR screen-group1 = 'GR2'.
screen-active = '0'.
screen-invisible = '1'.
ELSE.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ELSE.
IF screen-group1 = 'GR3'.
screen-active = '0'.
screen-invisible = '1'.
ELSE.
screen-active = '1'.
screen-invisible = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
START-OF-SELECTION
START-OF-SELECTION.
Check Radio Button
IF p_ver = 'X'.
PERFORM get_details_open_so_vertex.
ELSE.
PERFORM get_details_open_so.
ENDIF.
Display the output.
PERFORM diplay_report .
regards
vinod -
Trying to create a selection screen dynamically
Hi All,
My requirement is to fetch values from database table.A particular field in the table
has certain values,which i am supposed to create as radiobuttons.i.e
i need to pick the values and create a dynamic selection screen.
Can any one help me in this.
Thanks in Advance!!Hi MVPhani,
If u wish to create radio-buttons ( or check-boxes only ) dynamically, then u can achieve the same functionality using the below simpler alternative...
Put a button and while clicking it show the list of possible values ( taken from ur DB table ).. based on the selection display ur report... something like F4 help...
Check the below example..
TYPE-POOLS : slis.
TYPES : BEGIN OF ty_radiobuttons,
matnr TYPE matnr,
maktx TYPE maktx,
END OF ty_radiobuttons.
DATA : lt_radiobuttons TYPE STANDARD TABLE OF ty_radiobuttons,
ls_radiobutton TYPE ty_radiobuttons,
lt_fcat TYPE slis_t_fieldcat_alv,
ls_fcat TYPE LINE OF slis_t_fieldcat_alv.
PARAMETER selvalue TYPE matnr.
SELECTION-SCREEN PUSHBUTTON 60(20) text USER-COMMAND push.
INITIALIZATION.
MOVE 'Dynamic selection' TO text.
SELECT matnr
maktx
FROM makt UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE lt_radiobuttons
WHERE spras EQ sy-langu.
AT SELECTION-SCREEN .
CASE sy-ucomm.
WHEN 'PUSH'.
PERFORM popup.
WHEN OTHERS.
ENDCASE.
START-OF-SELECTION.
END-OF-SELECTION.
FORM popup.
DATA : selected_row TYPE slis_selfield,
action.
PERFORM build_fcat.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_selection = 'X'
i_zebra = 'X'
i_tabname = 'LT_RADIOBUTTONS'
it_fieldcat = lt_fcat
IMPORTING
es_selfield = selected_row
e_exit = action
TABLES
t_outtab = lt_radiobuttons
EXCEPTIONS
program_error = 1
OTHERS = 2.
CHECK sy-subrc EQ 0.
CHECK action NE 'X'.
READ TABLE lt_radiobuttons INTO ls_radiobutton INDEX selected_row-tabindex.
MOVE ls_radiobutton-matnr TO selvalue.
ENDFORM. "popup
FORM build_fcat.
FREE lt_fcat.
ls_fcat-fieldname = 'MATNR'.
ls_fcat-seltext_l = 'Material'.
ls_fcat-outputlen = '10'.
APPEND ls_fcat TO lt_fcat. CLEAR ls_fcat.
ls_fcat-fieldname = 'MAKTX'.
ls_fcat-seltext_l = 'Description'.
ls_fcat-outputlen = '20'.
APPEND ls_fcat TO lt_fcat.
CLEAR ls_fcat.
ENDFORM. "build_fcat
Cheers,
Jose. -
Creating Selection screen in Report Painter
Good day everyone,
Does anyone know how I could create a selection screen in Report Writer? Thanks!
>Christian<Hi,
Simple Parameters or Selec-options statements will suffice.
Eg : Parameters : p_matnr type mara-matnr.
select-options : s_matnr for mara-matnr.
In selection screen, you may have selec-options, parameters, check boxes, radio buttons etc.
Regards,
Sujatha. -
Making a field in selection screen dynamic mandatory
I have a parameter in the select option of a selection screen. The code is below:
TABLES:vbak,kna1,ekko,lfa1.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
PARAMETERS: rd1 RADIOBUTTON GROUP rd DEFAULT 'X' USER-COMMAND abc,
rd2 RADIOBUTTON GROUP rd,
rd3 RADIOBUTTON GROUP rd.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS:s_erdat FOR VBAK-ERDAT MODIF ID SAL,
s_vbeln FOR VBAK-VBELN MODIF ID SAL,
s_kunnr FOR KNA1-KUNNR MODIF ID SAL.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE TEXT-003.
SELECT-OPTIONS:p_aedat FOR EKKO-AEDAT MODIF ID PUR,
p_ebeln FOR EKKO-AEDAT MODIF ID PUR,
p_lifnr FOR EKKO-AEDAT MODIF ID PUR.
SELECTION-SCREEN END OF BLOCK b3.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rd1 EQ 'X'.
IF SCREEN-GROUP1 = 'SAL' OR SCREEN-GROUP1 EQ 'PUR'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
IF rd2 EQ 'X'.
IF SCREEN-GROUP1 EQ 'PUR'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
IF rd3 EQ 'X'.
IF SCREEN-GROUP1 EQ 'SAL'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
Now the parameters s_erdap & _aedat should both be dynamic mandatory. How this can be achieved?Hi,
This can be done in two ways:
1.
At selection-screen output.
loop at screen.
IF rd1 EQ 'X'.
if screen-name = 's_erdat-low' or screen-name = 'P_AEDAT'.
screen-required = 1.
modify screen.
endif.
endif.
endloop.
the above code would make the lower value in select-option s_erdat and parameter p_aedat mandatory.
2.
at selection-screen.
if rd1 eq 'X'.
if s_erdat is initial.
message 'PLease enter date'.
endif.
endif.
The above will fire an error when you hit execute and the rd1 is choosen and date is not entered
Himanshu -
Problem in creating selection screen from screen painter
hi ,
i am working with screens i have created a screen and in that wehn i click report button it has to ask for select options for dates.from there i will write a select quesry based on selection dates ...how to call a selection screen from screen.i created an include and in that include i used select options.but it is showing error message .guide me how to do it ?Hi..
Here for your problem,
I have created a button with function code 'CLICK' in screen no 1000.
when I click on the button I am capturing the ok_code and displaying the selection screen.
ok_code = sy-ucomm.
case:ok_code.
when 'CLICK'.
SELECTION-SCREEN BEGIN OF SCREEN 500 TITLE title.
SELECT-OPTIONS: P_DATE for sy-datum.
SELECTION-SCREEN END OF SCREEN 500.
title = 'Input Date'.
CALL SELECTION-SCREEN '0500'.
endcase.
You can also have them as subscreen by providing the required parameters in the selection screen.
Hope this solves your problem.
Warm Regards,
Bhuvaneswari. -
Creating Selection List Dynamically or Through Code
Has anyone created Selection Lists for Excel or Analyzer Dynamically Through Code? We have lists that could change quite often and would like to automate the process.
Different methods for different situations. If you are just concerned about capturing newly added descendants/children of a dimension, it may be best to always begin the query at the appropriate parent level, then zooming/drilling to list all children/descendants at the time the query is run. Assigning attributes is another way to achieve this, assuming all the members which you wish to capture are similar in nature (eg. flavor, size, product category, etc.). After creating the attribute dimensions and assigning them to base dimensions, simply adding the attribute to the query dynamically filter the values returned. You can also drill/zoom on the attribute dimension in the query to view detail lists of the individual members which match.
-
Selection screen dynamic enable and disable
HI all,
I have one requirement like
on selection of redio button my selection screen hould be enable and disable
Like if i select rediobutton tfile then my selection screen block B2 should enable and Block B3 hould be disable
If redio button selscr is selected then my block B3 should be enable and Block B2 should disable
my selection screen code is below
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005.
PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X'.
PARAMETERS: selscr RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR marc-matnr,
s_fkdat FOR vbrk-fkdat OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS : filename TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b3.
How to do that.
Help me here its urgent tnx in advance.Hi Lalit,
Check the below code.
TABLES: marc, vbrk.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-005.
PARAMETERS: tfile RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND rusr.
PARAMETERS: selscr RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR marc-matnr MODIF ID abc,
s_fkdat FOR vbrk-fkdat MODIF ID abc.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
PARAMETERS : filename TYPE rlgrap-filename MODIF ID def.
SELECTION-SCREEN END OF BLOCK b3.
AT SELECTION-SCREEN OUTPUT.
*Note: To disable the fields use the below one.
LOOP AT SCREEN.
IF screen-group1 = 'DEF'. "Name field
IF selscr = 'X'.
screen-input = 1.
ELSE.
screen-input = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'ABC'. "Name field
IF selscr = 'X'.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
*Note: To hide the screen use the below one.
LOOP AT SCREEN.
IF screen-group1 = 'DEF'. "Name field
IF selscr = 'X'.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF screen-group1 = 'ABC'. "Name field
IF tfile = 'X'.
screen-active = 1.
ELSE.
screen-active = 0.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP. -
Changing of default values on the selection screen dynamically
Hi,
I have 2 radiobuttons R_A & R_B and i have one text field like P_TEXT. Based on selection of radio button i have to change the default values in P_TEXT on the selection screen. like if i select R_A i have to display P_TEXT = 'A'. if i select R_B then it has to display P_TEXT = 'B'. I tried like as below
in AT SELECTION-SCREEN OUPUT EVENT.
IF R_A = 'X'
P_TEXT = 'A'.
ELSEIF R_B= 'B'.
P_TEXT = 'B'.
ENDIF.
But it's not working. it is working only for first radio button. when i select second radio button it is not giving the second value. can any one tell the sol.
Tks in advance.Hi Pammi,
Use this code, its working:-
PARAMETERS : r_a RADIOBUTTON GROUP gp1 DEFAULT 'X' USER-COMMAND rb,
r_b RADIOBUTTON GROUP gp1,
p_text(20).
"we use user command with the radiobutton so that some event is occured in order to call AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT.
IF r_a = 'X'.
p_text = 'Hello'.
ELSEIF r_b = 'X'.
p_text = 'Hi'.
ENDIF.
In the above case 'AT SELECTION-SCREEN OUTPUT' will act as PBO of the selection screen and will change value of selection text as per condition.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir -
Modifying the selection screen dynamically
Hey folks,
I have posted this question previously but no one understood the real problem.
I have 4 fields
Company Code
material Number
plant
storage Location
Unit
when I select the company code AA01 from the F4 help I want to disable material number and Plant ..Like this i have 4 scenarios where based upon the input given in the selection screen other fields have to be enabled or disabled.
I have already used at selection screen on output but that doesn't help me as its a PBO event I tried to search for a proper event but cudn't find it. Is there any way i can achieve this. A sample code wud be easy for me to understand .
Thanks in advance
RockSet different groups in your fieds on the screen.
Set the screen group for the Material and Plant as the GR1
Set the screen gorup for the Storage location as the GR2.
You need to modify your screen fields on the PBO event.
Like:
IF P_BUKRS = 'AA01'.
loop at screen.
if screen-group1 = 'GP1'.
screen-input = 0.
modify screen.
elseif screen-group2 = 'GP2'.
screen-input = 1.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'GP2'.
screen-active = 0.
modify screen.
elseif screen-group2 = 'GP1'.
screen-input = 1.
modify screen.
endif.
endloop.
endif.
Regards,
Naimesh Patel
Maybe you are looking for
-
I need help in Report for production orders for my customer.
Hi All I have scenario where plant A needs the following report for Material XXX which has setting as Stock Trnasfer order from Plant B. Need report withthe following details, Storage Unit number, Material No, Quantity, Planned Order Date in plant A,
-
IPhone 3 GS gives unknown error -1 after reboot
Mij iPhone 3 GS can not restored in iTunes. i tried it several times but every time de error (-1) occurs. (-1) seems to beeen hardwareproblem. Is their any experience whit this error?
-
Adobe muse stops other applications
Hi, I have Imac os x 10.8.3 - lion. Yesterday I downloaded adobe muse but everytime I launch the application the entire system go crashing (it stops all the other applications and nothing works at all, I must RESTART the computer). This happened even
-
Capture limit not working FCP 4.5 - Please help
I'm trying to import some analog footage (VHS) using a JVC SR-VS30 deck and the capture limit setting is not working, FCP just keeps capturing no matter what I set the time limit to. I have searched this forum as well as others and have yet to find a
-
I've checked archives for this forum and still can't figure this out. I've got a table called CHARGES. In the table I've got a column called AMOUNT. The following are sample rows: AMOUNT 100.25 200.05 300.5 100 200.4 I'm trying to update this column