How to get object
id when queues names have a short 2 digits number?
Sometimes you can get 1000 of BDocs, which are failed due to some
issues( server crash, wrong code implementation and etc.) now it is more
difficult to get B.object ID.
- First method with code for big numbers of mistakes.
For this you can implement short program with code:
REPORT ZZTESTKM.
tables: smw3_bdoc.
data: gt_bdoc type table of smw3_bdoc,
gs_bdoc type smw3_bdoc.
SELECT-OPTIONS: s_id for smw3_bdoc-BDOC_ID.
START-OF-SELECTION.
select * from smw3_bdoc into table gt_bdoc
where bdoc_id in s_id.
loop at gt_bdoc into gs_bdoc.
perform write.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form WRITE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM WRITE .
data l_body_ext type COMT_PROD_MATERIAL_BDOC_TAB.
data l_mat type COMT_PROD_MATERIAL_BDOC.
CALL METHOD cl_smw_bdocstore=>get_bdoc
EXPORTING
bdoc_id = gs_bdoc-BDOC_ID
GET_BDOC_HEADER = space
GET_BODY_EXT = 'X'
IMPORTING
bdoc_body_ext = l_body_ext.
loop at l_body_ext into l_mat.
write: / gs_bdoc-BDOC_ID, l_mat-header-COM_PRODUCT-PRODUCT_ID.
endloop.
ENDFORM. " WRITE
tables: smw3_bdoc.
data: gt_bdoc type table of smw3_bdoc,
gs_bdoc type smw3_bdoc.
SELECT-OPTIONS: s_id for smw3_bdoc-BDOC_ID.
START-OF-SELECTION.
select * from smw3_bdoc into table gt_bdoc
where bdoc_id in s_id.
loop at gt_bdoc into gs_bdoc.
perform write.
ENDLOOP.
*&---------------------------------------------------------------------*
*& Form WRITE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM WRITE .
data l_body_ext type COMT_PROD_MATERIAL_BDOC_TAB.
data l_mat type COMT_PROD_MATERIAL_BDOC.
CALL METHOD cl_smw_bdocstore=>get_bdoc
EXPORTING
bdoc_id = gs_bdoc-BDOC_ID
GET_BDOC_HEADER = space
GET_BODY_EXT = 'X'
IMPORTING
bdoc_body_ext = l_body_ext.
loop at l_body_ext into l_mat.
write: / gs_bdoc-BDOC_ID, l_mat-header-COM_PRODUCT-PRODUCT_ID.
endloop.
ENDFORM. " WRITE
You have to input only ID of BDoc messages and you will get result.
Advantage of this method, that you will get you BObject ID even, if Object link was already
deleted.
Second method:
- Without code.Go to T-code: SQVIJoin tables: SRRELROLES (field ROLETYPE) with SMWOREL(field ROLEA), andSMWOREL (field ROLE B) with SRRELROLES (field RoleID)In next wayAnd fields for selection: Object Type, Object Key, and again Object key, object typeRun request. Input ID of BDoc messages from T-code SMW02 into 1st field Object keyyou will get Object GUIDThis method has one disadvantage, if bDocs are too old and already lost their object link – this method doesn’t work.
Комментариев нет:
Отправить комментарий