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: 

Is it possible to send IDOC message output from BAPI_PO_CREATE1 ?!

erik_mulder
Explorer
0 Kudos

Is it possible to send an IDOC message (so a NEU (like) message with Message transmission medium (NACHA)=6 EDI) when creating a PO with BAPI_PO_CREATE1?.  We have a program working that creates a PO and sends a message via fax or e-mail to the supplier (by populating the POADDRVENDOR (bapimepoaddrvendor) structure. Now we want to send an IDOC message to a supplier when creating a PO for this supplier via BAPI_PO_CREATE1, just if a PO was entered manually via ME21N.

Is this possible at all? There seem no appropriate fields to pass to the BAPI to achieve this. So we leave the POADDRVENDOR structure empty. If you create a PO manually the communication method screen  in the message output screen SAPDV70A 0100 can  also not be reached , as all the communication data is stored in partner profiles (trx WEDI/WE20). The result is that the system creates a fax output (medium (NACHA=2)  message instead of creating an IDOC. If the exact same data (supplier/material) is entered in ME21N manually the system creates a NEU  (lke)message with medium 6 resulting in an IDOC to the supplier.

So  is it possible to send an IDOC output message to a supplier when the PO is created via BAPI_PO_CREATE1, and if so , how is it done?

Thanks for any answer!

Erik

10 REPLIES 10

Former Member
0 Kudos

Hi Erik,

I guess you can achieve this with the help of a function module IDOC_READ_COMPLETELY.

http://scn.sap.com/thread/1652718

http://scn.sap.com/thread/962703

https://scn.sap.com/thread/600967

0 Kudos

Hi Nivedita,

thanks for replying, didnt know that FM, However, Our problem is that we are not able to create an IDOC message when creating a PO from the BAPI, we cannot find a way to tell the message control system to send an IDOC, it only outputs a fax (or e-mail or printed output if we choose that).

0 Kudos

How is the IDOC sent via PO tcode is it via Message type..? If yes then please ask your functional people that the same message type should have been triggered for all PO's irrespective of whether they are created via BAPI/or tcode

0 Kudos

Hi Nabheet,

thanks for replying. When creating a PO via tcode ME21N  the IDOC is created via normal messaging control system, which finds via condition technique a condition record with medium 6 EDI. Same messagetype is used for tcode and BAPI. We discussed with our functional people,  and no matter what we change in the condition records, the BAPI still tries to send a fax message.

0 Kudos

Hi Erik

The BAPI is also triggering the output type but its fax. So first of all the EDI message type and Fax message type are they same? Secondly are you using standard driver to send idoc as well as fax. ?

Thanks

Nabheet

0 Kudos

Hi Nabheet,

thanks again for replying.

1. Yes, same messagetype (data element KSCHL), but different output  medium(=Message transmission medium (data element NACHA)=6 EDI)

2. I am not sure what you mean by driver? The main problem is that the IDOC is not created at all.

Thanks,

Erik

0 Kudos

Hi Erik

In the NACE transaction we have output type which are attached to a program and subroutine which may call a smartform or send email or fax. Please check if you are using standard report(driver program) or custom one. Basically it may happen that if it is a custom one and you are determining the logic whether to email,idoc,print it has a bug.

Please go to nace choose application EF-- choose your output type and then processing routine. It will provide you the details

0 Kudos

Hi Nabheet,

thanks again for replying.

The NACE customizing is used for tcode ME21N, which works fine, and creates the IDOC. However, with the exact same customizing the BAPI does not. We don't understand why.

0 Kudos

Hi Erik

What the driver program name is it custom or standard?

Nabheet

0 Kudos

Hi Nabheet,

thanks again for replying.

Processing progam is RSNASTED, which is standard. However it is not even triggered when creating a PO via BAPI . Program for faxing is custom, and is the same as used for printing. In someway. In the FM RV_MESSAGE_UPDATE (which is called in update task) when creating the PO via BAPI we can  see (in SM13 terminated updates)  in the VNAST table  that the output medium  (NACHA) is set to '2' (fax). We do not understand why this is set to 2. According to the NACE customizing it should be '6'  (EDI).

Erik