Ansicht
Dokumentation

RFM_SGT_DEFAULT_VALUE_MAINTAIN - Maintain Default Segmentation Values

RFM_SGT_DEFAULT_VALUE_MAINTAIN - Maintain Default Segmentation Values

CL_GUI_FRONTEND_SERVICES - Frontend Services   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

You can use this function module to define, change, and delete default segmentation values for a specific segmentation structure and segmentation strategy combination.

Usability

To use this function module, you must provide the parameter IS_SGT_DEF_HEADER. For operations other than Delete, you need to provide additional information. Therefore, if you maintain default segmentation for a new document type, you should provide at least the corresponding document type parameters IT_SGT_DEF_DYNAMIC_SEGMENTand IT_SGT_DEF_DYNAMIC_SEGMENTX. When you update an existing default segmentation, you only need to specify the updated data in addition to the header data.

Create a new default segmentation

Use the IS_SGT_DEF_HEADERparameter to specify for which segmentation strategy/structure combination the default segmentation is valid. Use I as the update indicator. Select the document types for which you want to create the default segmentation. For each document type, there are two table structures that need to be maintained. One table structure containing the actual data and the other table mostly containing indicators that shows which fields to use. The second structure also contains an update indicator that must be set to the value I. Both structures must be linked manually by inserting a common value in the NUMLINKfield. The corresponding input parameters must be filled based on the fact whether constant, explicitly defined segmentation values are to be used, or if the segmentation values are defined dynamically by values in table fields.

Update an existing default segmentation

Use the IS_SGT_DEF_HEADER parameter to specify for which segmentation strategy/structure combination the default segmentation is valid. Use U as the update indicator. Now there are several actions that can be performed:

  • You can update the fields that specify for which documents the default segmentation is valid.
  • You can delete the default segmentation validity for certain documents.
  • You can change the valid segmentation values as well as the default segmentation value.

Delete an existing default segmentation

Use parameter IS_SGT_DEF_HEADER to specify for which segmentation strategy/structure combination the default segmentation is valid. Use D as the update indicator.

Input Parameters

  • IS_SGT_DEF_HEADER:Specify the segmentation structure and strategy that you are processing.
  • IT_SGT_DEF_SALES_ORDER:Specify the sales order attributes for which a default segmentation is to be changed.
  • IT_SGT_DEF_SALES_ORDERX:Determines which fields should be read from the IT_SGT_DEF_SALES_ORDER parameter when changes are made. The input of both structures must be linked by a common value in the field NUMLINK.
  • IT_SGT_DEF_PUR_ORDER_STOCK: Specify the purchase order attributes for which a default segmentation is to be changed.
  • IT_SGT_DEF_PUR_ORDER_STOCKX:Determines which fields should be read from the parameter IT_SGT_DEF_PUR_ORDER_STOCKwhen changes are made. The input of both structures must be linked by a common value in the field NUMLINK.
  • IT_SGT_DEF_PUR_ORDER_REQ: Specify the attributes for stock transport orders for which a default segmentation is to be changed.
  • IT_SGT_DEF_PUR_ORDER_REQX:Determines which fields should be read from the IT_SGT_DEF_PUR_ORDER_REQparameter when changes are made. The input of both structures must be linked by a common value in the field NUMLINK.
  • IT_SGT_DEF_PUR_REQUIS_STOCK: Specify the purchase requisition attributes for which you want to change a default stock segment value.
  • IT_SGT_DEF_PUR_REQUIS_STOCKX:Determines which fields should be read from the IT_SGT_DEF_PUR_REQUIS_STOCKparameter when changes are made. The input of both structures must be linked by a common value in the field NUMLINK.
  • IT_SGT_DEF_PUR_REQUIS_REQ: Specify the purchase requisition attributes for which you want to change a default requirement segment value.
  • IT_SGT_DEF_PUR_REQUIS_REQX: Determines which fields are to be read from parameter IT_SGT_DEF_PUR_REQUIS_REQwhen changes are made. The input of both structures must be linked by a common value in field NUMLINK.
  • IT_SGT_DEF_OUTLINE_AGREEMENT: Specify the outline agreement attributes for which you want to change a default segmentation.
  • IT_SGT_DEF_OUTLINE_AGREEMENTX:Determines which fields are to be read from parameter IT_SGT_DEF_OUTLINE_AGREEMENTwhen changes are made. The input of both structures must be linked by a common value in field NUMLINK.
  • IT_SGT_DEF_PLANNED_ORDER: Specify the planned order attributes for which you want to change a default segmentation.
  • IT_SGT_DEF_PLANNED_ORDERX:Determines which fields are to be read from parameter IT_SGT_DEF_PLANNED_ORDERwhen changes are made. The input of both structures must be linked by a common value in field NUMLINK
  • IT_SGT_DEF_PRODUCTION_ORDER: Specify the production order attributes for which you want to change a default segmentation.
  • IT_SGT_DEF_PRODUCTON_ORDERX: Determines which fields are to be read from parameter IT_SGT_DEF_PRODUCTION_ORDERwhen changes are made. The input of both structures must be linked by a common value in field NUMLINK.
  • IT_SGT_DEF_SAFETY_STOCK: Specify the safety stock attributes for which you want to change a default segmentation.
  • IT_SGT_DEF_SAFETY_STOCKX: Determines which fields are to be read from parameter IT_SGT_DEF_SAFETY_STOCKwhen changes are made. The input of both structures must be linked by a common value in field NUMLINK.
  • IT_SGT_DEF_PIR: Specify the planned independent requirement attributes for which you want to change a default segmentation.
  • IT_SGT_DEF_PIRX: Determines which fields are to be read from parameter IT_SGT_DEF_PIRwhen changes are made. The input of both structures must be linked by a common value in field NUMLINK.
  • IT_SGT_DEF_DYNAMIC_SEGMENT:Specify a field-based or a value-based segmentation value.
  • IT_SGT_DEF_DYNAMIC_SEGMENTX: Determines which fields are to be read from parameter IT_SGT_DEF_DYNAMIC_SEGMENTwhen changes are made. The input of both structures must be linked by a common value in field NUMLINKX.
  • IT_SGT_DEF_VALID_SEGMENT: Can be used to restrict the valid segmentation values.
  • IT_SGT_DEF_VALID_SEGMENTX: Determines which fields are to be read from parameter IT_SGT_DEF_VALID_SEGMENTwhen changes are made. The input of both structures must be linked by a common value in field NUMLINK.
  • IV_COMMIT: Indicator whether the database changes are to be made persistent or if the BAPI is called in the test mode.

Exporting Parameters

  • ET_RETURN: Specify the return parameters.

Example

Create a new default segmentation for sales order type ORin segmentation structure STRCand segmentation strategy STRATEGY. The segmentation structure defines three valid segmentation values, for example, the colors RED, BLUE, and WHITE.

In this scenario we would like to set the default value to REDand the default segmentation should be valid from 2025-01-01.

The function module parameters must be as follows:

IS_SGT_DEF_HEADER:

SGT_STRUCTURE   SGT_STRATEGY   UPDATE_INDICATOR
STRC   STRATEGY   I

IT_SGT_DEF_SALES_ORDER:

SALES_DOC_TYPE   DEFAULT_SEGMENT   START_DATE   END_DATE   NUMLINK
OR   RED   20250101   99991231   1

IT_SGT_DEF_SALES_ORDERX:

SALES_DOC_TYPE   DEFAULT_SEGMENT   NUMLINK   UPDATE_INDICATOR
X   X   1   I

IT_SGT_DEF_VALID_SEGMENT:

VALID_SEGMENT   NUMLINK   NUMLINKX
RED   1   1
BLUE   1   2
WHITE   1   3

IT_SGT_DEF_VALID_SEGMENTX:

UPDATE_INDICATOR   NUMLINKX
I   1
I   2
I   3

IV_COMMIT: X

Notes

Further information





Parameters

ET_RETURN
IS_SGT_DEF_HEADER
IT_SGT_DEF_DYNAMIC_SEGMENT
IT_SGT_DEF_DYNAMIC_SEGMENTX
IT_SGT_DEF_OUTLINE_AGREEMENT
IT_SGT_DEF_OUTLINE_AGREEMENTX
IT_SGT_DEF_PIR
IT_SGT_DEF_PIRX
IT_SGT_DEF_PLANNED_ORDER
IT_SGT_DEF_PLANNED_ORDERX
IT_SGT_DEF_PRODUCTION_ORDER
IT_SGT_DEF_PRODUCTION_ORDERX
IT_SGT_DEF_PUR_ORDER_REQ
IT_SGT_DEF_PUR_ORDER_REQX
IT_SGT_DEF_PUR_ORDER_STOCK
IT_SGT_DEF_PUR_ORDER_STOCKX
IT_SGT_DEF_PUR_REQUIS_REQ
IT_SGT_DEF_PUR_REQUIS_REQX
IT_SGT_DEF_PUR_REQUIS_STOCK
IT_SGT_DEF_PUR_REQUIS_STOCKX
IT_SGT_DEF_SAFETY_STOCK
IT_SGT_DEF_SAFETY_STOCKX
IT_SGT_DEF_SALES_ORDER
IT_SGT_DEF_SALES_ORDERX
IT_SGT_DEF_VALID_SEGMENT
IT_SGT_DEF_VALID_SEGMENTX
IV_COMMIT

Exceptions

Function Group

RFM_SEGMENTATION_MAINTAIN

Addresses (Business Address Services)   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 17539 Date: 20240523 Time: 160902     sap01-206 ( 191 ms )