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: 

Inbound Purchase Order

Former Member
0 Kudos
508

Hi There,

I need to create a Partner Profile to create a Purchase Order in SAP, Originally was defined the IDoc ORDERS05 as the IDoc to receive the PO, however I was trying to create the partner profile for this and I could not do it because in the standard proposal these only a message code for Order confirmation. I would like to know if exist a process standard for this or it's necessary to develop everything from scratch.

Thanks in advance

Alexis Ramirez

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos
214

Hi,

You can use process code BAPI (FM BAPI_IDOC_INPUT1) for message type PORDCR with IDoc type PORDCR04.

This process code will call FM IDOC_INPUT_PORDCR to post the IDoc.

Regards,

Ferry Lianto

9 REPLIES 9

Former Member
0 Kudos
214

Hi Ramiez,

We have Outbound Purchase Order and Inbound Sales Order.

We can create partner profile in WE02 t.code and yes there is standard process for Inbound SO and Outbound PO.

Can you elaborate your query?

Regards,

Ali

ferry_lianto
Active Contributor
0 Kudos
214

Hi,

Please use message type PORDCR with IDoc type PORDCR04.

Regards,

Ferry Lianto

0 Kudos
214

Thanks for reply, I tried to create the partner profile in transaction we20 however I only have the message type.

Could you help me with the process code?

or Tell if I have to create the process code, to create the purchase order.

Regards

Alexis Ramirez

0 Kudos
214

check t.code we41 and we42 for outbound and we42 for inbound process code.

I think for inbound SO process code is SO01.

Ali

ferry_lianto
Active Contributor
0 Kudos
215

Hi,

You can use process code BAPI (FM BAPI_IDOC_INPUT1) for message type PORDCR with IDoc type PORDCR04.

This process code will call FM IDOC_INPUT_PORDCR to post the IDoc.

Regards,

Ferry Lianto

0 Kudos
214

Hi Ferry, I test your configuration and it's working Ok, however even when I created the PO, I don't see in the Idoc structure a segmen to include Header Text, only this feature is available for items, if you know how to include it, please let me know.

Thanks in advance

Alexis Ramirez

ferry_lianto
Active Contributor
0 Kudos
214

Hi Alexis,

You can not populate PO header text using FM IDOC_INPUT_PORDCR. This FM only allows you to populate item text.

I am afraid you need to use FM SAVE_TEXT in order to update the PO header text after the IDoc successfully posted. Even standard BAPI BAPI_PO_CREATE does not have the capabilty to populate the header text either.

Regards,

Ferry Lianto

0 Kudos
214

Hi There,

I have a problem two problems with the Idoc PORDCR04.

First problem is that the segments E1BPEKKOA and E1BPEKPOC are not realesed in the last version.

Second problem consist in send more than one item in the PO, in the transaction we19 I have enter two items according to the Idoc definition. Once I send the Idoc to be proccessed by SAP, something happen with the structure that makes a change in the Hier.level from the second item as you can see below. I don't undertand why is doing this.

This is the original Idoc structure in WE19

LEVEL 0 EDIDC

LEVEL 1 E1PORDCR X X

LEVEL 2 E1BPEKKOC 20071112NB

LEVEL 2 E1BPADDRESS

LEVEL 3 E1BPADDRES1

LEVEL 2 E1BPEKPOC

LEVEL 2 E1BPEKET

LEVEL 2 E1BPEKPOTX 0010 F01 LINE ONE TEXT

LEVEL 2 E1BPEKPOC 0020 0000009200000030

LEVEL 2 E1BPEKET 0020 20071130 50

LEVEL 2 E1BPEKPOTX 0020 F01 LINE TWO TEXT

After being processed the system convert the Idoc structure to this.

LEVEL 0 EDIDC

LEVEL 1 E1PORDCR X X

LEVEL 2 E1BPEKKOC 20071112NB

LEVEL 2 E1BPADDRESS

LEVEL 3 E1BPADDRES1

LEVEL 2 E1BPEKPOC

LEVEL 2 E1BPEKET

LEVEL 2 E1BPEKPOTX 0010 F01 LINE ONE TEXT

LEVEL 1 E1BPEKPOC 0020 0000009200000030

LEVEL 1 E1BPEKET 0020 20071130 50

LEVEL 1 E1BPEKPOTX 0020 F01 LINE TWO TEXT

If I unmark the option to check the sintax of the Idoc, I can create the PO, however I think this is not the best practice to receive an inbound message.

This is the error.

The segment E1BPEKPOC does not occur at the current level of the basic type PORDCR04 (extension ).

This error can have several reasons:

The segment E1BPEKPOC is assigned to a group whose header segment does not occur.

The segment E1BPEKPOC does not exist in the syntax description of the basic type PORDCR04 (extension ).

The sequence of segments in the group in which the segment appears is incorrect.

Previous errors ('mandatory' segment or group missing) may be due to this error

Thanks in advance,

Alexis

Message was edited by:

Alexis Ramirez

Message was edited by:

Alexis Ramirez

0 Kudos
214

This is the solution.

IDoc Type PORDCR04 awaits all item segments together, i.e.

if you fill data for 2 P.O. Items, then then following is syntactically

correct (using your example in description):

LEVEL 1 E1PORDCR X X

LEVEL 2 E1BPEKKOC 20071112NB

LEVEL 2 E1BPADDRESS

LEVEL 3 E1BPADDRES1

LEVEL 2 E1BPEKPOC

LEVEL 2 E1BPEKPOC 0020 0000009200000030

LEVEL 2 E1BPEKET

LEVEL 2 E1BPEKET 0020 20071130 50

LEVEL 2 E1BPEKPOTX 0010 F01 LINE ONE TEXT

LEVEL 2 E1BPEKPOTX 0020 F01 LINE TWO TEXT

The reason for this behaviour:

IDoc Type PORDCR04 is generated from the parameters of BAPI function

module BAPI_PO_CREATE