Skip to Content
author's profile photo Former Member
Former Member

How to refresh ALV-Table in which is filled from parallel process

Hi,

i have the following problem: I have created a user entry screen with several input fields and an alv-grid (cl_alv_gui_grid, set_table_for_first_display). With the information of the first input field i start a function in parallel mode (starting new task) to select some data and display them in the grid. The function calls at the end of it a subroutine which gets the selected data via the receive statement. The reason for this is that the function needs some time for collecting the data and i want the user to go on in his work wihout waiting.

So far so good. But when i try to refresh the table with method refresh_table_display i get always a short dump. The same result i get when i try to create an event which i have defined as a custom-event for the grid-object.

I wonder if anyone has dealed with the simialiar problem and got a solution for it. I am thankful for every hint and answer on this.

Take care

Günter

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2011 at 11:22 AM

    Check your object reference, It should be same for both method( SET_TABLE_FOR_FIRST_DISPLAY and REFRESH_TABLE_DISPLAY)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2011 at 03:33 PM

    Where are you refreshing the ALV? I hope it is not in the RECEIVING perform.

    You should count the number of spawned tasks while calling the FM in RFC. Keep the receiving count as well. Once both are match of you reached the max time for waiting, you should do the refresh of the ALV.

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2011 at 03:56 PM

    - At end of the RECEIVE of result from a call function starting new task, update the internal table and trigger the PAI of the screen via a call of method cl_gui_cfw=>set_new_ok_code.

    - In PAI (MODULE managing ok_code/USER_COMMAND) when this code is received, leave to current screen (do nothing if next screen of the dynpro is the dynpro itself)

    - In PBO execute a call to set_table_for_first_display first time (alv ref initial) else call method refresh_table_display.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2011 at 06:51 PM

    Hi,

    first thanks to you both for your quick answer!

    Unfortunately my problem is not solved.

    I have no problem with the task itiself - i see in the debugger that the receive form is entered and the results are there. But the refresh-method causes a short dump.

    Than i tried the version with the "set_new_ok_code", but the system is not reacting on this. My PBO works in the way that if the ALV_OBJ is initial, i use method set_display and not, i use method "refresh". I debugged than the set_new_ok_code method and i get the RC-importing parameter = -102 which means "wrong state" and in the documentation they say that you can use this method only in something like an "system event environment". I don't know what this means.

    Do you have any idea what i can do next?

    Thanks for your help!

    Günter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2011 at 09:26 AM

    Hi,

    Try this one.

    call method (method name ) --> free.

    Regards

    chitra

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2011 at 05:17 PM

    Hi,

    thanks again to your help, guys!

    I tried the version with the free method, but i getagain a short dump in the report SAPLCNDP, include LCNDPU23. line 291with the meaning that the instruction could not be processed.

    I am quite sure that i use the same objects for display and refresh because when i hit the enter key, the PBO is executed and in this module i refresh the object with the same coding - and the new contents is shown.

    If you have any other idea please let me know - i appreciate every hint.

    All the best

    Günter

    Add a comment
    10|10000 characters needed characters exceeded

    • Apparently, the RECEIVE is processed in an environment that cannot interact with the display management.

      So I suggest

      - In the RECEIVE, update internal table and set a flag in the global data of the display program

      - In the main program manage a periodic event via a local implementation of a class like CL_GUI_TIMER (*) and in event FINISHED handler, if the data loaded flag was set, clear it and trigger the PAI via the cl_gui_cfw=>set_new_ok_code.

      (*) Look at [Automatic Data Refresh on Module pool Screen|http://wiki.sdn.sap.com/wiki/display/Snippets/AutomaticDataRefreshonModulepoolScreen]

  • author's profile photo Former Member
    Former Member
    Posted on Dec 09, 2011 at 06:51 AM

    Hi,

    Try this code,

    DATA : CONT type ref to CL_GUI_CUSTOM_CONTAINER.

    IF NOT CONT IS INITIAL.

    CALL METHOD CONT->FREE.

    CLEAR: CONT.

    ENDIF.

    CREATE OBJECT CONT

    EXPORTING

    CONTAINER_NAME = 'CONTAINER'.

    CREATE OBJECT GRID

    EXPORTING

    I_PARENT = CONT.

    CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY

    CHANGING

    IT_OUTTAB = IT_KNA1

    IT_FIELDCATALOG = IT_FCAT.

    I hope this is useful for you .

    Cheers,

    G.Aditya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2011 at 09:33 AM

    Hi,

    first - thanks to all you guys who assist me in my problem. It is now solved!!

    The Idea from Raymond finally worked. The table is updated correctly after the select routine has gathered the data and the event routine is triggered. THANKS!!!

    I tried also the hint from G.Aditya, but i got short dumps again with the same error message as before - it had to do with exception messages which could not processed during creation/ display of the ALV-OBJ.

    I would gladly rewards points but i don't see any function/ possibility to do. May be you can help me again?!

    All the best - to the Best

    Günter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 07:25 AM

    Hi,

    For this issue you simple maintain ALV_REFRESH_TABLE after moving values into the Container.

    after SET_TABLE_FOR_FIRST_DISPLAY we have to refresh the table.

    Warm Regards,

    PavanKumar.G

    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.