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: 

Exit for PR creation

Former Member
0 Kudos

Hi,

The requirement is as below

We have added some zfields in shopping cart at item level.

These fields are transferred to R/3 and hence the z field data comes in the customer data tab of the PR.

Now, there needs to be one special condition checked. If one of the field is X -> mark the item as deleted

ie

if zfield1 = 'X' -> loekz = 'X'

I have used MEREQ001 for getting the zfields data in PR. I am getting all this data in PR.

But when I used the check if zfield1 = 'X' -> loekz = 'X' in this exit, deletion indicator is not set.

Can anyone please provide some exit for PR creation which can help to update the standard field based on the value of zfield at item level.

Thanks

Richa

5 REPLIES 5

Former Member
0 Kudos

AMPL0001 User subscreen for additional data on AMPL

LMEDR001 Enhancements to print program

LMELA002 Adopt batch no. from shipping notification when posting a G

LMELA010 Inbound shipping notification: Transfer item data from IDOC

LMEQR001 User exit for source determination

LMEXF001 Conditions in Purchasing Documents Without Invoice Receipt

LWSUS001 Customer-Specific Source Determination in Retail

M06B0001 Role determination for purchase requisition release

M06B0002 Changes to comm. structure for purchase requisition release

M06B0003 Number range and document number

M06B0004 Number range and document number

M06B0005 Changes to comm. structure for overall release of requisn.

M06E0004 Changes to communication structure for release purch. doc.

M06E0005 Role determination for release of purchasing documents

ME590001 Grouping of requsitions for PO split in ME59

MEETA001 Define schedule line type (backlog, immed. req., preview)

MEFLD004 Determine earliest delivery date f. check w. GR (only PO)

MELAB001 Gen. forecast delivery schedules: Transfer schedule implem.

MEQUERY1 Enhancement to Document Overview ME21N/ME51N

MEVME001 WE default quantity calc. and over/ underdelivery tolerance

MM06E001 User exits for EDI inbound and outbound purchasing document

MM06E003 Number range and document number

MM06E004 Control import data screens in purchase order

MM06E005 Customer fields in purchasing document

MM06E007 Change document for requisitions upon conversion into PO

MM06E008 Monitoring of contr. target value in case of release orders

MM06E009 Relevant texts for "Texts exist" indicator

MM06E010 Field selection for vendor address

MMAL0001 ALE source list distribution: Outbound processing

MMAL0002 ALE source list distribution: Inbound processing

MMAL0003 ALE purcasing info record distribution: Outbound processing

MMAL0004 ALE purchasing info record distribution: Inbound processing

MMDA0001 Default delivery addresses

MMFAB001 User exit for generation of release order

uwe_schieferstein
Active Contributor
0 Kudos

Hello Richa

How have you tried to set LOEKZ = 'X' ?

You may try the following approach:


FUNCTION EXIT_SAPLMEREQ_001.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(IM_REQ_ITEM) TYPE REF TO  IF_PURCHASE_REQUISITION_ITEM
*"----------------------------------------------------------------------


INCLUDE ZXM02U01 .

" Coding within the include:
DATA: ls_data    TYPE mereq_item,
          ls_datax   TYPE mereq_itemx.

  ls_data = im_req_item->get_data( ). " get current item data

  IF ( <condition is true> ).
    ls_data-loekz = 'X'.
    ls_datax-loekz = 'X'.

    im_req_item->set_data( ls_data ).
    im_req_item->set_datax( ls_datax ).
  ENDIF.

ENDFUNCTION.

Regards

Uwe

0 Kudos

Hi Uwe,

Yes i have tried in the same way in exit 001 and 005 also.

The documentation of this enhancement says that 005 can be used to change the standard field. But only those who are in structure MEREQ_ITEM_S_CUST_ALLOWED. This structure does not contain LOEKZ(infact this does not contain any standard field)

The documentation says as below

"There is a separate function exit for verifying the customer fields

(EXIT_SAPLMEREQ_005 Checking Customer's Own Purchase Requisition Data

(Without Dialog)). The object reference, the new data, the data from the

last verification, and the database status of the purchase requisition

items are available to you here. Parameter IM-FULL_CHECK is set if the

user has chosen to update or check explicitly. Parameter

IM_ITEM_HAS_ERRORS informs you whether the purchase requisition item has

been classified by the standard program as containing errors.

The task of this function exit is to ensure the consistency of the

customer-specific fields. *You can also change standard fields using the*

public interface if_purchase_requisition_item. The fields listed in

+structure MEREQ_ITEM_S_CUST_ALLOWED are available for changing."+

Any other way out.

Richa

Former Member
0 Kudos

Hello all,

I have the same problem like this one, to modify some standard field in ME51n: EMLIF & LBLKZ.

This fields aren't in MEREQ_ITEM_S_CUST_ALLOWED so method set_data() doesn't work.

Does someone has a solution?

Add a structure append in MEREQ_ITEM_S_CUST_ALLOWED with the fields I need?

Thx!

Edited by: Bruno Morrisson on Nov 29, 2010 11:30 AM

0 Kudos

Your suggestion is correct.

You can add append structure to MEREQ_ITEM_S_CUST_ALLOWED (something like ZSTDFIELDS). Within this structure specify the standard EBAN fields (I did it for PRIO_URG for example). After this you can use set_data method to update these fields.

I think that the risk is minimum because MEREQ_ITEM_S_CUST_ALLOWED contains all Z fields from CI_EBANDB, so most likely MOVE-CORRESPONDING is always used within SAP modules to interact with screen structures (MEREQ....).

BTW, set_data method does update all EBAN fields for items not currently displayed on the screen. I noticed it occasionally when trying to update standard fields in a loop across all requisition items. But this needs to be checked again if you'd like to use it..