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: 

How to assign Function Module in CT04

former_member200170
Participant
0 Kudos

Hi all,

In CT04 we assign a function Module in the Values Tab. I read from SAP help on the interface to be used. But not clear on how to assign this correctly. If anybody who worked on this can give me an example. How we do declare the function when we write dependency?

Thanks,

Manjula.S

1 ACCEPTED SOLUTION
14 REPLIES 14

0 Kudos

Hi shan Palani,

I already tried this. Anybody who worked on this in real time? Please give me an example.

Thanks,

Manjula.S

0 Kudos

I have not used a Variant Function at the Characteristic Value, but have done so at the Config Profile instead. I would assume that process would be the same but you would need to verify. You would define your function Module using TCode CU65. Here you define the Characteristics to be used in the Variant Function and you can also create the Function Module as well. Next you would create an Object Dependency to call the Variant Function.

Procedure: PRO_CALL_MY_VARFUNC.

(Syntax Below)

FUNCTION Z_MY_VARRUNC

(C_CHAR_1 = $SELF.C_CHAR_1,

C_CHAR_2 = $SELF.C_CHAR_2,

.

.

.

C_CHAR_N = $SELF.C_CHAR_N)

The SAP Help is very good at explaining on how to create and use a Variant Function.

0 Kudos

Hi Reich,

Thanks for replying. But the interface of the function Module is different when we assign the Function to the characteristic from that of the function we assign in CU65. Tried with information given in SAP help.The function module is working fine in SE37, but not triggering nor getting the values when assigned the corresponding Class to the Material. What could be missing?

Thanks&Regards,

Manjula.S

0 Kudos

How do you have your function being called within your Object Dependency? You should be able to add a manual BREAK-POINT in your Function Module and see it being called when you run your Variant Configuration. One caution when using a Variant Function, all the Characteristics you have defined in the Variant Function must have a value or it will not return anything.

0 Kudos

Hi Manjula,

I have a similar request and I am facing the same problem as well. The function with *_f4 is not getting called when you press F4 for the characteristic.

I will keep trying and if you figure this out, pls let me know.

Regards,

Venkat.

0 Kudos

Hi Venkat,

I will let you know if I ge it.

Thanks&Regards,

Manjula.S

0 Kudos

Hi Manjula,

I got it to work.

The missing part was in the Check function ( the one that you enter in the Characteristic definition for checking, not the XXXX_F4 function) you need to add an exporting parameter VALUE_EX of type CAWN-ATWRT and pass the value from the importing parameter VALUE to it.

This is not given in the documentation and i debugged the program to figure this out.

Now my issue is that it works only for single value, but my requirement is for multiple values. Back to debugging

Venkat.

0 Kudos

Hi Venkat,

Thanks for that. I tried as you suggested its getting the values in SE37.But when I assign this Function module in CT04 and assign the corresponding CLASS to material this is not triggered in CU50 when I simulate it. Do we need declare this Function Module any where else also?

Thanks&Regards,

Manjula.S

Edited by: Manjula on Jan 12, 2009 5:04 PM

0 Kudos

Hi Manjula,

There is nothing that needs to be done.

In the characteristic description CT04, you assign the function module.( without _F4) . Then when you do a F4 in CU50, the _F4 function automatically gets triggered. Please refer to note 631023. You have some sample working code as well.

My multi value is also resolved. I had to press "Enter" after selecting the values. That was it.

Good luck.

Venkat.

0 Kudos

Hello Venkat,

Thanks for information on the issue I am trying to resolve.

Can I get your email ID?

Thanks,

Sneha.

0 Kudos

I am trying to do the same for a user defined characteristic. Please give more details on how were you able to solve this?

Some documentation will be helpful.

Thanks

0 Kudos

Ok. Solved with help from SAP note 631023.

Simply put a BREAK-POINT for the code Step 1-3

Step1. Create FM ZXXX_ABCD

""Local Interface:

*" IMPORTING

*" REFERENCE(CHARACT_NO) LIKE CABN-ATINN

*" REFERENCE(CHARACT) LIKE CABN-ATNAM

*" VALUE(VALUE) LIKE CAWN-ATWRT

*" EXCEPTIONS

*" NOT_FOUND

Step2. Create FM ZXXX_ZBCD_F4

""Local Interface:

*" IMPORTING

*" REFERENCE(CHARACT_NO) LIKE CABN-ATINN

*" REFERENCE(CHARACT) LIKE CABN-ATNAM

*" REFERENCE(DISPLAY)

*" REFERENCE(ADDITIONAL_VALUES) LIKE CABN-ATSON

*" REFERENCE(MULTIPLE_VALUES) LIKE RCTMV-ATLIS

*" REFERENCE(LANGUAGE) LIKE SY-LANGU

*" REFERENCE(DISPLAY_WITH_LANGUAGE)

*" TABLES

*" VALUES STRUCTURE RCTVALUES

*" EXCEPTIONS

*" VALUE_NOT_FOUND

Step 3. ZMRO_USR_CHAR_DC

""Local Interface:

*" IMPORTING

*" REFERENCE(CHARACT_NO) LIKE CABN-ATINN

*" REFERENCE(CHARACT) LIKE CABN-ATNAM

*" REFERENCE(VALUE) LIKE CAWN-ATWRT

*" REFERENCE(LANGUAGE) LIKE SY-LANGU

*" EXPORTING

*" REFERENCE(DESCRIPTION) LIKE CAWNT-ATWTB

*" EXCEPTIONS

*" NOT_FOUND

Step 4.

Goto CT04->Enter Characteristic name->Values->Other Value Check->Funct. module-> Enter FM name FM ZXXX_ZBCD

Step 5.

Goto CU65->Enter FM name FM ZXXX_ZBCD->Enter->Characteristic->Enter Characteristic name->Check input parameter->save

Now go to the transaction from where you want to test and F4, the function should stop at the break point.

0 Kudos

Hi

Created F4 function module with prefix _f4 but its not triggering my break point.

only assigned fm and _dc is triggering my fm...

what is the problem in my f4 fm?

FUNCTION zxxxx_f4.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(CHARACT_NO) LIKE  CABN-ATINN
*"     REFERENCE(CHARACT) LIKE  CABN-ATNAM
*"     REFERENCE(DISPLAY) TYPE  CHKBOX
*"     REFERENCE(ADDITIONAL_VALUES) LIKE  CABN-ATSON
*"     REFERENCE(MULTIPLE_VALUES) TYPE  RCTMV-ATLIS
*"     REFERENCE(LANGUAGE) TYPE  SY-LANGU
*"     REFERENCE(DISPLAY_WITH_LANGUAGE) TYPE  CHKBOX
*"  TABLES
*"      VALUES STRUCTURE  RCTVALUES