cancel
Showing results for 
Search instead for 
Did you mean: 

POWL attribute of feeder class

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

I implemented the IF_POWL_FEEDER to get a POWL application.

Within the feeder class in the method: handle_action I set the value of a private instance attribute ATTR1.

Then in the get_objects method I want to read the value of this attribute ATTR1.

The value is no more filled.

I don't understand why, because I think the POWL should work with one instance of the feeder class and therefore the attribute value should be kept over all methods,

Any ideas ?

Thanks and kind regards.

Carola

Accepted Solutions (0)

Answers (3)

Answers (3)

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Okay, I did not really get the reason for the loss of the attribute value of the feederclass, but with the workaround, it's working.

Thanks for all comments.

Carola

alexandre_src
Participant
0 Kudos

Hi,

I faced with the same problem and I found the class CL_POWL_RUNTIME_SERVICES (POWL runtime services) using the follow methods:

  • GET_CONTENT_VALUES
  • SET_CONTENT_VALUES

Example:

Data:
    L_PARAMETER_VALUE TYPE STRING,
    ST_ADDITIONAL_PARAMETER TYPE POWL_NAMEVALUE_STY.


  CL_POWL_RUNTIME_SERVICES=>GET_CONTENT_VALUES(
    EXPORTING
      I_PARAMETER_KEY   = 'ACTION_VIEW_ID'
    IMPORTING
      E_PARAMETER_VALUE = L_PARAMETER_VALUE ).


  If not L_PARAMETER_VALUE is initial.
    ME->GC_ACTION_REQUEST_VIEW_ID = L_PARAMETER_VALUE.
  else.
    ST_ADDITIONAL_PARAMETER-KEY = 'ACTION_VIEW_ID'.
    ST_ADDITIONAL_PARAMETER-VALUE = GC_REQUEST_VIEW_ID_INBOX.

    CL_POWL_RUNTIME_SERVICES=>SET_CONTENT_VALUES                                                                         (
ST_ADDITIONAL_PARAMETER ).

    ME->GC_ACTION_REQUEST_VIEW_ID = GC_REQUEST_VIEW_ID_INBOX.
  endif.

Keep it in mind, if you have on or more POWL's queries, the parameter's value will be shared for all them.

Regards,

alsadah
Participant
0 Kudos

Hi Carola,

I tried debugging many POWL feeder class scenarios and the get_objects method was always called before the handle_action method.

This might have something to do with the cashed results for the user ID you are using. Try to run the report POWL_WLOAD via transaction SE38 to delete the cashed results for that user and then try to debug again. It should call the get_objects method first because the handle_action method is only supposed to be called upon a user action such as clicking on a button or selecting a row etc...

I hope this will help...

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello.

You are right, the get_objects is called first time before the Handle_action. But in the Handle_action I can initiate a refresh, so that the get_objects is called again ,after for example a button has been pressed.

Finally I want to set a Attribute when a button is pressed (in Handle_action). This attribute value then should be read in the get_objects method to influence the refresh.

Kind regards and thanks for all comments.

Carola

Former Member
0 Kudos

Hi,

if you have problems with such things, try creating another class which creates an object as a singleton or a static class, and read from that.

Best regards

Sebastian

Former Member
0 Kudos

Hi,

In Handle action method you have C_RESULT_TAB supplies the current query results table (including all changes done by the user if the results table is editable) to the Feeder,current result table (adhering to GET_OBJECT_DEFINITION).

Regards,

Amit

Former Member
0 Kudos

hello,

I set the value in a method get_object and read in handle_action,

it works fine,

Please check that method get_object is called after handle_action.

Best regards,

Rohit

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

I verified the order of the methods in the Debugger: First

handle_action is called, then Get_objects.

Within the get_objetcs methods all instance attributes of the feeder class are initial. That's strange.

Kind regards.

Carola

Former Member
0 Kudos

Hello,

The everytime refresh happens,

feeder class is again initiated.

Best regards,

Rohit

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Rohit.

sorry, but even if set the atttribute as static attribute, the value is lost.

Static attributes should be kept for also instances, don't they ?

Kind regards.Carola