Skip to Content
0
Nov 23, 2012 at 01:04 PM

Initialization problem in BRFplus function call

50 Views

Hi,

I have a function call with a table SORTIMENT as importing parameter. I call this function in a loop.

Unfortunately, the entries of the table are not cleared between the calls. This is because the auxiliary table variable (which is prepared from the input data) is not cleared before the next parameter passing starts.

Let me be more precise: The following code is what the generator makes from my function call, which is processed several times, inside of an enclosing loop. The auxiliary variable _V_TDOBJ_SORTIMENT3 is not initialized between successive calls, thereby providing the function with the wrong input. There is a CLEAR _V_TDOBJ_SORTIMENT3 missing before it is (re-)filled with the APPEND statements in line 11.

*** start of Function Call: D8D385DF85881ED1A68847372A1FCAE0 RABATT_ANWENDBAR* Start Function Call Expression ID: D8D385DF85881ED1A68847372A1FCAE0  DATA _v_lt_name_value3 TYPE abap_parmbind_tab.    CLEAR _v_lt_name_value3....  DATA _v_tdobj_SORTIMENT3 TYPE _yt_sortiment_.  FIELD-SYMBOLS <_v_s_source_struc3> LIKE LINE OF <_v_workarea3>-SORTIMENT.    LOOP AT <_v_workarea3>-SORTIMENT ASSIGNING <_v_s_source_struc3>.  DATA _v_tdobj_SORTIMENT3_wa TYPE _ys_zcrc_sortiment_.MOVE-CORRESPONDING <_v_s_source_struc3> TO _v_tdobj_SORTIMENT3_wa .APPEND _v_tdobj_SORTIMENT3_wa TO _v_tdobj_SORTIMENT3 .    ENDLOOP.    _v_ls_name_value3-name = 'SORTIMENT'.    GET REFERENCE OF _v_tdobj_SORTIMENT3 INTO _v_ls_name_value3-value.    INSERT _v_ls_name_value3 INTO TABLE _v_lt_name_value3....

Here is how it looks like in the debugger:

I looked for notes, but didn't find one.

Unfortunately, this is a productive problem. If there is no correction yet, the processing of an OSS note will take a while. How to provide a quick fix? Making the generated code transportable, by assigning a transportable package to the class?

Or is the generator itself as transparent that I could correct the code of the template there, and regenerate the application (btw, how would I do this)?

The best would be, of course, if there exists already a note, and I just didn't find it for some reason :-)

Thanks for looking at this.

Rüdiger

Attachments