Monday, March 01, 2004

User*exit hacking

Here is a very useful trick to access and change variables outside the scope of an user-exit function. For example, in exit EXIT_SAPMM07M_001 you can set the text in the material document, but no other MSEG field is supposed to be changed. Using field symbols you can access and change any field from the outer scope (this example sets the external post amount to 99).


CONSTANTS: c_mseg(21) VALUE '(SAPMM07M)MSEG'.

FIELD-SYMBOLS: <fc> TYPE MSEG.

ASSIGN (c_mseg) TO <fc>.
<fc>-exbwr = 99.


But, of course, doing this is higly unrecommended. If they find you doing it, the'll send an agent to deactivate your ... *disconnected*

Labels: