Ansicht
Dokumentation

CL_GOS_API - GOS API: Zugriff auf GOS Anlagenliste für Externe

CL_GOS_API - GOS API: Zugriff auf GOS Anlagenliste für Externe

BAL Application Log Documentation   ROGBILLS - Synchronize billing plans  
Diese Dokumentation steht unter dem Copyright der SAP AG.
SAP E-Book

Funktionalität

Zugriff auf die GOS Anlagenliste für Anwendungen. In ersten Schritt muss die Anwendung eine Instanz der Klasse CL_GOS_API erzeugen und dabei ihr eindeutiges Anwendungsobjekt bekannt geben. Zur Zeit werden Anwendungsobjekte der Kategorien BOR Objektund persistente Klassenunterstützt. Anschliessend kann die Anlagenliste gelesen, der Inhalt einzelner Anlagen geholt oder Anlagen geändert, gelöscht, angelegt werden.

Beziehungen

Beispiel

Lesen der Anlagenliste:


data ls_appl_object     type gos_s_obj.
data lo_gos_api         type ref to cl_gos_api.
data lt_attachment_list type gos_t_atta.
data lt_role_filter     type gos_t_rol.

ls_appl_object-typeid = .
ls_appl_object-instid = .
ls_appl_object-catid  = . "BO - BOR Object
                                                "CL - Persistent Class

* create instance of GOS API providing unique application object
try.
    lo_gos_api = cl_gos_api=>create_instance( ls_appl_object ).
*   get attachment list for this object (if needed restrict selection
*   by adding certain roles to filter table; initial table means: get
*   attachments in all roles)
*   *append cl_gos_api=>c_attachment to lt_role_filter.
*   *append cl_gos_api=>c_annotation to lt_role_filter.
*   *append cl_gos_api=>c_website to lt_role_filter.
    lt_attachment_list = lo_gos_api->get_atta_list( lt_role_filter ).
  catch cx_gos_api.
*   error handling
endtry.

Lesen des Inhalts eines Dokuments


data ls_attachment   type gos_s_atta.
data ls_attachm_cont type gos_s_attcont.
data ls_atta_key     type gos_s_attkey.

read table lt_attachment_list index
                              into ls_attachment.
move-corresponding ls_attachment into ls_atta_key.
try.
    ls_attachm_cont = lo_gos_api->get_al_item( ls_atta_key ).
  catch cx_gos_api.
*   error handling
endtry.

Löschen eines Dokuments


data lv_commit_required type flag.

try.
    lv_commit_required = lo_gos_api->delete_al_item( ls_atta_key ).
    if lv_commit_required is not initial.
      commit work.
    endif.
  catch cx_gos_api.
*   error handling
endtry.

Anlegen eines Dokuments


data lv_commit_required type flag.
data ls_attcont         type gos_s_attcont.
data lv_roltype         type oblroltype.

*Note
lv_roltype           = cl_gos_api=>c_annotation.

ls_attcont-atta_cat  = c_msg.
ls_attcont-descr     = .
ls_attcont-content   = .

*Website
lv_roltype           = cl_gos_api=>c_website.

ls_attcont-atta_cat  = c_msg.
ls_attcont-descr     = .
ls_attcont-content   = .

*Attachment
lv_roltype           = cl_gos_api=>c_attachment.

ls_attcont-atta_cat  = c_msg.
ls_attcont-filesize  = .
ls_attcont-filename  = .
ls_attcont-tech_type = .
ls_attcont-descr     = .
ls_attcont-content   = .
*or
ls_attcont-content_x = .


try.
    lv_commit_required = lo_gos_api->insert_al_item( is_attcont = ls_attcont iv_roltype = lv_roltype ).
    if lv_commit_required is not initial.
      commit work.
    endif.
  catch cx_gos_api.
*   error handling
endtry.

Hinweise

Weiterführende Informationen






General Material Data   Addresses (Business Address Services)  
Diese Dokumentation steht unter dem Copyright der SAP AG.

Length: 5837 Date: 20240425 Time: 054028     sap01-206 ( 58 ms )