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: 

PR number range exit for Tr ME51N

Former Member
0 Kudos

Hi Experts,

I am using Exit for assigning the number range to the PRs in ME51N transaction, using M06B0004 and M06B0003 enhancements but its not picking the exit .

I need WERKS and BSART to generate my own PR number.

I also tried exit EXIT_SAPLMEREQ_009 of enhancement MEREQ001. But i couldn't get plant from this.

If u have any other idea please suggest me or provide me sample code to get WERKS and BSART from the EXIT_SAPLMEREQ_009.

Thanks in advance,

1 ACCEPTED SOLUTION

former_member182371
Active Contributor
0 Kudos

Hi,

check this OSS Note:

Note 408017 - MERQ001: Implementation sample code

https://service.sap.com/sap/support/notes/408017

Best regards.

8 REPLIES 8

former_member182371
Active Contributor
0 Kudos

Hi,

check this OSS Note:

Note 408017 - MERQ001: Implementation sample code

https://service.sap.com/sap/support/notes/408017

Best regards.

0 Kudos

I have checked he Snote, but this doesn't solve my problem.

0 Kudos

Are those exits mentioned asigned to any CMOD project? Activated?

Did you try break-point in those exits?

0 Kudos

Hi,

in EXIT_SAPLMEREQ_009 try something like:


DATA: LT_ITEM TYPE TABLE OF  MMPUR_REQUISITION_ITEMS.
DATA: LS_ITEM TYPE MMPUR_REQUISITION_ITEMS.

CALL METHOD IM_REQ_HEADER->GET_ITEMS
  RECEVING
          RE_DATA = LT_ITEM.

READ LT_ITEM INTO LS_ITEM INDEX 1.
IF sy-subrc EQ 0.
* Do whatever here e.g.
SELECT * FROM ZXXX WHERE WERKS = LS_ITEM-WERKS
....
ENDIF.

Best regards.

0 Kudos

Hi Pablo ,

I have tried this code.

CALL METHOD im_req_header->get_items

RECEIVING

re_items = lt_item .

READ TABLE lt_item INTO ls_item INDEX 1.

IF sy-subrc EQ 0.

select single bukrs

from t001k

into lv_bukrs

where bwkey = LS_ITEM-WERKS.

But it gives syntax error :

Data object "LS_ITEM" doesn't have a component called "WERKS".

0 Kudos

Hi,

1.- in this thread by Uwe Schieferstein:

there is this piece of code (have a look at it):

i´ve added variables l_werks2 and l_werks3.


DATA: l_item_list TYPE mmpur_requisition_items,
l_item TYPE mmpur_requisition_item,
l_item_akt TYPE mereq_item,
l_item_ref TYPE REF TO if_purchase_requisition_item.
DATA: ld_attr TYPE string, lo_obj TYPE REF TO object.
FIELD-SYMBOLS: <fs_1>  TYPE ANY,
               <fs_2> TYPE mereq_item,
               <fs_3> TYPE mereq_itemx.
l_item_list = im_req_header->get_items( ).
LOOP AT l_item_list INTO l_item.
l_item_akt = l_item-item->get_data( ).
l_item_ref = l_item-item.
lo_obj ?= l_item-item. " casting to root object !!!!! ld_attr = 'MY_STATE'.
ASSIGN lo_obj->(ld_attr) TO <fs_1>.
ld_attr = 'MY_STATE->ITEM'.
ASSIGN lo_obj->(ld_attr) TO <fs_2>. " ASSIGN l_item_ref->(ld_attr) TO . " does not work...
DATA: l_werks2 TYPE werks.
l_werks2 = <fs_2>-werks.
* ld_attr = 'MY_STATE->ITEMX'.
ASSIGN lo_obj->(ld_attr) TO <fs_3>.
DATA: l_werks3 TYPE werks.
l_werks3 = <fs_3>-werks.
ENDLOOP. " NOTE: data definition of local class lcl_req_item_state (fg MEREQ)

2.- check this thread too:

Best regards.

Edited by: Pablo Casamayor on Jun 14, 2010 4:37 PM

0 Kudos

Hi Pablo,

Thanks for ur help. I have resolved it with some similar code of ur last post.But i would like to appriciate ur quick and helpfull response.

0 Kudos

Hi Sandy,

iam facing the same problem. Could you please share the code with which you have solved this problem,

Thanks in Advance,

Chintu Gupta