Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Own Idoc process code with FM v3.0 - How to get Idoc Number for linking Idoc to Business Object ?

$
0
0

Hello

 

i had created a custom process code (ZME_LEANLIFT) and linked it to a own FM "Z_MM_CREATE_WM_IDOC".

 

Processing is set to Processing with ALE service and version of FM is set to version 3.0.

 

07-04-2015 15-14-14.jpg

 

Idoc is created with no errors and sent successfully.

 

But i want to link the outbound idoc to business object BUS2017.

For doing so i need the idoc number. Do you know a way to get

the final idoc number in my FM ?

 

FM-Coding for linking idoc to business object:

 

*-----------------------------------------------------

* link idoc to business object

*-----------------------------------------------------

 

*************************************************

*   create link to idoc in GOS of business object

*************************************************

*   http://scn.sap.com/thread/1389795

*   http://scn.sap.com/thread/703865

 

*   Link TYPE Role A Role B Usage

*--------------------------------------

*   IDC0 OUTBELEG OUTIDOC Document trace

*   IDC1 INIDOC INBELEG Document trace

*   IDCB INIDOC OUTBELEG Document trace

*   IDC4 INIDOC OUTIDOC ALE Audit

*   IDC9 OUTIDOC INBELEG ALE Audit

*   IDC8 INIDOC INTID Monitoring

*   IDCA OUTIDOC OUTID Monitoring

 

   "read table comm_idoc_control into ls_comm_idoc_control.

 

   if sy-subrc = 0.

 

*    concatenate nast_key-mblnr  nast_key-mjahr into lv_key_obj.

*

*    move 'IDOC' to ls_obj_rola-objtype.

*    move control_record_in-docnum to ls_obj_rola-objkey.

*

*    move lv_key_obj   to ls_obj_rolb-objkey.

*    move 'BUS2017' to ls_obj_rolb-objtype.

*

*    lv_relation = 'IDC9'.

*

*    call function 'BINARY_RELATION_CREATE'

*      exporting

*        obj_rolea      = ls_obj_rola

*        obj_roleb      = ls_obj_rolb

*        relationtype   = lv_relation

*      exceptions

*        no_model       = 1

*        internal_error = 2

*        unknown        = 3

*        others         = 4.

*

*    if sy-subrc <> 0.

*

*    else.

*

*    endif.

 

   else.

   endif.


Thanks a lot for your hints and ideas.

Sebastian


Viewing all articles
Browse latest Browse all 8950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>