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: 

On click of Button

Former Member
0 Kudos

Hello Experts,

I have develop one sreen , in which i want once the user click on save button, entries get disable and save button also,

and edit button in appliaction toolbar get enable.

Plz suggest,

Aastha

8 REPLIES 8

Former Member
0 Kudos

Hi.

Have You ever heard the concept of Screen table? Using this concept you can achieve your desired functionality.

Regards,

D.Kiran Kumar

I355602
Advisor
Advisor
0 Kudos

Hi,

Refer:-

Take the group for all the screen fields as ABC using their respective properties when you double click the controls on screen.

Declare this as global parameter:


  DATA v_save TYPE c. "<--to identify whether SAVE button is clicked or not

Use this code in PAI when user clicks SAVE button.

In PAI:-


METHOD user_command_8001.

  DATA v_ucomm TYPE sy-ucomm.

  CLEAR v_save.
  v_ucomm = sy-ucomm.

  CASE v_ucomm.
    WHEN ' SAVE'.
      v_save = 'X'.
      "rest your code as per your requirement
  ENDCASE.
ENDMETHOD.

In PBO use code:-


METHOD status_8001.

  IF v_save = 'X'.
    LOOP AT SCREEN.
      IF screen-group = 'ABC'.
        screen-input = 0.
        screen-active = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group = 'ABC'.
        screen-input = 1.
        screen-active = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

ENDMETHOD.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

Hello Tarun,

i declared groups ABC 'in screen editor,

and code as suggested by u.

But it is throwing an error

The data object "SCREEN" does not have a component called "GROUP".

Plz suggest

Regards,

Aastha

Former Member
0 Kudos

Hi,

IT is GROUP1

Just check the 'SCREEN' structure in se11or in debugging mode

regards

padma

Former Member
0 Kudos

data : begin of gt_extab occurs 0,

fcode like rsmpe-func,

end of gt_extab.

CASE SY-UCOMM.

when 'SAVE'.

REFRESH GT_EXTAB.

MOVE 'SAVE' TO GT_EXTAB-FCODE.

APPEND GT_EXTAB.

CLEAR GT_EXTAB.

SET PF-STATUS 'STATUS' EXCLUDING GT_EXTAB.

ENDCASE.

0 Kudos

Hello Experts,

Can u tell what the following line do??

SET PF-STATUS 'STATUS' EXCLUDING GT_EXTAB.

My requirement is to disable SAVE button on Standard toolbar on click of save button.

Regards,

Aastha

0 Kudos

Hi ,

the excluding addition means you can deactivate the function of the GUI status.

this will help you to deactivate the function code and cannot be used.

Regards

Nilesh.

Former Member
0 Kudos

Hi ,

you can use Tarun code it seem to correct only thing is

screen-group1= 'ABC' .

Try it will work fine.

Regards

Nilesh