Skip to Content
0
Former Member
Jul 26, 2005 at 09:12 PM

duplicate R/3 custom requirement in IPC

252 Views

I am new to CRM/SAP, I need to "copy" a custom pricing requirement routine on R3 to IPC in CRM (routine attached below).

The R/3 routine involves a Z table which we have duplicated in CRM and it looks like:

-


FIELD -- DATA ELEMENT -- Short descrpt.

MANDT -- MANDT

VKORG -- VKORG -- sales org

MTPOS -- CRMT_ITEM_CAT_GROUP -- item category grp

KSCHL -- KSCHL -- condition type

PSTYV -- PSTYV -- sales doc item categor

KOBED -- KOBED -- requirement

-


Dom kindly told me in one of the earlier posting that I need to make sure every field is added and value filled in the communication structure, I am told that all fields have now been added all the fields in the communication structure. Can some one kindly tell me what fields we need to fill besides MTPOS that Dom mentioned? How do I "get/reference and use" them in the IPC? Should I modifiy PricingUserExits.checkRequirement(IConditionFindingManagerUserExit item, IStep step, int reqNo)? Looking at the R/3 routine, I don't have a good idea as what I need to code in the switch statement, would it be possible for someone to post a sample code snip?

Appreciate any help very much,

Yanhui

Please see the R3 routine source code for reference:

**********************************************************

  • 06/12/97 DV2K907733 - Andrew Bright / Origin Technology

  • New Routine to check that the condition is allowed for the

  • item category.

**********************************************************

FORM KOBED_900.

DATA: BEGIN OF MORE_REQ,

FIX(6) VALUE 'KOBED_',

NR LIKE T683S-KOBED,

END OF MORE_REQ,

X_VALID .

TABLES:ZSITCATPRI,MVKE.

CLEAR X_VALID.

SY-SUBRC = 4.

  • Find out the item cat. group from the material

  • master for S.Org, D.chn and division

  • - Jit Bhandari - DV2K913980

SELECT SINGLE * FROM MVKE WHERE MATNR = KOMP-MATNR

AND VKORG = KOMK-VKORG

AND VTWEG = KOMK-VTWEG.

IF SY-SUBRC = 0.

  • Check whether the record exit in table ZITCATPRI

  • First check whether the entry exist with the item

  • category also as a key or not

SELECT SINGLE * FROM ZSITCATPRI

WHERE VKORG = KOMK-VKORG

AND MTPOS = MVKE-MTPOS

AND PSTYV = KOMP-ZZPSTYV

AND KSCHL = KOMT1-KSCHL.

IF SY-SUBRC EQ 0.

  • If it is found in the table then this condition

  • type is to come in the calculation of the prices

IF ZSITCATPRI-KOBED NE 0.

  • Look for any other req.check exist in the table

MORE_REQ-NR = ZSITCATPRI-KOBED.

PERFORM (MORE_REQ) IN PROGRAM SAPLV61A.

ENDIF.

ELSE.

  • The item category record is not found in the ZSITCATPRI

SELECT * FROM ZSITCATPRI

WHERE VKORG = KOMK-VKORG

AND MTPOS = MVKE-MTPOS

AND KSCHL = KOMT1-KSCHL.

IF ZSITCATPRI-PSTYV IS INITIAL.

IF ZSITCATPRI-KOBED NE 0.

  • Look for any other req.check exist in the table

MORE_REQ-NR = ZSITCATPRI-KOBED.

PERFORM (MORE_REQ) IN PROGRAM SAPLV61A.

ENDIF.

EXIT.

ELSE.

X_VALID = 'N'.

EXIT.

ENDIF.

ENDSELECT.

ENDIF.

ENDIF.

IF NOT X_VALID IS INITIAL. SY-SUBRC = 4. ENDIF.

*if no record is found, then requirement not met (sy-subrc <> 0).

ENDFORM.

  • Vorstep

FORM KOBEV_900.

SY-SUBRC = 0.

ENDFORM.