Application Development 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: 

How to update/modify the ALV internal table once it is displayed

Former Member
0 Kudos

Hi All,

I have a alv grid report using fm reuse_alv_grid_dispaly. My requirement is to create sales order using bapi (up to here it is working fine) and once the SO is created update the function module tables field with the created sales order.

Example:

My alv grid display before creating SO:

Customer Material SalesOrder

1000001 material1

My alv grid display after creating SO:

Customer Material SalesOrder

1000001 material1 3025642

How can I achieve this functionality. Because the field catalog is already displayed, how can I modify/update it by adding the sales order number to it. Experts, suggest me.

Thanks.

6 REPLIES 6

Former Member
0 Kudos

You asked exactly the same question in . You said it was solved and marked it as solved. Why are you asking again?

Rob

0 Kudos

In the previous thread, I totally refreshed the entire row of internal table once the sales order is created without adding any new field to the field catalog. Now I need to update/modify the display by adding a new field to my field catalog. That's where I am messed up with. Please suggest me if you have any ideas.

0 Kudos

Initial display , set the Sales order field in the field catalog as No out or Tech field, later once order is created, Use the FM REUSE_ALV_GRID_LAYOUT_INFO_GET & REUSE_ALV_GRID_LAYOUT_INFO_SET. Make sure to takeout the No out for the sales order field in fieldcatalog before passing to SET method.

0 Kudos

Hi Suman,

Thanks for the response. By chance, do you have any sample code snippet which does the same thing what you have told.

0 Kudos

FORM callback_ucomm USING ucomm LIKE sy-ucomm
                               selfield TYPE slis_selfield.
CASE ucomm.

    WHEN 'CRE'.
* Logic to create sales order here...
* Show the Sales order column
    CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
      IMPORTING
        et_fieldcat   = gt_fieldcat
      EXCEPTIONS
        no_infos      = 1
        program_error = 2
        OTHERS        = 3.
    if sy-subrc eq 0.
      read table gt_fieldcat into gs_fieldcat with key fieldname = 'VBELN'.
      if sy-subrc eq 0.
        gs_fieldcat-no_out = space.
        gs_fieldcat-tech   = space.
        modify gt_fieldcat from gs_fieldcat index sy-tabix transporting no_out tech.
      endif.

      CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
        EXPORTING
          it_fieldcat          = gt_fieldcat[].
    endif.
ENDFORM.

0 Kudos

Hi Suman,

Thanks for the reply. My problem is solved.

Thanks Again.