Ansicht
Dokumentation

MM_PUR_S4_SSPPR_DEF_ - Setting of Default Delivery Address of a Self-Service Purchase Requisition

MM_PUR_S4_SSPPR_DEF_ - Setting of Default Delivery Address of a Self-Service Purchase Requisition

ROGBILLS - Synchronize billing plans   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

You can use this Business Add-In (BAdI) to auto-populate the delivery address and address type of an item in a purchase requisition. Please note that this BAdI is used ONLY when you add or edit an item in a purchase requisition using the "Create Purchase Requisition" or "My Purchase Requisitions" app.

The implementation of the BAdI does not have any effect on other applications, interface calls or other Customizing activities.

This is a classic extensibility BAdI and must be implemented using the transaction SE19 or SE18.

·,,In the standard system, the BAdI is not active.

·,,The BAdI is filter-independent.

Method: SET_DEF_DELIVERY_ADDRESS

Parameters:

Importing Parameters:

DETERMINEADDRESSATTRIBUTES Attributes that are required to determine the delivery address of the purchase requisition item

Changing Parameters:

PURCHASEREQUISITIONITEMADDRESS Delivery address of the purchase requisition item
CT_MESSAGESError Messages

Example Implementation

IF determineaddressattributes-plant IS NOT INITIAL.

DATA : lv_adrnr TYPE adrnr.

SELECT SINGLE addressid FROM i_plant INTO @lv_adrnr WHERE plant EQ @determineaddressattributes-plant.
IF sy-subrc EQ 0.
SELECT SINGLE * FROM iaddress INTO CORRESPONDING FIELDS OF purchaserequisitionitemaddress WHERE addressid EQ lv_adrnr.

SELECT SINGLE * FROM iaddremailaddr INTO
CORRESPONDING FIELDS OF purchaserequisitionitemaddress WHERE addressid = purchaserequisitionitemaddress-addressid.
purchaserequisitionitemaddress-sspitemaddresstype = 'P' .
ENDIF.
ENDIF.

Implementing the above piece of code does the following:

  • Populates the delivery address of the purchase requisition item with the Plant address
  • Sets the address type as 'P'

Note on setting Address Type

Following are the descriptions of the address types that you can set in the BAdI

P - Address type is 'Plant'. Delivery address is auto-populated with the Plant address, and is non-editable in the "Create Purchase Requisition" and "My Purchase Requisitions" app.

U - Address type is 'User Entry', and the assigned delivery address is editable in the "Create Purchase Requisition" and "My Purchase Requisitions" app.

Blank- If Address Type is NOT set in the BAdI implementation, then it is set as follows in the "Create Purchase Requisition" and "My Purchase Requisitions" app:

In Create Mode: Address type is set as 'U'

In Edit Mode: The existing address type 'P' or 'U' is retained






PERFORM Short Reference   General Material Data  
This documentation is copyright by SAP AG.

Length: 3450 Date: 20240523 Time: 185110     sap01-206 ( 48 ms )