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

Difficulty with buttons in Status GUI Application Toolbar

Hello everyone,

I am using ALV grid in my program. It collects data from tables. I want to set buttons - Add, Edit and Delete. After selecting a row from ALV grid and clicking 'Edit', data from the table should be copied to In/Out fileds in the other part of the screen. I have to use GUI Status buttons. What's strange for me, when exactly the same code is called after clicking ALV toolbar button or Status GUI button program behaves differently. ALV toolbar works fine and data is copied correctly, but using button 'Edit' or 'Add' from GUI Status Toolbar makes In/Out Fields grey out.

Does anyone have idea of why the program behaves this way and how to solve it?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 12, 2012 at 09:30 AM

    Hello Karol,

    In case of ALV toolbar button click, both PAI and PBO get invoked while in case of GUI status button click, only PAI is invoked.

    This is the reason of your problem.

    Regards,

    ManuB

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2012 at 09:35 AM

    @Manu: Thank you, but I am not sure this is the case.

    Anyway, removing DYNP_UPDATE_FIELDS seems to be solution. Problem solved.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2012 at 09:17 AM

    Here is a part of code executed after clicking 'Edit' . I am using "DYNP_UPDATE_FIELDS" because otherwise in/out fields are not refreshing correctly..

    WHEN '&EDIT&'.
    CALL METHOD alv_grid->get_selected_rows
    IMPORTING et_index_rows = i_selected_rows.

    CASE number1.
    WHEN '1101'.

    LOOP AT i_selected_rows INTO w_selected_rows.
    READ TABLE it_przedm INTO wa_przedm INDEX w_selected_rows-index. "ZMIANA

    IF sy-subrc EQ 0.
    MOVE-CORRESPONDING wa_przedm TO w_modified_przedm. "ZMIANA
    * APPEND w_modified TO i_modified.
    ENDIF.

    ENDLOOP.

    PRZEDM_N = w_modified_przedm-PRZEDMIOT.
    PRZEDM_S = w_modified_przedm-SKROT.
    PRZEDM_ID = w_modified_przedm-ID.
    "CLEAR I_DYNPFIELDS.

    W_DYNPFIELDS-FIELDNAME = 'PRZEDM_N'. W_DYNPFIELDS-FIELDVALUE = PRZEDM_N.
    APPEND W_DYNPFIELDS TO I_DYNPFIELDS.

    W_DYNPFIELDS-FIELDNAME = 'PRZEDM_S'. W_DYNPFIELDS-FIELDVALUE = PRZEDM_S. "ZMIANA

    APPEND W_DYNPFIELDS TO I_DYNPFIELDS.

    (...)

    CLEAR W_DYNPFIELDS.

    MOVE number1 TO DNMB.

    CALL FUNCTION 'DYNP_UPDATE_FIELDS'
    EXPORTING
    DYNAME = SY-REPID
    DYNUMB = number1
    TABLES
    DYNPFIELDS = I_DYNPFIELDS.


    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.