cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI to save an output type

ged_hurst
Participant
0 Kudos

Hello everyone,

I'm manually creating a new output type thru this procedure:

VA02>Extras>Outpu>Header>Edit

I then create a new line specifying:

- output type

- medium

- language

- communication method

and I save the sales order.

What's the BAPI to use to code this?

Thank you.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Function Module: RV_MESSAGE_UPDATE_SINGLE will add nast entry programmatically.

former_member183879
Active Contributor
0 Kudos

Hi,

If you want to do this output creation automatically, you dont really need to code anything for this.

You only have to maintain the output record for this in VV11(for sales order) and then create the sales order.

In sales order, during order creation, if the configuration is correct and VV11 is maintained, the output type will be automatically created.

During order change, depending on teh configuration of the output type, it may either be triggered, or may not. If this is not triggered for the second time, that means that the output type is not enabled for automatic trigger for 2nd time. In this case, you have to change the configuration.

In display mode, the output type is not triggered ( as there is no change possible in display mode)

Hope this helps

ged_hurst
Participant
0 Kudos

Thank you very much for your detailed reply.

The output type is correctly maintained in the system.

At the moment, when I assign the output type and I save the order, it's automatically triggered (an email gets sent).

My question is concerned with the actual assignment of the output type to the sales order.

When I create the assignment I also specify the communication method ( message and recipient of the email). This cannot be automatically created because this information varies from sales order to sales order. How can I code this? Isn't there a BAPI to allow programmatic access to the functionality?

Cheers

former_member183879
Active Contributor
0 Kudos

Hi,

You cannot code for this. You only have to manually change this in the sales order, or you have to maintain it in VV11. The kind of trigger maintained in VV11 is proposed to the sales order. However if you want the trigger to be some other way (say from email to print), you can manually change it in the sales order (provided you have allowed this trigger type in configuration of the outptu type). You cannot change this using a program.

Hope this helps

ged_hurst
Participant
0 Kudos

Hello,

the document at [Output Type|http://wiki.sdn.sap.com/wiki/display/ABAP/ProcessOutputtypesthroughprogram] provides an interesting way of creating a message programmatically.

The thing is that I need to specify a message text + recipient (email address) and haven't found how to.

So to be honest I think that it is possible to implement the process through coding.

Do you know how to create a message text and recipient and assign it to the output type entry?

Cheers

ged_hurst
Participant
0 Kudos

I've set up VV11/VV12 correctly and a message is sent whenever a sales order is created by the BAPI.

The thing is that I need to have the text of the email and the recipient parameterized because they'll be filled at runtime.

Therefore customizing isn't enough for me. However there must be another way to code this in my program.

Does anybody know how to?

Cheers

Shiva_Ram
Active Contributor
0 Kudos

The recipient email you can maintain at the customer master (t.code XD02), General data ->contact persons tab. Here you can maintain the email address of the contact person with partner function as sales order recipient.

For text of the email, you can keep the text in t.code SO10, with some text object, text name and language. Check the system as some entries may already be there for sales applications. Similar entries you can make and use in the BAPI to read.

Hope this helps.

Regards,

ged_hurst
Participant
0 Kudos

HI,

the thing is that the text and the email address are keyed in by the end user into 2 input fields, so are filled up dynamically at runtime.

I've seen that when I create an entry into the NAST table I need to provide an ID like FOL26000000000004SCR35000000000050 for instance, which identifies the message and the address.

The only thing is that I still need to figure out how to create this object programmatically....