Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create asset Outbound IDOC using BAPI-ALE

Former Member
0 Likes
4,994

Hi,

I am trying to create asset outbound IDOC  from AS01 tcode and done the below settings, but asset outbound IDOC not created in source system.

1) Create Port 'TEST' using WE21

2)  Created partner profiles using WE20 : 

       Message Type : FIXEDASSET_CREATEFROMDATA1

       Basic Type    :  FIXEDASSET_CREATEFROMDATA102

       Reciever Port:  TEST

       Checked Transfer idoc immediately check box

3) Assigned FM to logical Messge and IDoc Type ( WE57)

          Function moduel: ALE_FIXEDASSET_CRETAE1

          Functiuon Type:   F

          BASIC TYPE:      FIXEDASEET_CREATEFROMDATA102

          Message Type:    FIXEDASEET_CREATEFROMDATA1

          Object type : BUS1022

          Direction : Outbound    

4) Distibution model BD64 :

   Created disticbution model and  seelcted add BAPI

     Object name:     FuxedAsset

     Method name:    CreateFromData1

Generated partner priofile succefull and model distrubuted.

Created Asset from AS01 tcode , but IDOC is not created as expected .

    

Please let me know if i am doing anything wrong here.

Thanks

Siri

1 ACCEPTED SOLUTION
Read only

Sougata
Active Contributor
2,627

The BOR object and the Method "CreateFromData1" that you are using is for Inbound processing and not meant for Outbound.

If your requirement is to replicate an Asset (via an IDoc) immediately after an Asset is created in the source system then you need a Method similar to BOR object BUS2075 (Internal Order) Method "SaveReplica". Unfortunately there is no such method available for BOR 1022 (Fixed Asset).

So, you will need to create one yourself. We had a similar problem where we wanted to replicate Funds Center but the related BOR object BUS0033 had no standard method to trigger/replicate this.

So we copied BUS0033 into ZBUS0033 and added a new Method "SaveReplica" into the BOR then used this in the ALE Distribution Model to replicate outbound IDocs from the source system.

Other Z FMs, Z BAPI (for the BOR Method "SaveReplica) and some wrapper FMs were developed as necessary which were then linked to the ALE customizing. Finally, the wrapper FM, which was designed as an Update Module, was called (synchronously of course) in an User-Exit of the application at the time of any change to the Fund Center. I would think you will need to design and implement something very similar.

Cheers,

Sougata.

The BOR object and the Method "CreateFromData1" that you are using is for Inbound processing and not meant for Outbound.

If your requirement is to replicate an Asset (via an IDoc) immediately after an Asset is created in the source system then you need a Method similar to BOR object BUS2075 (Internal Order) Method "SaveReplica". Unfortunately there is no such method available for BOR 1022 (Fixed Asset).

So, you will need to create one yourself. We had a similar problem where we wanted to replicate Funds Center but the related BOR object BUS0033 had no standard method to trigger/replicate this.

So we copied BUS0033 into ZBUS0033 and added a new Method "SaveReplica" into the BOR then used this in the ALE Distribution Model to replicate outbound IDocs from the source system.

Other Z FMs, Z BAPI (for the BOR Method "SaveReplica) and some wrapper FMs were developed as necessary which were then linked to the ALE customizing. Finally, the wrapper FM, which was designed as an Update Module, was called (synchronously of course) in an User-Exit of the application at the time of any change to the Fund Center. I would think you will need to design and implement something very similar.

Cheers,

Sougata.

5 REPLIES 5
Read only

Sougata
Active Contributor
2,628

The BOR object and the Method "CreateFromData1" that you are using is for Inbound processing and not meant for Outbound.

If your requirement is to replicate an Asset (via an IDoc) immediately after an Asset is created in the source system then you need a Method similar to BOR object BUS2075 (Internal Order) Method "SaveReplica". Unfortunately there is no such method available for BOR 1022 (Fixed Asset).

So, you will need to create one yourself. We had a similar problem where we wanted to replicate Funds Center but the related BOR object BUS0033 had no standard method to trigger/replicate this.

So we copied BUS0033 into ZBUS0033 and added a new Method "SaveReplica" into the BOR then used this in the ALE Distribution Model to replicate outbound IDocs from the source system.

Other Z FMs, Z BAPI (for the BOR Method "SaveReplica) and some wrapper FMs were developed as necessary which were then linked to the ALE customizing. Finally, the wrapper FM, which was designed as an Update Module, was called (synchronously of course) in an User-Exit of the application at the time of any change to the Fund Center. I would think you will need to design and implement something very similar.

Cheers,

Sougata.

Read only

Former Member
0 Likes
2,627

Sougata,

'

Thanks for your reply,

When i go to Tcode BDBG ->

           Object Type :BUS1022

           Method        CreateFromData1   ->select category ->Object Type-> Display Interface

Here I can see

Function Module for Outbound ALE     ALE_FIXEDASSET_CREATE1 

is there any way i can create a Asset outbound idoc using function module ALE_FIXEDASSET_CREATE1 when i create Asset using AS01 ?

Thanks

Siri

Read only

Sougata
Active Contributor
0 Likes
2,627

That's great news because that means you do not have to develop the custom ALE FMs to populate the IDoc - so half of your problem is already solved!

For the other half, I would identify the appropriate User-Exit or BAdI which is called everytime as Asset is created/changed etc. Then I would call FM "ALE_FIXEDASSET_CREATE1" in Update Task within the User-Exit to create the IDoc - the mappings already exists in this FM. I had a quick look at SMOD - Enhancement "AINT0001" looks good but I'm not sure if it will be called everytime - you'll have to implement it and see if it breaks on save at AS01, 02 etc.

The Distribution Model which you have already customized can stay the same if you have used Message Type "FIXEDASSET_CREATEFROMDATA1" and added it as an outbound parameter for the target LS (Logical System).

Hope this solves the issue.

Cheers,

Sougata.

Read only

Sougata
Active Contributor
0 Likes
2,627

Sougata Chatterjee wrote:

The Distribution Model which you have already customized can stay the same if you have used Message Type "FIXEDASSET_CREATEFROMDATA1" and added it as an outbound parameter for the target LS (Logical System).

Hope this solves the issue.

Cheers,

Sougata.

Ok, I correct myself - You first need to delete the entry in the Distribution Model (BD64) for the BAPI which you had added earlier. In the Partner Profile (WE20), also delete the entry which the Distr.Model generated before. Then choose the target Logical System from the left hand side and add the Message Type "FIXEDASSET_CREATEFROMDATA1" as an outbound parameter and save.

Also remember, in the User-Exit, before you call FM "ALE_FIXEDASSET_CREATE1" in Update Mode, you would need to read the Asset master data (for the particular Asset number) and fill up the various Import & Tables Parameters of this FM as per your requirement so that then this FM can populate the appropriate segments of the IDoc. It will not do this by itself because it does not know which segments you require or you don't.

Cheers,

Sougata.

Read only

0 Likes
2,627

Is this Solution Implemented . How it is done. [removed by moderator]