cancel
Showing results for 
Search instead for 
Did you mean: 

Sort field in maintenance order

Former Member
0 Kudos

Hello;

I want to make sort field in maintenance order as a mandatory field. But if I make it as a mandatory field, system still allows me to save the order as long as I have not clicked 'Location' tab. So there is no positive control over this field. May I know, how do I achieve this? I have even tried to put order type as the influencing field but it does not help.

Points assured.

Regards

Hemant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Hemant,

I would do the following:

1. search OSS for a solution

if there's no OSS note ->

2. create OSS message - as you can maintain the field selection for the sort field within the order, it should work, even, if the user doesn't access the location-tab.

3. use user-exit "before saving PM order" and check if sort field is filled.

Best regards

Stephan

Former Member
0 Kudos

Thanks Stephan for your reply.

Can you pls. let me know the complete procedure step by step for creating OSS message & to create- use/ apply the user exit?

Regards

Hemant

Former Member
0 Kudos

Hello Hemant,

access to the SAP service marketplace via www.service.sap.com to create an OSS message. Choose link "product errors". Therefore you need an OSS user and you have to be authorized to create OSS messages.

To create an user-exit, you have to go to transaction CMOD. There you have to create a project and assign the enhancement you want to use (I'm not really sure, but I think IWO10009 is the correct one in your case - you can search the user-exits via transaction SMOD - search for IWO*).

After this you have to implement your coding and then you have to activate the project.

The implementation of the user-exit should be done by an ABAP developer.

By the way - I've had a look at the OSS. There's note 768576.

-

-


Reason and Prerequisites

The problem is caused by a missing function.

Influences set via field selection will only become effective if a screen with the corresponding fields is processed. You must also refer to the documentation defined in the corresponding Customizing area. For the location & account assignment data, no additional check is (such as with the general order header data) is realised during the saving.

Prerequisite

Via field selection you declared fields of the location & account assignment data as mandatory field, and no screen that contains these fields was passed.

Solution

By means of the example code, you must implement a corresponding mandatory field check via customer enhancement IWO10009 at the time of the order backup.

1. Create subroutine Z_IWO10009_GET_DATA_FOR_FAW in program SAPMILA0. It would be best if you create an own include ZMILA0F1 for this so that you will not have any unnecessary expenditure for future Support Packages (via Transaction SE80).

FORM Z_IWO10009_GET_DATA_FOR_FAW.

CALL FUNCTION 'CO_IH_GET_HEADER'

IMPORTING

CAUFVD_IMP = CAUFVD.

CALL FUNCTION 'CO_IH_GET_ILOA'

EXPORTING

CAUFVD_IMP = CAUFVD

IMPORTING

ILOA_WA = ILOA.

ENDFORM. "Z_IWO10009_GET_DATA_FOR_FAW

2. Create the following source code in customer enhancement IWO10009:

STATICS: XTFAWF LIKE TFAWF OCCURS 0 WITH HEADER LINE.

tables: tfawf.

DATA: wa_screen LIKE screen.

FIELD-SYMBOLS: 'A'.

perform Z_IWO10009_GET_DATA_FOR_FAW(SAPMILA0).

if xtfawf[] is initial.

SELECT * FROM TFAWF INTO TABLE XTFAWF

WHERE PROG = 'SAPMILA0'.

endif.

LOOP AT XTFAWF WHERE CUST_M = 'X'.

CALL FUNCTION 'FIELD_SELECTION_INFLUENCE'

EXPORTING

dynprogruppe = '7 '

mode = 'C'

modulpool = 'SAPMILA0'

fieldname = XTFAWF-MFELD

IMPORTING

input = wa_screen-input

output = wa_screen-output

active = wa_screen-active

required = wa_screen-required

intensified = wa_screen-intensified

invisible = wa_screen-invisible

EXCEPTIONS

OTHERS = 1.

if wa_screen-required = 1.

clear lv_mfeld.

lv_mfeld = 'CAUFVD_IMP-'.

case XTFAWF-MFELD.

when 'ILOA-AUFNR'.

lv_mfeld+11 = 'IAUFNR'.

when 'ILOA-KOKRS'.

lv_mfeld+11 = 'IKOKRS'.

when 'ILOA-BUKRS'.

lv_mfeld+11 = 'IBUKRS'.

when 'ILOA-GSBER'.

lv_mfeld+11 = 'IGSBER'.

when 'RILA0-ARBPL'.

lv_mfeld11 = xtfawf-mfeld6.

when others.

lv_mfeld11 = xtfawf-mfeld5.

endcase.

ASSIGN (lv_mfeld) TO IS INITIAL.

Message E461(IW)

with 'Mussfelder der Standort&Kontierungsdaten füllen'.

EXIT.

ENDIF.

endif.

endloop.

endif.

3. Activate the changes

Correspondingly you can implement this solution also for the order release, for example, via customer enhancement IWO10002.

Bear in mind that this is a source code proposal. It might be useful or necessary to adjust this source code to special applications.

-

-


Best regards

Stephan

Edited by: Stephan Theis on Jan 5, 2008 11:20 AM

Former Member
0 Kudos

Thanks Stephan for your reply.

This would certainly help me & my ABAPer.

Regards

Hemant

Answers (0)