Application Development and Automation 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: 
Read only

problem with user buffer in one session

0 Likes
2,555

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.

1 ACCEPTED SOLUTION
Read only

0 Likes
1,988

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'

8 REPLIES 8
Read only

Former Member
0 Likes
1,988

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

Read only

0 Likes
1,988

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.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
1,988

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

Read only

0 Likes
1,988

In my case, the startup sequence of transactions and programs:

1. Call transaction SBWP - global session begins

2. I take a job in the workflow and click the call button "function modules №1" from the function group  №1 - local session begins

3. Next, function module №2 of function group 2 (here comes the launch of FOX - planning sequence) starts from the functional module №1 - is also a local session

4. Upon completion of the functional modules, I remain in the transaction SBWP, as global session is not completed, I think so.

5. If i again press the button in the workflow and execute function module №2. New attributes can not be read Fox- planning function until I get out of the transaction SBWP and enter into the transaction again.

I think the global session stores the buffer before exiting the transaction. But I did not try to clean it, the Fox-planning function does not see the new attributes.

I tried:

- Clean the buffer application server

- Use LEAVE TO TRANSACTION and CAMMIT WORK

- Use FM  'STATUS_BUFFER_REFRESH'

- Right after i have modified the tables and commited the changes to the database i call CL_RSPLFS_PLSE method factory( ) for your planning function. This should invalidate the buffer and store the new "version" in the buffer.

None of the methods did not help solve the problem. It is not clear how to clear the buffer of the global session .. Maybe some ideas on this?

Read only

0 Likes
1,988

I am not an expert in workflow. Therefore I cannot say which buffering mechanisms are used in that framework. But I dare to say that it is not a good idea to randomly

reset one or the other system buffer. This rather seems to be a workflow and not an ABAP question.

Horst

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,988

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.

Read only

0 Likes
1,989

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'

Read only

0 Likes
1,988

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).