Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Display note using CL_GOS_DOCUMENT_SERVICE

Former Member
0 Likes
1,882

Hello,

I'm trying to read notes captured using method DISPLAY_NOTE in class CL_GOS_DOCUMENT_SERVICE. I'm not sure what are the correct contents parameters.

IS_OBJECT : OBJKEY = ?

OBJTYPE = ?

LOGSYS = ?

IP_NOTE = ?

IP_DISP_HTML = 'X'

I tried to use the values in table SRGBTBREL, but that gives me a short dump: "Short text of error message:

Relationship NOTE Can No Longer Be Used with this Interface".

Will reward points for helpful answers.

Thanks,

Chris.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,154

Hi,

I've recently written the following demo program, which may be of some help to you.

My default values are for a particular service notification that I was testing with.

REPORT YJNM_DISPLAY_GOS_NOTES.

parameters:

p_botype like borident-objtype default 'BUS2080', " e.g. 'BUS2012'

p_bo_id like borident-objkey default '000200000591'.

data:

is_object type sibflporb,

et_links type obl_t_link,

et_links_s type obl_s_link ,

icx_obl_parameter_error type ref to cx_obl_parameter_error,

icx_obl_internal_error type ref to cx_obl_internal_error,

icx_obl_model_error type ref to cx_obl_model_error,

header_row type solisti1,

content_row type solisti1,

object_header like table of header_row,

object_content like table of content_row,

document_data type sofolenti1,

subline like content_row,

subline_fragment like subline-line,

subline_temp like subline,

sublines like table of subline,

all_sublines like table of subline,

document_id type sofOlenti1-doc_id,

exception_string type string.

----


  • find the links to where the notes are stored

is_object-instid = p_bo_id.

is_object-typeid = p_botype.

is_object-catid = 'BO'.

try.

call method cl_binary_relation=>read_links_of_binrel

exporting

is_object = is_object

ip_relation = 'NOTE'

importing

et_links = et_links.

catch cx_obl_parameter_error into icx_obl_parameter_error.

exception_string = icx_obl_parameter_error->get_longtext( ).

catch cx_obl_internal_error into icx_obl_internal_error .

exception_string = icx_obl_internal_error->get_longtext( ).

catch cx_obl_model_error into icx_obl_model_error.

exception_string = icx_obl_model_error->get_longtext( ).

endtry.

----


  • use the links to where the notes are stored

sort et_links by utctime.

loop at et_links into et_links_s.

  • get the data for a note

refresh all_sublines.

document_id = et_links_s-instid_b .

CALL FUNCTION 'SO_DOCUMENT_READ_API1'

EXPORTING

DOCUMENT_ID = document_id

IMPORTING

DOCUMENT_DATA = document_data

TABLES

OBJECT_HEADER = object_header

OBJECT_CONTENT = object_content.

  • display a header for the note

format reset.

skip.

format color col_heading.

write: / document_data-obj_descr,

/ 'Created by:',

document_data-creat_name,

document_data-creat_fnam,

'Last changed:',

document_data-chang_date.

  • interpret and display the note contents

format reset.

clear subline_fragment.

  • EOL (end of line) in the table object_content has nothing to do

  • with EOL for the note.

  • The table object_content is just a stream of characters - including

  • embedded CRLFs (carriage return & line feed) - that happens to be

  • 255-character rows.

loop at object_content into content_row.

  • split content row at embedded CRLFs

split content_row-line

at cl_abap_char_utilities=>cr_lf into table sublines.

loop at sublines into subline.

read table sublines into subline_temp index sy-tabix.

at first.

  • subline_fragment from end of previous content_row needs to be

  • stuck on to the first subline of this content_row

concatenate subline_fragment subline_temp-line

into subline_temp-line.

endat.

at last.

  • final subline may not be a complete line of the note -

  • so save it to use with beginning of next content_row

subline_fragment = subline_temp-line.

exit.

endat.

  • if we reach here, subline_temp will be a complete note-line

append subline_temp to all_sublines.

endloop.

endloop.

subline-line = subline_fragment.

append subline to all_sublines.

loop at all_sublines into subline.

write: / subline-line.

endloop.

endloop.

3 REPLIES 3
Read only

Former Member
0 Likes
1,155

Hi,

I've recently written the following demo program, which may be of some help to you.

My default values are for a particular service notification that I was testing with.

REPORT YJNM_DISPLAY_GOS_NOTES.

parameters:

p_botype like borident-objtype default 'BUS2080', " e.g. 'BUS2012'

p_bo_id like borident-objkey default '000200000591'.

data:

is_object type sibflporb,

et_links type obl_t_link,

et_links_s type obl_s_link ,

icx_obl_parameter_error type ref to cx_obl_parameter_error,

icx_obl_internal_error type ref to cx_obl_internal_error,

icx_obl_model_error type ref to cx_obl_model_error,

header_row type solisti1,

content_row type solisti1,

object_header like table of header_row,

object_content like table of content_row,

document_data type sofolenti1,

subline like content_row,

subline_fragment like subline-line,

subline_temp like subline,

sublines like table of subline,

all_sublines like table of subline,

document_id type sofOlenti1-doc_id,

exception_string type string.

----


  • find the links to where the notes are stored

is_object-instid = p_bo_id.

is_object-typeid = p_botype.

is_object-catid = 'BO'.

try.

call method cl_binary_relation=>read_links_of_binrel

exporting

is_object = is_object

ip_relation = 'NOTE'

importing

et_links = et_links.

catch cx_obl_parameter_error into icx_obl_parameter_error.

exception_string = icx_obl_parameter_error->get_longtext( ).

catch cx_obl_internal_error into icx_obl_internal_error .

exception_string = icx_obl_internal_error->get_longtext( ).

catch cx_obl_model_error into icx_obl_model_error.

exception_string = icx_obl_model_error->get_longtext( ).

endtry.

----


  • use the links to where the notes are stored

sort et_links by utctime.

loop at et_links into et_links_s.

  • get the data for a note

refresh all_sublines.

document_id = et_links_s-instid_b .

CALL FUNCTION 'SO_DOCUMENT_READ_API1'

EXPORTING

DOCUMENT_ID = document_id

IMPORTING

DOCUMENT_DATA = document_data

TABLES

OBJECT_HEADER = object_header

OBJECT_CONTENT = object_content.

  • display a header for the note

format reset.

skip.

format color col_heading.

write: / document_data-obj_descr,

/ 'Created by:',

document_data-creat_name,

document_data-creat_fnam,

'Last changed:',

document_data-chang_date.

  • interpret and display the note contents

format reset.

clear subline_fragment.

  • EOL (end of line) in the table object_content has nothing to do

  • with EOL for the note.

  • The table object_content is just a stream of characters - including

  • embedded CRLFs (carriage return & line feed) - that happens to be

  • 255-character rows.

loop at object_content into content_row.

  • split content row at embedded CRLFs

split content_row-line

at cl_abap_char_utilities=>cr_lf into table sublines.

loop at sublines into subline.

read table sublines into subline_temp index sy-tabix.

at first.

  • subline_fragment from end of previous content_row needs to be

  • stuck on to the first subline of this content_row

concatenate subline_fragment subline_temp-line

into subline_temp-line.

endat.

at last.

  • final subline may not be a complete line of the note -

  • so save it to use with beginning of next content_row

subline_fragment = subline_temp-line.

exit.

endat.

  • if we reach here, subline_temp will be a complete note-line

append subline_temp to all_sublines.

endloop.

endloop.

subline-line = subline_fragment.

append subline to all_sublines.

loop at all_sublines into subline.

write: / subline-line.

endloop.

endloop.

Read only

former_member194669
Active Contributor
0 Likes
1,154

Hi,

Check whether while selecting from srgbtbrel


  i_objectd-objtype = 'YNOTE'.    << GOS object name
  i_objectd-logsys  = 'BO'.
  i_objectd-objkey  = inumber.    << document number 

  if not i_objectd-objkey is initial.
    select * from srgbtbrel                " Get GOS Link
             into table i_srgbtbrel
             where instid_a eq i_objectd-objkey
               and typeid_a eq i_objectd-objtype
               and catid_a eq i_objectd-logsys
               and reltype eq 'NOTE'.   << relationship type will be NOTE    
    if sy-subrc eq 0.
      clear : i_objectd-logsys.
      create object i_attsrv.
      loop at i_srgbtbrel.
        i_borident-objkey =  i_srgbtbrel-instid_b.
        call method i_attsrv->display_note
          exporting
            is_object     = i_objectd
            ip_note        = i_borident-objkey
            ip_disp_html = ' '.
      endloop.
    endif.
  endif. .

Thanks

aRs

Read only

Former Member
0 Likes
1,154

Thank you for your helpful input. It helped solve my problem