Query related to at selection screen event & at selection-screen output
Hi all,
thanks in advance
i have two radio buttons say rd1 & rd2
on my selection screen i have date,period,year and these fields r mandatory fields
when i try to select the radio button rd2 then it is not disabling the fields period and year rather it is checking the fields for mandatory and vicevesr
here is the code plz help me out
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF rd1 = 'X'.
IF screen-group1 = 'GR1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
IF rd2 = 'X'.
IF screen-group1 = 'GR2'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
blank period is not allowed
IF monat[] IS INITIAL.
MESSAGE e008.
ENDIF.
blank fiscal year is not allowed
IF gjahr[] IS INITIAL.
MESSAGE e009.
ENDIF.
blank document date is not allowed
IF bldat[] IS INITIAL.
MESSAGE e020.
ENDIF.
awiting for all u r replies
I UNDERSTOOD Y U HAVE GIVE ERROR MESSAGE,
WHEN U R DECLARING THE VALUES AS OBLIGATORY BEFORE, THEN NO NEED TO GIVE MESSAGES IN AT SELECTION SCREEN.
BUT BASED ON SOME CONDITIONS, IF U WANT TO MAKE THEM OBLIGATORY DYNAMICALLY THEN GIVE THE CONDITION ALSO
EXAMPLE
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF a = 'X'.
IF screen-group1 = 'GR2'.
screen-input = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF c = 'X'.
IF screen-group1 = 'GR1'.
screen-input = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
IF d is initial.
MESSAGE e009.
ENDIF.
start-of-selection.
write b.
2ND EXAMPLE:
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF a = 'X'.
IF screen-group1 = 'GR2'.
screen-input = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
IF c = 'X'.
IF screen-group1 = 'GR1'.
screen-input = 0.
ELSE.
SCREEN-INPUT = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
IF B = 5 AND d is initial.
MESSAGE e009.
ENDIF.
start-of-selection.
write b.
I HAVE SENT U TWO EXAMPLES, IN THE SEOND EXMAPLE, IT WORKS FINE AS U HAVE GIVEN SOME OTHER CONDITION.
IN THE FIRST EXAMPLE, AS IT WILL NOT WORK AS IAM CHECKING ONLY INITIAL CONDITION.
FOR CHECKING ONLY INITIAL CONDITION, NO NEED TO WRITE IT AT SELECTION SCREEN , U CAN DIRECTLY DECLARE AS OBLIGATORY IN THE BEGINING IT SELF.
JUST COPY AND PASTE MY TWO PROGRAMS AND FIND OUT THE DIFFERENCE IAM EXPLAINING
Message was edited by: Hymavathi Oruganti
Similar Messages
-
How to prevent AT SELECTION-SCREEN event on second Selection Screen
Hi All
I have a program in which I am entering some parameters in a selection screen and also validating them in AT SELECTION-SCREEN events. After validating them the program shows another selection screen in which I have some push-buttons. I have some events on those push-buttons also.
However I am facing a different problem now. When I execute the second selection screen I get the report, and when I click on back button then it again triggers the AT SELECTION SCREEN event of the first selection screen and displays the related messages.
How to prevent this ? Is there any way where I can restrict the execution of selection screen events for a particular selection screen?
AmolHi,
try this logic when Ist selection screen validation
is done set a flag = 'X' .
at selection-screen.
if glag is initial
*screen validation
flag = 'X..
endif.
regards
amole -
How to get rid of the loop in ALV output from At selection screen event?
I have several push buttons on a selection screen.
Clikc on a button, then it pops up an editable ALV report. (This gets triggered AT SELECTION SCREEN event.). REUSE_ALV_GRID_DISPLAY_LVC..
On the ALV output, I enabled F4 for a couple of fields. Once I click on the F4 button, ONF4 method gets triggerd and a pop up appears with custom search helps.
choose a line and it fills the cell.
Upto this it works fine.
Now I click on the BACK button at the ALV output, it takes me to the selection screen. I click on the button again, it show the editable ALV. Now when I click on the F4 button, the pop up comes up twice and the cell gets filled from the second pop - up.
How to control this?
Probably I am not refreshing something?
(I am using REUSE_ALV_GRID_DISPLAY_LVC and tooks ome code for ONF4 event from BCALV_*DATATYPES (forgot the exact name) program.)
Thanks,
VenHi,
FORM refresh_grid USING pw_grid TYPE REF TO cl_gui_alv_grid.
*Work area
DATA : wal_stable TYPE lvc_s_stbl.
CHECK NOT pw_grid IS INITIAL.
wal_stable-col = c_check.
wal_stable-row = c_check.
*Method to refresh grid
CALL METHOD pw_grid->refresh_table_display
EXPORTING
is_stable = wal_stable
i_soft_refresh = c_check
EXCEPTIONS
finished = 1
OTHERS = 2.
ENDFORM. " refresh_grid
Thanks,
Sree. -
How to catch the select-options value in AT SELECTION-SCREEN event?
Hi,all
This is my code:
SELECT-OPTIONS: P_BUKRS FOR T012-BUKRS.
PARAMETERS: P_BNKA TYPE BANKA.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BNKA.
select single bankl from bnka where bukrs = p_bukrs.
Last statement failed because p_bukrs was null.
So, How can I got the value of p_bukrs in AT SELECTION-SCREEN event?Hi Jie,
try following code.
REPORT zanu_test.
TABLES : t012.
PARAMETERS: p_bukrs LIKE t012-bukrs.
PARAMETERS: p_bnka TYPE banka.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bnka.
DATA: BEGIN OF dynpfields OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.
*--- IT for changing fields on the screen
DATA : t_dynp_flds LIKE dynpread OCCURS 0 WITH HEADER LINE,
t_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE.
DATA: l_bukrs LIKE t012-bukrs.
DATA: BEGIN OF it_bank OCCURS 0,
banka LIKE bnka-banka,
END OF it_bank.
DATA: l_tabix LIKE sy-tabix.
dynpfields-fieldname = 'P_BUKRS'. APPEND dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = 'ZANU_TEST'
dynumb = sy-dynnr
TABLES
dynpfields = dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
IF sy-subrc EQ 0.
MOVE dynpfields-fieldvalue TO l_bukrs.
ENDIF.
ELSE.
EXIT.
ENDIF.
SELECT b~banka INTO CORRESPONDING FIELDS OF TABLE it_bank
FROM t012 AS a
INNER JOIN bnka AS b
ON abanks = bbanks AND abankl = bbankl
WHERE a~bukrs = l_bukrs.
CLEAR l_tabix.
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 85
endpos_row = 20
startpos_col = 50
startpos_row = 10
titletext = text-035
IMPORTING
choise = l_tabix
TABLES
valuetab = it_bank
EXCEPTIONS
break_off = 1
OTHERS = 2.
IF sy-subrc EQ 0.
READ TABLE it_bank INDEX l_tabix.
IF sy-subrc EQ 0.
*--- Clear IT t_dynp_flds
CLEAR : t_dynp_flds,
t_dynp_flds[].
*--- Append screen values
t_dynp_flds-fieldname = 'P_BNKA'.
t_dynp_flds-fieldvalue = it_bank-banka.
APPEND t_dynp_flds.
CLEAR t_dynp_flds.
ENDIF.
ENDIF.
*--- Change screen field contents w/o PBO
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'ZANU_TEST'
dynumb = sy-dynnr
TABLES
dynpfields = t_dynp_flds
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
START-OF-SELECTION.
-Anu -
Infoset Query- How do I clear the in-built selection screen in LDB
Dear Experts,
When LDB is used in queries unwanted selection screen blocks appear.
Please help in getting rid of the same.
Kind Regards
Jogeswara RaoHello Jogeswara,
1. In the Infoset push button Extras and then select Code tab.
2. Select AT SELECTION-SCREEN OUTPUT for Code Section.
Suppose your query is based on logical database KDF and you went to hide the SELECT-OPTIONS for Company Code.
loop at screen.
if SCREEN-NAME = '%_KD_BUKRS_%_APP_%-TEXT' OR
SCREEN-NAME = '%_KD_BUKRS_%_APP_%-OPTI_PUSH' OR
SCREEN-NAME = '%_KD_BUKRS_%_APP_%-TO_TEXT' OR
SCREEN-NAME = '%_KD_BUKRS_%_APP_%-VALU_PUSH' OR
SCREEN-NAME = 'KD_BUKRS-LOW' OR
SCREEN-NAME = 'KD_BUKRS-HIGH'.
screen-invisible = '1'.
screen-active = '0'.
modify screen.
endif.
endloop.
Kind Regards,
Rae Ellen Woytowiez -
Regarding at selection screen event
hi experts,
i m working on hr abap report with the help of pnp ldb i made my selection screen using report category 'PY_DEF' now what i want that i m not using the first selction screen which contains current period details etc but when i click on the payroll period button the second selection screen is coming no doubt... containing payroll area current period ,other periods etc here i m entering payroll area eq 'ka' and other periods from '012006' to '122006' ,,here i want to validate the user input that it sud be of one year that is from 1 to 12.....for this i know i will use at selection event but how can i use it for the second selection screen not for first screen......... plz help me....Do u realy need the first selection screen having the current period? If u don't need then u can hide the field in the report category, by passing only the payroll area with other period, in this case we can validate through selection screen..
Reward points ... if found helpful...
Regards,
Sowmen Das -
Hi Guys,
we have a customized selection program similar to RSNAST00. In that while maintaining the variant when the users enter values other than say "ZABC " in output type field (KSCHL) and press enter certain fields in the screen should not be available for input. I have written this event which is getting trigerred but no changes are done to the screen
AT SELECTION-SCREEN ON S_KSCHL.
LOOP AT SCREEN.
IF screen-group1 = 'SHP'.
IF s_kschl-low NE 'ZABC'.
SCREEN-INPUT = '1'.
ELSE.
SCREEN-INPUT = '0'.
ENDIF.
MODIFY SCREEN .
ENDIF.
ENDLOOP
Can anyone please advice me how to achieve this.
Thanks
KrithikaHi Krithika,
Recently 3 days before i have posted the same question and i got the solution which i am sharing you. I am having a drop box input field where if i select NO from the dropdown then automatically concern fields has to be disabled.
In PBO
IF ZFORMA-CISWK = 'NO'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZFORMA-YISWK'. "field will become inactive
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
In PAI
IF ZFORMA-CISWK = 'YES'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ZFORMA-YISWK'. "field will be active
SCREEN-INPUT = 1.
SCREEN-ACTIVE = 1.
SCREEN-OUTPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
It is work with me fine.
Hope my answer will help you.
Cheers!! -
'SET PF-STATUS EXCLUDING fcode' not working in Selection Screen event
Hi all,
I am trying to set PF-Status dynamically in Selection Screen based on Radio button.
For that i have inserted following code under event --> AT SELECTION-SCREEN OUTPUT
* SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS: s_inc RADIOBUTTON GROUP rad DEFAULT 'X'
USER-COMMAND inc MODIF ID mod,
p_inc(10) MODIF ID m1,
s_lbr RADIOBUTTON GROUP rad,
p_lbr(10) MODIF ID m2.
SELECTION-SCREEN END OF BLOCK b1.
* AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
REFRESH fcode.
IF s_inc IS INITIAL.
APPEND 'CRTE' TO fcode.
APPEND 'CHNG' TO fcode.
APPEND 'DISP' TO fcode.
APPEND 'PRNI' TO fcode.
APPEND 'CRTL' TO fcode.
SET PF-STATUS 'STATUS_IN' EXCLUDING fcode.
ELSE.
SET PF-STATUS 'STATUS_IN'.
ENDIF.
Though s_inc is initial, i can see all the buttons from Status 'STATUS_IN' after execution of above code. EXCLUDING statement is not taking any effect which we normally get in Module pool program.
Please tell me what went wrong in above code?Problem solved ......Thanks Keshav,
Giving code correction -->
* SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS: s_inc RADIOBUTTON GROUP rad DEFAULT 'X'
USER-COMMAND inc MODIF ID mod,
p_inc(10) MODIF ID m1,
s_lbr RADIOBUTTON GROUP rad,
p_lbr(10) MODIF ID m2.
SELECTION-SCREEN END OF BLOCK b1.
* AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
REFRESH fcode.
IF s_inc IS INITIAL.
APPEND 'CRTI' TO fcode.
APPEND 'CHGI' TO fcode.
APPEND 'DISI' TO fcode.
APPEND 'DELI' TO fcode.
APPEND 'PRNI' TO fcode.
APPEND 'CRTL' TO fcode.
APPEND 'DATA' TO fcode.
ELSE.
APPEND 'CHGL' TO fcode.
APPEND 'DISL' TO fcode.
APPEND 'PRNL' TO fcode.
ENDIF.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = 'STATUS_IN'
P_PROGRAM = sy-repid
TABLES
p_exclude = fcode -
Enforcing event AT-SELECTION-SCREEN OUTPUT
Hi Gurus
Does anybody know how to force event AT-SELECTION-SCREEN OUTPUT ?
What I'm aiming for is changing screen somewere outside of this event. For example.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_param.
IF p_param = 'change'.
changes_in_screen = 'X'.
*???* "forcing AT-SELECTION-SCREEN OUTPUT event
ENDIF.
AT-SELECTION-SCREEN OUTPUT.
IF changes_in_screen = 'X'.
LOOP AT SCREEN.
"do something
ENDLOOP.
ENDIF.
I would be grateful for any hints.One alternative to define two selection screens. First selection screen (default selection screen of report #1000) having Client_type. After user hits execute (F8) then show the second selection screen with corresponding parameters.
PARAMETERS: p_client(1).
SELECTION-SCREEN BEGIN OF SCREEN 9000 AS WINDOW.
PARAMETERS: p_name(20),
p_lname(20),
p_cname(20),
p_oname(20).
SELECTION-SCREEN END OF SCREEN 9000.
AT SELECTION-SCREEN OUTPUT.
CHECK sy-dynnr = '9000'.
* Hide corresponding fields on second selection screen
* based on values of P_CLIENT.
* Also should make key parameters obligatory!
START-OF-SELECTION.
CALL SELECTION-SCREEN 9000 STARTING AT 5 5.
Another alternative is to use a dialog/module pool program to handle this. Such screen field controlling can easily be done in dialog programs because you have full PAI/PBO control, unlike report program selection screen 1000. Unfortunately in a dialog program it is not easy to reproduce the functionality of a select-option. -
Subscreen with Select-Options called from At Selection Screen event
Dear friends,
I'm trying to call a subscreen that contains a select-options, from an 'at selection screen' event, in a report program, but without sucess.
Here's go what I'm doing:
I declared a selection-screen as subscreen in my main program, and I'm calling it from a module-pool subscreen area, to make the module-pool select-options magic.
In my main report program, I have a customized status GUI with a new toolbar button and I'm handling it at the 'at selection screen' event.
What I need to do is to call the subscreen that contains the select-options when this new customized button get pressed, but when It happens, the select-option selections pop-up doesn't appear.
If I call the subscreen from the 'start-of-selection' event, it goes fine, just don't work from the 'at selection screen'.
Any ideas on how can I do it?
Thank you,
Heberi think you should try something like this:
at selection screen.
if condition handled ....
show_popup = 'X'.
endif.
at selection screen output.
if show_popup EQ 'X.
call subscreen
endif. -
Radio button on selection screen event issue.
Hi all,
I have two radio buttons and two input mandatory fields on selection screen.
- If first radio button selected then some value 'ABC' should fill in second input field.(because it is a mandatory field)
- If second radio button selected then some value 'XYZ' should fill in first input field..(because it is a mandatory field)
If suppose, user deletes first input value (ABC) and selects second Radio then, ABC to automatically display on first input field as this is mandatory. Same like,If he deletes second input field value and selects first radio, it should display XYZ in second input field. (As these fields are mandatory and requires some value).
I tried with below code, but not working. Appreciate your quick response.
PARAMETER ppart RADIOBUTTON GROUP src DEFAULT 'X'.
SELECT-OPTIONS p_sndprn FOR edoc_stat-sndprn OBLIGATORY DEFAULT 'ABC'.
PARAMETER psndr RADIOBUTTON GROUP src.
SELECT-OPTIONS p_sendid FOR zabc-sndlad OBLIGATORY DEFAULT 'XYZ'.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP src.
IF SSCRFIELDS-UCOMM = 'PRGP'.
IF ppart EQ 'X'.
P_SENDID-LOW = 'XYZ'.
ELSE.
P_SNDPRN-LOW = 'ABC'.
ENDIF.
ENDIF.
Thanks,
Ranjith.Search the forum... don't make fields obligatory and use event AT SELECTION-SCREEN OUTPUT.
-
Is it possible to have two at selection-screen events in a program
Hi all,
I have a selection screen wherein i am using i have 5 radiobuttons and 3 select-options and a parameter. I am trying to use two at selection-screen events
1) at selection-screen on radiobutton group rad1.
2) AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_STATUS.
the second event is not getting triggered.
I have to get certain values for the parameter p_status based on the radiobutton selected from an internal table(the field doesn't belong to any dictionary table i am filling an itab with some values based on the radiobutton selected) pls help. its urgent.
Regards
TharanathHi
TYPES : BEGIN OF ST_OBJID_SH,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
END OF ST_OBJID_SH.
DATA : IT_OBJID_SH TYPE STANDARD TABLE OF ST_OBJID_SH.
DATA : WA_OBJID_SH TYPE ST_OBJID_SH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
IF S_OBJID IS NOT INITIAL.
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = 'D'.
IF SY-SUBRC EQ 0.
SEARCH HELP FOR QUALIFICATION.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'OBJID'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_OBJID'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_OBJID_SH
FIELD_TAB =
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 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.
ENDIF.
Use in this way it will defently triggers
<b>REward if usefull</b> -
Event at selection-screen output
Hi all,
we have common include for all the reports. Now i need to add few selects to all screens based upon some conditions.so i added the seletions to the common include. Based upon some conditions ,i need to activate or deactivate these selections. this can be done at the event at seleciton-screen output. so i did that but few programs are giging dump as these programs already have the above mentioned event(ie at selection-screen output) now how to solve this issue.
Please suggest me .
Thanks
Jaffer Vali shaikHi Jaffer,
The conditions to display the additional selection, are they based on user input data? If not, you could try to put the logic in the initialization event. Check the 'where-used list' to see whether all programs accessing this common include already has initialization event or not.
If the display for selection are based on other selection criteria, then you need to evaluate the common include. Based on your project standard, does the include should have events processing in it? If yes, maybe the few programs that cause shortdump should move their logic to this common include (using the SY-REPID condition).
Regards,
Dewi -
Hi Friends,
Use of at selection screen event is to perform some validation PBO .. process before output.
But wht is the use of
AT SELCETION-SCREEN ON
AT SELECTION-SCREEN OUTPUT
Please explain with some sample programs.Hi,
<b>AT SELCETION-SCREEN ON</b>
The event is processed when the selection screen has been processed (at the end of PAI ).
Validation & Checks of inputted values happen here
<b>AT SELECTION-SCREEN OUTPUT.</b>
The event is processed before the display of selection screen.
<b>You can refer with this example also..</b>
REPORT z_72105_alv_radio.
TABLES: eban,mara, sscrfields.
TYPE-POOLS: slis.
DATA: BEGIN OF it_eban OCCURS 0,
banfn TYPE eban-banfn,
bnfpo TYPE eban-bnfpo,
bsakz TYPE eban-bsakz,
statu TYPE eban-statu,
ekgrp TYPE eban-ekgrp,
matnr TYPE eban-matnr,
werks TYPE eban-werks,
lgort TYPE eban-lgort,
preis TYPE eban-preis,
peinh TYPE eban-peinh,
END OF it_eban.
DATA: ad_repid TYPE sy-repid,
matnew TYPE eban-matnr,
strloc TYPE eban-lgort.
DATA : BEGIN OF it_mara OCCURS 0,
matnr TYPE mara-matnr,
END OF it_mara.
DATA : BEGIN OF it_lgort OCCURS 0,
lgort TYPE eban-lgort,
END OF it_lgort.
DATA: inum TYPE i VALUE 1,
icount TYPE i VALUE 0.
DATA: fldcat TYPE slis_t_fieldcat_alv,
layout TYPE slis_layout_alv,
e_event TYPE slis_t_event,
wa_event TYPE slis_alv_event.
INITIALIZATION .
ad_repid = sy-repid.
LOOP AT SCREEN.
IF screen-group1 = 'C1' .
screen-active = '0' .
MODIFY SCREEN .
ENDIF.
IF screen-name = 'S_MATNR-HIGH' OR screen-name = 'S_MATNR-LOW' OR screen-name = 'STR-HIGH' OR screen-name = 'STR-LOW'.
screen-input = '0' .
MODIFY SCREEN .
ENDIF.
ENDLOOP.
PERFORM fieldcatalog_populate USING fldcat.
PERFORM layout USING layout.
PERFORM build_event.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: r1 RADIOBUTTON GROUP prr USER-COMMAND x ,
r2 RADIOBUTTON GROUP prr .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-000.
PARAMETERS: material AS CHECKBOX USER-COMMAND x MODIF ID d1 .
SELECT-OPTIONS: s_matnr FOR mara-matnr MODIF ID d1.
PARAMETERS: storage AS CHECKBOX USER-COMMAND x MODIF ID d1.
SELECT-OPTIONS: str FOR eban-lgort MODIF ID d1.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.
SELECT-OPTIONS: banfn FOR eban-banfn MODIF ID c1.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN PUSHBUTTON 1(15) text-t10 USER-COMMAND fetch .
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF r1 EQ 'X' AND
screen-group1 = 'C1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF r2 EQ 'X' AND
screen-group1 = 'D1'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
LOOP AT SCREEN.
IF material EQ 'X' .
IF screen-name = 'S_MATNR-HIGH' OR screen-name = 'S_MATNR-LOW'.
screen-input = '1' .
MODIFY SCREEN .
ENDIF.
ELSE.
IF material NE 'X' .
IF screen-name = 'S_MATNR-HIGH' OR screen-name = 'S_MATNR-LOW'.
screen-input = '0' .
MODIFY SCREEN .
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF storage EQ 'X' .
IF screen-name = 'STR-HIGH' OR screen-name = 'STR-LOW'.
screen-input = '1' .
MODIFY SCREEN .
ENDIF.
ELSE.
IF storage NE 'X' .
IF screen-name = 'STR-HIGH' OR screen-name = 'STR-LOW'.
screen-input = '0' .
MODIFY SCREEN .
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
AT USER-COMMAND .
AT SELECTION-SCREEN.
CASE sscrfields.
WHEN 'FETCH'.
PERFORM z_72105_selection.
ENDCASE.
*& Form USER_COMMAND
text
-->V_UCOMM text
-->SELFIELD text
FORM user_command USING v_ucomm TYPE sy-ucomm
selfield TYPE slis_selfield.
IF v_ucomm = 'PREVIOUS'.
inum = inum - 1.
IF inum = 0.
inum = inum + 1.
icount = 0.
MESSAGE e000(z_72105_msg).
ELSE.
icount = 0.
LOOP AT it_eban.
DELETE it_eban.
ENDLOOP.
PERFORM z_72105_selection.
ENDIF.
ENDIF.
IF v_ucomm = 'NEXT'.
LOOP AT it_mara .
icount = icount + 1 .
ENDLOOP.
inum = inum + 1.
IF inum GT icount .
inum = inum - 1 .
icount = 0 .
MESSAGE e000(z_72105_msg).
ELSE.
icount = 0.
LOOP AT it_eban .
DELETE it_eban .
ENDLOOP.
ENDIF.
PERFORM z_72105_selection.
ENDIF.
ENDFORM. "user_command
**& Form z_72105_selection
text
FORM z_72105_selection .
END-OF-SELECTION.
START-OF-SELECTION.
SELECT DISTINCT matnr FROM eban INTO TABLE it_mara WHERE matnr IN s_matnr.
READ TABLE it_mara INTO matnew INDEX inum.
SELECT * FROM eban INTO CORRESPONDING FIELDS OF TABLE it_eban
WHERE matnr = matnew.
SELECT DISTINCT lgort FROM eban INTO TABLE it_lgort WHERE lgort IN str.
READ TABLE it_lgort INTO strloc INDEX inum.
SELECT * FROM eban INTO CORRESPONDING FIELDS OF TABLE it_eban
WHERE lgort = strloc.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = ad_repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
is_layout = layout
it_fieldcat = fldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
it_events = e_event
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_eban
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab =
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " z_72105_selection
*& Form set_pf_status
text
-->RT_EXTAB text
FORM set_pf_status USING rt_extab TYPE slis_t_extab .
SET PF-STATUS 'SET_PF_STATUS' .
ENDFORM . "SET_PF_STATUS -
Radiobutton during at selection-screen event is not triggered
Hi experts,
I have this event:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file
perform f_file_sel.
I want to select a file according to the radiobuttons on the selection screen, but during the f_file_sel form I recognized, that the radiobutton which I selected is not triggered.
It's only triggered after 'start-of-selection'.
How can I force the program to trigger it when f_file_sel is processing?Hi,
SELECT-OPTIONS : so_matnr1 FOR mvke-matnr MODIF ID id1,
so_matnr2 FOR mara-wrkst MODIF ID id2.
PARAMETERS : rb_mat TYPE c RADIOBUTTON GROUP rbg DEFAULT 'X' USER-COMMAND hid,
rb_var TYPE c RADIOBUTTON GROUP rbg.
LOOP AT SCREEN.
IF rb_mat EQ c_x.
IF screen-group1 EQ 'ID2'.
screen-input = '0'.
ENDIF.
ENDIF.
IF rb_var EQ c_x.
IF screen-group1 EQ 'ID1'.
screen-input = '0'.
ENDIF.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Apply this piece of code to your requirement with files in place of fields.Hope your issue will be resolved.
Regards,
Anand.
Maybe you are looking for
-
"The installation was interrupted before iTunes could be installed"
For several months now I have tried unsuccessfully to install iTunes on my laptop computer. The older versions worked, with several bugs, but they worked nonetheless. After installing EITHER iTunes or QuickTime, I get the messages: "The installation
-
Will Quicktime support PPAPI? Does it already?
Quicktime is blocked in Chrome, IE Explorer, and Firefox, but not yet in Safari. Can I count on this being true in the future? Let me explain my problem: I'm developing a website that will show literally hundreds of video clips of American Sign Langu
-
Opening projects in CS4 from earlier versions of Premiere
I have various projects in Premiere 2.0. They work fine. I tried opening one in Premiere CS4. It mostly works, but I found a small hickup where a transition (cross disolve) is quite messed up. Otherwise, it seems the project is playing the same in CS
-
My brother and I share contacts. How can I separate them?
At the moment, we're stuck sharing contacts. Anytime I delete a contact, it gets deleted off his phone, which I learnt when I cleared out the contacts and he lost all of his. If I add one, also, it's added to his phone. How can I change this? P.S.
-
Current running sql statement in procedure?
How to identify the current running sql statement in procedure or package? From the v$sqlarea, i can see the only procedure name with parameters, but not current execution statement? is there any dba view to know the current execution statement in 9i