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: 

User Exit - EXIT_SAPMF02D_001

Former Member
0 Kudos

Hi All,

I'm currently using this User Exit EXIT_SAPMF02D_001 to do a check for change in Bank details during 'SAVE' from transaction code FD02.

If there is a change (comparing the import tables with a SELECT statement to the database table), I would need to update the import table parameter T_KNBK-BKONT with a special value.

However, my problem is that the value is only updated within the User Exit. Once it returns to the main calling program (SAPMF02D), the updated value is lost. I've checked the codes and concluded that this User Exit only allows checking of data but not changing them. SAP creates a copy of the table before calling the User Exit function module and passed the copy into the Function Module instead.

Can anyone here suggest an alternative for me? I need to change the data during 'SAVE'.

Thanks!

Regards,

Alban

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Alban,

This is how u do the updateion of the field BKONT in the unser eixt EXIT_SAPMF02D_001 .

Data:fld(50) value '(SAPMF02D)XKNBK[]'.

field-symbols: <fs1> type table.

assign (fld) to <fs1>.

now it is pointing to the internal table.

loop at <fs1> into wa_knbk.

cnt = sy-tabix.

wa_knbk-bkont = '11'.

modify <fs1> from wa_knbk index cnt.

endloop.

This will definately work.

7 REPLIES 7

Former Member
0 Kudos

may be you can try the expert mode of accessing variables through field-symbol.

field-symbols: <FS> type any.

assign '(program name)variablename' to <FS>.

check this out if it works for you, then maybe you can change it through <FS>.

0 Kudos

Hi Sharath,

Thanks! You pointed me in the right direction.

Although it took some time to figure out how to get the entire table accross, but your advice was well appreciated.

Thanks!

Former Member
0 Kudos

check out this BADI definition in se18.

CUSTOMER_ADD_DATA

Regards,

BIkash

Former Member
0 Kudos

Hi Alban,

I think u can use the following BAdi's

CUSTOMER_ADD_DATA "Additional Data at Customers"

CUSTOMER_ADD_DATA_CS "Additional Data at Customers "

CUSTOMER_ADDRSCR_CHG "Change Address Screen in

the Master Data Maintenance"

u can write ur code for updation of tables that u want.

u have to write this code in method "SAVE_DATA" ,so that

while saving data after cahnge, it will get called.

There are many methods u can appropriate method that u think for ur requirement.

Regards,

Ranjit Thakur.

Mark the Helpful Answers.

Former Member
0 Kudos

Hey everyone. Thanks... the problem is solved!

Thanks to everyone for their advice.

Former Member
0 Kudos

Hello Alban,

This is how u do the updateion of the field BKONT in the unser eixt EXIT_SAPMF02D_001 .

Data:fld(50) value '(SAPMF02D)XKNBK[]'.

field-symbols: <fs1> type table.

assign (fld) to <fs1>.

now it is pointing to the internal table.

loop at <fs1> into wa_knbk.

cnt = sy-tabix.

wa_knbk-bkont = '11'.

modify <fs1> from wa_knbk index cnt.

endloop.

This will definately work.

0 Kudos

Hi Abhijit,

Thanks for sharing your code.

However, I have solved it earlier. Thanks to Sharath.

Here's the snippet. Its very similar. 😃

DATA: lw_field(50) TYPE c VALUE '(SAPMF02D)XKNBK[]'.

FIELD-SYMBOLS: <f1> TYPE ANY TABLE,

<f2> TYPE knbk.

ASSIGN (lw_field) TO <f1>.

IF <f1> IS ASSIGNED.

LOOP AT <f1> ASSIGNING <f2>.

<f2>-bkont = 'AA'.

ENDLOOP.

ENDIF.