04-08-2011 10:56 AM
Hi guys,
I need to disable the matnr and zmeng(qty) field in sales order change mode.I have done the coding in userexit -
USEREXIT_FIELD_MODIFICATION->userexit_field_input_enable.Iam able to disable the material and quantity field.But my requirement is, i need to disable complete column(material and quantity).
04-08-2011 11:44 AM
04-08-2011 11:46 AM
I agree with you.But it needs to be done based on sales org, document type,plant and distribution channel conditions.
04-08-2011 12:11 PM
In my opinion, hiding entire column in item details table control (VA02) cannot be done through USEREXIT. This exit works well with fields which are not part of table control (by setting SCREEN-INVISIBLE = 1).
04-08-2011 12:18 PM
I dont want to hide.You are not getting my point.See my requirement is as follows -
The sale order is created and submitted for approval.
Once its in approval process then user should not be allowed to add or make any changes to the existing material and qty in Va02.Its should be in non editable status. Iin fact the two columns should be in non editable status.
04-08-2011 12:26 PM
Still I am confused with your earlier statement
Iam able to disable the material and quantity field.But my requirement is,
i need to disable complete column(material and quantity).
If the requirement is to disable the columns from input, it can be done through user exit MV45AFZZ, form-routine "USEREXIT_FIELD_MODIFICATION" (by setting screen attribute SCREEN-INPUT = 0 for filelds RV45A-MABNR and VBAP-KWMENG)
04-08-2011 1:34 PM
Vinod,
Its working for only one row or the existing materials created in Va01.My requirement is to make non editable for complete column so that the user cannot be able to add materials till it get approved.
04-08-2011 1:35 PM
I have done the coding in the same exit itself but still we can add materials and quantity.
04-08-2011 5:25 PM
Ok. This exit may not work when the user try to add new line item. Alternate option is to use user exit MV45AFZB, form-routine "USEREXIT_CHECK_VBAP", where you can validate and raise an error when user try to create a line item & for existing line items you can use the userexit mentioned in previous reply.
04-11-2011 5:36 AM
So you mean to say there is no any exit to disable complete columns?.Either we can validate or make it non editable to the existing materials..
04-11-2011 6:28 AM
As far as I know this is the option available where you have to use the comibnation of Screen modification(Existing lines) & validation (for new line items).
04-28-2011 12:34 PM
08-19-2011 5:27 AM
Hi Priyanka,
How did you acheive this requirement?
Even i have the same kind of requirement.It would be helpful if you can tell me the way you have did.
Thanks.
11-23-2015 12:17 PM
Hi Priyanka,
Could you please tell us how you achieved this. I'm also stuck in finding a solution for this.
12-09-2015 7:20 PM
Found a way;
The specific problem I faced was how to disable two fields, but let standard mapped data to be displayed in them.
To cater this requirement I used the following;
Include: MV45AFZZ
User Exit Name: USEREXIT_FIELD_MODIFICATION
Enhancement Name: -Any name you want-<br/>
I created an Enhancement and wrote the following code;
"Specify the condition
IF VBAK-VKORG = '1234' AND ( sy-TCODE = 'VA02' OR sy-TCODE = 'VA01' ) AND ( screen-name = 'VBAP-KDMAT' OR screen-name = 'VBAP-ARKTX' ).
screen-input = 0."disable input
MODIFY SCREEN.
DATA: i_tab_mara TYPE TABLE OF MARA WITH HEADER LINE.
DATA: l_maktx TYPE MAKT-MAKTX.
DATA: WA_MARA LIKE LINE OF i_tab_mara.
DATA: i_tab_vbap TYPE TABLE OF VBAP WITH HEADER LINE.
DATA: wa_vbap LIKE LINE OF i_tab_vbap.
IF sy-TCODE = 'VA01' .
SELECT SINGLE * from MARA INTO WA_MARA WHERE MATNR eq VBAP-MATNR.
SELECT MAKTX FROM MAKT INTO l_maktx WHERE MATNR eq VBAP-MATNR.
ENDSELECT.
VBAP-KDMAT = WA_MARA-KDMAT.
VBAP-ARKTX = l_maktx.
MODIFY SCREEN.
ELSEIF sy-TCODE = 'VA02' .
SELECT SINGLE * FROM VBAP INTO WA_VBAP WHERE VBELN eq VBAK-VBELN AND POSNR eq VBAP-POSNR.
IF WA_VBAP-ARKTX eq ''." Check if the fileds are empty, otherwise old data is overwritten
SELECT MAKTX FROM MAKT INTO l_maktx WHERE MATNR eq VBAP-MATNR.
ENDSELECT.
VBAP-ARKTX = l_maktx.
MODIFY SCREEN.
ENDIF.
IF WA_VBAP-KDMAT eq ''." Check if the fileds are empty, otherwise old data is overwritten
SELECT SINGLE * from MARA INTO WA_MARA WHERE MATNR eq VBAP-MATNR.
VBAP-KDMAT = WA_MARA-KDMAT.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDIF.