Skip to Content
0
Former Member
Jan 21, 2011 at 09:33 AM

User exit for XD01 with delivery priority

81 Views

Hi ,

I am using a user exit EXIT_SAPMF02D_001 for customer master.Below is the piece of code .I am just displaying message based on delivery priority field in the customer master .

But the probleam is when user only change the value in delivery priority field then only my message should come .But now my logic executes when ever no changes in the delivery priority field also and any touch other than this field also getting the message.

Means the value in the delivery priority field not refreshed in the customer master screen .Thats why the message is coming any time when not touching the field also.

so can somebody suggest what to do?My logic should work only when delivery priority field only changed.

TABLES:tpakd.

DATA:l_lprio TYPE lprio,

l_kztlf TYPE kztlf,

l_antlf TYPE antlf.

DATA:l_lp(2) TYPE c VALUE '03',

l_kz(1) TYPE c VALUE 'B',

l_an(1) TYPE c VALUE '1'.

SELECT SINGLE * FROM tpakd

INTO tpakd

WHERE parvw = 'WE'

AND ktokd = i_kna1-ktokd.

IF sy-subrc = 0 .

MOVE i_knvv-lprio TO l_lprio.

MOVE i_knvv-kztlf TO l_kztlf.

MOVE i_knvv-antlf TO l_antlf.

IF l_lprio = l_lp AND ( l_kztlf NE l_kz OR l_antlf NE l_an ) .

MESSAGE w534(zm).

ELSEIF l_lprio IS NOT INITIAL

AND ( l_kztlf IS NOT INITIAL

OR l_antlf IS NOT INITIAL

OR l_antlf NE '0'

OR l_antlf NE '9' ).

MESSAGE w534(zm) .

ENDIF.

ELSE.

EXIT.

ENDIF.