2006 May 26 1:18 AM
Hello people,
I currently have a program where I call a Popup FM during the initilization event. My plan that when the program is executed a popup will appear asking the using for a button to press. This works fine but my problem is once you press execute during the selection-screen the popup will appear again if no list in the report is generated.
Lets say no data exists based on your selection parameters, instead of staying in the selection screen, the pop will appear again.
My question is, is there a method or way to supress the popup after you already selected the option from it so it wont appear again?
Thank you all very much and good day.
2006 May 26 3:17 AM
This is the code I used before you guys helped me out
<b>
INITIALIZATION.
PERFORM POP_UP.
AT SELECTION-SCREEN OUTPUT.
PERFORM MODIFY_SCREEN.
</b>
Subroutines
FORM POP_UP.
CALL FUNCTION 'POPUP_TO_DECIDE'
EXPORTING
DEFAULTOPTION = '1'
TEXTLINE1 = 'Please select the procedure'
textline2 = 'Vat Rate cannot be extracted.'
textline3 = 'Please Select a VAT Rate for Computation'
TEXT_OPTION1 = 'Manual Selection'
TEXT_OPTION2 = 'File Upload'
TITEL = 'Choose selection type'
START_COLUMN = 25
START_ROW = 6
CANCEL_DISPLAY = 'X'
IMPORTING
ANSWER = ANS.
ENDFORM. " POP_UP
FORM MODIFY_SCREEN.
CASE ANS.
WHEN '1'.
CLEAR P_PATH.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'P_PATH'.
SCREEN-INPUT = '2'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN '2'.
SET CURSOR FIELD 'P_PATH'.
REFRESH: SO_INFNR, SO_MATKL, SO_MATNR, SO_LIFNR,
SO_WERKS, SO_EKGRP, SO_DISC.
CLEAR: P_DATAB, P_DATAB2, P_DATBI2, P_DSRCH, C_OVER, P_VAT,
P_DISC, P_DTYPE, C_VB.
LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'SO_INFNR-LOW' OR 'SO_INFNR-HIGH' OR 'SO_MATKL-LOW' OR
'SO_MATKL-HIGH' OR 'SO_MATNR-LOW' OR 'SO_MATNR-HIGH' OR
'SO_LIFNR-LOW' OR 'SO_LIFNR-HIGH' OR 'SO_WERKS-LOW' OR
'SO_WERKS-HIGH' OR 'SO_EKGRP-LOW' OR 'SO_EKGRP-HIGH' OR
'P_DATAB' OR 'P_DSRCH' OR 'SO_DISC-LOW' OR 'SO_DISC-HIGH'.
SCREEN-INPUT = '2'.
WHEN 'P_DATBI2' OR 'P_DATAB2' OR 'C_OVER' OR 'P_VAT' OR 'P_DISC'
OR 'P_DTYPE' OR 'C_VB'.
SCREEN-INPUT = '2'.
WHEN OTHERS.
SCREEN-INPUT = '1'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
WHEN OTHERS.
LEAVE PROGRAM.
ENDCASE.
ENDFORM. " MODIFY_SCREEN
Thanks again!
Hello people,
I currently have a program where I call a Popup FM during the initilization event. My plan that when the program is executed a popup will appear asking the using for a button to press. This works fine but my problem is once you press execute during the selection-screen the popup will appear again if no list in the report is generated.
Lets say no data exists based on your selection parameters, instead of staying in the selection screen, the pop will appear again.
My question is, is there a method or way to supress the popup after you already selected the option from it so it wont appear again?
Thank you all very much and good day.
2006 May 26 1:24 AM
Hi,
This has to be done using the logic.
If you want the popup to come only once, have a variable and show the the popup when the variable is initial. Right after the pop up funciton set the variable to 'X'.
Have a IF condition for the pop up display.
IF flag_popup = 'X'.
show popup.
endif.
flag_popup = 'X'.
Regards,
Ravi
Note : Please mark the helpful answers
2006 May 26 1:26 AM
Hi Chad,
If no data is found put in the following code to display an information message..
message i016(rp) with 'No data Found'.
stop.
Regards,
Suresh Datti
2006 May 26 1:46 AM
Hmmm im trying both methods none of them seem to be effective.
The case of Flag I believe, the value resets after execution.
The case of stop. I tried it, and the popup still seems to be executing.
2006 May 26 1:52 AM
I don't think the value of the flag gets reset after execution.
If at all that is the case, try the other way round. Set a default value of the flag to 'X' and show the popup if it is X and then clear the flag.
Regards,
Ravi
2006 May 26 2:00 AM
Seems to still return to its default value despite clearing a flag.
It seems to return to the Initilization phase after pressing F8 and returns all data to its default value.
2006 May 26 2:28 AM
2006 May 26 3:16 AM
2006 May 26 3:17 AM
This is the code I used before you guys helped me out
<b>
INITIALIZATION.
PERFORM POP_UP.
AT SELECTION-SCREEN OUTPUT.
PERFORM MODIFY_SCREEN.
</b>
Subroutines
FORM POP_UP.
CALL FUNCTION 'POPUP_TO_DECIDE'
EXPORTING
DEFAULTOPTION = '1'
TEXTLINE1 = 'Please select the procedure'
textline2 = 'Vat Rate cannot be extracted.'
textline3 = 'Please Select a VAT Rate for Computation'
TEXT_OPTION1 = 'Manual Selection'
TEXT_OPTION2 = 'File Upload'
TITEL = 'Choose selection type'
START_COLUMN = 25
START_ROW = 6
CANCEL_DISPLAY = 'X'
IMPORTING
ANSWER = ANS.
ENDFORM. " POP_UP
FORM MODIFY_SCREEN.
CASE ANS.
WHEN '1'.
CLEAR P_PATH.
LOOP AT SCREEN.
IF SCREEN-NAME EQ 'P_PATH'.
SCREEN-INPUT = '2'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
WHEN '2'.
SET CURSOR FIELD 'P_PATH'.
REFRESH: SO_INFNR, SO_MATKL, SO_MATNR, SO_LIFNR,
SO_WERKS, SO_EKGRP, SO_DISC.
CLEAR: P_DATAB, P_DATAB2, P_DATBI2, P_DSRCH, C_OVER, P_VAT,
P_DISC, P_DTYPE, C_VB.
LOOP AT SCREEN.
CASE SCREEN-NAME.
WHEN 'SO_INFNR-LOW' OR 'SO_INFNR-HIGH' OR 'SO_MATKL-LOW' OR
'SO_MATKL-HIGH' OR 'SO_MATNR-LOW' OR 'SO_MATNR-HIGH' OR
'SO_LIFNR-LOW' OR 'SO_LIFNR-HIGH' OR 'SO_WERKS-LOW' OR
'SO_WERKS-HIGH' OR 'SO_EKGRP-LOW' OR 'SO_EKGRP-HIGH' OR
'P_DATAB' OR 'P_DSRCH' OR 'SO_DISC-LOW' OR 'SO_DISC-HIGH'.
SCREEN-INPUT = '2'.
WHEN 'P_DATBI2' OR 'P_DATAB2' OR 'C_OVER' OR 'P_VAT' OR 'P_DISC'
OR 'P_DTYPE' OR 'C_VB'.
SCREEN-INPUT = '2'.
WHEN OTHERS.
SCREEN-INPUT = '1'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
WHEN OTHERS.
LEAVE PROGRAM.
ENDCASE.
ENDFORM. " MODIFY_SCREEN
Thanks again!
2006 May 26 4:25 AM
hI,
I just tried this and it worked.
In the perform Popup.
IMPORT ANS FROM MEMORY ID 'ANS'.
IF ANS IS INITIAL.
CALL FUNCTION 'POPUP_TO_DECIDE'
EXPORTING
* DEFAULTOPTION = '1'
TEXTLINE1 = 'Please select the procedure'
* textline2 = 'Vat Rate cannot be extracted.'
* textline3 = 'Please Select a VAT Rate for Computation'
TEXT_OPTION1 = 'Manual Selection'
TEXT_OPTION2 = 'File Upload'
TITEL = 'Choose selection type'
START_COLUMN = 25
START_ROW = 6
* CANCEL_DISPLAY = 'X'
IMPORTING
ANSWER = ANS.
EXPORT ANS TO MEMORY ID 'ANS'.
ENDIF.
Regards,
Ravi
2006 May 26 4:39 AM