cancel
Showing results for 
Search instead for 
Did you mean: 

Material Replication Enhancements

dean_hinson2
Active Contributor
0 Kudos

Hello,

I was looking through the IMG looking for enhancements that can be implemented for material replication. I found these enhancements (COM_PRD_POST_FILTER and PRODUCT_SET) but I am not sure if they apply to material replication.

Does anyone know?

Points awarded accordingly.

Regards, Dean.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

When you change a (local)product/material in SRM,you can use teh BADi PRODUCT_SET to define your own cross-client checks that you would like to be performed before a product can be saved.

See the foll documentation

This enhancement can be used to define your own cross-client checks that you would like to be performed before a product can be saved.

This enhancement contains the method CHECK_BEFORE_UPDATE, in which you can formulate the check.

When creating a check (implementation), you must specify in the filter the data segment (set type ID) that contains the data fields you want to check.

If a product is rejected, you generate an error message with the:

Message type 'E' if the product can only be saved as an inactive version

Message type 'A' if the product cannot be saved at all

This message, together with the name of the field, is then placed in the application log in product maintenance. The error message is displayed and you can navigate to the data field that caused the error message with a double-click.

If you wish the field to be displayed in a table control on the screen, you must also specify the line number in the table control when inserting the error message in the application log.

Requirements

The current data and old data of a segment (set type) is passed to the method CHECK_BEFORE_UPDATE in the parameters IT_SETDATA and IT_SETDATA_OLD. They are not assigned a type. So that you can read the individual data fields, you must declare an appropriate work area. In the sample code, this variable is called ls_set.

The data structure required can be determined in the Maintain Set Types and Attributes function by choosing Environment ->Set Type Structures. The data structure is displayed together with the field names it contains. The transaction data fields that can be used for the check are highlighted.

You should create your own message to describe the error situation in the application log. Message 014 from message class COM_PRODUCT, which is used in the example, serves as a template and should not be used in your checks.

Activities

1. Clicking on the IMG activity starts the BAdI Builder, and a dialog box is displayed with all consistency check implementations (enhancements) that already exist. You can create a new implementation for the definition PRODUCT_SET by choosing Create. Use a name in the customer namespace.

2. Select the data segment containing the fields for which you want to define the check. To do this, you must first insert an empty entry in the filter settings by choosing Insert Line. The set types (data segments of the product) can be displayed using the possible entries pushbutton. You can re-sort the entries by clicking on the header, or select an entry with a double-click.

3. The sample code can be used as a template in your implementation. To do this, choose Goto -> Sample Code -> Copy.

4. You now have to adjust the sample code as you are using another data segment (set types) and formulate your check for other fields. To do this, choose the Interface tab page and select the method CHECK_BEFORE_UPDATE with a double-click. Your method is shown with the sample code in the Class Builder. You must replace the data structure of the work area (ls_setdata) and the field names and check conditions. The procedure for finding the name of the data structure for your set type and the field names it contains is described under Requirements. You are advised to start the Maintain Set Types and Attributes function in a separate session so that you can simply copy across the information you require with copy and paste.

5. Check whether your code contains syntax errors.

6. Activate the method IF_EX_PRODUCT_SET~CHECK_BEFORE_UPDATE.

7. Activate the implementation (enhancement).

Further notes

This enhancement contains sample source code which does not allow an active version of the product to be saved if

the data field F0010 (Quantity) has the value 0

the data field F0011 (Unit of measure) is 'PC'

in the data segment (set type SETTYPE01).

Caution

Note that you are not allowed to make data changes to the code of the implementation (such as deleting data records).

BR,

Disha.

<b>Pls reward points for useful answers.</b>

dean_hinson2
Active Contributor
0 Kudos

Disha,

Your information helped alot, but what I am trying to do is assist the replication filter. Under certain conditions, I do not want the material to replicate but based on the BADI, I don't think this is the one I can use.

I didn't want to generate an error which causes the queue (SMQ2) to grow to an enormous size. I just want to have it so that if the criteria in the BADi is not met, it does not save it in EBP.

Please let know your thoughts on this scenario.

Dean.

Former Member
0 Kudos

Hi

<u>Please read the Standard SRM BADI documentation of COM_PRD_POST_FILTER and PRODUCT_SET in this case.</u>

<b>See the related documentation for BADI - COM_PRD_POST_FILTER</b>

<u>BADI COM_PRD_POST_FILTER</u>

(BAdI: Data Filtering for Product Distribution)

Use

This Business Add-In (BAdI) is for filtering product data.

Documentation for BAdI methods:

FILTER_PRODUCT_DATA


Activities

After you call the IMG activity, the system displays a dialog box where you enter a name for the implementation.

If implementations of this Business Add-In have already been created, the system displays them in a dialog box. You then choose one of them by choosing Create, and continue as follows:

1. In the dialog box, enter a name for the implementation of the Add-In and choose Create.
The system displays the initial screen for creating Business Add-In implementations.
2. On this screen, enter a short description for you implementation in the Implementation Short Text field.
3. If you choose the Interface tab, you will notice that the system has filled in the Name of the Implementing Class field automatically, by assigning a class name based on the name of your implementation.
4. Save your entries and assign the Add-In to a package.
5. To edit a method, double-click its name.
6. Enter your implementation code between the method <Interface Name>~<Name of Method>. and endmethod. statements.
7. Save and activate your code. Navigate back to the Change Implementation screen.
Note: You can also create an implementation for an Add-In and not activate it until later. If you want to do this, do not carry out the following step:
8. Choose Activate.
When the application program is executed, the system carries out the code in the method you wrote.

Hope this will guide and help.

Do let me know.

Regards

- Atul

dean_hinson2
Active Contributor
0 Kudos

Atul,

This is good information but how do you debug a BADi like this? I mean, material replication usually happens in queues in backgound. So, how would you launch a replication and debug this Badi interactively?

Regards, Dean.

Former Member
0 Kudos

Hi

Which R/3, CRM, and SRM versions are you using ?

<b>Please look and go through the following SAP OSS Consulting and Recommended Notes, which will help in this case -></b>

Note 839290 BADI PRODUCT_SET is not called

Note 927473 Errors maintain fin. data for different org data

Note 888565 BADI PRODUCT_SET not called

Note 880027 F4 help for minimum order quantity

Note 840959 Input help for characteristic values

Note 791458 Interne Nummernvergabe im Cleansing des Produkts

Note 749043 Feedback messages: Secondary keys are missing

Note 724008 Feedback messages

Note 677563 Runtime error ITAB_DUPLICATE_KEY_IDX_OP

Note 690695 BADI for input help product attributes

Note 682184 Verification after change in link handler is missing

Note 485954 Extensions not assigned to the category are maintainable

Note 403760 Customer-specific consistency check before saving product

Do let me know.

Regards

- Atul