cancel
Showing results for 
Search instead for 
Did you mean: 

From BRF+ output in ABAP not coming Properly

former_member198721
Participant
0 Kudos

Hi Experts,

I have created few functions in BRFplus and added code in ABAP for calling them.

At the first run output comes properly, but in case i make any change in the ABAP code then output  is not coming as expected,

then everytime i have to go to BRFplus function , i have to make some change there and re-activate it.

Then output can be seen in ABAP.

Kindly let me know what is the solution for this problem.

Regards ,

Khushbu

Accepted Solutions (1)

Accepted Solutions (1)

anbusivam_s
Participant
0 Kudos

Whenever you execute a BRF+ function the context values are changed. What I suspect here is the previous buffers were not cleared during the execution second time which may result in wrong output. Whenever you make any change to the function in brf+ workbench it triggers generation of new abap class and it invalidates the previous buffer. That could be the reason for you to get right results after a change. Please implement the note 1912092 which should solve this issue. If it doesn't then I would advice you to open a customer message with SAP.

former_member198721
Participant
0 Kudos

Hi Anbusivam,

How could i read sap note 1912092 , i am not able to find it.

former_member190447
Participant
0 Kudos

I just checked for the note and it is available and released for customers.

Do you have issues accessing this specific note, or can't you access any SAP notes?

anbusivam_s
Participant
0 Kudos

You have to find it in snote transaction in your system where you can download and install notes. snote utility will fetch the note from sap service market place (smp).

former_member198721
Participant
0 Kudos

Hi Anbusivam,

yes i got your point,but can you look at below code.Its happening when my output is table type.Its working perfect for single output from BRFplus.

It could be because of underlined command .I am creating w_t as of my Z table at run time.

can you suggest.

c_id contains function id.

DATA: ls_plant    TYPE if_fdt_types=>element_text,

       ls_lgnum    TYPE i,

       ls_mat      TYPE if_fdt_types=>element_text,

       ls_us       TYPE if_fdt_types=>element_text,

       ls_cntrl    TYPE if_fdt_types=>element_text,

       ls_res      TYPE if_fdt_types=>element_text,

       w_t         TYPE REF TO data,

       dref_tab    LIKE TABLE OF w_t.

TRY.

   CLEAR : lo_context,

                lo_function,

                lo_result.

   MOVE:  '000000000082084596' TO ls_mat,

          '1706' TO ls_plant,

          'X'    TO ls_us,

          'X'    TO ls_cntrl.

*"GET BRFPlus Function

     lo_function ?=

     cl_fdt_factory=>if_fdt_factory~get_instance( )->get_function('c_id').

*" set BRFlus function context(Input variable)

     lo_context = lo_function->get_process_context( ).

     lo_context->set_value( iv_name = 'MATNR'    ia_value = ls_mat ).

     lo_context->set_value( iv_name = 'WERKS'    ia_value = ls_plant ).

     lo_context->set_value( iv_name = 'ZPROD_US' ia_value = ls_us ).

     lo_context->set_value( iv_name = 'ZCONTROL' ia_value = ls_cntrl ).

* " Process the BRFplus function

     lo_function->process( EXPORTING io_context    =  lo_context

                           IMPORTING eo_result     =  lo_result ).

     CREATE DATA w_t TYPE STANDARD TABLE OF zctdg.

     ASSIGN w_t->* TO <d_ref>.

     lo_result->get_value( IMPORTING er_value = w_t ).

     lo_result->get_value( IMPORTING ea_value = <d_ref> ).

   CATCH cx_fdt INTO lx_fdt.

ENDTRY.

anbusivam_s
Participant
0 Kudos

But you have mentioned the first run is returning proper results. Is it true for table type result also? If yes I couldn't think of anything else other than buffering issue which will be fixed by this note.

former_member198721
Participant
0 Kudos

Hi Wolfgang,

I got that SAP note, but i have to take help from Basis team for implementing that , and my requirement is urgent.

former_member198721
Participant
0 Kudos

Hi Anbusivam,

yes its giving correct output for the same code ,

but if i leave code and run it on another day then i cannot see value in the object w_t.

Can you directly tell me how to resolve the buffering issue for this , implementing note can take time as i haven't done it before.

Cant i add some command?

anbusivam_s
Participant
0 Kudos

No. I would recommend you to wait until this note is implemented successfully.

former_member198721
Participant
0 Kudos

Hi Anbusivam,

Thanks for your help

former_member198721
Participant
0 Kudos

Hi Anbusivam,

I have raised request for implementing note , as it needs appoval.Meanwhile i would like to ask one question.The issue is happening only ofr the BRFfunctions those are having result object as  table.

For the below BRF+ Funtion , i never face this issue. This function is having single element in Result object.

C_id contain functions id.

TRY.

*"GET BRFPlus Function

     lo_function ?=

     cl_fdt_factory=>if_fdt_factory~get_instance( )->get_function('c_id').

*" set BRFlus function context(Input variable)

     lo_context = lo_function->get_process_context( ).

     lo_context->set_value( iv_name = 'MAIL_ID' ia_value = ls_mail).

* " Process the BRFplus function

     lo_function->process( EXPORTING io_context    =  lo_context

                           IMPORTING eo_result     =  lo_result ).

     lo_result->get_value( IMPORTING ea_value = ls_lgnum ).

     IF ls_lgnum EQ 1.

       COMMIT WORK.

     ENDIF.

   CATCH cx_fdt INTO lx_fdt.

ENDTRY.

Can you explain why it is so?

Regards,

Khushbu

anbusivam_s
Participant
0 Kudos

Exact reason can be found only by debugging. You may debug your code once to know how the values are returned from the function by adding a breakpoint in the generated code while executing second time with table type result. You can get the generated code from report FDT_GENERATION_TOOL. You can get the abap class that is generated by providing function id & selecting display single function option. Add a breakpoint inside PROCESS_PURE method which will contain the exact coding for the rules you modeled. This will give exact idea where the issue lies. You may also step into lo_result->get_value.

former_member198721
Participant
0 Kudos

Hi Anbusivam ,

I don't have access to Run this report FDT_GENERATION_TOOL in my development box.

former_member198721
Participant
0 Kudos

I know the class name for each BRF+ function , and can see them SE24 also.Now will that help in determining the root cause of the issue?

ttrapp
Active Contributor
0 Kudos

Maybe you should try to get the authority, but this no topic for SCN, son't you think?

Best Regards,

Tobias

anbusivam_s
Participant
0 Kudos

Yes. You can debug through PROCESS_PURE method when you call second time with table result type. Also debug through move to ext method in the same class when you get the result. You will get an idea. If you find anything wrong other than the buffer issue I mentioned open a css message.

Answers (2)

Answers (2)

former_member198721
Participant
0 Kudos

Hi Experts


As suggested by you we have implemented SAP note 1912092 in our  box but still our issue is not resolved.



Issue is:


We have many BRFplus functions with the output as a table

----------------------------------------------------------------------------

Function 1.

Input parameters: Matnr (element)

                               Mat_grp_check (element(boolean))

                               Statm (element)

                               Werks (element)

Ouptut: Z_ZCTDE (table)

---------------------------------------------------------------------------

Now i have called this function in ABAP as below

-----------------------------------------------------------------------------

DATA: lo_function TYPE REF TO if_fdt_function,

           lo_context  TYPE REF TO if_fdt_context,

           lo_result   TYPE REF TO if_fdt_result,

           e_wa_dref   TYPE REF TO data,

           lx_fdt      TYPE REF TO cx_fdt.

   DATA: lo_message TYPE REF TO cx_fdt.

   FIELD-SYMBOLS: <fs_any>     TYPE any,

                  <fs_is_final> TYPE STANDARD TABLE,

                  <fs_message> TYPE if_fdt_types=>s_message.

   DATA: ls_werks    TYPE if_fdt_types=>element_text,

         ls_matnr    TYPE if_fdt_types=>element_text,

         ls_statm    TYPE if_fdt_types=>element_text,

         ls_grp      TYPE if_fdt_types=>element_boolean,

         w_t         TYPE REF TO data.

   FIELD-SYMBOLS : <d_ref>  TYPE ANY TABLE,

                   <d_ref1> TYPE zctde.

   CLEAR : ls_werks,

           ls_matnr,

           ls_statm,

           ls_grp.

   MOVE : inp_data-werks TO ls_werks,

          inp_data-matnr TO ls_matnr,

          'X'     TO ls_statm.

   TRY.

*"GET BRFPlus Function

       lo_function ?= cl_fdt_factory=>if_fdt_factory~get_instance( )->get_function('001E0B8362C21ED39FCE26B763418104').

*" set BRFlus function context(Input variable)

       lo_context = lo_function->get_process_context( ).

       lo_context->set_value( iv_name = 'MATNR' ia_value = ls_matnr ).

       lo_context->set_value( iv_name = 'STATM' ia_value = ls_statm ).

       lo_context->set_value( iv_name = 'WERKS' ia_value = ls_werks ).

* " Process the BRFplus function

       lo_function->process( EXPORTING io_context    =  lo_context

                             IMPORTING eo_result     =  lo_result ).

       CREATE DATA w_t TYPE STANDARD TABLE OF zctde.

       ASSIGN w_t->* TO <d_ref>.

       lo_result->get_value( IMPORTING er_value = w_t ).

       lo_result->get_value( IMPORTING ea_value = <d_ref> ).

     CATCH cx_fdt INTO lx_fdt.

   ENDTRY.

       lo_function ?= cl_fdt_factory=>if_fdt_factory~get_instance( )->get_function('001E0B8362C21ED39FCE26B763418104').

*" set BRFlus function context(Input variable)

       lo_context = lo_function->get_process_context( ).

       lo_context->set_value( iv_name = 'MATNR' ia_value = ls_matnr ).

       lo_context->set_value( iv_name = 'STATM' ia_value = ls_statm ).

       lo_context->set_value( iv_name = 'WERKS' ia_value = ls_werks ).

* " Process the BRFplus function

       lo_function->process( EXPORTING io_context    =  lo_context

                             IMPORTING eo_result     =  lo_result ).

       CREATE DATA w_t TYPE STANDARD TABLE OF zctde.

       ASSIGN w_t->* TO <d_ref>.

       lo_result->get_value( IMPORTING er_value = w_t ).

       lo_result->get_value( IMPORTING ea_value = <d_ref> ).

     CATCH cx_fdt INTO lx_fdt.

   ENDTRY.

------------------------------------------------------------------------------------------

Now what is happening , the moment i created the BRF function and added the code and executed the porgram then after the execution of  RED highlighted statement , one entry is coming in W_T

I have attached the screenshot of the debugger with the name sucess_run.


But in case i create some other function or test some other function in BRF or i execute the program on next day or after few hours , then the output does not come in the table.


I have noticed one more thing that there is a tab of CODE GERENATION, and it gets cleared whenever i make any change in the function.


For example i have another function and coded in the same way as mentioned above , for that this code generation tab is filled and screensot is attached.


And while i execute this function i could not see any output. but the moment i go and make any change in the BRF function , i can see the output and this tab also get cleared.


And in some cases previous function get stopped working and the recently changed  function only gives the output.


Kindly suggest what is the solution for this problem as the note is already implemented.

Regards,

Khushbu Agarwal

carsten_ziegler
Active Contributor
0 Kudos

Please do not post same content multiple times.

See my comment on your other post:

anindyaSAP
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Khushbu,

This should not happen. Can you elaborate on exactly what are you changing in code and what output is not coming properly after making that change? Also, what is the expected output that you get only for the 1st time (before changing the code) ?

Thanks,

Anindya