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: 

Need to change the Sort field(kna1-sortl) value

Former Member
0 Kudos
494

Hi All,

We have the requirement to fill the Search Term (kna1-sortl) based the accounting group and 'kunnr' value.

I.e as per the legacy system number range in brazil we need fill the sortl field based on accoung goup by concating the kunnr value to it.

for Ex: 2GXXXXX0 this number need to filled in sortl field.

where 'X' is repplaced by kunnr value.'2' and '0' are the constant values.Based on accounting group after value '2' we need to add either 'g' or 'S'.

We find one user exit 'EXIT_SAPMF02D_001' but which does not contain the kna1 as the change perameter.

kindly help me on it .if there is any other badi

5 REPLIES 5

marcin_milczynski
Contributor
0 Kudos
162

Hi,

There is no std user-exit for this (at least we haven't found it as well).

We have created implicit enhancement point implementation athe the end of form AUFRUF_USER_EXIT in include MF02DFEX.

The code should be similiar to following:


ENHANCEMENT 1  YEDSD_EO_ADD_DOC_PREFIX.    "active version
    DATA:
      ltp_doc_prefix TYPE y_dt_docpref.

*--only in creation and change mode
    IF T020-AKTYP = 'H' OR
       T020-AKTYP = 'V'.
      CONCATENATE kna1-ktgrd kna1-kunnr INTO ltp_doc_prefix.
      kna1-yydocpre = ltp_doc_prefix.
    ENDIF.
ENDENHANCEMENT.

Regards,

Marcin

0 Kudos
162

i tried with this.no use.it is getting changed back after this code

Edited by: rakibuddala on Jan 6, 2012 8:00 AM

kesavadas_thekkillath
Active Contributor
0 Kudos
162

Hi,

In EXIT_SAPMF02D_001 itself try it like below


field-symbols: <f_kna1> type kna1.
data:lv_string(20) type c value '(SAPMF02D)KNA1'.
assign (lv_string) TO <f_kna1>.
if sy-subrc eq 0.
  <f_kna1>-sortl = 'Testing Updation'.
endif.

0 Kudos
162

IN EXIT_SAPMF02D_001 the kna1 is in importing parameter.it is not in either exporting or changing.

How can i change it from here.

0 Kudos
162

Please try that.