Page tree
Skip to end of metadata
Go to start of metadata

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 pass those 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).

Create header segment

 

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


Step 3: WE81: Createmessage type (ZMGFGS1).

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

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

Step 6: SE37: Creationof 'Z' function module (ZFM_ACCRUAL_POST).*
Copy any standard 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 function module.



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: Create inbound process code (ZFBS1POST).

  

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.

8 Comments

  1. Former Member

    Many thanks for this usefull tutorial!

  2. Former Member

    Dear Krishna,

    I stucked at step 6, because with your described method, it is not possible to activate to copied function module from original IDOC_INPUT_FIDCC2, because many information are missing from the top includes. 

    I have manually copied F050 function group to new one, and within that, copied only IDOC_INPUT_FIDCC2 to the new group under a new name, but I still got activation errors.

    I think it can only work, if I copy the whole group, with all the function modules under a customer namespace.

    Please describe, how you did it yourself to made it work!

    BR,

    Gabor Antal,

    Hungary

  3. Unknown User (w1sz445)

    Step 4 should be WE82 instead of WE80.

  4. Former Member

    Can you please send me some SAP Portal study material my mail id is sandeepbbd89@gmail.com

  5. This blog is very useful who are new to crate custom IDOC's, custom segments, custom IDOC type and custome message type.

    Thanx...

    Regards,

    Lokesh

  6. Former Member

    Thanks everyone for liking this doc. 

    Regards,

    Krishna Chauhan

  7. Thanks for sharing good informaiton.. small correction.

    There is no T-code called WE80, Please correct it as WE82.

    1. Former Member

       

      Thank you Batineni and Guest(smile).... It was a typo mistake... Its my bad...

      I am unable to edit this document, Point No 4 should be WE82.

      Regards,

      Krishna Chauhan