Application Development 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: 

Trigger WE19 by code

oliver_am
Active Participant
0 Kudos

Hello,

Is it possible to create a new inbound idoc by code.
Like in we19 when you choose radiobutton BasicType, to starting from scratch.

I cannot create a new idoc and send it with FM MASTER_IDOC_DISTRIBUTE, because this idoc type is not configured as outbound idoc.
Functional Team needs to create an inbound idoc like others of this type that enter in this system. And use the same FM and other custom transactions to manage this idocs...

Is there any FM to do that, I think it will be difficult to do it with a batch input to WE19....

Or do we need to configure we20 to able the idoc as outbound and enter in this same system...?

Sorry if its a basic question, I have no experience with idocs, I've tried to find a solution before post...


Thanks.

1 ACCEPTED SOLUTION

DominikTylczyn
Active Contributor

Hello oliver.am

You need to make all the regular settings in WE20 for the IDoc. Then you can generate an inbound IDoc from your own program by call IDOC_INBOUND_ASYNCHRONOUS function module.

Best regards

Dominik Tylczynski

8 REPLIES 8

FredericGirod
Active Contributor
0 Kudos

Why didn't you use IDoc from flat file ?

oliver_am
Active Participant
0 Kudos

Hi, thanks for answer.
Could you give me a tip to do that?

former_member1716
Active Contributor
0 Kudos

Hello oliver.am,

Recommend you to go through the below Blog for details on Flat file method.

BLOG

Regards!

FredericGirod
Active Contributor
0 Kudos

I am not sure, external link are allowed

keyword are "we21 file SAP"

http://saptechnical.com/Tutorials/ALE/File/Page2.htm

DominikTylczyn
Active Contributor

Hello oliver.am

You need to make all the regular settings in WE20 for the IDoc. Then you can generate an inbound IDoc from your own program by call IDOC_INBOUND_ASYNCHRONOUS function module.

Best regards

Dominik Tylczynski

I'm trying with this FM also and It seem to work fine.

The problem is that with this FM I cannot get the idoc number in my program, but I think this function can be useful for what we want.

kartikrajag
Participant
0 Kudos

If I understood your question correct: you are trying to trigger an outbound Idoc ( which is not configured yet) from a custom program which mimics WE19. Below steps may help:

1. If its not a standard Idoc, create your custom idoc fist, WE30

2. Configure it(Logical systems, RFC Connection, Distribution Mode,...etc); transaction SALE may come handy

3. Trigger Idoc from Application Transaction associated with Idoc you created in step1 ( if transaction not exists, write the custom program you mentioned in question which mimics WE19.

4. This custom program will have logic to fetch the data required to build(populate) Idoc and call the FM which you might have figured during step1 & 2. Once your o/b idoc is generated/triggered successfully.

5. You could display/view it in WE02/WE05.

These are not very detailed technical steps, but they outline the whole process.

oliver_am
Active Participant
0 Kudos

Hello, all.

I'm trying to follow this blog:

https://blogs.sap.com/2015/09/20/sending-a-idoc-to-the-same-client-in-a-sap-system/

I've created the logical system, port, etc and it's working fine, now if I create an outbound idoc it's is inmediately created an inbound idoc.

But this inbound idoc reaches to an incorret partner.

Its always received in the partner with the name of this client: e.g. ID1CLNT100. (this partner is inactive and would like to use other)

I've created a distribution model and put another partner in the receiver, but it doesn't get there.

Do you know why?

Thanks