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

regarding subscreen

Former Member
0 Likes
298

hi,

i have to work on subscreen....i m new to dialogue programming...the scenario is like this on clicking a push button(after input) a screen will appear in the o/p screen which show some data..plz help me with codings....thnx in advance

1 ACCEPTED SOLUTION
Read only

former_member673464
Active Contributor
0 Likes
281

Hi Ravi,

Try this example code for your requirement .

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: number1(4) TYPE n VALUE '0110',

number2(4) TYPE n VALUE '0130',

field(10) TYPE c, field1(10) TYPE c, field2(10) TYPE c.

CALL SCREEN 100.

MODULE status_100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE fill_0110 OUTPUT.

field = 'Eingabe 1'(001).

ENDMODULE.

MODULE fill_0120 OUTPUT.

field = field1.

ENDMODULE.

MODULE fill_0130 OUTPUT.

field = 'Eingabe 2'(002).

ENDMODULE.

MODULE fill_0140 OUTPUT.

field = field2.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE save_ok INPUT.

save_ok = ok_code.

CLEAR ok_code.

ENDMODULE.

MODULE user_command_0110 INPUT.

IF save_ok = 'OK1'.

number1 = '0120'.

field1 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_0130 INPUT.

IF save_ok = 'OK2'.

number2 = '0140'.

field2 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_100 INPUT.

CASE save_ok.

WHEN 'SUB1'.

number1 = '0110'.

WHEN 'SUB2'.

number1 = '0120'.

CLEAR field1.

WHEN 'SUB3'.

number2 = '0130'.

WHEN 'SUB4'.

number2 = '0140'.

CLEAR field2.

ENDCASE.

ENDMODULE.

The screen flow logic for screen 100 is as follows:

PROCESS BEFORE OUTPUT.

MODULE status_100.

CALL SUBSCREEN: area1 INCLUDING sy-repid number1,

area2 INCLUDING sy-repid number2.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

MODULE save_ok.

CALL SUBSCREEN: area1,

area2.

MODULE user_command_100.

The screen flow logic of subscreen screens 110 and 130 is:

PROCESS BEFORE OUTPUT.

MODULE fill_0110|0130.

PROCESS AFTER INPUT.

MODULE user_command_0110|0130.

The screen flow logic of subscreen screens 120 and 140 is:

PROCESS BEFORE OUTPUT.

MODULE fill_0120|0150.

PROCESS AFTER INPUT.

When you run the program, a screen appears on which subscreens 110 and 130 are displayed. The pushbuttons on the main screen allow you to choose between two subscreen screens for each screen area. The pushbuttons on the subscreens allow you to transfer the data from subscreens 110 and 130 to subscreens 120 and 140.

Since the same field name FIELD is used on all subscreens, the identically-named ABAP field is transferred more than once in each PBO and PAI event of the main screen. For this reason, the values have to be stored in the auxiliary fields FIELD1 and FIELD2 in the ABAP program.

The pushbuttons on the subscreen screens have different function codes, and they are handled normally in an ABAP field. If the function codes had had the same names, it would again have been necessary to use auxiliary fields.

regards,

veeresh

1 REPLY 1
Read only

former_member673464
Active Contributor
0 Likes
282

Hi Ravi,

Try this example code for your requirement .

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: number1(4) TYPE n VALUE '0110',

number2(4) TYPE n VALUE '0130',

field(10) TYPE c, field1(10) TYPE c, field2(10) TYPE c.

CALL SCREEN 100.

MODULE status_100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE fill_0110 OUTPUT.

field = 'Eingabe 1'(001).

ENDMODULE.

MODULE fill_0120 OUTPUT.

field = field1.

ENDMODULE.

MODULE fill_0130 OUTPUT.

field = 'Eingabe 2'(002).

ENDMODULE.

MODULE fill_0140 OUTPUT.

field = field2.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE save_ok INPUT.

save_ok = ok_code.

CLEAR ok_code.

ENDMODULE.

MODULE user_command_0110 INPUT.

IF save_ok = 'OK1'.

number1 = '0120'.

field1 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_0130 INPUT.

IF save_ok = 'OK2'.

number2 = '0140'.

field2 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_100 INPUT.

CASE save_ok.

WHEN 'SUB1'.

number1 = '0110'.

WHEN 'SUB2'.

number1 = '0120'.

CLEAR field1.

WHEN 'SUB3'.

number2 = '0130'.

WHEN 'SUB4'.

number2 = '0140'.

CLEAR field2.

ENDCASE.

ENDMODULE.

The screen flow logic for screen 100 is as follows:

PROCESS BEFORE OUTPUT.

MODULE status_100.

CALL SUBSCREEN: area1 INCLUDING sy-repid number1,

area2 INCLUDING sy-repid number2.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

MODULE save_ok.

CALL SUBSCREEN: area1,

area2.

MODULE user_command_100.

The screen flow logic of subscreen screens 110 and 130 is:

PROCESS BEFORE OUTPUT.

MODULE fill_0110|0130.

PROCESS AFTER INPUT.

MODULE user_command_0110|0130.

The screen flow logic of subscreen screens 120 and 140 is:

PROCESS BEFORE OUTPUT.

MODULE fill_0120|0150.

PROCESS AFTER INPUT.

When you run the program, a screen appears on which subscreens 110 and 130 are displayed. The pushbuttons on the main screen allow you to choose between two subscreen screens for each screen area. The pushbuttons on the subscreens allow you to transfer the data from subscreens 110 and 130 to subscreens 120 and 140.

Since the same field name FIELD is used on all subscreens, the identically-named ABAP field is transferred more than once in each PBO and PAI event of the main screen. For this reason, the values have to be stored in the auxiliary fields FIELD1 and FIELD2 in the ABAP program.

The pushbuttons on the subscreen screens have different function codes, and they are handled normally in an ABAP field. If the function codes had had the same names, it would again have been necessary to use auxiliary fields.

regards,

veeresh