2014 Dec 12 1:09 PM
In VA01, If the purchase order and purchase order item is blank then error message will be displayed for the user to input these values .
I have writtwen below code in MV45AFZZ, USEREXIT_SAVE_DOCUMENT_PREPARE. The problem is that when purchase order or purchase order item is not entered, the field is greyed out . Please suggest
If VBAK-BSTNK is initial.
message e000(ZMSG). " Enter Purchase Order
ELSE.
Read table xvbap with key POSEX = ' '.
* If VBAP-POSEX is initial.
IF sy-subrc = 0 .
SHIFT xvbap-POSNR LEFT DELETING LEADING '0'.
message e001(ZMSG) with xvbap-POSNR . " In Order data Tab, Enter Purchase order item
ENDIF.
ENDIF.
2014 Dec 12 1:14 PM
Hi
Try to add check condition in
MV45AFZB - userexit_check_vbak / userexit_check_vbap
Regards,
Pranav
2014 Dec 12 1:33 PM
When I add my Code in userexit_check_vbap, the error message displays in initial screen .
Say , If i added line item with its details in intial screen , the error message for Purchase order Item displays in intial screen hence we cannot naviagate to item screen ---> order tab--Purchase order item field
2014 Dec 12 1:31 PM
Why User Exit ? I am not sure, whether you have discussed with your Functional Consultant since this can be achieved with standard Incompletion Log itself.
Go to OVA2, select Sales Header > Procedures > Sale Order and maintain the following entries there.
VBKD:::::POSNR::::KBES:::01:::X
G. Lakshmipathi
2014 Dec 12 2:36 PM
Thanks you for your reply .
I would like to know whether warning message or error message will be displayed through OVA2.
Currently for Purchase Order below enteries are entered but it displays warning message & user is able to proceed with this message
VBKD:: BSTKD:: PO number::: KBES ::01::X
For Purchase Order Item
VBAP POSEX Purchase order item KBES 01
2014 Dec 12 3:26 PM
2014 Dec 12 3:37 PM
Hi Rachel,
MV45AFZZ, USEREXIT_SAVE_DOCUMENT_PREPARE will do the job for you.Try the following code snippet.
MESSAGE <Write your custom message> here. //Ensure you are using 'S' Message type rather than "E"
PERFORM FOLGE_GLEICHSETZEN(SAPLV00F).
FCODE = 'ENT1'.
SET SCREEN SYST-DYNNR.
LEAVE SCREEN.
Hope it helps.
Regards,
Kannan
2014 Dec 16 10:04 AM
Dear Kannan
May i know why are you recommending for development-when it can be done with standard??
Interested to know in what scenarios-we can differ the same process..
Phanikumar
2014 Dec 17 2:46 PM
I have tried the incompletion log as suggested by G. Lakshmipathi & also tried Kanan's solution .
Since I wanted error message for specific customer I tried below code suggested by Kanan . It is working perfectly fine.
MESSAGE <Write your custom message> here. //Ensure you are using 'S' Message type rather than "E"
PERFORM FOLGE_GLEICHSETZEN(SAPLV00F).
FCODE = 'ENT1'.
SET SCREEN SYST-DYNNR.
LEAVE SCREEN.
- Also, could you help me how can we position the cursor on "Purchase order item" field so that user will know that PO item has to be entered
-I am also curious to know how error message can be displayed through incompletion log since I was getting warning message and was able to proceed further but while saving, the document shows in incomplete status.
2014 Dec 20 10:02 AM
"""I am also curious to know how error message can be displayed through incompletion log since I was getting warning message and was able to proceed further but while saving, the document shows in incomplete status""
You can check based on the Flag-Incomplete messages in VOV8
(If it is deactive-then you will get the option about incompletion).
Also to change the Message status from W to E--Try with OVAH (else at se91 at coding level)
Note:Incompletion procedure will not work based on customer--if business wants based on customer--then you need to go with exits.
Very Imp Note: Incompletion log will always check whether some value to be maintained in the respective field--but it does not validate(other than f4 options for some fields)
Phanikumar