Application Development 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: 

function 'BDS_ALL_CONNECTIONS_GET' and field LOIO_ID

0 Kudos

Hi all,

I am trying to get a documentent via 'BDS_ALL_CONNECTIONS_GET' and 'BDS_DOCUMENT_GET_TABLE' but i am getting

the message " nothing found". When i call 'BDS_ALL_CONNECTIONS_GET,the field LOIO_ID is initial in tha table all_connections.

Any idea? Why?

Thanks in advanced.

Gab.

11 REPLIES 11

0 Kudos

hi again...

searching...i found that table BDS_CONN00 is initial...how can i create records in this table?.

Thanks in advanced.

Gab.

yavuzasik
Participant
0 Kudos

I am having the same EXCEPTION , does anybody find a solution for this problem ,years years later

0 Kudos

Hi Chericher.

How do you call de function?

I did this:

DATA: WA_CONN TYPE BDN_CON,
      IT_CONN LIKE TABLE OF W_CONN,
      V_COUNT TYPE I,
      V_OBJECT_KEY TYPE SBDST_OBJECT_KEY.

V_OBJECT_KEY = V_BANFN. "Purchase Req Number

CALL FUNCTION 'BDS_ALL_CONNECTIONS_GET'
    EXPORTING
      CLASSNAME = 'BUS2105'
      CLASSTYPE = 'BO'
      OBJKEY    = V_OBJECT_KEY
*      CLIENT    = SY-MANDT
      ALL       = 'X'
*      NO_AL_DOCS
      NO_GOS_DOCS = 'X'
    IMPORTING
      COUNT = V_COUNT
    TABLES
      ALL_CONNECTIONS = IT_CONN
    EXCEPTIONS
      NO_OBJECTS_FOUND = 1
      ERROR_KPRO = 2
      INTERNAL_ERROR = 3
      NOT_AUTHORIZED = 4
      OTHERS = 5.

By example, BUS2105 is for Purchase Requisition. With NO_GOS_DOCS = ' ' (empty) I will get GOS attachs too. Try this.

0 Kudos

My call is like that : First call is OK it turns connections but lt_conn table rows has empty "LOIO_ID" columns. SO the COPY funtion gets an EXCEPTION "Nothing Found" . IN fact i have problem with COPY funcyion .Thanks a lot

CALL FUNCTION 'BDS_ALL_CONNECTIONS_GET'

EXPORTING

classname = lv_classname

classtype = 'BO'

objkey = is_obj-objkey

all = 'X'

no_gos_docs = space

TABLES

all_connections = lt_conn

EXCEPTIONS

no_objects_found = 1

error_kpro = 2

internal_error = 3

not_authorized = 4.

LOOP AT lt_conn INTO ls_conn .

lv_docid = ls_conn-bds_docid .

CALL FUNCTION 'BDS_BUSINESSDOCUMENT_COPY'

EXPORTING

classname = lv_classname

classtype = ls_source-catid

client = sy-mandt

object_key = ls_source-instid

doc_id = lv_docid

doc_ver_no = ls_conn-doc_ver_no

doc_var_id = ls_conn-doc_var_id

new_classname = lv_classname

new_classtype = ls_target-catid

new_client = sy-mandt

new_object_key = ls_target-instid

EXCEPTIONS

nothing_found = 1

parameter_error = 2

not_allowed = 3

error_kpro = 4

internal_error = 5

not_authorized = 6

OTHERS = 7.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDLOOP.

0 Kudos

Try with this:

DATA: O_BDS TYPE REF TO CL_BDS_DOCUMENT_SET,
      PROPERTIES TYPE SBDST_PROPERTIES,
      V_OBJECT_KEY_LIC TYPE SBDST_OBJECT_KEY,
      V_DOC_ID TYPE SBDST_DOC_ID,
      V_NEW_OBJECT_KEY TYPE SBDST_OBJECT_KEY,
      V_NEW_DOC_ID TYPE SBDST_DOC_ID,
      V_NEW_DOC_VER_NO TYPE SBDST_DOC_VER_NO,
      V_NEW_DOC_VAR_ID TYPE SBDST_DOC_VAR_ID.

  IF SY-SUBRC = 0 AND IT_CONN[] IS NOT INITIAL.

    IF O_BDS IS INITIAL.
      CREATE OBJECT O_BDS.
    ENDIF.

    LOOP AT IT_CONN INTO WA_CONN.

      CLEAR: V_NEW_OBJECT_KEY, V_NEW_DOC_ID, V_NEW_DOC_VER_NO,
             V_NEW_DOC_VAR_ID, V_DOC_ID.
      REFRESH PROPERTIES.

      V_DOC_ID = WA_CONN-LOIO_ID.

      CALL METHOD O_BDS->COPY
        EXPORTING
          CLASSNAME = 'BUS2105'
          CLASSTYPE = 'BO'
          OBJECT_KEY = V_OBJECT_KEY
          DOC_ID     = V_DOC_ID
          DOC_VER_NO = '00000001'
          DOC_VAR_ID = '00000001'
          NEW_CLASSNAME = 'ZLICIT'
          NEW_CLASSTYPE = 'BO'
          NEW_OBJECT_KEY = V_OBJECT_KEY_LIC
        IMPORTING
          NEW_OBJECT_KEY_EXPORT = V_NEW_OBJECT_KEY
          NEW_DOC_ID = V_NEW_DOC_ID
          NEW_DOC_VER_NO = V_NEW_DOC_VER_NO
          NEW_DOC_VAR_ID = V_NEW_DOC_VAR_ID
        CHANGING
          PROPERTIES = PROPERTIES
        EXCEPTIONS
          ERROR_KPRO = 1
          INTERNAL_ERROR = 2
          NOTHING_FOUND = 3
          NOT_ALLOWED = 4
          NOT_AUTHORIZED = 5
          PARAMETER_ERROR = 5
          OTHERS = 6.

      CLEAR WA_CONN.

    ENDLOOP.

  ENDIF.

Check this: maybe, MAYBE, your documents're not BDS, but GOS. If yes, try with this:

DATA: lt_services TYPE tgos_sels.    " Services table typ
DATA: ls_service TYPE sgos_sels.     " Services structure type
DATA: ls_source TYPE sibflporb,      " Source
      ls_target TYPE sibflporb.      " Target

  CLEAR: LS_SERVICE, LS_SOURCE, LS_TARGET.

  REFRESH: LT_SERVICES.

* Service needs to be performed
  ls_service-sign   = 'I'.
  ls_service-option = 'EQ'.
  ls_service-low    = 'PCATTA_CREA'.
  APPEND ls_service TO lt_services.

* Source
  ls_source-instid = V_BANFN.
  ls_source-typeid = 'BUS2105'.
  ls_source-catid  = 'BO'.

* Target
  ls_target-instid = V_SUBMI.
  ls_target-typeid = 'ZLICIT'.
  ls_target-catid  = 'BO'.

* Copy the objects between Source and Target
  cl_gos_service_tools=>copy_linked_objects(
      is_source            = ls_source
      is_target            = ls_target
      it_service_selection = lt_services
        ).

  COMMIT WORK.

It don't need call the mentioned functions.

0 Kudos

Thks Emanuel. But the problem is WA_CONN-LOIO_ID is initial in my case. I have tried your code too ,but the result is the same

0 Kudos

Do you've any entries in database table BDS_CONN00?

More specific: filer it with CLASSNAME, CLASSTYPE and OBJECT_KEY.

0 Kudos

Taknks my friend . İ have just one record in BDS_CONN00 . Bu it its not related me .

0 Kudos

And table BDS_LOIO ?

0 Kudos

BDS_LOIO does have three entry related with me. I am very confused about this issue

0 Kudos

Try creating another BDS doc for any object, and then check tables and function.

Addition: create a new BDS document for your object with OAER transaction, and test function....