‎2007 Mar 22 4:38 AM
hi experts,
here i have some problem in one scenario. can u please see this.
input: months range.
after this i have to give option for 12 months in check boxes or radio buttons.
if the user clicks on any particular month, i have to give one option for input(8 fields). like that user may clicks on 12 months one by one , i have to give option for total 96 entries (8 entries for each month).
if i click on first jan, then one screen should come,
if i click on feb, then one new screen should come, the first screen will be off.,
like this it has to come for all the months.
how can i do this. please help me...in this scenario.
‎2007 Mar 22 5:37 AM
Execute the code
REPORT zex13 .
PARAMETERS : cb1_jan AS CHECKBOX user-command r,
cb2_feb AS CHECKBOX user-command r .
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001 . "text-001 = 'jan'
PARAMETERS : f1(8) TYPE c MODIF ID a,
f2(8) TYPE c MODIF ID a,
f3(8) TYPE c MODIF ID a,
f4(8) TYPE c MODIF ID a,
f5(8) TYPE c MODIF ID a,
f6(8) TYPE c MODIF ID a,
f7(8) TYPE c MODIF ID a,
f8(8) TYPE c MODIF ID a.
SELECTION-SCREEN END OF BLOCK a.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002 ."text-002 = 'Feb' maintain this
PARAMETERS : f21(8) TYPE c MODIF ID b,
f22(8) TYPE c MODIF ID b,
f23(8) TYPE c MODIF ID b,
f24(8) TYPE c MODIF ID b,
f25(8) TYPE c MODIF ID b,
f26(8) TYPE c MODIF ID b,
f27(8) TYPE c MODIF ID b,
f28(8) TYPE c MODIF ID b.
SELECTION-SCREEN END OF BLOCK b.
AT SELECTION-SCREEN OUTPUT.
IF cb1_jan Eq ' ' .
LOOP AT SCREEN .
IF screen-group1 = 'A'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
else.
LOOP AT SCREEN .
IF screen-group1 = 'A'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF cb2_feb Eq ' ' .
LOOP AT SCREEN .
IF screen-group1 = 'B'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
else.
LOOP AT SCREEN .
IF screen-group1 = 'B'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.See if this is working for u .
I hope i have understood ur query .
Just extend the logic for other months .
//if the user clicks on any particular month, i have to give one option for input(8 fields). like that user may clicks on 12 months one by one , i have to give option for total 96 entries (8 entries for each month).
One thing you need to understand is if i take the radio button option i can only make one block appear but if u want to see the entries for more than one month no choice but to go for check box.
Regards,
Vijay
‎2007 Mar 22 4:44 AM
declare the screen with all the fields as no display .in a selection screen block .
at selection-screen event .
check which radio button or checkbox is ticked based on display selection-screen block .
keep a track of which selection you are displaying coz if selects another buttonb you will again make the previous selection as no dispaly .
This should as dynamic selections .
Please reward if useful.
‎2007 Mar 22 5:06 AM
hi durgesh,
at selection-screen on p_jan. " request for p_file.
IF p_jan = 'X'.
PARAMETERS : 1_acn01 LIKE pc207-betrg ,
1_acno10 LIKE pc207-betrg ,
1_acn02 LIKE pc207-betrg,
1_acn21 LIKE pc207-betrg,
1_acn22 LIKE pc207-betrg,
1_bank LIKE pa0009-bankl,
1_date LIKE sy-datum,
1_total LIKE pc207-betrg.
ENDIF.
[ i require all these 8 fieldds in all the 12 months. with some name difference.
for feb it is starting with 2, march 3, april 4 like this,.....)
if i give like this it is giving errors.
can u please guide me with soem suitable code..
Message was edited by:
dasr r
‎2007 Mar 22 5:22 AM
<b>Hi u need to do the coding for making the fields invisible, in the AT SELECTION-SCREEN OUTPUT event..
Check the below code..</b>
<u><i>U cannot define the PARAMETERS and SELECT OPTIONS locally.. imean in subroutines , in at selection screen events and in GET events... Thats y it is giving error for u..</i></u>
parameters : p_jan as checkbox.
PARAMETERS :
1_acn01 LIKE pc207-betrg modif id GRP,
p_acno10 LIKE pc207-betrg modif id GRP,
1_acn02 LIKE pc207-betrg modif id GRP,
1_acn21 LIKE pc207-betrg modif id GRP,
1_acn22 LIKE pc207-betrg modif id GRP,
1_bank LIKE pa0009-bankl modif id GRP,
1_date LIKE sy-datum modif id GRP,
1_total LIKE pc207-betrg modif id GRP.
at selection-screen output. " request for p_file.
IF p_jan = 'X'.
loop at screen.
if screen-group1 eq 'GRP'.
screen-active = 0.
modify screen.
endif.
endloop.
ENDIF.
regards,
sai ramesh
‎2007 Mar 22 5:31 AM
Hi,
u can't write like that.
it will give u the error "Within FORM routines and function modules, the SELECTION-SCREENstatement is not allowed." right?
where u have to show these parameter in the same screen or in the other screen.
regards,
bharat.
‎2007 Mar 22 6:44 AM
YAH , waht u r telling is right , it is giving the same error.
ok
tahnks
‎2007 Mar 22 7:30 AM
hI,
WHAT SNIPER HAS GIVE IS WRITE.THAT WILL WORK FINE.
PUT AT SELECTION SCREEN OUTPUT EVENT BEFORE INITIALIZATION.
REGARDS,
BHARAT.
‎2007 Mar 22 5:13 AM
If You want to acieve this Using Selection-screen, then You have to assign Function codes to Each element on your screen.
In At selection-screen output event,
You need to loop at screen and hide the elements which you do not want to display depending on Selected Function key.
If you are to acive the result using screen then it is more easire. Define 8 subscreen areas having the required content. Depeding on the selected button, u call the desired Subscreen.
‎2007 Mar 22 5:18 AM
hi,
parameters:
p_jan1 radiobutton group g1,
p_feb1 radiobutton group g1,
p_mar1 radiobutton group g1,
....
PARAMETERS :
1_acn01 LIKE pc207-betrg modif id jan,
p_acno10 LIKE pc207-betrg modif id jan,
1_acn02 LIKE pc207-betrg modif id jan,
1_acn21 LIKE pc207-betrg modif id jan,
1_acn22 LIKE pc207-betrg modif id jan,
1_bank LIKE pa0009-bankl modif id jan,
1_date LIKE sy-datum modif id jan,
1_total LIKE pc207-betrg modif id jan,
...
1_acn03 LIKE pc207-betrg modif id feb,
...
like u declare 96 parameters and give same modif id for for the parameters what to display for a selected month.
then.
at selection screen output.
loop at screen .
<b>if p_jan1 = 'X'.
if screen-group1 = 'jan'
screen-active = 1.
else .
screen-active = 0.
endif.</b>
elseif p_feb1 = 'X'.
if screen-group1 = 'feb'
screen-active = 1.
else .
screen-active = 0.
endif.
..
..
..
modify screen.
endloop.
regards ,
ananth.
Message was edited by:
ananth
‎2007 Mar 22 5:20 AM
P_NUM type spfli-carrid MODIF ID G1,
INITIALIZATION.
P_NUM = '25'.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'G1'.
SCREEN-output = 0.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
start-of-selection.
The above is just a sample code...
http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm
check the above site
‎2007 Mar 22 5:23 AM
Hi Dasr,
Yes it is possible through at-selection-screen output.
First define parameters. add modif id <xxx> to that parameters. (Here u will define total 12 modif ids). Then take one flag. mention in at selection screen output as when select first radio button then looping for screen and screen group is reqired name related to reqired parameter. screen active is 0.
Hope this helps you, reply for queries,
Regards.
kumar.
‎2007 Mar 22 5:37 AM
Execute the code
REPORT zex13 .
PARAMETERS : cb1_jan AS CHECKBOX user-command r,
cb2_feb AS CHECKBOX user-command r .
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001 . "text-001 = 'jan'
PARAMETERS : f1(8) TYPE c MODIF ID a,
f2(8) TYPE c MODIF ID a,
f3(8) TYPE c MODIF ID a,
f4(8) TYPE c MODIF ID a,
f5(8) TYPE c MODIF ID a,
f6(8) TYPE c MODIF ID a,
f7(8) TYPE c MODIF ID a,
f8(8) TYPE c MODIF ID a.
SELECTION-SCREEN END OF BLOCK a.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002 ."text-002 = 'Feb' maintain this
PARAMETERS : f21(8) TYPE c MODIF ID b,
f22(8) TYPE c MODIF ID b,
f23(8) TYPE c MODIF ID b,
f24(8) TYPE c MODIF ID b,
f25(8) TYPE c MODIF ID b,
f26(8) TYPE c MODIF ID b,
f27(8) TYPE c MODIF ID b,
f28(8) TYPE c MODIF ID b.
SELECTION-SCREEN END OF BLOCK b.
AT SELECTION-SCREEN OUTPUT.
IF cb1_jan Eq ' ' .
LOOP AT SCREEN .
IF screen-group1 = 'A'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
else.
LOOP AT SCREEN .
IF screen-group1 = 'A'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF cb2_feb Eq ' ' .
LOOP AT SCREEN .
IF screen-group1 = 'B'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
else.
LOOP AT SCREEN .
IF screen-group1 = 'B'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.See if this is working for u .
I hope i have understood ur query .
Just extend the logic for other months .
//if the user clicks on any particular month, i have to give one option for input(8 fields). like that user may clicks on 12 months one by one , i have to give option for total 96 entries (8 entries for each month).
One thing you need to understand is if i take the radio button option i can only make one block appear but if u want to see the entries for more than one month no choice but to go for check box.
Regards,
Vijay
‎2007 Mar 22 7:15 AM
hi ... thanks for u r reply. here where to put that code of at selection-screen.
whetehr it is after the initialization or after the block a.
only....
here the code is like this.
SELECTION-SCREEN POSITION 1.
PARAMETERS : c_jan AS CHECKBOX USER-COMMAND r. " DEFAULT 'X'.
SELECTION-SCREEN COMMENT 3(10) text-062.
SELECTION-SCREEN POSITION 14.
PARAMETERS : c_feb AS CHECKBOX USER-COMMAND r.
SELECTION-SCREEN COMMENT 16(9) text-063.
-
same for other months
SELECTION-SCREEN BEGIN OF BLOCK Jan WITH FRAME TITLE text-004 . "text-001 = 'jan'
PARAMETERS: 1_acn01 LIKE pc207-betrg MODIF ID jan,
1_acno10 LIKE pc207-betrg MODIF ID jan,
1_acn02 LIKE pc207-betrg MODIF ID jan,
1_acn21 LIKE pc207-betrg MODIF ID jan,
1_acn22 LIKE pc207-betrg MODIF ID jan,
1_bank LIKE pa0009-bankl MODIF ID jan,
1_date LIKE sy-datum MODIF ID jan,
1_total LIKE pc207-betrg MODIF ID jan.
SELECTION-SCREEN:END OF BLOCK Jan.
SELECTION-SCREEN BEGIN OF BLOCK Feb WITH FRAME TITLE text-005 ."text-002 = 'Feb' maintain this
PARAMETERS: 2_acn01 LIKE pc207-betrg modif id Feb,
2_acno10 LIKE pc207-betrg modif id Feb,
2_acn02 LIKE pc207-betrg modif id Feb,
2_acn21 LIKE pc207-betrg modif id Feb,
2_acn22 LIKE pc207-betrg modif id Feb,
2_bank LIKE pa0009-bankl modif id Feb,
2_date LIKE sy-datum modif id Feb,
2_total LIKE pc207-betrg modif id Feb.
SELECTION-SCREEN:END OF BLOCK Feb.
AT SELECTION-SCREEN OUTPUT.
IF C_Jan EQ ' ' .
LOOP AT SCREEN .
IF screen-group1 = 'Jan'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN .
IF screen-group1 = 'Jan'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF C_Feb EQ ' ' .
LOOP AT SCREEN .
IF screen-group1 = 'Feb'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN .
IF screen-group1 = 'Feb'.
screen-active = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
problem is , if i click on jan checkbox, the feb screen not going off.
why it is like this.
Message was edited by:
dasr r
‎2007 Mar 22 7:17 AM
U can write the code wherever u want ...
Events will get executed in a predefined order..
so u can write the code either before or after any event..
And initialization is the first event that gets triggered before any event !!
reward if it helps u,
sai ramesh
‎2007 Mar 22 7:28 AM
confirm that if u take two months jan and feb the o/p is okay for u .
if yes.
Proceed the declaration exactly as shown for each and every month till 12 and u need to write the at selection-screen output after the blocks declarations .
selection block a
selection block b
selection block c
selection block 12
at selection-screen ouput .
*****************************
IF screen-group1 = 'JAN'.
IF screen-group1 = 'FEB'.
maintain in CAPS ..
Regards,
Vijay