2006 May 30 5:11 PM
hi folks,
I need help in updating the selection screen, I have declared the 'parameters' object in the selection screen like this.
parameters:
Paygroup type ZPGKIS obligatory.
it has three values '5A', '5B' and '5V'. when I select '5V' from the parameters, I need to display another parameters selection object for 'date' otherwise NO
I tried something like this.....
if Paygroup = '5V'.
parameters: p_date type d.
endif.
It is not working...
How can I correct this??
Thanks in advance
Vinu
2006 May 30 5:14 PM
did u do that in AT SELECTION-SCREEN OUTPUT .
To give u an idea check this code, here cal_tra is the variable
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
hi folks,
I need help in updating the selection screen, I have declared the 'parameters' object in the selection screen like this.
parameters:
Paygroup type ZPGKIS obligatory.
it has three values '5A', '5B' and '5V'. when I select '5V' from the parameters, I need to display another parameters selection object for 'date' otherwise NO
I tried something like this.....
if Paygroup = '5V'.
parameters: p_date type d.
endif.
It is not working...
How can I correct this??
Thanks in advance
Vinu
2006 May 30 5:14 PM
did u do that in AT SELECTION-SCREEN OUTPUT .
To give u an idea check this code, here cal_tra is the variable
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
2006 May 30 5:14 PM
hii
you can make that using radio button
<b>
REPORT z_selectionscreen .
SELECTION-SCREEN BEGIN OF BLOCK blk.
PARAMETERS : p_rb1 TYPE PAYGROUP RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND FC,
p_rb2 TYPE PAYGROUP RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK blk.
SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME.
PARAMETERS : p_werks1 TYPE werks_d MODIF ID bk1.
SELECTION-SCREEN END OF BLOCK blk_1.
SELECTION-SCREEN BEGIN OF BLOCK blk_2 WITH FRAME.
PARAMETERS : p_werks2 TYPE werks_d MODIF ID bk2,
p_matnr2 TYPE matnr MODIF ID bk2.
SELECTION-SCREEN END OF BLOCK blk_2.
AT SELECTION-SCREEN OUTPUT.
IF p_rb1 = '5V'.
LOOP AT SCREEN.
IF screen-group1 = 'BK1'.
screen-active = 0.
MODIFY SCREEN.
ELSE.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF screen-group1 = 'BK2'.
screen-active = 0.
MODIFY SCREEN.
ELSE.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.</b>
you can as well check this code
-
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS : P_FILE(25) TYPE C,
O_FILE(25) TYPE C.
SELECTION-SCREEN END OF BLOCK B1.
*Selection Screen 2
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
PARAMETERS: CAL_TRA RADIOBUTTON GROUP G1 USER-COMMAND FLAG,
SESSION RADIOBUTTON GROUP G1 DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK B2.
*Selection Screen 3
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-003.
PARAMETERS: MODE DEFAULT 'X' MODIF ID BL1,
UPDATE DEFAULT 'X' MODIF ID BL1.
SELECTION-SCREEN END OF BLOCK B3.
*Selection Screen 4
SELECTION-SCREEN BEGIN OF BLOCK B4 WITH FRAME TITLE TEXT-003.
PARAMETERS: SES_NAM TYPE APQI-GROUPID MODIF ID BL2,
KEP_TRAS TYPE C DEFAULT 'X' MODIF ID BL2,
LOC_DATE TYPE SY-DATUM MODIF ID BL2,
USER TYPE SY-UNAME DEFAULT SY-UNAME MODIF ID BL2.
SELECTION-SCREEN END OF BLOCK B4.
************************************************************************
At Selection-Screen Output *
************************************************************************
AT SELECTION-SCREEN OUTPUT.
IF CAL_TRA = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '1'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
IF SESSION = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BL1'.
SCREEN-ACTIVE = '0'.
ENDIF.
IF SCREEN-GROUP1 = 'BL2'.
SCREEN-ACTIVE = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Message was edited by: Naresh Kumar
Message was edited by: Naresh Kumar
2006 May 30 5:16 PM
Hi Vinu,
In the at selection-screen output event,
YOu have to use the FM dynp_values_get to dynamically make the date field visible or invisible.
<b>at selection-screen output.
if p_field = <some value>.
loop at screen.
if screen-name = 'P_DATE'.
screen-invisible = 1.
screen-active = 0.
modify screen.
endif.
endloop.
endif. </b>
Regards,
ravi
2006 May 30 5:17 PM
Hi,
instead of using parameters use radio buttons
and enable and disable the parameters.
EG:-
PARAMETERS : p_ra1 RADIOBUTTON GROUP rad1
USER-COMMAND radio DEFAULT 'X'.
PARAMETERS : p_rad2 RADIOBUTTON GROUP rad1 .
PARAMETERS : p_rad3 RADIOBUTTON GROUP rad1 .
PARAMETERS : p_sumfl TYPE char255 modif id ABC.
PARAMETERS : p_detfl TYPE char255 modif id ABC.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_rad1 = 'X'.
IF screen-group1 = 'ABC'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
Copy paste code u will get an idea how it works
if u want one more another set of group to be activated and deactivated then declare parameter with different MODIF ID and one more if condition in loop at screen
Mark Helpfull Answers
Regards
manoj
Message was edited by: Manoj Gupta
2006 May 30 5:19 PM
Hi,
You have to use loop at screen in this case.
PARAMETERS: xxx TYPE char01
You have to give all the input parameters in the screen. and define the date parameter as a separate group using modif id.
AT SELECTION-SCREEN OUTPUT.
if pay-group='5V'.
loop at screen.
if screen-group='G1'.
screen-active = 1.
MODIFY SCREEN.
endif.
endloop.
else.
loop at screen.
if screen-group = 'G1'.
screen-active = 0.
endif.
ENDLOOP.
endif.
Regards,
Aswin
2006 May 30 5:20 PM
Vinu,
You need to use AT SELECTION SCREEN OUTPUT event.
In this event code you need activate / deactivate based on the paygroup value.
Use dynproGetvalues fm to read the values of selection screen, then based on condition you have disable / enable the parameters.
Regds
Manohar
2006 May 30 5:21 PM
You have to use DYNP_VALUES_READ function module to read the current value of this parameter and then depending on its value you can do the following in AT SELECTION-SCREEN OUTPUT event.
IF paygroup = '5V'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'DATE'.
SCREEN-ACTIVE = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-NAME = 'DATE'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
2006 May 30 5:33 PM
Thanks a lot folks,
while using the fm 'DYNP_VALUES_READ ' all I know is screen number '1000' it is asking for other parameters, which I do not have a clue, can anyone help me in that ??
Vinu
2006 May 30 5:37 PM
2006 May 30 5:39 PM
Although, I'm really not sure why you are using it, you can call it like this.
data: dynfields type table of dynpread with header line.
* Add the field to the table
dynfields-fieldname = 'P_PAYGRP'.
append dynfields.
call function 'DYNP_VALUES_READ'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
translate_to_upper = 'X'
tables
dynpfields = dynfields
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.
* You can read this table to get the value from the screen
read table dynfields with key fieldname = 'P_PAYGRP'.
p_PAYGRP = dynfields-fieldvalue.
what exactly is the requirement here.
Regards,
Rich HEilman
2006 May 30 5:45 PM
Rich,
The 'Paygroup' parameters option has to display by default on the screen, however when I select the option as '5V' the date object has to be displayed otherwise NO.
Thanks
Vinu
2006 May 30 5:47 PM
Oh, I had it backwards. This is not working for you?
report zrich_0001.
parameters: p_paygrp(2) type c.
parameters: p_datum type sy-datum modif id GR1.
at selection-screen output.
loop at screen.
if screen-group1 = 'GR1'.
if p_paygrp = '5V'.
screen-active = '1'.
else.
screen-active = '0'.
endif.
modify screen.
endif.
endloop.
Regards,
Rich Heilman
2006 May 30 5:50 PM
Let me explain it clearly,
I need a selection object for the paygroup on the screen hence I used the 'parameters' and it contains three values in it '5A', '5B' and '5V' which represent differetn pay groups.
For <b>paygroup '5V'</b> I need to provide the pay period ending date on the screen, hence I need to use another 'parameters' object to display the date.
That's all.
Vinu
2006 May 30 5:54 PM
2006 May 30 6:05 PM
Yes, I need that to happen. Because when I run the program only the paygroup 'parameter' option has to display and click on 'F4' from where I select the option '5V' then the pay date selection object has to display.If I select '5A' or '5B' the same screen has to be displayed with no pay period date
I used that peice of code it is not working...
Thanks
Vinu
2006 May 30 6:12 PM
2006 May 30 6:17 PM
2006 May 30 6:24 PM
2006 May 31 2:55 PM
Why don't you throw an error message to enter the date when the paygroup selected is '5V' instead of making it dynamically available on the selection screen?
2006 May 30 5:25 PM
Here is a simple program. You enter the value and must hit enter. Is this what you are looking for?
report zrich_0001.
parameters: p_paygrp(2) type c.
parameters: p_datum type sy-datum modif id GR1.
at selection-screen output.
loop at screen.
if screen-group1 = 'GR1'.
if p_paygrp = '5V'.
screen-active = '0'.
else.
screen-active = '1'.
endif.
modify screen.
endif.
endloop.
Regards,
Rich Heilman
2006 May 30 6:39 PM
Do this way.
PARAMETERS: paygroup TYPE zpgkis AS LISTBOX VISIBLE LENGTH 30
USER-COMMAND entry.
PARAMETERS: p_date TYPE sy-datum.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'P_DATE'.
IF paygroup = '5V'.
screen-active = '1'.
ELSE.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
2006 May 31 2:44 PM
No Srinivas, it did not work, but thanks a lot for everyone for helping out here. I shall reward points accordingly to everyone.
Vinu
2006 May 31 4:27 PM
It worked for me. Can you paste your selection screen and AT SELECTION-SCREEN logic here please?
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |