cancel
Showing results for 
Search instead for 
Did you mean: 

Sales x Purchase IDocs

RafaelVieira
Active Participant
0 Kudos

Hi all,

I have an interface running which sends Sales Order Data from SAP to SQL DB (ORDERS05) online.

I received a request to pull out also purchase data from SAP and push it into the same SQL DB, in different tables.

I tried to figure out which IDoc might be used for this purpose and realized that the same IDoc ORDERS05 can be used for both, Sales data and Purchase data.

Is this correct? If not, which one is supposed to be used achieve that for purchasing data?

If this is correct, can anyone give me some light on how I should configure to have both running online?

I still don't imagine Purchase and Sales Order running in the same IDoc. How am I going to differentiate them within PI during the mapping to point it out to DB-tables 1 or DB-tables 2?

I really appreciate your suggestions.

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

You can use the below flow for your scenario.

Outbound: Sales Order & Purch Order -> ORDERS.ORDERS05

Inbound : Sales Order -> ORDERS.ORDERS05

Purch Order -> PORDCR1.PORDCR102

If we use PORDCR1.PORDCR102 in the Inbound Partner Profile (LS) & in the Distribution Model View(BD64), It would ask for a BAPI instead of IDOC Message Type.

As you are creating an Inbound PO, can make use of BUS2012 Object (SWO1) and can fill Object & Method with PurchaseOrder & Create. Hope this would answer your requirement.

- $andeep

RafaelVieira
Active Participant
0 Kudos

Tks for ur replies.

The flow I'm referring to is the outbound.

As mentioned, I just wanted to assure that in fact I can use the ORDERS05 for both (Sales Order & Purchase).

But my main question is, how to use both. I've already running it for Sales orders and it's working fine, sending data to SQL.

What I want to know is not about IDoc extensions, but how I can differentiate the Purchase ORDES05 to Sales Order ORDERS05.

Maybe I can reuse the same interface and its complex Message Mapping by just adding another Mapping to treat the message when it's regarding Purchasing data.

Should I open this thread in the abap forum? I thought it could be answered easily here, once most part of XI'ers are/were abapers.

former_member611181
Participant
0 Kudos

It depends on what output type and what process code is assigned in partner profiles.

For sales orders output & process code is different when compared to purchased.

And if you see qualifiers in IDOC ORDERS05 for sales and purchase are different.

E.g.E1EDK14-QUALF

002-Sales area,008-Sales organization,009-Purchasing group

former_member181962
Active Contributor
0 Kudos

YOu can probanly check the actual data in the idocs (create one for SO and one for PO) and see for your self.

Can you check the values for E1EDK01-BSART?

I think they are going to e diffferent for SO and PO.

Best Regards,

Ravi

RafaelVieira
Active Participant
0 Kudos

@Ravi - In some cases I can see E1EDK01-BSART. Most part of S.O. Outbound IDocs, there's no BSART field, but VSART.

The VSART comes like 02, 04, 07, 23, and so on. Sometimes, when VSART = 04, I could see that there is a BSART (= DFUE) field, but not aways.

@Sriram - Regarding the qualifiers, I've seen in the S.O. IDoc that is common to have 4 or 5 E1EDK14 structures. Each one containing its corresponding qualifier field.

I've seen also that the most commons (I didn't check all IDocs to assure) are 06, 07, 08, 12 and 16.

May I define a rule, like:

If find 08, then -> SO

If find 09, then -> PO

?

The one used in the current Sales IDoc partner profile config. is the SD10 with msg type BA00. If I want to get both configured to auto trigger when a SO/PO is changed/created, should I insert there other process code?

And, once it's done, how can I identify it within the interface runtime to diferentiate one process of the another (by running some specifics message mappings for Sales Order and some other message mappings for Purchase Order)?

I have 2 situations here:

1 - As firstly explained in the thread description, I have already an Sales Ord. IDoc configured and running. I need to know how to put a Purchase Ord. IDoc running as well. Should I use same IDoc? If yes, how?

2 - Once I have it configured, how can I identify the current process in runtime, to diferentiate 'em and perform the corresponding message mapping and SQL DB insertion/deletion/changing?

Really appreciate your helps!

RafaelVieira
Active Participant
0 Kudos

My case is outbound.

So, how should I do to get PO IDoc (ORDERS05) being triggered as well?

Tks!

rajasekhar_reddy14
Active Contributor
0 Kudos

testing purpose if you want to trigger ORDERS05 IDoc then follow below steps.

enter Transaction code we 19 and enter ORDERS05 , it will show IDoc structure, then enter values for IDoc segments then select inbound processing IDoc will reach PI(assuming that Connection between PI and ECC done).

if you want trigger IDoc automatically then ask your function/ABAP team write a report or schedule a process.

Regards,

Raj

former_member611181
Participant
0 Kudos

Seems like your situation is tricky.

Generally if you use EDI or XI the way of usage depends on message type(and output type).

Message Type "ORDERS" is used for purchase order.

ORDRSP is used to Sales orders.

So you can message type to create a rule.

Edited by: Sriram K on Jul 11, 2011 12:47 PM

former_member181962
Active Contributor
0 Kudos

Hi Silva,

If nothing else works, you can look for the number range of the SO vs Number range of PO.

I think in both cases the (PO number or SO Numebr) will come in E1EDK01- BELNR.

In most cases the number range of both will be different. for eg.PO numbers might start with a digit 4 whereas the Sales Order starts with some other number. You can use this in your receiver determination condition.

Best Regards,

Ravikanth Talagana

RafaelVieira
Active Participant
0 Kudos

As you said ORDRSP for Sales Order and ORDERS for Purchase Order.

I thought we could use exactly the same (for IDoc type and msg type as well).

Once we use different msg types, we cannot have only 1 PI interface for both, PO and SO outbound, because the outbound interface name will be different.. Am I right? Or is there any other way of doing it?

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>Once we use different msg types, we cannot have only 1 PI interface for both, PO and SO outbound, because the outbound interface name will be different.. Am I right?

Yes your mesg type will be different. you need one for each.

former_member611181
Participant
0 Kudos

Ofcourse you can 1 message type and IDOC type for PI.

It is a general requirement. If that is the case then what you should do is as explained in above answers use conditions related to qualifiers like Order type or sales office or any other condition in receiver determination.

E.,g

PO ---> for Puch org --> Recev1

SO ---> For Sales Org --> Recev2

RafaelVieira
Active Participant
0 Kudos

tks for the inputs.

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Better to talk with ABAP/Functional team they will correcly tell you which IDoc to use, because first we have to check in SAP Tables and have to find which IDoc have all these fields in IDoc.

if any IDoc extension required they ABAP Team will take care about that.

Regards,

Raj