03-20-2012 9:41 AM
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
03-22-2012 10:45 AM
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
03-20-2012 9:48 AM
Hi
Are you validating fields using FIELD or CHAIN ENDCHAIN statements?
Thanks,
Chandra
03-20-2012 10:09 AM
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
03-20-2012 9:56 AM
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.
03-20-2012 10:25 AM
Hi Vinith,
I implemented badi what u said it is giving error message but cursor is not going to that field .
Regards
Suri
03-20-2012 10:26 AM
03-20-2012 10:32 AM
hi Vinith
I already used
set cursor field wa_poheader-zreference
but cursor is going to org data tab.
Regards
suri
03-20-2012 9:56 AM
As you are not going to the custom screen have you implemented EXIT_SAPMM06E_012 enhancement to validate the data for the same.
Nabheet
03-20-2012 10:11 AM
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
03-20-2012 10:17 AM
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
03-20-2012 10:17 AM
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
03-20-2012 10:30 AM
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
03-20-2012 10:37 AM
03-20-2012 10:44 AM
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.
03-20-2012 11:09 AM
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
03-20-2012 6:43 PM
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
03-21-2012 6:32 AM
03-21-2012 7:15 AM
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
03-21-2012 5:49 PM
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
03-21-2012 7:00 PM
03-20-2012 10:44 AM
03-20-2012 11:12 AM
03-20-2012 11:55 AM
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
03-20-2012 12:36 PM
03-20-2012 5:57 PM
03-20-2012 6:05 PM
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.
03-22-2012 10:45 AM
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
03-22-2012 12:10 PM
03-22-2012 12:24 PM
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.
03-24-2012 1:59 PM
04-01-2012 12:01 PM
03-25-2012 6:01 AM
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...
03-25-2012 1:49 PM
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
03-26-2012 8:58 AM
04-11-2012 8:39 AM
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.