Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

me_process_req_cust badi for generating plantwise number range in me51n

Former Member
0 Kudos

Hi all,

I have client requirement that while creating PR in me51n they want to generate internal number range.me_process_req_cust badi is getting triggered here.I got the purchase requisition data from this badi.here,I do not know where to update this number range number from custom table.can anyone guide me to accomplish this.

Regards,

Sheela Patil

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi sheetal,

The field name is BANFN sorry EKGRP is purchasing group.

sorry for the incovenience.

Thanks & Regards

Ajit Chirania.

9 REPLIES 9

Former Member
0 Kudos

Hi sheetal,

I think you should update the EBAN table field (EKGRP) .

Please check.

Thanks & Regards

Ajit Chirania.

Former Member
0 Kudos

Hi sheetal,

The field name is BANFN sorry EKGRP is purchasing group.

sorry for the incovenience.

Thanks & Regards

Ajit Chirania.

0 Kudos

Hi,

these are not the required fields to pass the data.I got the data from PR, here how to update number range data.any ideas plz..

Regards,

Sheela Patil

0 Kudos

Hi all,

Following is the code I have written for getting data in this badi.here,how I can pass the number range generated from custom table.

DATA: i_items TYPE mmpur_requisition_items.

DATA: wa_item LIKE LINE OF i_items,

lv_if_item TYPE REF TO if_purchase_requisition_item,

lt_itm_data TYPE mereq_item,

lx_itm_data TYPE mereq_itemx.

break-point.

CALL METHOD im_header->get_items

RECEIVING

re_items = i_items.

SELECT SINGLE * FROM zvs_mm_range

INTO wa_tab

WHERE bukrs EQ bukrs

AND werks EQ werks

AND bsart EQ lbsart.

IF sy-subrc EQ 0.

ELSE.

MESSAGE 'Please maintain Number range in table zvs_mm_range' TYPE 'E'.

ENDIF.

Can anyone guide me to update this number range using this badi.Thanks in advance.

Regards,

Sheela Patil

0 Kudos

Dear Sheela,

You can use the enhancement M06B0003 where you can use your own number range of PR .

FM Exit : EXIT_SAPMM06B_001

In the include ZXM06U18 you can write the following code top replace the number generated.

TABLES : zvs_mm_range.

DATA W_NRLEVEL LIKE NRIV-NRLEVEL.

DATA :W_NR(2),

W_NUMBER(10),

W_RETURNCODE LIKE INRI-RETURNCODE.

*To get the number range from zmm_po_ranges table

SELECT SINGLE * FROM zvs_mm_range

WHERE bukrs EQ neban-bukrs

AND werks EQ neban-werks

AND bsart EQ neban-bsart.

IF SY-SUBRC NE 0.

MESSAGE 'pls manitain number range'.

ELSE.

W_NR = zvs_mm_range-RANGE.

ENDIF.

*function module which gives the po number

*basing on number range object

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = W_NR

OBJECT = 'BANF'

QUANTITY = '1'

  • SUBOBJECT = ' '

  • TOYEAR = '0000'

  • IGNORE_BUFFER = ' '

IMPORTING

NUMBER = W_NUMBER

RETURNCODE = W_RETURNCODE

EXCEPTIONS

INTERVAL_NOT_FOUND = 1

NUMBER_RANGE_NOT_INTERN = 2

OBJECT_NOT_FOUND = 3

QUANTITY_IS_0 = 4

QUANTITY_IS_NOT_1 = 5

INTERVAL_OVERFLOW = 6

BUFFER_OVERFLOW = 7

OTHERS = 8

.

IF SY-SUBRC <> 0.

*PO No range problem occurred for Pur.org. &

  • MESSAGE E115(ZC) WITH NEKKO-EKORG.

ELSE.

NUMBER = W_NUMBER. " Assign back the P.R number.

EXIT.

ENDIF.

Regards,

Deepak.

0 Kudos

Hi,

Thanks for the quick reply.I checked with this enhancement but it is not triggering in me51n transactions. is there any way where I can update this number range from custom table using badi ME_PROCESS_REQ_CUST.I got the data from this badi but I am not able to update the number generated here.any help will be greatly appriciated.

Regards,

Sheela Patil

0 Kudos

As mentioned earlier by Deepak enhacement M06B0003 (EXIT_SAPMM06B_001) is used to replace the standard number range.

Remember to create and activate project in CMOD with enhancement M06B0003.

Within EXIT_SAPMM06B_001 either you can use your own previously defined Number range object and intervals to get next number which will then be update in parameter NUMBER

or you can define number range in transaction OMH7 and pass the number range interval in parameter RANGE .

Regards,

Pawan.

0 Kudos

Hi,

I tried this exit but it is not triggering for transaction me51n.Can anyone guide me to achieve the same using me_process_req_cust badi.any help will be greatly appriciated.

Regards,

Sheela Patil

0 Kudos

Hi Sheela,

You can use the exit EXIT_SAPLMEREQ_009 , it will trigger for ME51N.

As said earlier u can use the same code to achive your requirement.

Regards,

Deepak.