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 set user command in module pool program

Former Member
0 Kudos
3,554

hello expert,

like in report: PARAMETERS: RB_SING RADIOBUTTON GROUP RAD3 DEFAULT 'X' USER-COMMAND C1.

in module pool program, hw to set user-command in screen.

srinivas

3 REPLIES 3

Former Member
0 Kudos
583

PBO.

Call subscreen <SUBSCREEN NAME> Including sy-repid(PROGRAM NAME) G_DYNNR(SCREEN NUMBER'.

PAI

module user_command.

Call subscreen <subscreen name>

Module user_command.

case sy-ucomm.

when 'BUT1'.

g_dynnr = 200.

when 'BUT2'.

g_dynnr = 300.

Endcase.

end module

****************************************

REPORT demo_dynpro_tabstrip_server.

CONTROLS mytabstrip TYPE TABSTRIP.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA number TYPE sy-dynnr.

mytabstrip-activetab = 'PUSH2'.

number = '0120'.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE user_command INPUT.

save_ok = ok_code.

CLEAR ok_code.

IF save_ok = 'OK'.

MESSAGE i888(sabapdocu) WITH 'MYTABSTRIP-ACTIVETAB ='

mytabstrip-activetab.

ELSE.

mytabstrip-activetab = save_ok.

CASE save_ok.

WHEN 'PUSH1'.

number = '0110'.

WHEN 'PUSH2'.

number = '0120'.

WHEN 'PUSH3'.

number = '0130'.

ENDCASE.

ENDIF.

ENDMODULE.

  • flow logic of the screen 100

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

CALL SUBSCREEN SUB INCLUDING SY-REPID NUMBER.

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

CALL SUBSCREEN SUB.

MODULE USER_COMMAND.

  • flow logic of the screen 110

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

  • flow logic of the screen 120

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

  • flow logic of the screen 130

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

******************************************

REGARDS

VASU

Former Member
0 Kudos
583

Hi,

In module pool programs you can set the User Command's through screen painter.

In SE51 you can design the screen and you can set the user command's for Each and Every fields.

For Example, You design one Button "Save" in Screen painter, and Double click it. It displays the Attributes menu. Here you can Enter the Function Code for that [Example "Savebutton"].

Then in your program you should write code like this,

SAVE_OK = OK_CODE.
CLEAR OK_CODE.

CASE SAVE_OK.

WHEN 'savebutton'

.

Write your Code Here.

Endcase.

Thanks,

Reward If Helpful.

hymavathi_oruganti
Active Contributor
0 Kudos
583

in module pool, no need for the addition specifically.

in the screen layout, when u create a radiobutton, pushbutton they will automatically react for the user-command .

u can code in the pai.