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: 

SM30 : Conditionally Disable a column Cell

nsikka
Active Participant
0 Kudos

Hi All,

I have a requirement to disable a column cell when another column (with checkbox) is clicked on SM30 screen.

I have written table event and tried changing the property of table control but it results in disabling all the rows of that column. Instead I wan to disable column in that particular row.

Thanks,

Nitin Sikka

1 ACCEPTED SOLUTION

former_member182877
Participant
0 Kudos

Hi Nitin,

I dont think this can be achieved via just EVENTS!...

Go to SM30 --> Change --> (Menu) System ---> Status .. Double click on the 'Screen Number' - you would be forwarded to the Screen Logic.

In the PBO Section, Within the LOOP at SCREEN on that screen-field name., Check whether the 'Check' is done, if yes then make screen-active = '0'.

Hope this helps.

Cheers,

Kripa Rangachari.

11 REPLIES 11

enric101
Active Contributor
0 Kudos

Hi Nitin

When you create a view SM30, the system create a table control associate to table.

Look this link to acces at programa with your table.

https://scn.sap.com/message/8062475#8062475

Then, Please check this link to block a cell:

Good luck,

King regards.

Enric,

nsikka
Active Participant
0 Kudos

Thanks Enric, but I want to write the handler in the event code. can I access table control inside events?

Former Member
0 Kudos

What event did you use and what did your code look like?

Rob

enric101
Active Contributor
0 Kudos

Check this linck

I'm not sure if is possible to make with single click.

I think that the best option is implement an alv OO

former_member182877
Participant
0 Kudos

Hi Nitin,

I dont think this can be achieved via just EVENTS!...

Go to SM30 --> Change --> (Menu) System ---> Status .. Double click on the 'Screen Number' - you would be forwarded to the Screen Logic.

In the PBO Section, Within the LOOP at SCREEN on that screen-field name., Check whether the 'Check' is done, if yes then make screen-active = '0'.

Hope this helps.

Cheers,

Kripa Rangachari.

0 Kudos

Hi Kripa,

Thanks for the reply. I did it like this..

MODULE edit_column_display OUTPUT.

  DATA : lv_line(48)  TYPE c,

         lv_field(18) TYPE c VALUE 'EXTRACT-LINE+23(1)'.

  FIELD-SYMBOLS: <fs_value> TYPE char1.

  ASSIGN (lv_field) TO <fs_value>.

*  IF sy-ucomm = 'CHECK'.

    "lv_line = ( 'EXTRACT-LINE' ).

    LOOP AT SCREEN.

      IF screen-name = 'ZTSD017_BILL_PLN-TO_DATE' AND

        <fs_value> = 'X'.

        "( 'EXTRACT-LINE+23(1)' ) = 'X'.

        screen-input = '0'.

      ELSE.

        screen-input = '1'.

      ENDIF.

      MODIFY SCREEN.

    ENDLOOP.

*  ENDIF.

ENDMODULE.

0 Kudos

So is it Working Nitin?

Cheers,

Kripa Rangachari.

0 Kudos

yes it is working now... actually I have to loop at extract table and it is only available at runtime.

I had to write some code to capture that run time.

0 Kudos

You have to be careful when making changes to the automatically generated code in a TMG. If you make a change to the screen later, your code may be overwritten.

Rob

0 Kudos

Hi Nitin!....

Great to know! and as Rob mentioned... please have this change Documented well so that any change in future though affects the Code, people can refer to the related documentation and have your code re-done easily!

And also, probably you can have your pseudo too pasted here.. so that anyone in future having the same requirement can get an easy help!

Cheers,

Kripa Rangachari.

0 Kudos

Best just to create a dummy screen with the same code.

Rob