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: 

Disable column in sales order

Former Member
0 Kudos

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).

14 REPLIES 14

former_member262988
Active Contributor
0 Kudos

Hi,

You can do with screen variants.

Thanks,

Shailaja Ainala.

0 Kudos

I agree with you.But it needs to be done based on sales org, document type,plant and distribution channel conditions.

0 Kudos

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).

0 Kudos

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.

0 Kudos

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)

0 Kudos

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.

0 Kudos

I have done the coding in the same exit itself but still we can add materials and quantity.

0 Kudos

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.

0 Kudos

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..

0 Kudos

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).

0 Kudos

Hi guys..Thanks a lot lot..I have done this in other way..

0 Kudos

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.

0 Kudos

Hi Priyanka,

Could you please tell us how you achieved this. I'm also stuck in finding a solution for this.

garayaka
Explorer
0 Kudos

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.