03-31-2010 10:33 AM
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.
03-31-2010 3:14 PM
hi again...
searching...i found that table BDS_CONN00 is initial...how can i create records in this table?.
Thanks in advanced.
Gab.
02-01-2012 12:44 PM
I am having the same EXCEPTION , does anybody find a solution for this problem ,years years later
02-01-2012 1:10 PM
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.
02-01-2012 1:28 PM
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.
02-01-2012 1:38 PM
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.
02-01-2012 2:00 PM
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
02-01-2012 3:01 PM
Do you've any entries in database table BDS_CONN00?
More specific: filer it with CLASSNAME, CLASSTYPE and OBJECT_KEY.
02-01-2012 3:59 PM
Taknks my friend . İ have just one record in BDS_CONN00 . Bu it its not related me .
02-01-2012 5:54 PM
02-02-2012 6:52 AM
BDS_LOIO does have three entry related with me. I am very confused about this issue
02-02-2012 12:36 PM
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....