Application Development and Automation 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: 
Read only

TABLE Control Change Button

former_member221838
Participant
0 Likes
1,837

Hi Guys,

I need to add CHANGE button to my table control.

Right now in dialog program I am showing table control with line count = 100.

I need to provide CHANGE button through which table control will become read only as well as if user press that button again it will go into EDIT mode.

Please provide some suggestions.

-

Thanks and Regards,

Nikhil J.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,031

Hi,

Add two button in your Table Control

Assign a Function Code to it.

In user Command write code against the Function Code.

i.e,

Loop At Screen.

if change button is pressed.

Screen input =1.

if display button is pressed.

Screen input = 0.

Regards

Sandipan

5 REPLIES 5
Read only

Former Member
0 Likes
1,031

Hi,

Go through this program: DEMO_DYNPRO_TABCONT_LOOP_AT

Hope this helps.

Regards,

Deepthi.

Read only

Former Member
0 Likes
1,031

hi

pls go through the link below , which explains the step by step process to insert data from table control in to z table...

[]

hope the content is useful.

kindly close the thread if the issue iss resolved.

regards

R@sap

Read only

Former Member
0 Likes
1,032

Hi,

Add two button in your Table Control

Assign a Function Code to it.

In user Command write code against the Function Code.

i.e,

Loop At Screen.

if change button is pressed.

Screen input =1.

if display button is pressed.

Screen input = 0.

Regards

Sandipan

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,031

Hi Nikhil,

Take a PF-Status with two buttons, one for display with function code DISPLAY and other for editing with function code EDIT.

Take the group1 of fields as 'ABC', which needs to editable when user clicks EDIT button, and read-only when user click DISPLAY button.

When user clicks display, records are read-only and if user clicks edit button, then records can be edited.

At PBO include code:-


module modify_screen.
  case sy-ucomm.
    when 'EDIT'.
      set pf-status 'Z_PFSTAT' excluding 'EDIT'.
      if screen-group1 = 'ABC'.
        loop at screen.
          screen-input = 1. "to make the records as editable
          screen-active = 1.
        endloop.
        modify screen.
      endif.
    when 'DISPLAY'.
      set pf-status 'Z_PFSTAT' excluding 'DISPLAY'.
      if screen-group1 = 'ABC'.
        loop at screen.
          screen-input = 0. "to make fields read-only
          screen-active = 0.
        endloop.
        modify screen.
      endif.
  endcase.
endmodule.

Now when user click EDIT button the table control rows are in now editable mode and the button EDIT is excluded from the pf-status and display button is included.

On the other hand, when user clicks DISPLAY button, the records of table control are now in read-only mode and DISPLAY button is excluded and EDIT button is included in the pf-status.

This will work as per your requirement.

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Read only

former_member221838
Participant
0 Likes
1,031

Thanks Guys... Overwhelming response 

Edited by: Nikhil Jathar on Jan 23, 2009 7:16 AM