2007 Jun 05 8:29 AM
Hi all,
I understand that the function module SAPGUI_SET_FUNCTIONCODE is being used to manully trigger the PAI/PBO at the POV. However, I was not able to get it to even trigger anything. Need suggestion as of how to use this function module. I try to call it at the end of the POV but to no avail. Any help is greatly appreciated and rewarded.
2007 Jun 05 8:39 AM
Hi,
Refer program : MSPAMO01
*----
PBO time event
*----
<b>PROCESS BEFORE OUTPUT.</b>
MODULE refresh_pat03?.
MODULE status_conversion. "For compatibility with Rel. 30A-30C
MODULE read_packages_and_queue.
MODULE check_attributes. "Ensure that PAT03 is consistent
MODULE purge_old_pat01_entries. "Ensure that queue is consistent
MODULE delete_q_from_indx. "For consistency with 3.1H/4.0A +
MODULE read_ocs_semaphore.
MODULE read_batch_jobs.
MODULE set_title.
MODULE set_status.
MODULE set_fields.
<b> MODULE suppress_dialog.</b>
*----
PAI time event
*----
PROCESS AFTER INPUT.
MODULE ok_code.
MODULE ok_code AT EXIT-COMMAND.
MODULE suppress_dialog OUTPUT.
IF gv_start_import = on.
ok_code = 'IMPL'.
gv_suppress_ok_code = ok_code.
<b> CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'</b>
EXPORTING
functioncode = ok_code
EXCEPTIONS
function_not_supported = 1
OTHERS = 99.
IF sy-subrc <> 0.
SUPPRESS DIALOG.
ENDIF.
ENDIF.
Best regards,
Prashant
ENDMODULE. "SUPPRESS_DIALOGUE OUTPUT
2007 Jun 05 8:37 AM
Hi,
I've implemented it like this in one of the requirements.
MODULE user_command_9000 INPUT.
okcode = sy-ucomm.
CASE okcode.
WHEN 'CLOS'.
WAIT UP TO 10 SECONDS.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
functioncode = 'CLOS'
EXCEPTIONS
function_not_supported = 1
OTHERS = 2.
MESSAGE i002(sy) WITH text-002.
DELETE DATASET fname.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
Thanks,
Jyoti
2007 Jun 05 8:38 AM
Hi Jyoti,
Does it actually proceed to fire the PBO/PAI event?
2007 Jun 05 8:48 AM
2007 Jun 05 8:39 AM
Hi,
Refer program : MSPAMO01
*----
PBO time event
*----
<b>PROCESS BEFORE OUTPUT.</b>
MODULE refresh_pat03?.
MODULE status_conversion. "For compatibility with Rel. 30A-30C
MODULE read_packages_and_queue.
MODULE check_attributes. "Ensure that PAT03 is consistent
MODULE purge_old_pat01_entries. "Ensure that queue is consistent
MODULE delete_q_from_indx. "For consistency with 3.1H/4.0A +
MODULE read_ocs_semaphore.
MODULE read_batch_jobs.
MODULE set_title.
MODULE set_status.
MODULE set_fields.
<b> MODULE suppress_dialog.</b>
*----
PAI time event
*----
PROCESS AFTER INPUT.
MODULE ok_code.
MODULE ok_code AT EXIT-COMMAND.
MODULE suppress_dialog OUTPUT.
IF gv_start_import = on.
ok_code = 'IMPL'.
gv_suppress_ok_code = ok_code.
<b> CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'</b>
EXPORTING
functioncode = ok_code
EXCEPTIONS
function_not_supported = 1
OTHERS = 99.
IF sy-subrc <> 0.
SUPPRESS DIALOG.
ENDIF.
ENDIF.
Best regards,
Prashant
ENDMODULE. "SUPPRESS_DIALOGUE OUTPUT
2007 Jun 05 8:41 AM
Hi,
Afer POV control will not go to PBO until y pressed ENTER . for overcome this you need to set a dummy OKCODE. in the following way.
CALL FUNCTION SAPGUI_SET_FUNCTIONCODE
EXPORTING
FUNCTIONCODE = =
EXCEPTION
FUNCTION_NOT_SUPPORTED = 1
OTHERS = 2
Here is the sample code
PROCESS BEFORE OUTPUT.
MODULES l201_blanklines.
LOOP RK intdrad WITH CONTROL tab_x CURSOR tab_x-current_line.
MODULES l201_init.
FINAL LOOP.
PROCESS AFTER INPUT.
MODULES l201_new.
LOOP RK intdrad.
CHAIN.
FIELD equi equnr.
MODULES l201_bear.
FINAL CHAIN.
FINAL LOOP.
MODULES l201_end.
Importantly
PROCESS ON VALUE REQUEST.
field EQUI EQUNR of modules ZZ_DMS_MULTIPLE_EQUIS.
Importantly
--End to screen Logic
Modules ZZ_DMS_MULTIPLE_EQUIS
CALL FUNCTION F4IF_FIELD_VALUE_REQUEST
EXPORTING
TABNAME = EQUI
FIELDNAME = EQUNR
SEARCHHELP = EQUI
SHLPPARAM = EQUNR
DYNPPROG = system-repid
DYNPNR = system-dynnr
DYNPROFIELD = EQUI EQUNR
MULTIPLE_CHOICE = X
TABLES
RETURN_TAB = lt_return_tab
EXCEPTION
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5
.
CALL FUNCTION SAPGUI_SET_FUNCTIONCODE
EXPORTING
FUNCTIONCODE = =
EXCEPTION
FUNCTION_NOT_SUPPORTED = 1
OTHERS = 2
.
...
CALL FUNCTION DYNP_VALUES_UPDATE
EXPORTING
DYNAME = system-repid
DYNUMB = system-dynnr
TABLES
DYNPFIELDS = lt_dynpfields
EXCEPTION
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
MORE INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
UNDEFIND_ERROR = 7
OTHERS = 8
Regards
Sudheer
2007 Jun 05 9:00 AM
Hi Sudheer,
I have used it in the POV event just like you did, but it didn't event fire PBO once I select an entry from the search help. A lot of people here claim that they are able to get PBo fired with this function module and I wonder how they actually did it. At least I was not able to get it working.
2007 Jun 05 9:14 AM
Example
A screen contains a single output field:
Counter ____
with the field reference "count".
This field is changed in the single flow logic module:
process before output.
module pbo.
and the default function code "=" is processed:
module pbo output. add 1 to count. if count > 20.
leave to screen 0.
endif.
call function 'SAPGUI_SET_FUNCTIONCODE'.
endmodule.