‎2006 Oct 04 2:49 PM
Hi,
In executable program,
I have 3 fields in selection screen. But initially I need to display only 1 field, after entering the value for the first field, I need to check that value and if its correct then user should get the left of the 2 fields to enter the input values. After entering the 2 fields values and click submit button program should execute.
Can any one tell me what the best way I can do this ?
Initially I put one field in selection screen and I used CALL SELECTION-SCREEN statement for the 2 fields, but for this after entering the 2 fields values and submit program is not executing the
START-OF-SELECTION logic, its simply coming out from START-OF-SELECTION line.
Thanks for ur time.
‎2006 Oct 04 2:51 PM
hi,
chk this sample code.
REPORT ypra_sample56.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETER: p_r1 RADIOBUTTON GROUP rg1 USER-COMMAND vend DEFAULT 'X',
p_r2 RADIOBUTTON GROUP rg1,
p_r3 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-002.
PARAMETER: p_c1 TYPE c AS CHECKBOX,
p_c2 TYPE c AS CHECKBOX,
p_c3 TYPE c AS CHECKBOX,
p_c4 TYPE c AS CHECKBOX,
p_c5 TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK a2.
***********************************************************************
INITIALIZATION
***********************************************************************
INITIALIZATION.
PERFORM enable_fields.
***********************************************************************
AT SELECTION SCREEN OUTPUT
***********************************************************************
AT SELECTION-SCREEN OUTPUT.
PERFORM sel_screen_output.
&----
*& Form sel_screen_output
&----
Selection screen Output
----
FORM sel_screen_output.
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
PERFORM enable_fields.
ENDIF.
IF p_r3 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name = 'P_C5'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " sel_screen_output
&----
*& Form enable_fields
&----
enable fields in selection screen
----
FORM enable_fields .
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name EQ 'P_C5'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
rgds
anver
if hlped mark points
‎2006 Oct 04 2:51 PM
hi,
chk this sample code.
REPORT ypra_sample56.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
PARAMETER: p_r1 RADIOBUTTON GROUP rg1 USER-COMMAND vend DEFAULT 'X',
p_r2 RADIOBUTTON GROUP rg1,
p_r3 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF BLOCK a1.
SELECTION-SCREEN BEGIN OF BLOCK a2 WITH FRAME TITLE text-002.
PARAMETER: p_c1 TYPE c AS CHECKBOX,
p_c2 TYPE c AS CHECKBOX,
p_c3 TYPE c AS CHECKBOX,
p_c4 TYPE c AS CHECKBOX,
p_c5 TYPE c AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK a2.
***********************************************************************
INITIALIZATION
***********************************************************************
INITIALIZATION.
PERFORM enable_fields.
***********************************************************************
AT SELECTION SCREEN OUTPUT
***********************************************************************
AT SELECTION-SCREEN OUTPUT.
PERFORM sel_screen_output.
&----
*& Form sel_screen_output
&----
Selection screen Output
----
FORM sel_screen_output.
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
PERFORM enable_fields.
ENDIF.
IF p_r3 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name = 'P_C5'.
screen-active = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " sel_screen_output
&----
*& Form enable_fields
&----
enable fields in selection screen
----
FORM enable_fields .
IF p_r1 EQ 'X' OR p_r2 EQ 'X'.
LOOP AT SCREEN.
IF screen-name EQ 'P_C4' OR screen-name EQ 'P_C5'.
screen-active = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
rgds
anver
if hlped mark points
‎2006 Oct 04 2:52 PM
At INITIALIZATION event Hide the two fields using LOOP AT SCREEN.And modify the screen.
In AT SELECTION-SCREEN event loop through the screen again and validate the value entered and do the same logic to modify the screen
‎2006 Oct 04 2:52 PM
Loop at the screen and set them off in the AT SELECTION-SCREEN OUTPUT event. Here is an example program. If the first field has a value, then the second and third fields will be opened.
report zrich_0002.
parameters: p_field1 type c,
p_field2 type c modif id chk,
p_field3 type c modif id chk.
at selection-screen output.
if p_field1 is initial.
loop at screen.
if screen-group1 = 'CHK'.
screen-active = '0'.
modify screen.
endif.
endloop.
endif.Regards,
Rich Heilman
Message was edited by: Rich Heilman
‎2006 Oct 04 2:53 PM
Hi
Use Submit Keyword for passing data in between two executable programs. Refer to its documentation.
Regards
AK
‎2006 Oct 04 5:00 PM
Hi all thanks for ur answers.
I got answers for hiding and enabling 2 fields.
But I dint get, when I click on second submit buttoon how do I can execute the program.
after entering first field values click Buttion1 then it will enable 2 fields and after entering 2 field values when i Click button2 then its comming out from START-OF-SELECTION. program is not executing.
Please some one can let me.
thanks.
‎2006 Oct 04 5:26 PM
‎2006 Oct 04 7:12 PM
Hi Prakash,
can u send email to my id - n.kavitha.n@gmail.com
thanks.
‎2006 Oct 04 8:18 PM
Hi Kavitha,
Solution to your second problem:
Just change the user-command code for the Submit pushbutton as 'ONLI'.
FYI
When you click the second submit button, you will not be able to trigger the start-of-selection event if the id is not 'ONLI'. Thats' the reason, after you click the submit button AT SELECTION-SCREEN OUTPUT event will be triggered.
You can trigger START-OF-SELECTION Event only by using the F8 key or the execute button.
Just change the user-command code for the Submit pushbutton as 'ONLI'.
Regards,
Navneet Saraogi
‎2006 Oct 04 2:59 PM
Hi Kavitha,
u need to reprocess the screen. how do you want achive it?
After you fill the first field, do you press the enter button or what?
bye
enzo
‎2006 Oct 04 3:03 PM
Check the below logic..
Report = Zreport.
1.Define the parameters as p1, p2, p3 and pexecute.
where pexecute as no-display default to 0.
2.In the INITIALIZATION even make the parameters p2 and p3 invisible.
3.At selection-screen event..validate p1 and if correct, enable p2 and p3.
4.In start of selection event use the below code.
if pexecute = 0.
submit zreport with (submit the same abap_)
p1 = p1
p2 = p2
p3 = p3
pexecute = 1.
else.
--> your processing logic.
endif.