Steps to Create Custom IDOC

Embed Size (px)

Citation preview

  • 7/30/2019 Steps to Create Custom IDOC

    1/6

    http://wiki.sdn.sap.com/wiki/display/ABAP/Steps+to+creat

    e+custom+IDOC

    Steps to create custom IDOC

    Attachments:13

    Added by Krishna Chauhan, last edited by Moshe Naveh on Feb 09, 2010 (view change)

    Scenario: Let's assume we require to create a custom IDOC for posting accrual (FBS1 transaction). For posting

    accrual we have a BAPI called 'BAPI_ACC_DOCUMENT_POST'. Our first approach will be to understand the

    transaction FBS1 and identify the mandatory and minimum fields require for posting accruals by transaction FBS1.

    First we will be making the segments in custom Idoc with same fields require to populate in BAPI. Our approach for

    posting accruals from custom Idoc will be, first we will populate the segments of custom Idoc and then we will passthose fields to our 'Z' function module (which we will be creating with BAPI functionality). Our 'Z' function module will

    be doing the whole functionality for posting accrual.

    Steps we will perform in creating custom IDOC:

    1> WE31: Creation of segments (ZFBS1_HDR, ZFBS1_DET).

    2> WE30: Creation of Idoc type (ZFBS1_IDOC_TY).

    3> WE81: Create message type (ZMGFGS1).

    4> WE80: Assign message type (ZMGFGS1) to Idoc type (ZFBS1_IDOC_TY).

    5> SE80: Creation of function group (ZFG_IDOC).

    6> SE37: Creation of 'Z' function module (ZFM_ACCRUAL_POST).

    7> WE57: Assign Idoc (ZFBS1_IDOC_TY) to function module (ZFM_ACCRUAL_POST).

    8> BD51: Create an entry for function module (ZFM_ACCRUAL_POST).

    9> WE42: Create inbound process code (ZFBS1POST).

    10> BD54: Create logical system (CIDCLNT200).

    11> SM59: Create RFC destination.

    12> WE20: Create partner profile.

    13> WE19: Test tool for Idoc.

    Step 1: WE31: Creation of segments (ZFBS1_HDR, ZFBS1_DET).

    http://wiki.sdn.sap.com/wiki/display/ABAP/Steps+to+create+custom+IDOChttp://wiki.sdn.sap.com/wiki/display/ABAP/Steps+to+create+custom+IDOChttp://wiki.sdn.sap.com/wiki/display/ABAP/Steps+to+create+custom+IDOChttp://wiki.sdn.sap.com/wiki/pages/viewpageattachments.action?pageId=166461514&metadataLink=truehttp://wiki.sdn.sap.com/wiki/pages/viewpageattachments.action?pageId=166461514&metadataLink=truehttp://wiki.sdn.sap.com/wiki/display/~nc0euofhttp://wiki.sdn.sap.com/wiki/display/~k7y0jy2http://wiki.sdn.sap.com/wiki/pages/diffpages.action?pageId=166461514&originalId=166461569http://wiki.sdn.sap.com/wiki/pages/diffpages.action?pageId=166461514&originalId=166461569http://wiki.sdn.sap.com/wiki/display/ABAP/Steps+to+create+custom+IDOChttp://wiki.sdn.sap.com/wiki/display/ABAP/Steps+to+create+custom+IDOChttp://wiki.sdn.sap.com/wiki/display/ABAP/Steps+to+create+custom+IDOChttp://wiki.sdn.sap.com/wiki/pages/viewpageattachments.action?pageId=166461514&metadataLink=truehttp://wiki.sdn.sap.com/wiki/display/~nc0euofhttp://wiki.sdn.sap.com/wiki/display/~k7y0jy2http://wiki.sdn.sap.com/wiki/pages/diffpages.action?pageId=166461514&originalId=166461569
  • 7/30/2019 Steps to Create Custom IDOC

    2/6

    Create header segment

  • 7/30/2019 Steps to Create Custom IDOC

    3/6

    Step 2 : WE30: Creation of Idoc type (ZFBS1_IDOC_TY).

    Step 3: WE81: Createmessage type (ZMGFGS1).

    Step 4: WE80: Assignmessage type (ZMGFGS1) to Idoc type (ZFBS1_IDOC_TY).

    Step 5: SE80: Creation of function group(ZFG_IDOC).

    *

  • 7/30/2019 Steps to Create Custom IDOC

    4/6

    Step 6: SE37: Creationof 'Z' function module (ZFM_ACCRUAL_POST).*

    Copy anystandard function module which is running behind any IDOC, here I am copying 'IDOC_INPUT_FIDCC2'to

    'ZFM_ACCRUAL_POST'. Comment the standard code and activate the fun mod.

    Step7: WE57: AssignIdoc (ZFBS1_IDOC_TY) to function

    module(ZFM_ACCRUAL_POST).

    Step 8: BD51:Create an entry for function module (ZFM_ACCRUAL_POST).

    Step 9: WE42: Createinbound process code

    (ZFBS1POST).

  • 7/30/2019 Steps to Create Custom IDOC

    5/6

    Step 10: BD54:Create logical system

    (CIDCLNT200).

    Step 11: SM59: Create RFC destination.

    Step12: WE20:Create partner profile.

    Step 13: WE19:Test tool for Idoc.

  • 7/30/2019 Steps to Create Custom IDOC

    6/6