cancel
Showing results for 
Search instead for 
Did you mean: 

Call to BRFPlus Function using the generated FM code not working

Former Member
0 Kudos

Dear Experts,

I have a situation where I have created a new BRFPlus Application in the Development system. This is our first BRFPlus Application.

I simulated the BRFPlus Function in the DEV system. It is working fine. It is giving the correct results.

I have used the option to generate the Function module from the BRFPlus Function. And I am calling this generated Function Module to call the BRFPlus function from my program. It is working fine in the development system. The BRFPlus rules are getting executed successfully.

Now, I have transported the whole BRFPlus Application to the test system. I simulated the BRFPlus Function in the test system. It is also working fine. It is giving the correct results.

However, when I call the BRFPlus function from my program using the generated Function Module. It doesn't return any results in the test system.

I am not able to understand why the same generated FM is working in Development system. However, it is not working in the test system.

I checked that the BRFPlus Application is active and it is same in DEV and Test system. The BRFPlus Function is also getting simulated successfully in the Test system.

Thanks,

Nitin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Nitin,

why did you generate a funtion module? This is not really neccessary (only if you want to expose your decision service as RFC or WS).

Did you debug your program? Is there a CX_FDT_INPUT exception thrown and you did not catch it?
What storage type did you choose for you BRFplus application?

Best regards

  Daniel

Former Member
0 Kudos

Hi Daniel,

Thanks for the response.

Earlier, I was using the method cl_fdt_function_process=>process to call the BRFPlus Function from my program.

I got the whole code by executing the report FDT_TEMPLATE_FUNCTION_PROCESS.

However, this method cl_fdt_function_process=>process was working in the DEV system but didn't worked in the Test system.I debugged and I was not getting any exception. Only the BRFPlus is not returning any results.

Then, I used the next approach to generate a RFC Function module from the BRFPlus Function and use it. The FM did worked in the DEV system but not returning nay result in the TEST system.

I am using the storage type as Customizing.

I want to know if I am missing something?

Thanks,

Nitin

Former Member
0 Kudos

Well, set a break-point in the generated class of your decision service.

The class name is available in the Workbench for example. Just navigate to your function an klick on tab "Code Generation". Here you see the class name.

When you call your decision service with trace choose the one which supports a trace.

Set the break-point in method IF_FDT_GEN~PROCESS of the class.

Here you can check the context, jump into the rules processing (method process_pure) and you are able to check the construction of the the return value.

Best regards

Daniel

Former Member
0 Kudos

Hi Daniel,

Yes, I will debug the method process_pure of the generated class. I will let you know the findings.

Can you please elaborate which trace shall I use while debugging based on your statement:

"When you call your decision service with trace choose the one which supports a trace."

Thanks,

Nitin

Former Member
0 Kudos

Hi Nitin,

if you call CL_FDT_FUNCTION_PROCESS=>PROCESS you can specify a trace mode.

If you don't want to trace ignore the parameter. Then you have to debug the class without trace compiled.

When you choose IV_TRACE_MODE = 'L' you'll have to debug the class with generated trace mode.

To receive a technical trace with IV_TRACE_MODE = 'T' you do not need a generated class. The whole application is being interpreted by it's database entries.

christianlechne
Active Contributor
0 Kudos

Hi Nitin,

as you are using storage type customizing the information in BRFplus is client dependent. So I guess that on DEV you use the same client for the BRF+ rules modelling and the call of the BRFplus function (either via cl_fdt_function_process or via the FM).

When you do the transport to the test system please make sure that the customizing is imported on the correct client, namely the one that you use when calling the BRFplus function. Otherwise you get no result. In other words everthing concerning transport of customizing requests and post-work on them (e. g. copy to different clients) that you do for "regular" customizing has to be done for the BRFplus specific customizing requests, too.

BR

Christian

Former Member
0 Kudos

Hi Christian,

you are right. But I thought that process_pure is being called. So the generation took place and the customizing was copied into the right client.

Did I misunderstood you Nitin?

Former Member
0 Kudos

In development we have two clients. In testing we have the single client.

Since these are customizing requests therefore I copied the requests(SCC1) in development from one client to another. Then tested and it worked.

However, I am now re-importing the whole BRFPlus Application transport again from DEV system to Test system, just to make sure.

After the import, I will test again.

Thanks for your response.

Regards,

Nitin

Former Member
0 Kudos

Hi Daniel/Christian,

I am able to add the Technical trace to the CL_FDT_function_process=>process method. I am attaching my sample code below. I am using the method READ and READ_HIERARCHY of IF_FDT_TRACE to get back the Technical log/trace. However, these methods give the trace in the format which is not readable.

Do you have some sample code to read the trace. For e.g. the parameter ETS_TRACE in the method READ of IF_FDT_TRACE. Basically to interpret the xml trace in if_ixml_document. So that I can analyze the trace properly.

I will now debug the method CL_FDT_function_process=>process.

Thanks,

Nitin

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

* Trigger function processing

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

       DATA: lcl_fdt_trace TYPE REF TO if_fdt_trace.

       ASSIGN _vr_data->*  TO <_v_any>.

       CALL METHOD cl_fdt_function_process=>process

         EXPORTING

           iv_function_id = '005056940AF61EE49BD923E4A9140C54'

           iv_timestamp   = _v_timestamp

           iv_trace_mode  = 'T'

         IMPORTING

           ea_result      = <_v_any>

           eo_trace       = lcl_fdt_trace

         CHANGING

           ct_name_value  = _vts_name_value_pair.

       TRY.

           TYPES:

             BEGIN OF s_trace,

               timestamp   TYPE fdt_trace_0000-trace_timestamp,

               user        TYPE fdt_trace_0000-trace_user,

               function_id TYPE fdt_trace_0000-trace_fct_id,

               o_document  TYPE REF TO if_ixml_document,

             END OF s_trace .

           TYPES:

             ts_trace TYPE SORTED TABLE OF s_trace WITH UNIQUE KEY timestamp user .

           DATA: lv_trace      TYPE string,

                 lcl_trace_doc TYPE REF TO if_ixml_document.

           DATA: e_xml_trace TYPE string,

                 e_trace     TYPE ts_trace.

           lcl_fdt_trace->read( IMPORTING ev_trace = e_xml_trace

                                          ets_trace = e_trace ).

           CALL METHOD lcl_fdt_trace->read_hierarchy

*            EXPORTING

*              itr_timestamp     =

*              itr_user          =

*              itr_function_id   =

*              iv_memory_only    = ABAP_FALSE

             IMPORTING

               ev_trace          = lv_trace

               eo_trace_document = lcl_trace_doc.

         CATCH cx_fdt_input .

         CATCH cx_fdt_system .

       ENDTRY.

Former Member
0 Kudos

Hi Daniel,

I debugged the method PROCESS_PURE. And it gave me the answers to my queries.

I observed that the code generated in this method is different in the Dev and Test system. Then on further debugging, I found that the table FDT_CC_0000 stores the auto generated class name. I found that it has 2 entries for my BRF+ Function - one class name for trace and one class name without trace.

The code is correctly generated for the class used with tracing. However, the code is generated once for the class without trace. And afterwards each time I am activating and testing my BRFPlus application, the code is not getting generated in the class without trace.

So as a workaround, I am not calling my BRFPlus function with Lean trace. And it is working with traces.

On further analysis, I found that the report FDT_GENERATION_TOOL can be used to manually generate the code. However, I am now raising the OSS Message instead of manually re generating the code myself.

Thanks for your help.

Regards,

Nitin

Answers (1)

Answers (1)

Former Member
0 Kudos

The issue is resolved by implementing the OSS Note 2118024 - After transport function code is not re-generated .

Thanks all for help.

Regards,

Nitin