cancel
Showing results for 
Search instead for 
Did you mean: 

Placing the button inside the cell of a table

former_member219737
Participant
0 Kudos

Hi Team,

I need to place the button inside the cell of a table ...so that the user will edit and capture the same ... Can u suggest me an idea on the same ...

Regards,

Karthik S

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member211591
Contributor
0 Kudos

Hi,

if you are using an SALV_WD_TABLE:

you can use a "button" cell_editor of type CL_SALV_WD_UIE_A_BUTTON in your ALV-conbfiguration method.

if you are using a standard table, just add an "Button"-Cell editor to your column:

(There is already a button added to column TABLE_EINRI.)

After that you have to create an onaction-method for your button and assign it to your button cell-editor. Using the wdevent parameter of the onaction method you can identify in which row the button has been clicked.

Regards

former_member219737
Participant
0 Kudos

Hi Ismail,

Thanks for your reply ...

I want to place the button inside the field specified in the below screen shot ..

Need to place the button inside the cell of a table..so that Button and Value should be visible...

Request to give me an idea for the same ...

Regards,

KArthik S

Former Member
0 Kudos

here I place a button inside the cell - and the VALUE of the cell is the button text

here is some code

  define create_button.
    create object lr_button.
    lr_button->set_text_fieldname( <col>-id ).
    lr_button->set_image_source_fieldname( 'IMAGE' ).
    lr_button->set_width( '47' ).
    <col>-r_column->set_cell_editor( lr_button ).
    free lr_button.
  end-of-definition.

    lr_col_header->set_ddic_binding_field( if_salv_wd_c_ddic_binding=>ddic_bind_none ).
    case <col>-id.
      when 'SEQNR'.
        lr_col_header->set_text( 'Item' ).
        lr_column->set_position( 1 ).
        lr_column->set_width( '55' ).
        lr_column->set_h_align( cl_wd_table_column=>e_h_align-forced_left ).
        create_button.

" here is the result (when the button is clicked an action is performed - uploads a file)

former_member219737
Participant
0 Kudos

Hi Steve,

Thanks for your reply ...

Can i know the exact code and then the respective method for the Snippet of Code

to be written for the screen shot below ...

Regards,

Karthik S

former_member219737
Participant
0 Kudos

Hi Steve,

For the screen shot mentioned ....

I need to place the Button,value ...for ex : Button, 5 (where 5 is dynamic value)

which I need to place it in all the cells which is attached ...

Can u give me an idea for the same ...

Regards,

KArthik S

former_member219737
Participant
0 Kudos

Hi Steve,

I am just using the Normal Table ..not the ALV Concept ...

Please suggest me an idea on the same ...

Regards,

Karthik S

Former Member
0 Kudos

sorry, I did not realise you were not using the ALV table

I am sure there is a std example - if I find one i'll come back.


former_member219737
Participant
0 Kudos

Thanks Steve...

Once u find it, let me know ...

Regards,

KArthik S

former_member211591
Contributor
0 Kudos

Hi,

just do it as I said. Go to your view, and change the cell-editor of your column as shown in my screenshot before.

regards

former_member219737
Participant
0 Kudos

Hi Ismail,

I am not able to see any Button option under table option .

Can u tell me the exact path to create the Button inside the Table Option of UIElement Container ..

Can u tell me the

Regards,

KArthik S

former_member219737
Participant
0 Kudos

Hi Ismail,

I tried the button...its fine ,...but I need to place the Button and Value in a single cell of a table .

Regards,

KArthik S

Former Member
0 Kudos

That is not possible! You can set the value as button text

former_member211591
Contributor
0 Kudos

As Christopher said. Thats not possible. You've got to remove the former cell-editor (it should be an InputField) and then add a new Button-Cell-Editor to the column. As Button-Text you can bind the value (it is the same context-attribute which was bound to your InputFields value). Thus you will have a button with "2.0" as Button text according to your example.

former_member219737
Participant
0 Kudos

Hi Ismail,

Thanks for your Valuable reply ...

Can i get the exact snippet of code and steps to achieve the same ...

Regards,

KArthik  S

Former Member
0 Kudos

why don't you try it on your own? It does not help anything when you paste copy, you Need to use your brain!

I wasn't in scn the last years, but it seems that  90% of post are "post the code, give me exact instruction" and so on. But nobody wants to LEARN those things, to expirement and to find out, everybody wants to copy&paste

former_member219737
Participant
0 Kudos

Hi Christoper,

On the Same topic of making the field Editable , Changing the values from the old to new value using Change Log Method & making Button, Value in same field ...

I have been trying this stuff for past 1 month and on different aspects i'm trying to achieve my Applications ...

U can refer the same from my previous Posts ...

Its not that Copy , Paste of code and we need base to know and learn things ...

Regards,

Karthik S

former_member211591
Contributor
0 Kudos

There is nothing to code. It is pure layout design. look for "how to change cell-editor in standard tables".

I can't describe you how to do it from scratch. I've to assume that you have some basic knowledge.

The given ideas should be enough for you to figure out how to realize it.

Sorry..

Former Member
0 Kudos

Then take the time and learn those Basic Things. There are lot's of how to guides where all your Topics are explained. Most questions are answered several times before, just use the search.

People like Ismail makes it so easy for you but it seems that your only waiting for the right code for copying.

former_member219737
Participant
0 Kudos

Hi Ismail,

I have tried the same and placed button inside the cell ..

Will check the same and update you...

Regards,

Karhik S