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: 

We can execute module pool program from se38............it is possilble

Former Member
0 Kudos

Hi all,

In the morning I put a thread asking can we execute module pool program from se38? every one says no......... even i got convinced and close the thread but this is not true.

WE CAN EXECUTE MODULE POOL WITH SE 38 ...........IT IS REALLY POSSIBLE.

just go to se 38 and give your program name and exceute it directly with out displaying it you can execute it.. but make sure your program must attch with a Tcode.

Try this .....................and please send your comments

regards,

Ruchika saini

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

u can execute modulepool programing in SE38..

1. go to SHDB transaction code and then call new recording using module pool transaction code.

2. transfer that recording into report.

3. write a code as per ur requirement and then

4.call transaction code .

in this below code i created a transaction code.

ZSAMPLE and written module pool programing.i am calling inside the report itself.u can execute this program in SE38

check this example may help u.

report ZMMTEST

no standard page heading line-size 255.

include bdcrecx1.

tables : zemployee,zdepartment.

type-pools : slis , icon.

data : d_fieldcat type slis_t_fieldcat_alv,

d_fieldcat_wa type slis_fieldcat_alv.

data : begin of itab_emp occurs 0,

empid like zemployee-empid,

empname like zemployee-empname,

empaddress like zemployee-empaddress,

detid like zemployee-detid,

end of itab_emp.

data : begin of itab_dept occurs 0,

detid like zdepartment-detid,

deptname like zdepartment-deptname,

designation like zdepartment-designation,

end of itab_dept.

data : begin of itab_final occurs 0,

empid like zemployee-empid,

empname like zemployee-empname,

empaddress like zemployee-empaddress,

detid like zemployee-detid,

deptname like zdepartment-deptname,

designation like zdepartment-designation,

end of itab_final.

data : itab_bdcdata like bdcdata occurs 0 with header line,

msgtab like bdcmsgcoll occurs 0 with header line,

v_mode(1) type c value 'N',

v_update(1) type c value 'A',

zz_msg(100) type c.

data : begin of errortab occurs 0,

empid like zemployee-empid,

text(100) type c,

end of errortab.

selection-screen : begin of block blk1 with frame title text-001.

select-options : s_detid for zdepartment-detid.

selection-screen : end of block blk1.

start-of-selection.

select empid empname empaddress detid from zemployee into corresponding fields of table itab_emp where detid in s_detid.

if not itab_emp[] is initial.

select detid deptname designation from zdepartment into corresponding fields of table itab_dept

for all entries in itab_emp

where detid = itab_emp-detid.

endif.

end-of-selection.

loop at itab_emp.

itab_final-empid = itab_emp-empid.

itab_final-empname = itab_emp-empname.

itab_final-empaddress = itab_emp-empaddress.

itab_final-detid = itab_emp-detid.

append itab_final.

clear itab_final.

endloop.

loop at itab_final.

read table itab_dept with key detid = itab_final-detid.

if sy-subrc = 0.

itab_final-deptname = itab_dept-deptname.

itab_final-designation = itab_dept-designation.

modify itab_final transporting deptname designation.

endif.

endloop.

d_fieldcat_wa-fieldname = 'EMPID'.

d_fieldcat_wa-seltext_l = 'Employee Id'.

d_fieldcat_wa-col_pos = 1.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'EMPNAME'.

d_fieldcat_wa-seltext_l = 'Employee Name'.

d_fieldcat_wa-col_pos = 2.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'EMPADDRESS'.

d_fieldcat_wa-seltext_l = 'Employee Address'.

d_fieldcat_wa-col_pos = 3.

d_fieldcat_wa-edit = 'X'.

d_fieldcat_wa-input = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'DETID'.

d_fieldcat_wa-seltext_l = 'Department Id'.

d_fieldcat_wa-col_pos = 4.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'DEPTNAME'.

d_fieldcat_wa-seltext_l = 'Department Name'.

d_fieldcat_wa-col_pos = 5.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'DESIGNATION'.

d_fieldcat_wa-seltext_l = 'Designation'.

d_fieldcat_wa-col_pos = 6.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

data : gd_repid like sy-repid.

gd_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = gd_repid

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = d_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = itab_final

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

perform bdc_emp.

*if not errortab[] is initial.

*

*perform bdc_error.

*

*clear errortab.

*refresh errortab.

*

form set_pf_status using rt_extab type slis_t_extab.

set pf-status 'NEWSTATUS'.

endform.

&----


*& Form bdc_emp

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM bdc_emp .

loop at itab_final.

perform bdc_dynpro using 'ZSAMPLE' '9000'.

perform bdc_field using 'BDC_CURSOR'

'ZDEPARTMENT-DETID'.

perform bdc_field using 'BDC_OKCODE'

'=BUT1'.

perform bdc_field using 'ZDEPARTMENT-DETID'

'D1'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_OKCODE'

'=&F03'.

perform bdc_dynpro using 'ZSAMPLE' '9000'.

perform bdc_field using 'BDC_CURSOR'

'ZDEPARTMENT-DETID'.

perform bdc_field using 'BDC_OKCODE'

'=BUT2'.

perform bdc_field using 'ZDEPARTMENT-DETID'

'D1'.

*perform bdc_transaction using 'ZSAMPLE'.

call transaction 'ZSAMPLE' using itab_bdcdata

mode v_mode

update v_update

messages into msgtab.

clear itab_bdcdata.

refresh itab_bdcdata.

endloop.

ENDFORM. " bdc_emp

Reward with points if helpful.

11 REPLIES 11

former_member181962
Active Contributor
0 Kudos

I still maintain , it is not possible.

If the program is defined as type Modulepool, then you can't RUN it using se38.

For example , SAPBAL10 is a type M program, which is attached to the tcode BA10.

Run it in se38. YOu will see se93 transaction.. but not BA10 transaction.

Regards,

Ravi

0 Kudos

Hi,

Yes you are absolutely right. Do you know the reason why it is happening?

In some programs we can execute but in your case executing will take us to se 93. what is the reason??????????

regards,

Ruchika saini

Former Member
0 Kudos

I think you have given your program type as executable so only you are able to exectute through se38.

If it is module pool type it is not possible to execute it without a transaction.

Reward if helful.

0 Kudos

No, I am executing program typr M only..........

but i am deirectly executing without displaying the program. and i m able to do that.

regards,

Ruchika saini

Former Member
0 Kudos

Hi Ruchika ,

I tried it on one of my systems and it gave a message

SAPBAL10 is not a report program (type 'M')

hence i was not able to execute the program , could you please tell the version on which you are working.

Regards

Arun

0 Kudos

hi arun,

try to execute with out displaying..............

No, I am executing program typr M only..........

but i am directly executing without displaying the program. and i m able to do that.

regards,

Ruchika saini

0 Kudos

hi arun,

i am using 4.7 e.

regards,

ruchika

Former Member
0 Kudos

hi,

u can execute modulepool programing in SE38..

1. go to SHDB transaction code and then call new recording using module pool transaction code.

2. transfer that recording into report.

3. write a code as per ur requirement and then

4.call transaction code .

in this below code i created a transaction code.

ZSAMPLE and written module pool programing.i am calling inside the report itself.u can execute this program in SE38

check this example may help u.

report ZMMTEST

no standard page heading line-size 255.

include bdcrecx1.

tables : zemployee,zdepartment.

type-pools : slis , icon.

data : d_fieldcat type slis_t_fieldcat_alv,

d_fieldcat_wa type slis_fieldcat_alv.

data : begin of itab_emp occurs 0,

empid like zemployee-empid,

empname like zemployee-empname,

empaddress like zemployee-empaddress,

detid like zemployee-detid,

end of itab_emp.

data : begin of itab_dept occurs 0,

detid like zdepartment-detid,

deptname like zdepartment-deptname,

designation like zdepartment-designation,

end of itab_dept.

data : begin of itab_final occurs 0,

empid like zemployee-empid,

empname like zemployee-empname,

empaddress like zemployee-empaddress,

detid like zemployee-detid,

deptname like zdepartment-deptname,

designation like zdepartment-designation,

end of itab_final.

data : itab_bdcdata like bdcdata occurs 0 with header line,

msgtab like bdcmsgcoll occurs 0 with header line,

v_mode(1) type c value 'N',

v_update(1) type c value 'A',

zz_msg(100) type c.

data : begin of errortab occurs 0,

empid like zemployee-empid,

text(100) type c,

end of errortab.

selection-screen : begin of block blk1 with frame title text-001.

select-options : s_detid for zdepartment-detid.

selection-screen : end of block blk1.

start-of-selection.

select empid empname empaddress detid from zemployee into corresponding fields of table itab_emp where detid in s_detid.

if not itab_emp[] is initial.

select detid deptname designation from zdepartment into corresponding fields of table itab_dept

for all entries in itab_emp

where detid = itab_emp-detid.

endif.

end-of-selection.

loop at itab_emp.

itab_final-empid = itab_emp-empid.

itab_final-empname = itab_emp-empname.

itab_final-empaddress = itab_emp-empaddress.

itab_final-detid = itab_emp-detid.

append itab_final.

clear itab_final.

endloop.

loop at itab_final.

read table itab_dept with key detid = itab_final-detid.

if sy-subrc = 0.

itab_final-deptname = itab_dept-deptname.

itab_final-designation = itab_dept-designation.

modify itab_final transporting deptname designation.

endif.

endloop.

d_fieldcat_wa-fieldname = 'EMPID'.

d_fieldcat_wa-seltext_l = 'Employee Id'.

d_fieldcat_wa-col_pos = 1.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'EMPNAME'.

d_fieldcat_wa-seltext_l = 'Employee Name'.

d_fieldcat_wa-col_pos = 2.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'EMPADDRESS'.

d_fieldcat_wa-seltext_l = 'Employee Address'.

d_fieldcat_wa-col_pos = 3.

d_fieldcat_wa-edit = 'X'.

d_fieldcat_wa-input = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'DETID'.

d_fieldcat_wa-seltext_l = 'Department Id'.

d_fieldcat_wa-col_pos = 4.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'DEPTNAME'.

d_fieldcat_wa-seltext_l = 'Department Name'.

d_fieldcat_wa-col_pos = 5.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

d_fieldcat_wa-fieldname = 'DESIGNATION'.

d_fieldcat_wa-seltext_l = 'Designation'.

d_fieldcat_wa-col_pos = 6.

d_fieldcat_wa-edit = 'X'.

append d_fieldcat_wa to d_fieldcat.

clear d_fieldcat_wa.

data : gd_repid like sy-repid.

gd_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = gd_repid

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME =

  • IS_LAYOUT =

IT_FIELDCAT = d_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = itab_final

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

perform bdc_emp.

*if not errortab[] is initial.

*

*perform bdc_error.

*

*clear errortab.

*refresh errortab.

*

form set_pf_status using rt_extab type slis_t_extab.

set pf-status 'NEWSTATUS'.

endform.

&----


*& Form bdc_emp

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM bdc_emp .

loop at itab_final.

perform bdc_dynpro using 'ZSAMPLE' '9000'.

perform bdc_field using 'BDC_CURSOR'

'ZDEPARTMENT-DETID'.

perform bdc_field using 'BDC_OKCODE'

'=BUT1'.

perform bdc_field using 'ZDEPARTMENT-DETID'

'D1'.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_OKCODE'

'=&F03'.

perform bdc_dynpro using 'ZSAMPLE' '9000'.

perform bdc_field using 'BDC_CURSOR'

'ZDEPARTMENT-DETID'.

perform bdc_field using 'BDC_OKCODE'

'=BUT2'.

perform bdc_field using 'ZDEPARTMENT-DETID'

'D1'.

*perform bdc_transaction using 'ZSAMPLE'.

call transaction 'ZSAMPLE' using itab_bdcdata

mode v_mode

update v_update

messages into msgtab.

clear itab_bdcdata.

refresh itab_bdcdata.

endloop.

ENDFORM. " bdc_emp

Reward with points if helpful.

Former Member
0 Kudos

Plz can any one explain all these confusin.........

regards,

ruchika

0 Kudos

Hi Ruchika,

You are correct. Module pool program can be executed from se38. But few people couldnt able to execute. Reason is

Atleast one 'GUI support' must be maintained in se93 for the T-code.

I have tested this in ECC 6.0. it works fine

Hope the confussion is over.

With Wishes

Jai

0 Kudos

Hi jai,

Thanks for the reply,

can you plz tell me how to check 'GUI support' in se93 for the T-code.

regards,

Ruchika