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: 

SD_SALESDOCUMENT_CREATE BAPI is not proposing the output type

Former Member
0 Kudos
367

Hi Gurus,

I am creating the sales order through BAPI SD_SALESDOCUMENT_CREATE and it working perfectly. My problem is, when i create the sales order it has to propose the output type for order confirmation mail but it is not doing. I try to debugging and it is filling the XNAST values but finally it is not updating the NAST table with output type and not showing in display mode. If i go through VA02 and output then it is proposing. IF i create the order through VA01 and the output type is proposing automatically.

Last word, I won't to send mail to the order creator through mail when the order is created through BAPI.

Regards,

Challa

5 REPLIES 5

Former Member
0 Kudos
103

Hi Gurus,

I am creating the sales order through BAPI SD_SALESDOCUMENT_CREATE and it is working perfectly. My problem is, when i create the sales order with BAPI it has to propose the output type to send order confirmation through mail but it is not proposing output type. I tried in debugging and it is filling the XNAST values but finally it is not updating the NAST table with output type and not showing in output screenb in VA03. If i go through VA02 and output then it is proposing. If i create the order through VA01 then output type is proposing automatically.

Last word, I want to send mail to the order creator through mail when the order is created through BAPI.

Note: I am doing BAPI commit.

Regards,

Challa

0 Kudos
103

Hi,

Can any body knows the answer

Regards,

Challa

0 Kudos
103

Usually I create SO using BAPI BAPI_SALESORDER_CREATEFROMDAT2. Maybe u can try it.

0 Kudos
103

To send email, you can use SO_NEW_DOCUMENT_SEND_API1 after you check that the SO has been created successfully.

DATA: lw_emailobj TYPE SODOCCHGI1,

lt_email_content type table of SOLISTI1,

lw_email_content LIKE LINE OF lt_email_content,

lt_receiver type table of SOMLRECI1,

lw_receiver LIKE LINE OF lt_receiver.

  • Set the email subject

lw_emailobj-obj_descr = text-001.

lw_emailobj-sensitivty = 'O'.

  • Set the email content.

lw_email_content = 'email content'.

APPEND lw_email_content TO lt_email_content.

lw_receiver-receiver = 'abc@email.com'.

lw_receiver-rec_type = 'B'.

lw_receiver-express = 'X'.

APPEND lw_receiver TO lt_receiver.

CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'

EXPORTING

document_data = lw_emailobj

TABLES

object_content = lt_email_content

receivers = lt_receiver

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

OTHERS = 8.

0 Kudos
103

Hi,

My mail is working properly when i create the sales order through VA01. but when itry to create the sales order though BAPI, every thing is working fine except the proposing the output type.

Regards,

Challa