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 put drop down in table control ?

Former Member
0 Kudos

Hi All,

I m writing one module pool program to edit table.

I want dropdown to one field so that user can select the appropriate value. And also I want to save that record.

So how to get the dropdown list and after editing that record how to save that in the database?

Thanx in advance.

-Umesh

2 REPLIES 2

ferry_lianto
Active Contributor
0 Kudos

Hi Umesh,

Please check this demo program RSDEMO_TABLE_CONTROL on how to add drop down list in table control. Also check this program DEMO_DYNPRO_TABCONT_LOOP_AT as well.

To save to database you can code something like this in PAI.


MODULE USER_COMMAND_0100 INPUT.
  SAVE_OK = OK_CODE.
  CLEAR OK_CODE.

  CASE SAVE_OK.
    ...
   
    WHEN 'SAVE'.
      MODIFY <database table> FROM TABLE <table control>.
    
      IF SY-SUBRC = 0.
        ...
      ELSE.
        ...  
      ENDIF.
  
    WHEN OTHERS.
  ENDCASE.

ENDMODULE.                 " USER_COMMAND_0100  INPUT

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos

Hi Umesh,

You have to make use of POV (<b>PROCESS ON VALUE-REQUEST</b>) event in your module pool program. Under this event you need to call a FM <b>F4IF_INT_TABLE_VALUE_REQUEST</b>.

Declare and populate a internal table, you have to pass this internal table to the <b>VALUE_TAB</b> field under <b>TABLES</b> parameter of the FM. You also need to specify the retfield (return field) under <b>EXPORTING</b> parameter of the FM. (retfield is the field which gets populated in table control, once the user clicks any entry from dropdown).

Regards,

Abdul

P.S: Reward points, if useful.