FUNCTION Z_AB_QM_SHOW_ATTACHMENT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_VIQMEL) LIKE VIQMEL STRUCTURE VIQMEL
*" VALUE(I_CUSTOMIZING) LIKE V_TQ85 STRUCTURE V_TQ85
*" TABLES
*" TI_IVIQMFE STRUCTURE WQMFE
*" TI_IVIQMUR STRUCTURE WQMUR
*" TI_IVIQMSM STRUCTURE WQMSM
*" TI_IVIQMMA STRUCTURE WQMMA
*" TI_IHPA STRUCTURE IHPA
*" EXCEPTIONS
*" ACTION_STOPPED
*"----------------------------------------------------------------------
constants: gos_path type string value '(SAPLSWUG)GO_GOS_MANAGER'.
field-symbols: <gos> type ref to cl_gos_manager.
assign (gos_path) to <gos>.
if <gos> is assigned and <gos> is not initial.
data(object) = value borident( objkey = i_viqmel-qmnum ).
select single qmtyp into data(qmtyp)
from tq80
where qmart eq i_viqmel-qmart.
"different type of BUS for different notification type
object-objtype = switch #( qmtyp when '01' then 'BUS2038'
when '02' then 'BUS2078'
when '03' then 'BUS2080'
when '04' then 'BUS7050'
when '05' then 'BUS7051'
).
<gos>->start_service_direct(
exporting
ip_service = 'VIEW_ATTA' " Generic Service to Be Executed
is_object = object
exceptions
no_object = 1
object_invalid = 2
execution_failed = 3
others = 4
).
if sy-subrc <> 0.
endif.
endif.
endif.
endfunction.
Direct access quality notification attachments from action box
When you use QM01/QM02/QM03/IQS1/IQS2/IQS3 transactions then you've noticed that when you have some task defined then you cannot directly go to attachments of notification. Following popup always appears:
But there is a way of getting rid of it. We can add new action box action to call directly attachments of notification.
So go to SPRO and find Define Action Box in QM node.
Then add new function with your new FM name and following parameters:
This will create an action like this.
Then let's create our FM. As you can see bellow, old trick of assigning data from program found in stack is used and then GOS manager is used to call directly attachment list.
Once it's done then when you click on your new action it will show you directly attachment list of notification.
Have Fun!