Skip to Content
0
Former Member
Mar 15, 2007 at 04:59 AM

Could you check our source? (To determine the PR type and number range)

31 Views

Hello.

We use SRM Server5.5 with Classic Scenario.

We will use the BADI BBP_SC_TRANSFER_BE to determine the PR type and number range according to your recommend.

We have two PR type in R/3.

1) KGPR

2) KTR1

As you know that shopping cart has no type. So we add customer field to mapping to R/3 PR type and this field has two values.

1) PR01: mapping to KGPR

2) PR02: mapping to KTR1

We will use the method GROUP_RQ to determine the PR type.

If customer field is PR01, PR type is determined KGPR

If customer field is PR002, PR type is determined KTR1.

To determine the PR number range, we will use the method GET_NUMBER_OR_RANGE.

If PR type is KGPR, Choose the No key 12

If PR type is KTR1, Choose the No key 16.

Configuration step:

1. Maintain the PR number range in SRM.

No key: 12 (for KGPR) internal NR

No range: 2520000000 – 2529000000

No key: 16 (for KTR1) internal NR

No range: 2560000000 – 2569000000

2. Maintain the PR number range in R/3

No key: 12 (for KGPR) Ext NR

No range: 2520000000 – 2529000000

No key: 16 (for KTR1) Ext NR

No range: 2560000000 – 2569000000

3. Assign the PR number range to PR type in R/3

KGPR – 12 (EXT)

KTR1 – 16 (EXT)

4. Maintain the attribute in SRM

Document type in R/3

Add KGPR and KTR1

We developed this logic, but it’s not working.

LOOP AT ct_proc_item INTO ls_proc_item “ Where is no date in ct_proc_item:

We can not find out the reason.

Could you check our source?

METHOD if_ex_bbp_sc_transfer_be~group_rq.

DATA:

ls_proc_item TYPE bbps_procurement,

lv_number_int TYPE bbp_item_no,

ls_item TYPE bbp_pds_transfer_item,

lv_group_counter TYPE numc5,

CONSTANTS:

lc_on(1) VALUE 'X'.

SORT ct_proc_item BY obj_to_gen.

CLEAR: lv_group_counter.

LOOP AT ct_proc_item INTO ls_proc_item

where obj_to_gen eq iv_object_to_generate.

  • get item data which includes customer fields

MOVE ls_proc_item-preq_item TO lv_number_int. " convert

READ TABLE it_item INTO ls_item WITH KEY number_int = lv_number_int.

IF sy-subrc = 0.

IF ls_item-pr_type EQ 'PR01'.

ls_proc_item-doc_type = 'KGRP'.

ELSEIF ls_item-pr_type EQ 'PR02'.

ls_proc_item-doc_type = 'KTR1'.

ENDIF. " lv_cust_field

lv_group_counter = lv_group_counter + 1. " increase counter

ls_proc_item-group_1 = lv_group_counter.

*

MODIFY ct_proc_item FROM ls_proc_item

TRANSPORTING group_1.

ENDIF. " sy-subrc

*

ENDLOOP.

cv_method_active = lc_on.

ENDMETHOD.

-


method IF_EX_BBP_SC_TRANSFER_BE~GET_NUMBER_OR_RANGE.

if is_item-pr_type = 'PR01'.

CV_NUMBER_RANGE = '12'.

CV_NUMBER = '2520000000'.

elseif is_item-pr_type = 'PR02'.

CV_NUMBER_RANGE = '16'.

CV_NUMBER = '2560000000'.

endif. " is_proc_item / is_item

Thank you

Best Regard

SH