CL_EXM_IM_N_APP_CONSTR_CHG - Example Implementation for BAdI Definition N_APP_CONSTR_CHG

TXBHW - Original Tax Base Amount in Local Currency   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Functionality

This class contains the sample code for the Business Add-In (BAdI) N_APP_CONSTR_CHG.

The interface method CHG_APP_CONSTR describes how you can change the appointment template.

The system changes the organizational unit (OU) of the appointment template as follows:

  1. The system checks whether a valid instance of an appointment template was transferred.
  2. The system determines the data of the appointment template and checks whether the OU has been changed manually.
  • If the OU has already been changed manually, the system does not change the OU and exits the BAdI.

  • If the OU has not been changed manually, processing can be continued.

  1. The system determines the order item for the transferred appointment template and then the item data.
  2. The system fills the OU in the change structure for the appointment template with the treatment OU from the data of the order item and sets the change indicator to ON.
  3. The system calls the CHANGE method for the transferred appointment template to change the OU there.

The system creates a new dependency as follows:

  • The system determines any existing dependencies from the transferred appointment template (since an appointment template can only have one subsequent template).
  • If no dependencies exist, the system can search for an appointment template that is suitable for a subsequent template, using the method FIND_POSSIBLE_NEXT.
    An appointment template is suitable for a subsequent template when:
  • This appointment template itself is not yet defined as a subsequent template in a dependency (an appointment template can only have one preceding template).

  • The transferred appointment template is not already contained in the sequence of its subsequent templates, since otherwise an endless loop would result.

  • When a suitable subsequent template has been found, the system sets the attributes of the new dependency.
  • The system calls the method ADD_NEXT of the transferred appointment template to create a new dependency with the defined attributes.

The system changes an existing dependency as follows:

  • The system determines the dependency to a subsequent template from the transferred appointment template.
  • If a dependency to a subsequent template exists, the system changes the attributes of the dependency.
  • The system calls the method CHANGE_NEXT of the transferred appointment template to make the change to the attributes in the dependency.

The system removes an existing dependency as follows:

  • The system determines the dependency to a subsequent template from the transferred appointment template.
  • If a dependency to a subsequent template exists, the system calls the method REMOVE_NEXT of the transferred appointment template to remove the dependency.
  • The system changes the organizational unit (OU) of the appointment template if the OU is the order filler of the order item and a coordinating facility, as follows:
  • The system checks whether presetting is necessary. Presetting is not executed here, if:
  • the OU was manually changed

  • an OU is entered which is not a coordinating facility

  • If presetting should be executed, the system determines all OUs which can perform the services.
  • The system determines the subordinate OUs of the coordinating facility.
  • In the determined subordinate OUs of the coordinating facility the system searches for the first OU which can perform the services.
  • If there are no subordinate OUs assigned to the coordinating facility, the system uses the first OU which can perform the services.
  • If there are no OUs which can perform the services, the system will not preset the OU here.
  • If an OU is found, the system fills the change structure and calls the change method of the appointment template.

Relationships

Example

Notes

Further information



RFUMSV00 - Advance Return for Tax on Sales/Purchases   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.


Length: 4924 Date: 20120526 Time: 122048     triton ( 139 ms )