Skip to Content

problem with user buffer in one session

Hello experts,

In transaction SBWP i have workflow, where i have button with logic execute the planning sequence.

Under button i call FM ZRSPLSSE_PLSEQ_EXECUTE, example code:

*"--------------------------------------------------------------------—

*" IMPORTING

*" VALUE(I_SEQNM) TYPE RSPLS_SEQNM

*" VALUE(I_VARIANT) TYPE RSPARAMNM DEFAULT SPACE

*" VALUE(I_FAST_ENQUEUE) TYPE RS_BOOL DEFAULT RS_C_FALSE

*" EXPORTING

*" VALUE(E_TK_RETURN) TYPE ZBAPIRET2

*"--------------------------------------------------------------------—

DATA

: lc_exec TYPE REF TO cl_rsplfr_web_start_sequence

, i_r_application TYPE REF TO cl_rsbolap_application

, i_r_data_area TYPE REF TO if_rsbolap_data_area

, l_t_mesg TYPE rrms_t_mesg

, l_s_mesg TYPE smesg

, ls_tk_return TYPE bapiret2

.

i_r_application = cl_rspls_plan_application=>get( ).

i_r_data_area = i_r_application->get_data_area( ).

CREATE OBJECT lc_exec

EXPORTING

i_seqnm = i_seqnm

i_r_application = i_r_application

i_r_data_area = i_r_data_area

.

CALL METHOD lc_exec->execute

IMPORTING

e_t_mesg = l_t_mesg

.

LOOP AT l_t_mesg INTO l_s_mesg.

CLEAR ls_tk_return.

ls_tk_return-type = l_s_mesg-msgty.

ls_tk_return-message = l_s_mesg-text.

ls_tk_return-id = l_s_mesg-arbgb.

ls_tk_return-number = l_s_mesg-txtnr.

ls_tk_return-message_v1 = l_s_mesg-msgv1.

ls_tk_return-message_v2 = l_s_mesg-msgv2.

ls_tk_return-message_v3 = l_s_mesg-msgv3.

ls_tk_return-message_v4 = l_s_mesg-msgv4.

APPEND ls_tk_return TO e_tk_return.

ENDLOOP.

FREE lc_exec.


In the FM I transfer the name of the planning sequence. In the planning sequence, I use the operator ATRV, who read value attribute characteristic ZCHAR.

When you first start the FM the planning sequence correctly reads the attributes ZCHAR. As part of the same session, I start the FM for the second time, and the new attributes ZCHAR not be read. Attributes characteristic ZCHAR may change dynamically at any time. Therefore, I need to start the planning sequence always with new attributes.

I suppose that when you first start the FM variables and attributes characteristics are stored somewhere in the ABAP memory, or user buffer. Perhaps someone faced such problem? I want to run the FM is always like the first time. I think we have to somehow clean the user's buffer, but we can not find an answer to my question.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Sep 08, 2016 at 08:15 AM

    Thank you all for your help!

    I have not learned how to to clean a specific buffer, but I has solved my promlem starting a function module in the new session. Example:

    CALL FUNCTION 'ZIM_RSPLSSE_PLSEQ_EXECUTE'

    STARTING NEW TASK 'CALL_SEQ_WITH_NEW_ATTR'

    DESTINATION 'NONE'

    Add a comment
    10|10000 characters needed characters exceeded

    • By the way, you are calling the function module asynchronously (so both caller and callee will be processed parallely). You may call synchronously by removing STARTING NEW TASK '...', and keeping DESTINATION 'NONE' to still execute in a separate external session (but synchronously).

  • Posted on Aug 15, 2016 at 10:11 AM

    In order to learn where ABAP data are stored and how long they live, you can start with

    General Memory Organization

    and also

    Validity and Visibility

    In a function module, you deal with local data of the function module (procedure) or with global data of the function group (ABAP program). The first lives during execution of the FM, the second lives as long as the FG is loaded in an internal session. It depends on the coding of the function group, whether data are stored in a memory that lives longer than the function group itself, e.g. in the shared memory of the application server. There is no automatism in ABAP that stores data there.

    Horst

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 15, 2016 at 08:23 AM

    Hi,

    so this FM is used in a method and part of a step in a workflow right? Well then you should check the workflow log to see if somehow on second try of executing the step that the same containerelements are sent to the method.

    I have a feeling this is just a binding issue and not a buffer issue.

    Kind regards, Rob Dielemans

    Add a comment
    10|10000 characters needed characters exceeded

    • Yes, this FM is a part of a step in a workflow. In container workflow a value containerelements is not changes, therefore problem not in sending to the method value containerelements.

      The problem is that in the FOX-planning sequence use ATRV operator, who not read new value attributes ZCHAR in the second FM launch.Value attributes are not stored in the container workflow. Value the attribute is read in a fox-function of the following way:

      l_var = ATRV(atr1,ZCHAR).

      When I change this attribute in the master data ZCHAR in the same session where I launch FM the first time, i am launch FM the second times, but the new attribute values can not be read..

      New attribute values can be read if I go into the transaction SBWP again.

  • Posted on Aug 19, 2016 at 04:05 PM

    I guess it's more a question how to use this part of the BW application (CL_RSPLS* and so on). Did you try methods like L_R_DATA_AREA->REFRESH( ). "Check Whether There Is New Data, or even methods REFRESH_CHAR_REL_BUFFERS or FREE or RESET, etc.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.