Application Development and Automation 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: 
Read only

Field exits

Former Member
0 Likes
611

Hi All,

I have created a field exit for data element(MATKL) and inside the field exit function module i have done a validation and raised an error message.

When i m exectuing the transactions such as OMSF (SPRO->Logistsis->MasterData->Define Material group) or any other transaction,

the error message is triggering and the field exit is working fine.

Now i have a requirement that this validation should neglect/not consider one particular transaction(eg: OMSF) and allow me to enter any value for MATKL field in that particular tranascation.

I tried to add my validation inside the field exit function module by checking sy-tcode...

i.e

***********************************************************

check not sy-tcode='OSMF'

if input = 'DC14'

message e004 with 'Obselete material group'

endif.

end function.

*******************************************************

but in this case the sy-tcode value is being SM30 as i m validating inside the FM.

In this case if i validate for sy-tcode for SM30 my requirement fails....

So in such cases i need a differentiator for recognising the transaction OSMF

Please help me to exclude this particular transaction while validating the field exit

Regards

Shiva

Hi All,

I have created a field exit for data element(MATKL) and inside the field exit function module i have done a validation and raised an error message.

When i m exectuing the transactions such as OMSF (SPRO->Logistsis->MasterData->Define Material group) or any other transaction,

the error message is triggering and the field exit is working fine.

Now i have a requirement that this validation should neglect/not consider one particular transaction(eg: OMSF) and allow me to enter any value for MATKL field in that particular tranascation.

I tried to add my validation inside the field exit function module by checking sy-tcode...

i.e

***********************************************************

check not sy-tcode='OSMF'

if input = 'DC14'

message e004 with 'Obselete material group'

endif.

end function.

*******************************************************

but in this case the sy-tcode value is being SM30 as i m validating inside the FM.

In this case if i validate for sy-tcode for SM30 my requirement fails....

So in such cases i need a differentiator for recognising the transaction OSMF

Please help me to exclude this particular transaction while validating the field exit

Regards

Shiva

3 REPLIES 3
Read only

alejandro_lpez
Contributor
0 Likes
552

Hi,

When you active a field exit (using report RSMODPRF), it is necessary to indicate the program and dynpro number where the field exit will work. Therefore if you define the correct dynpro number in combination with sy-tcode, you should not have problems validating this field.

Regards,

Alejandro.

Read only

Former Member
0 Likes
552

Hi

Try to use the system function DY_GET_CURRENT_TRANSACTION to get the trx code:

DATA: TCODE LIKE SY-TCODE.

CALL 'DY_GET_CURRENT_TRANSACTION' ID 'TRANSACTION_NAME'
                               FIELD TCODE.
IF TCODE = ......
ENDIF.

Max

Read only

Former Member
0 Likes
552

Hi Shiva

Also, please check if you can make use of system field: <b>SY-CPROG</b>.

Kind Regards

Eswar