Professional Documents
Culture Documents
PROGRAM73:
INCLUDE PROGRAM:
*&--------------------------------------------------------------------*
*& Include Z5PMTOP
Module
poo*
*&
*
*&--------------------------------------------------------------------*
program z5pmprog73
.
data : x type i,
io1 type i,
io2 type i,
io3 type i.
module user_command_1000 input.
case sy-ucomm.
when 'F2'.
leave program.
when 'F1'.
x = 12.
endmodule.
SCREEN100:
LAYOUT:
" STATUS_1000
OUTPUT
INPUT
TRANSACTION CODE:
PROGRAM74:
*&--------------------------------------------------------------------*
*& Module pool
Z530PMPROG74
*
*&
*
*&--------------------------------------------------------------------*
*&
*
*&
*
*&--------------------------------------------------------------------*
PROGRAM Z530PMPROG74
data : io1 type i,
io2 type i,
io3 type i.
MODULE USER_COMMAND_0100 INPUT.
case sy-ucomm.
when 'P1'.
io3 = io1 + io2.
when 'P2'.
leave program.
endcase.
ENDMODULE.
" USER_COMMAND_0100
INPUT
PROGRAM75:
*&--------------------------------------------------------------------*
*& Report Z530PMPROG75
*
*&
*
*&--------------------------------------------------------------------*
*&
*
*&
*
*&--------------------------------------------------------------------*
REPORT
Z530PMPROG75
write :/ 'hello'.
include z530pminc.
x = 10.
y = 20.
z = x + y.
write z.
Z530PMINC:
*&--------------------------------------------------------------------*
*& Include
Z530PMINC
*
*&--------------------------------------------------------------------*
data : x type i,
y type i,
z type i.
PROGRAM76:
*&--------------------------------------------------------------------*
*& Report Z530PMPROG76
*
*&
*
*&--------------------------------------------------------------------*
*&
*
*&
*
*&--------------------------------------------------------------------*
REPORT
Z530PMPROG76
perform abc.
include z530pminc1.
Z530PMINC1:
*&--------------------------------------------------------------------*
*& Include
Z530PMINC1
*
*&--------------------------------------------------------------------*
form abc.
write :/ 'inside abc'.
endform.
PROGRAM77:
*&--------------------------------------------------------------------*
*& Report Z530PMPROG77
*
*&
*
*&--------------------------------------------------------------------*
*&
*
*&
*
*&--------------------------------------------------------------------*
REPORT
Z530PMPROG77
include z530pminc1.
include z530pminc.
start-of-selection.
x = 20.
PERFOrm abc.
Z530PMINC1:
*&--------------------------------------------------------------------*
*& Include
Z530PMINC1
*
*&--------------------------------------------------------------------*
form abc.
write :/ 'inside abc'.
endform.
Z530PMINC:
*&--------------------------------------------------------------------*
*& Include
Z530PMINC
*
*&--------------------------------------------------------------------*
data : x type i,
y type i,
z type i.
PROGRAM78:
INCLUDE PROGRAM:
*&--------------------------------------------------------------------*
*& Include Z5PM78TOP
Module
poo*
*&
*
*&--------------------------------------------------------------------*
program z5pmprog78
.
tables kna1.
types : begin of ty_kna1.
include structure kna1.
*
kunnr type kna1-kunnr,
*
land1 type kna1-land1,
*
name1 type kna1-name1,
types : end of ty_kna1.
data : ls_kna1 type ty_kna1.
module user_command_1300 input.
case sy-ucomm.
when 'F2'.
leave program.
when 'F1'.
ls_kna1-kunnr = kna1-kunnr.
ls_kna1-land1 = kna1-land1.
ls_kna1-name1 = kna1-name1.
insert kna1 from ls_kna1.
if sy-subrc eq 0.
message 'record inserted' type 'I'.
else.
message 'record not inserted' type 'I'.
endif.
endcase.
endmodule.
module abc input.
case sy-ucomm.
when 'F3'.
leave program.
endcase.
" USER_COMMAND_1300
INPUT
endmodule.
" abc INPUT
module ghi input.
select single * from kna1 into kna1
where land1 = kna1-land1.
if sy-subrc ne 0.
message 'Please choose other country' type 'E'.
endif.
endmodule.
" ghi
SCREEN1300:
INPUT
LAYOUT:
TRANSACTION CODE:
PROGRAM79:
REPORT
Z530PMPROG79
define abc.
&3 = &1 + &2.
&4 = &1 - &2.
end-of-definition.
data : r1 type i,r2 type i.
abc 20 10 r1 r2.
write :/ 'sum is ',r1,
/ 'difference is ',r2.
abc 60 40 r1 r2.
write :/ 'sum is ',r1,
/ 'difference is ',r2.
*
*
*
*
PROGRAM80:
REPORT
Z530PMPROG80
Z530FM1(SE37):
IMPORT:
EXPORT:
SOURCE CODE:
function z530fm1.
*"--------------------------------------------------------------------*"*"Local interface:
*" IMPORTING
*"
REFERENCE(I_X) TYPE I
*"
REFERENCE(I_Y) TYPE I
*" EXPORTING
*"
REFERENCE(E_Z) TYPE I
*"
REFERENCE(E_M) TYPE I
*"--------------------------------------------------------------------e_z = i_x + i_y.
e_m = i_x - i_y.
endfunction.
PROGRAM81:
INCLUDE PROGRAM:
*&--------------------------------------------------------------------*
*& Include Z81TOP
Module
poo*
*&
*
*&--------------------------------------------------------------------*
program z530pmprog81
.
type-pools vrm.
data flag type i.
data io1(3) type c.
data : lt_values type vrm_values,
*
standard table of vrm_value,
ls_values like line of lt_values.
module user_command_0100 input.
case sy-ucomm.
when 'P1'.
leave program.
when 'P2'.
if io1 = 'K1'.
flag = 2.
elseif io1 = 'K2'.
flag = 3.
endif.
endcase.
endmodule.
" USER_COMMAND_0100
OUTPUT
form preparevalues .
clear ls_values.
ls_values-key = 'K1'.
ls_values-text = 'KNA1'.
append ls_values to lt_values.
clear ls_values.
ls_values-key = 'K2'.
ls_values-text = 'MARA'.
append ls_values to lt_values.
clear ls_values.
ls_values-key = 'K3'.
ls_values-text = 'VBAK'.
append ls_values to lt_values.
call function 'VRM_SET_VALUES'
exporting
id
= 'IO1'
values
= lt_values[].
endform.
" preparevalues
form customer_visible .
loop at screen.
if screen-group1 = 'G1'.
screen-invisible = '0'.
screen-input = '1'.
modify screen.
endif.
INPUT
if screen-group2 = 'G2'.
screen-invisible = '1'.
screen-input = '0'.
modify screen.
endif.
endloop.
endform.
" customer_visible
form material_visible .
loop at screen.
if screen-group1 = 'G1'.
screen-invisible = '1'.
screen-input = '0'.
modify screen.
endif.
if screen-group2 = 'G2'.
screen-invisible = '0'.
screen-input = '1'.
modify screen.
endif.
endloop.
endform.
" material_visible
SCREEN100:
process
module
*
process
module
before output.
status_0100.
after input.
user_command_0100.
LAYOUT:
TRANSACTION CODE:
PROGRAM82:
INCLUDE PROGRAM:
*&--------------------------------------------------------------------*
*& Include Z82TOP
Module
poo*
*&
*
*&--------------------------------------------------------------------*
program
.
z530pmprog82
SCREEN100:
" USER_COMMAND_0100
LAYOUT:
INPUT
SCREEN200:
LAYOUT:
SCREEN300:
LAYOUT:
TRANSACTION CODE:
PROGRAM83:
INCLUDE PROGRAM:
*&--------------------------------------------------------------------*
*& Include Z83TOP
Module
poo*
*&
*
*&--------------------------------------------------------------------*
program
.
z530pmprog83
tables kna1.
controls tbctrl type tableview
using screen 100.
types : begin of ty_kna1,
kunnr type kna1-kunnr,
name1 type kna1-name1,
name2 type kna1-name2,
end of ty_kna1.
data : lt_kna1 type standard table of ty_kna1,
ls_kna1 type ty_kna1.
module user_command_0100 input.
case sy-ucomm.
when 'P2'.
leave program.
when 'P1'.
if kna1-land1 is not initial.
perform getcustomers.
else.
message 'Please enter country' type 'I'.
endif.
endcase.
endmodule.
" USER_COMMAND_0100 INPUT
form getcustomers .
select kunnr name1 name2
from kna1
into table lt_kna1
where land1 = kna1-land1.
if sy-subrc eq 0.
describe table lt_kna1.
tbctrl-lines = sy-tfill.
endif.
endform.
" getcustomers
*&--------------------------------------------------------------------*
*&
Module STATUS_0100 OUTPUT
*&--------------------------------------------------------------------*
*
text
*---------------------------------------------------------------------*
module status_0100 output.
kna1-kunnr = ls_kna1-kunnr.
kna1-name1 = ls_kna1-name1.
kna1-name2 = ls_kna1-name2.
endmodule.
" STATUS_0100 OUTPUT
*&--------------------------------------------------------------------*
*&
Module xyz INPUT
*&--------------------------------------------------------------------*
*
text
*---------------------------------------------------------------------*
module xyz input.
call function 'POPUP_TO_INFORM'
exporting
titel
= 'Custom f1 help'
txt1
= 'KNA1 TABLE'
txt2
= 'CUSTOMER NO'.
endmodule.
" xyz INPUT
module pqr input.
call function 'POPUP_TO_INFORM'
exporting
titel = 'Custom F1 help'
txt1
= 'Button'
txt2
= 'Retrieve Customers'.
endmodule.
" pqr
INPUT
SCRENN100:
LAYOUT:
TRANSACTION CODE:
PROGRAM84:
PROGRAM85:
report
z530pmprog85
exporting
filename
filetype
tables
data_tab
= 'c:\customer.txt'
= 'ASC'
= lt_legacy[].
SE80:
Z530PROG85_CALL:
INCLUDE PROGRAM:
*&--------------------------------------------------------------------*
*& Include Z85CALLTOP
Module
poo*
*&
*
*&--------------------------------------------------------------------*
program z530prog85_call
.
tables kna1.
module user_command_0100 input.
case sy-ucomm.
when 'P1'.
insert kna1.
if sy-subrc eq 0.
message 'Inserted' type 'I'.
else.
message 'Not inserted' type 'I'.
endif.
when 'P2'.
leave program.
endcase.
endmodule.
" USER_COMMAND_0100
INPUT
" abc
SCREEN100:
process before output.
* MODULE STATUS_0100.
*
process after input.
module user_command_0100.
module abc at exit-command.
LAYOUT:
TRANSACTION CODE:
INPUT
PROGRAM86:
REPORT
Z530PMPROG86.
ls_bdcdata-program = prgname.
ls_bdcdata-dynpro = scrno.
ls_bdcdata-dynbegin = 'X'.
append ls_bdcdata to lt_bdcdata.
endform.
form fldinfo using fname fvalue.
clear ls_bdcdata.
ls_bdcdata-fnam = fname.
ls_bdcdata-fval = fvalue.
append ls_bdcdata to lt_bdcdata.
endform.
SE80:
Z530PROG85_CALL:
INCLUDE PROGRAM:
*&--------------------------------------------------------------------*
*& Include Z85CALLTOP
Module
poo*
*&
*
*&--------------------------------------------------------------------*
program z530prog85_call
.
tables kna1.
SCREEN100:
" abc
LAYOUT:
INPUT
INPUT
TRANSACTION CODE: