Friday, April 22, 2011

Gos Manager Class cl_gos_manager

 cl_gos_manager is very useful to manage attachments on a report. It lets you upload and download files related any object inside your report. You can also take notes. Simple to use ;

  DATA go_manager   TYPE REF TO cl_gos_manager,
         lp_no_commit TYPE        sgs_cmode,
         gp_service   TYPE        sgs_srvnam,
         gs_object    TYPE        borident.

  DATA  gs_bc_object TYPE sibflpor.
  DATAgs_service_selection TYPE sgos_sels,
        gt_service_selection TYPE tgos_sels.

*** go_manager related bor object and key 
 " key field for ex. document no    gs_object-objkey  '0000001'.
 " bor object that you created at swo1
  gs_object-objtype 'ZZ_OBJ'.

  CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
    IMPORTING
      own_logical_system             gs_object-logsys
    EXCEPTIONS
      own_logical_system_not_defined 1
      OTHERS                         2.

*** Which service we're gonna use

"" For Attaching Document
  gp_service 'PCATTA_CREA'.
"" Display and change documents 
*  gp_service = 'VIEW_ATTA'. 

*** Create Instance 
  CREATE OBJECT go_manager
    EXPORTING
      ip_no_commit lp_no_commit
      is_object    gs_object.

*** Start Service
  CALL METHOD go_manager->start_service_direct
    EXPORTING
      ip_service       gp_service
      is_object        gs_object
    EXCEPTIONS
      no_object        1
      object_invalid   2
      execution_failed 3
      OTHERS           4.




 There are test programs to use and understand the functionality. 



GOS_SERV_TOOLS_TEST    
GOS_SERVICE_TEST                    
GOS_TOOLBOX_TEST         



 Hope to post more often. See you.



No comments:

Post a Comment