cancel
Showing results for 
Search instead for 
Did you mean: 

Macro to find out Predecessor

Former Member
0 Kudos

Hi,

Can anyone let me know the macro function to find out the Predecessor products from Interchangeability groups.

Thanks in advance.

Thanks & Regards,

Jagadeesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jagadeesh.

I am guessing you have tried MATLOC_INC_C() with which you can find out the succeding product when you have selected the predecessor. Unfortunately it does not seem to work the other way around.

I'd be interested in other approaches also.

M

Former Member
0 Kudos

Hi Jagadeesh,

I'm not sure whether a macro function module present to find the Predecessor products. But the below code will be useful for u to find the successor and predecessor products for the given IC number. So you can copy this logic to the user defined macro function and call it in ur macro logic. In the mean time if I get any macro function will let u know.

  • Fetch the products and location based on the IC number

CALL METHOD /incmd/cl_ppeuiinc_cntl=>read_inc_group

EXPORTING

iv_icno = '00000000001000000001'

iv_ictype = '1'

IMPORTING

et_itm_data = lt_item

EXCEPTIONS

inc_group_read_error = 1

INTERFACE_ERROR = 2

OTHERS = 3 .

In lt_item structure PRODUCT-CMPEXT gives u the predecessor and SUCCESSOR_PRODUCT-CMPEXT gives the successor product.

Regards,

Siva.

Former Member
0 Kudos

Hi Sivaprakash,

Thanks for your reply. But i have never used any User exit macros till now so can you please guide me the steps on how to do it.

I ll apreciate your help.

Thanks & Regards,

Jagadeesh

Former Member
0 Kudos

Hi Jagadeesh,

The above logic is not for user exit macro it's for User function in Macro. Since I'm not there in the system right now can't give u a detail description. But check this ,

steps :

1. Create a function module in se37 with the interface as below

*"----


""Local Interface:

*" TABLES

*" VALUE_TAB STRUCTURE /SAPAPO/VALUE_TAB

*" CHANGING

*" REFERENCE(F_CALC_ERROR) TYPE CHAR1

*" REFERENCE(F_ARGUMENT) TYPE /SAPAPO/MXVAL

*"----


2. Write ur logic in the function module (Get the input in the value_tab and output in the f_argument).

3. Goto the macro builder and select the planning book.

In the menu edit->Edit User Function

4. Give the function module name u created here and check for ur conditions.

I know the above explanation is so good to understand. Will send u the link for the documentation tommorrow.

Regards,

Siva.