on 11-12-2010 7:32 AM
Dear Experts,
While saving the PR, based on the plant i need to control the number range. Eg. if plant is '1000', the range should be 'Z1'.
i found a User exit EXIT_SAPLMEREQ_009 for PR but i dont know whether i can achive the above with this.
Please advise.
Thanks in advance,
Chintu
HI,
The EXIT what you have mentioned will work. If you want to Check it just write a BREAK-POINT and rise a message in the EXIT,
AND RUN the transaction enter the plant and wrong number if it risess the message what you have writen in the EXIT.
Then it will be the right EXIT to write the IF CONDITIONS FOR RESTRICTING THE NUMBER RANGES for the selected Plants.
The Answer what i have given may help you.
Thanks & Regards,
Anvesh Gummadapu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
DATA PR_HEADER TYPE MEREQ_HEADER.
DATA PR_ITEMS TYPE MMPUR_REQUISITION_ITEMS.
DATA PR_ITEM TYPE MMPUR_REQUISITION_ITEM.
DATA: L_ITEM TYPE MEREQ_ITEM.
CALL METHOD me->get_items
receiving
re_items = PR_ITEMS.
READ TABLE PR_ITEMS INTO PR_ITEM INDEX 1.
CALL METHOD PR_ITEM->get_data
receiving
re_data = L_ITEM.
CHECK L_ITEM-WERKS = '1000'.
CALL METHOD IM_REQ_HEADER->GET_DATA
RECEIVING RE_DATA = PR_HEADER.
SELECT SINGLE * INTO L_T161
WHERE BSART = PR_HEADER-BSART
AND BSTYP = PR_HEADER-BSTYP.
IF L:T161-NUMKI NE 'Z1'.
EX_RANGE = 'Z1'.
ENDIF.
.
Max
Hi
I've tried this in my system and it works fine
DATA PR_HEADER TYPE MEREQ_HEADER.
DATA PR_ITEMS TYPE MMPUR_REQUISITION_ITEMS.
DATA PR_ITEM TYPE MMPUR_REQUISITION_ITEM.
DATA: L_ITEM TYPE MEREQ_ITEM.
DATA: L_T161 TYPE T161.
CALL METHOD IM_REQ_HEADER->GET_ITEMS
RECEIVING
RE_ITEMS = PR_ITEMS.
READ TABLE PR_ITEMS INTO PR_ITEM INDEX 1.
CALL METHOD PR_ITEM-ITEM->GET_DATA
RECEIVING
RE_DATA = L_ITEM.
CHECK L_ITEM-WERKS = '1000'.
CALL METHOD IM_REQ_HEADER->GET_DATA
RECEIVING
RE_DATA = PR_HEADER.
SELECT SINGLE * INTO L_T161
FROM T161
WHERE BSART = PR_HEADER-BSART
AND BSTYP = PR_HEADER-BSTYP.
IF L_T161-NUMKI NE 'Z1'.
EX_RANGE = 'Z1'.
ENDIF.
Max
Hi
The number range depends on PR document type, so you should check only certain document types are used for that plant
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
The number range depends on PR document type, so you should check only certain document types are used for that plant
In order to get th range u need to read the table T161, if the assigned range is Z1 you don't nothing else you set Z1:
The exit is Ok, because you can change the range there
Max
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.