cancel
Showing results for 
Search instead for 
Did you mean: 

File to IDoc: RFC lookup

Former Member
0 Kudos

Hi Experts,

My Scenario is like following...

I will be getting orders in the file and need to create orders in R/3. And I have done it successfully. Now my client asks me to check whether the order is exists in R/3. If it is exists I need to send an email otherwise create the orders in R/3(its already done).

Need clarifications for the below q's:

1) How do I check the orders are already exists in R/3?

2) If the orders are already exists then how do I send the mail and where exactly I have do changes.

3) If the orders are already exists then there shouldn't be mapping done. Just triger the mail with some details in body.

4) How/Where do I call them separately...

Do needful...

Regards,

Ramesh.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

If you are using IDOC then you can imlement the logic in an IDOC exit.

Where if it already exists it blocks the order by setting the IDOC status to error and sends the mail. This way the logic is done in the R/3 backend and the interface stays the same in XI with the result of always submitting the IDOC.

You can also use an RFC, where you do the following:

1. Add a field to your input structure called "OrderExists"

2. Call RFC populating the order number to check if it exists.

3. In your mapping populte the '0' or '1' result from the RFC lookup in the "OrderExists" field.

4. Define your "OrderExists" field as a contrcxt field.

Following this in your configuration you can use the context field to conditionally route

to either the IDOC adapter or a SMTP adapter. Hope this helps.

Former Member
0 Kudos

Hi,

Check this nice blog of sravya on creting RFC lookups.

/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups

Check these links on RFC lookups:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1...

Thanks,

Vijaya.

Edited by: Vijaya Lakshmi Palla on Jun 6, 2008 6:59 AM

Former Member
0 Kudos

Hi,

Thanks for your reply. I have writen RFC lookup and got SY-SUBRC values in one field. Now my question is how do split my mapping one to mail and another to create orders.

Regards,

Ramesh.

Former Member
0 Kudos

Hi Ramesh,

IS your scenarion like this.

After getting the IDOC into R/3..you will check whether that PO exiting in R/3 and if its existing you will send that through an email or u will create a new PO..

if it is...

take the vbeln from the header segment and check that is existing...if not do call transaction ME21N...or send email thorugh SO_DOCUMENT_SEND_API1.

Thanks,

Vijaya.

Thanks,

Vijaya.

Edited by: Vijaya Lakshmi Palla on Jun 6, 2008 7:19 AM

Former Member
0 Kudos

Hi,

Now my client asks me to check whether the order is exists in R/3. If it is exists I need to send an email otherwise create the orders in R/3(its already done).

if order exists in R/3 you need to send mail right then call Function module from R/3 SO_DOCUMENT_SEND_API1

create the orders in R/3

You use the enjoy transaction ME21N for creating PO

Please reward points if it helps

Thanks

Vikranth

rajasekhar_reddy14
Active Contributor
0 Kudos

What is PO, anyone explain...

Former Member
0 Kudos

Hey,

you can use an RFC look up in this case,

Check for a primary key if it exists so do your orders.

trigger a mail in this case.

If it does not exists then create the oder with the scenario that you have created.

RFC look up

/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups

for mail triggering

/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address

reward poins if useful.

regards,

Milan

Former Member
0 Kudos

Hi Milan,

Thanks for your reply.

Where do I write RFC lookups. And how do I map the result to both(mail/create orders).

Regards,

Ramesh.

Former Member
0 Kudos

Hey,

I guess it wont be possible to give the condition in Reciever detemination. also it wont be possible using a 1:N scenario(multimapping as you wont be able to give the condition, which is possible only through a source sturcture, but our conditon is some where in between)

So you need to go for the Bpm with an Extra transformation step which will consists of the mapping of RFC look up.

the output of transformation will decide whether to create the Idoc or to trigger the mail.

For this you need to give a switch case and then two asynch send step one each for Idoc and the other for the mail.

regards,

Milan

Former Member
0 Kudos

Hi,

this can be achieved using BPM or ABAP proxies.

a, receive step->mapping(using rfc llokup if the order exists)->based on value (switch step)

b1, async send step to RFC which sends e-mail (if order exists)

b2, async send step to create order

I think that using proxies would be better (and definetely much quicked):

no rfc lookup needed

no workflow will be executed.

just code you proxies: check if the order exists, if it doesn't, create it, otherwise send an e-mail

Peter

Former Member
0 Kudos

Hi,

Thanks for your reply. My client is not happy with BPM/Proxy. So please do let me know with this how do I proceed. Help me.

Regards,

Ramesh.

Former Member
0 Kudos

Hi,

Thanks for your reply. My client is not happy with BPM/Proxy. So please do let me know without this how do I proceed. Help me.

Regards,

Ramesh.

Former Member
0 Kudos

Hi,

You dont want to use any BPM for File to Idoc then look this block

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Also see the below links

/people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

/people/sravya.talanki2/blog/2005/12/09/xiidoc-message-packages

Please Reward points if it helps

Thanks

Vikranth