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: 

reg screen exit in me21n using mm06e005

Former Member
0 Kudos

Hi,

I have implemented screen exit mm06e005 i added 2 fields at header level and 1 field at item level

every thing is fine but only thing is

      I kept all fields are required but it is not generating any error message until unless if we got to the custom tab.

    Please tell me how to validate with out going to that custom tabs.

Regards

Suresh

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

First read Note 310154 - ME21N/ME51N: Customer-specific check, generating error log

This note will explain you how-to use SAP provided macros to manage error message and attach those to field and screen area.
- mmpur_business_obj_id (opt)
- mmpur_metafield (attach to screen area and field)
- mmpur_message_forced (send message)

Regards,
Raymond

34 REPLIES 34

former_member209722
Participant
0 Kudos

Hi

Are you validating fields using FIELD or CHAIN ENDCHAIN statements?

Thanks,

Chandra

0 Kudos

I mean suppose if we do not enter any value on custom fields system should raise an error message

and cursor should go to that field  how to do that ?

I wrote code in exit_sapmm06e_012 FM to check the screen exit fields data

IF ekko_ci-zreference is initial.
   message 'Enter Reference' type 'E'.

ENDIF.
if ekko_ci-zdate is initial.
   message 'Enter Reference Date' type 'E'.
endif.
IF ekpo_ci-zidate is initial.
  message 'Enter Ir Date' type 'E'.
ENDIF.
endif.

it is not generating any error message but when syntax check of po it is showing error message ''enter reference'' .

Here if i  use set cursor statement before first message it is going to different  tab ?

Please advice.

Regards

Suri

former_member189779
Active Contributor
0 Kudos

Hi

You can validate in BADI ME_PROCESS_PO_CUST before saving the PO

Methods PROCESS_HEADER and PROCESS_ITEM

DATA:wa_poheader TYPE mepoheader.
wa_poheader = im_header->get_data( ).
IF wa_poheader-field IS INITIAL.

message

ENDIF.

0 Kudos

Hi Vinith,

I implemented badi what u said  it is giving error message but cursor is not going to that field .

Regards

Suri

0 Kudos

Use SET CURSOR statement to place cursor on particular field

0 Kudos

hi Vinith

I already used

    set cursor field wa_poheader-zreference

but cursor is going to org data tab.

Regards

suri

nabheetscn
Active Contributor
0 Kudos

As you are not going to the custom screen have you implemented EXIT_SAPMM06E_012 enhancement to validate the data for the same.

Nabheet

0 Kudos

hi Nabheet,

wrote code in exit_sapmm06e_012 FM to check the screen exit fields data

IF ekko_ci-zreference is initial.
   message 'Enter Reference' type 'E'.

ENDIF.
if ekko_ci-zdate is initial.
   message 'Enter Reference Date' type 'E'.
endif.
IF ekpo_ci-zidate is initial.
  message 'Enter Ir Date' type 'E'.
ENDIF.
endif.

it is not generating any error message but when syntax check of po it is showing error message ''enter reference'' .

Here if i  use set cursor statement before first message it is going to different  tab ?

Please advice.

Regards

Suri

0 Kudos

Hi

Can you please clarify what the issue is. Is the issue like you are on a different screen and press save then this message is not triggered or something else please clarify.

Nabheet

0 Kudos

Hi

Can you please clarify what the issue is. Is the issue like you are on a different screen and press save then this message is not triggered or something else please clarify.

Nabheet

0 Kudos

hi Nabheet,

Suppose if we do not enter vendor system will give error message and sets cursor position on vendor field automatically .

how to implement the same for screen exit fields .

Regards

Suri

0 Kudos

hi

Expecting replies

Regards

Suri

0 Kudos

Use CHAIN - ENDCHAIN statements for validating of fields. It will automatically move cursor to incorrect field like below example

    CHAIN.

    FIELD INPUT4.
    MODULE CHAIN_MODULE_1.
    FIELD INPUT5.
    FIELD INPUT6 MODULE CHAIN_MODULE_2.
  ENDCHAIN.

0 Kudos

Hi,

You need to implement the following user exits for customer enhancements.

EXIT_SAPMM06E_007 - Export Data to Customer Subscreen for Purchasing Document Header (PAI)

EXIT_SAPMM06E_017 - Export Data to Customer Subscreen for Purchasing Document Item (PAI)

Regards,

Danish

0 Kudos

hi danish,

MOVE-CORRESPONDING TEKPO TO EKPO_CI.

GL_AKTYP1 = I_AKTYP.

if ekpo_ci-zidate is INITIAL.

  call SCREEN '0111'.

set CURSOR FIELD ekpo_ci-zidate.

message 'Enter Ir Date' type 'E'.

endif.

but it is giving short dump invalid_dynpro_type . So i changed screen as normal from subscree at that time  it is showing as normal screen .

So please tell me how to avoid this short dump with out changing the screen type 

Regards

Suri

0 Kudos

Hi Nahbeet,

Please advice

Regards

suri

0 Kudos

Hi Suri

What you can try is before throwing the error message set sy-dynnr number to your screen number and see what happens. I have seen it working in case of user exit. Just give it a try and let us know what happen.

Thanks

Nabheet

0 Kudos

Hi Nabheet,

I wrote following code. but it is giving me dynpro does not exist.

Error analysis

    The system attempted to use dynpro 0111 in program "SAPLMEGUI".

    This dynpro does not exist.

MOVE-CORRESPONDING TEKPO TO EKPO_CI.

GL_AKTYP1 = I_AKTYP.

if ekpo_ci-zidate is INITIAL.

set sCREEN 0111.

set CURSOR FIELD ekpo_ci-zidate.

message 'Enter Ir Date in Ir Details tab ' type 'E'.

  ENDIF.

Please suggest

Regards

Suri

0 Kudos
Dont use set screen and all try to  write sy-dynnr = 1111.  Be sure about to check its ater effects if any

former_member189779
Active Contributor
0 Kudos

try SET SCREEN and then SET CURSOR

0 Kudos

hi

when we are using set screen it is giving short dump.

suri

0 Kudos

In method process_header of badi

when i use set cursor it  is  going to org data tab but it is not coming to my custom tab field.

Please help

Regards

Suresh

0 Kudos

Not sure but may be try

call subscreen ....

0 Kudos

Hi vinit

it s not working

How to solve this .

Regards

Suri

0 Kudos

Hi,

It seems we can not control the cursor postion for customer data through exit.

There are similar problem discusssed on forum but do not see any answer if we really can do this. Lets wait if somebody else has any idea to this thread.

I will try to get access to the system and try myself.

raymond_giuseppi
Active Contributor
0 Kudos

First read Note 310154 - ME21N/ME51N: Customer-specific check, generating error log

This note will explain you how-to use SAP provided macros to manage error message and attach those to field and screen area.
- mmpur_business_obj_id (opt)
- mmpur_metafield (attach to screen area and field)
- mmpur_message_forced (send message)

Regards,
Raymond

0 Kudos

Hi Raymond,

Can u provide me the code how to write

Regards

Suri

0 Kudos

Dear Raymond,

I Wrote following code in exit_sapmm06_012 function module

if ekpo_ci-zidate is INITIAL.

   CONSTANTS: mmmfd_zidate type mmpur_metafield value 31009.
*
mmpur_metafield  mmmfd_zidate.
set CURSOR FIELD ekpo_ci-zidate.
mmpur_message_forced 'E' 'ME' '900' '' '' '' ''.

*message 'Enter Ir Date in Ir Details tab ' type 'E'.
endif.

the issue is when i check the document in application tool bar only it is showing error message

in pop window but if check that one and click on edit button cursor is not moving to custom screen

Please advice how to write

Regards

suri.


0 Kudos

Hi Experts

Please advice

Regards

suri

0 Kudos

Hi Raymond,

Can u provide me the steps how to write

Regards

Suri

Former Member
0 Kudos

Hi,

Even I have implement this exits for many client, even if you keep input required at screen level for your custom field this will work only if user goes to your customer tab only and also u cannot use point 1 and 2...

1) set screen 0111 it is used to set normal screen, if you do so the system will through dump because your custom screen is sub-screen not a normal screen...

2) Call SubScreen this is used only in flow logic, if you use in user-exit then system will through dump...

As per my experience, you cannot set cursor on a custom field in your custom-tab, but you can validate your custom fields in user-exit EXIT_SAPMM06E_012.....

By the end, you have met your client requirement, that you need user to enter values in custom fields in your custom tab.

This can be achieved by using exit  EXIT_SAPMM06E_012.....

E.G.

IF I_EKKO-ZZPLANT IS INITIAL.
MESSAGE E002(ZMIL).
ENDIF.

Please let me know....

Regards,

Rajesh Sadula...

0 Kudos

Hi,

Rajesh,

     Already i did that one am gettting error message when syntax check.

    My issue is

      when we select that message click on edit it  ie cursor should go to field of custom screen

      Regards

     Suri

0 Kudos

Any idea

Reg

Suri

Former Member
0 Kudos

Hi,

As an ABAPer we cannot set cursor on custom field in ME21n/ME22n, and I had a discussion on this with my MM consultant is there any setting in SPRO they said "No"..

I don't think so it is possible.

Let c others what they say...

Regards,

Rajesh Sadula.