Entering content frame

This graphic is explained in the accompanying text Example: Conditions for Order Confirmation Locate the document in its SAP Library structure

This example of an order confirmation shows how requirements and access sequences can be set up.

Prerequisites

You have created an action profile ZAB in Customizing with the action type Order Confirmation. You have defined the following processing types (output medium) for the action definition Order Confirmation.

If you call up the activity Define Requirements for Output (old) for output determination in Customizing, you see the following screen in the requirement overview for order confirmation:

This graphic is explained in the accompanying text

A condition definition is created for each condition in this overview in the screen area Schedule Condition.

The output medium from the action profile is entered for each task in the screen area Action and Processing.

 

The requirements are coded as follows (an explanation of these code lines can be found under Procedure).

Condition 1: Status check

* T = condition true

* F = condition false

 

* check if the document is correct

call function 'CRM_OUTPUT_CHECK_DOCUMENT'

exporting

io_context = l_context

importing

ep_result = rule_evaluation_outcome.

 

Condition 2: Order confirmation by email

* T = condition true

* F = condition false

data: l_deflt_comm type ad_comm.

 

* determine the communication type from the sold-to-party

call function 'SPPF_GET_COMM_DATA'

exporting

partners = l_context->partner

partner_role = '0001'

importing

deflt_comm = l_deflt_comm.

 

* check communication type

if l_deflt_comm eq 'INT'.

rule_evaluation_outcome = 'T'.

else.

rule_evaluation_outcome = 'F'.

endif.

 

Condition 3: Order confirmation by fax

data: l_deflt_comm type ad_comm.

 

* determine the communication type from the sold-to-party

call function 'SPPF_GET_COMM_DATA'

exporting

partners = l_context->partner

partner_role = '0001'

importing

deflt_comm = l_deflt_comm.

 

* check the communication type

if l_deflt_comm eq 'FAX'.

rule_evaluation_outcome = 'T'.

else.

rule_evaluation_outcome = 'F'.

endif.

 

Condition 4: Order confirmation by print

*print the document

RULE_EVALUATION_OUTCOME = 'T'.

 

* T = condition true

* F = condition false

 

Process Flow

The system checks the conditions in the given sequence. The conditions in this sequence signify the following:

  1. The system checks the status of the document. If the document is incorrect, output determination terminates at this point (stop symbol). If the document is complete and contains no errors, the system looks at the next condition.
  2. The system checks the conditions for email: Is the standard communication type in the business partner master for the sold-to party email? If yes, it sends the order confirmation by email and ends output determination (stop symbol).
  3. If the conditions for email are fulfilled, the system checks conditions for sending by fax: Is the standard communication type fax in the business partner master for the sold-to party? If yes, it sends the order confirmation by email and ends output determination (stop symbol).
  4. If the conditions for the fax are not met, the system prints the order confirmation.

Note

If the system finds from the conditions that output, for example, should be sent by fax, but that no fax number has been entered in the business partner master, the system cannot send output. Output determination terminates as the output is seen as having been successfully processed.

Leaving content frame