cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction IW81

fayaz_ramsahaye
Explorer
0 Kudos
1,000

I need to make the fields Cost center and Functional Location mandatory for this transaction only. Please advise.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

rakesh_kushwaha
Participant
0 Kudos

Hi Fayaz,

You can make it mandatory by Field selection of Oder for Location & Account Assignment data. as below.

Before:

Configuration to field mandatory


After Configuration

But this functionality will not Work untill unless you will go to Location Tab of Order.

For Customize warning for mandatory fields You have to work with Technical Consultants.

For this Follow Jogeswara Rao K Sir. post

Thanks,

Rakesh

jogeswararao_kavala
Active Contributor
0 Kudos
  • It was discussed many times in the past that Mandatory settings through the SPRO tcode OIAZ for inside tab Location will work only when the user enters that tab.
  • When the user saves the Order without entering the Location tab, system will not stop you and the Order will be created without Cost Center.
  • For this reason, we will have to take help of user-exit for these requirements.
  • For Functional location field the mandatory settings through spro tcode OIAN will work, because the field is in HeaderData tab.
  • If it is the requirement of Resp Cost center field in the Additional Data tab then we have compulsorily go for user-exit
  • When we are having to go for user-exit because of Cost Center field/s, we can have Functional Location field mandatory there itself with the code I provided.

Just for information to save Time and Efforts.

Regards

KJogeswaraRao

Answers (3)

Answers (3)

fayaz_ramsahaye
Explorer
0 Kudos

Hello,

Thanks for the solutions provided. Issue has been resolved. I have gone for the Abap update.

Regards,

Fayaz

jogeswararao_kavala
Active Contributor
0 Kudos

Fayaz

Ask your ABAPer to put the following code in the include ZXWOCU07 of  F/Exit EXIT_SAPLCOIH_009 user-exit IWO10009 .


IF sy-tcode = 'IW81'.

   IF caufvd_imp-tplnr IS INITIAL .

     MESSAGE: 'Please fill Functional Location' TYPE 'E' DISPLAY LIKE 'I'.

   ENDIF.

   IF caufvd_imp-kostl IS INITIAL .

     MESSAGE: 'Please fill the Cost center field in Location tab' TYPE 'E' DISPLAY LIKE 'I'.

   ENDIF.

   IF caufvd_imp-kostv IS INITIAL .

     MESSAGE: 'Please fill the Cost center field in Additional Data tab' TYPE 'E' DISPLAY LIKE 'I'.

   ENDIF.

ENDIF.

  • After this, during IW81, when user tries to save the Order with FLocn field blank, then he will be stopped from doind so by an error pop-up saying 'Please fill Functional Location'.  This is first of the 3 parts of above code.
  • Similarly when the user tries to Save the Order with Cost center field of Location tab blank then he will be stopped by an error popup saying 'Please fill the Cost center field in Location tab'
  • Likewise when the user tries to Save the Order with Cost center field of Additional Data tab blank then he will be stopped by an error popup saying 'Please fill the Cost center field in Additional Data tab'

Remove the code from the above which is not relevant to you.

Good luck

KJogeswaraRao

MTerence
Active Contributor
0 Kudos

Hi Fayaz,

Share the screenshot of the fields you want to make mandatory.

Basically, if you are trying to make mandatory in location tab or any other tabs, then you need to ask your abaper to code a logic to check. Using field selection system will not check whether the field is mandatory during save.

Regards

Terence