Application Development and Automation 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: 
Read only

Trigger IDOC_OUTPUT_ORDRS using custom program.

Former Member
0 Likes
2,794

Hello.

I have a requirement to send an order response (ORDERS05) IDoc by calling FM IDOC_OUTPUT_ORDRS using a custom program. Wanted to know if anyone had suggestions on the best approach. We are using much of the native mapping and adding a few segments (which I would handle updating in the customer exits).

My biggest question is how to setup the call to IDOC_OUTPUT_ORDRS. I think I need to simulate the NAST table entry. Is that the recommended approach? Any tips or hints would be appreciated.

Thanks,

Cal

Edited by: Cal on Feb 3, 2009 7:07 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,180

You can figure out a way to call IDOC_OUTPUT_ORDERS to create a outbound order response idoc. But if you think about it, there are several things involved here, which make it difficult

1. This FM expects to be triggered from an output type, which supplies it with the receiving partner profile, message type etc - all which go to form the control record of the Idoc

2. This is triggered via NAST entries, as you said.

So in my opinion the most elegant way is to trigger the output from the sales order in yellow (processing time in output condition record set to "Send with a schedule job").

Later you can trigger IDOC_OUTPUT_ORDERS using RSNAST00 program, where object will be your sales order, application V1, output type. This way you can take control of when to issue the Idoc - which I think is main purpose of your requirement.

I would advise not to spend efforts in trying to reinvent the wheel here

5 REPLIES 5
Read only

Former Member
0 Likes
2,181

You can figure out a way to call IDOC_OUTPUT_ORDERS to create a outbound order response idoc. But if you think about it, there are several things involved here, which make it difficult

1. This FM expects to be triggered from an output type, which supplies it with the receiving partner profile, message type etc - all which go to form the control record of the Idoc

2. This is triggered via NAST entries, as you said.

So in my opinion the most elegant way is to trigger the output from the sales order in yellow (processing time in output condition record set to "Send with a schedule job").

Later you can trigger IDOC_OUTPUT_ORDERS using RSNAST00 program, where object will be your sales order, application V1, output type. This way you can take control of when to issue the Idoc - which I think is main purpose of your requirement.

I would advise not to spend efforts in trying to reinvent the wheel here

Read only

0 Likes
2,180

Thanks for the reply Vishnu!

The reason why we're not using output type is because we want to send 1 IDoc per day for a given order, and the order might be changed more than once.

If I'm reading your response correctly, you're saying I should use output control which would create an output type entry after the order is changed with a setting of 'send with schedule job.' I would then use a custom program to trigger the batch job for each order using RSNAST00.

Given that we only want to send 1 IDoc per day for a given order, Is there a way to create only 1 output entry in NAST, even if the order was changed more than once?

Edited by: Cal on Feb 3, 2009 8:14 PM

Read only

0 Likes
2,180

Yes definitely.

There is checkbox "Multiple issuing" in the output type configuration page - if this is left blank, a output will be issued only once during create and subsequent changes won't trigger the output automatically.

Goto NACE, select application V1 and lick on "Output types", select BA00 and display. Press F1 on the "Multiple issuing" checkbox and you will see this SAP message..

********************************************

Multiple issuing of output

Indicates whether the same output may be issued to the same partner more than once.

Example

For example, if you add an order item to a sales order for which the order confirmation was already sent, you will want to send a changed output to the same customer.

Read only

0 Likes
2,180

OK, that would definitely work for my requirement. Thanks!

One last question:

I want to trigger the output type only for certain orders and deliveries. Do you know of a customer exit that I can use in the Sales Order and Delivery modules that will allow me to analyze the NAST record before an output type record is created? I want to be able to control if an output type is created (based on specific settings) for orders and deliveries of the same doc type.

Read only

0 Likes
2,180

Actually condition technique based on which output determination works - is designed for exactly what you are asking - triggering the output type under certain conditions.

You can create ouput condition records with key fields that represent your business conditions: for example certain sales org, distrib channel, certain sales order type can only trigger the output. You can make it as finer as you want (like even including sold-to as a criteria), like you can include any field that appears in the sales document as a criteria to trigger the idoc.

The tables that store condition records - condition tables - are custom created with your business field combination that you want to base the triggering upon.

Goto the IMG path:

IMG -> SD -> Basic functions -> Output control -> Output determination -> Maintain output determination for sales documents.

1. A o/p determination procedure is assigned to sales document type

2. A o/p determination procedure comprise a list of output types, which are checked sequentially by the system

3. Custom condition tables with new business criteria can be assigned to new or existing access sequence

4. Access sequence is attached to output type

How the system triggers a particular output type during application document processing, say sales order processing:

1. From the sales document type, the o/p determination procedure is determined

2. The system then checks the output types inside the procedure one by one

3. Say at output type 1, the system checks to see what access sequence it has

4. The access sequence comprises of 1 or more condition tables.

5. The system then checks each condition table, by comparing the key fields of the condition table with the correpsonding sales document fields - like comparing sales org, documen type in the condition record with what the sales document has. If every thing matches, the output type is triggered.

I have just simplified the whole o/p determination. There are several other features which are controlle at o/p determination, procedure, output type and access sequence levels. Spend some time one these, it is a neat, flexible and future proof concept. You will never regret! )