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

OPEN PROGRAM

Former Member
0 Likes
1,228

Hi all

I have a requirement such that once i double clic on the output it should skip the first screen and go n open the program directly from SE38.I know how to take it to SE38 but from there how to pass on the program name.Please help.

REPORT ZPRE_6.

TABLES:BSEG.

DATA:ITAB LIKE STANDARD TABLE OF BSEG WITH HEADER LINE.

PARAMETERS:p_WERKS TYPE BSEG-WERKS.

Select * From bseg into corresponding fields of table itab up to 10 rows where werks = p_werks .

Loop at itab.

Write:/ itab-werks,itab-wrbtr.

endloop.

AT LINE-SELECTION.

Call transaction 'SE38' and skip first screen.

SET PARAMETER ID 'ZPRE_6.

END-OF-SELECTION.

With Regards

Vijay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,153

Hi,

Check the sample code which resolves your problem.

code

report zrich_0001.

Global ALV Data Declarations

type-pools: slis.

Internal Tables

data: begin of itab occurs 0,

matnr type mara-matnr,

maktx type makt-maktx,

end of itab.

start-of-selection.

perform get_data.

perform call_alv.

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

Form GET_DATA

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

form get_data.

select maramatnr maktmaktx

into corresponding fields of table itab

from mara

inner join makt

on maramatnr = maktmatnr

up to 20 rows.

endform.

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

CALL_ALV

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

form call_alv.

data: ifc type slis_t_fieldcat_alv.

data: xfc type slis_fieldcat_alv.

data: repid type sy-repid.

repid = sy-repid.

clear xfc. refresh ifc.

clear xfc.

xfc-reptext_ddic = 'Material Number'.

xfc-fieldname = 'MATNR'.

xfc-tabname = 'ITAB'.

xfc-outputlen = '18'.

append xfc to ifc.

clear xfc.

xfc-reptext_ddic = 'Material Description'.

xfc-fieldname = 'MAKTX'.

xfc-tabname = 'ITAB'.

xfc-outputlen = '40'.

append xfc to ifc.

Call ABAP List Viewer (ALV)

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = repid

i_callback_user_command = 'HANDLE_USER_COMMAND'

it_fieldcat = ifc

tables

t_outtab = itab.

endform.

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

FORM handle_User_Command *

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

form handle_user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

case rs_selfield-FIELDNAME.

when 'MATNR'.

set parameter id 'MAT' field rs_selfield-value.

call transaction 'MD04' and skip first screen.

endcase.

endcase.

endform.

[/code]

Regards,

Raj.

8 REPLIES 8
Read only

Former Member
0 Likes
1,153

Hi,

Use HIDE statement that holds the data to be displayed in the secondary list.

See example program: demo_list_hide in SE38

Regards

Kiran Sure

Read only

prasanth_kasturi
Active Contributor
0 Likes
1,153

hi,

use the below

in tables add the table RS38M

change the statement as

SET PARAMETER ID 'RID' FIELD RS38M-PROGRAM.

and in RS38M-PROGRAM pass your program name

if your prog name is 'ZPRE_6'.

TABLES:BSEG,rs38m

.

DATA:ITAB LIKE STANDARD TABLE OF BSEG WITH HEADER LINE.

PARAMETERS:p_WERKS TYPE BSEG-WERKS.

Select * From bseg into corresponding fields of table itab up to 10 rows where werks = p_werks .

Loop at itab.

Write:/ itab-werks,itab-wrbtr.

endloop.

AT LINE-SELECTION.

rs38m-program = 'ZPRE_6'.

Call transaction 'SE38' and skip first screen.

SET PARAMETER ID 'RID' field rs38m-program.

END-OF-SELECTION.

regards

prasanth

Read only

0 Likes
1,153

Hi

It is just displaying the program name...but its not opening...please help.

Vijay

Read only

Former Member
0 Likes
1,154

Hi,

Check the sample code which resolves your problem.

code

report zrich_0001.

Global ALV Data Declarations

type-pools: slis.

Internal Tables

data: begin of itab occurs 0,

matnr type mara-matnr,

maktx type makt-maktx,

end of itab.

start-of-selection.

perform get_data.

perform call_alv.

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

Form GET_DATA

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

form get_data.

select maramatnr maktmaktx

into corresponding fields of table itab

from mara

inner join makt

on maramatnr = maktmatnr

up to 20 rows.

endform.

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

CALL_ALV

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

form call_alv.

data: ifc type slis_t_fieldcat_alv.

data: xfc type slis_fieldcat_alv.

data: repid type sy-repid.

repid = sy-repid.

clear xfc. refresh ifc.

clear xfc.

xfc-reptext_ddic = 'Material Number'.

xfc-fieldname = 'MATNR'.

xfc-tabname = 'ITAB'.

xfc-outputlen = '18'.

append xfc to ifc.

clear xfc.

xfc-reptext_ddic = 'Material Description'.

xfc-fieldname = 'MAKTX'.

xfc-tabname = 'ITAB'.

xfc-outputlen = '40'.

append xfc to ifc.

Call ABAP List Viewer (ALV)

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = repid

i_callback_user_command = 'HANDLE_USER_COMMAND'

it_fieldcat = ifc

tables

t_outtab = itab.

endform.

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

FORM handle_User_Command *

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

form handle_user_command using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'.

case rs_selfield-FIELDNAME.

when 'MATNR'.

set parameter id 'MAT' field rs_selfield-value.

call transaction 'MD04' and skip first screen.

endcase.

endcase.

endform.

[/code]

Regards,

Raj.

Read only

prasanth_kasturi
Active Contributor
0 Likes
1,153

hi,

you cant open the prog becuse ther are many options from the initial screen itself like activting , executing,display, change and system doesnot know which operation you want. so it stops at the initial screen

hope you understand

prasanth

Read only

0 Likes
1,153

Hi prashant.,..

Thankx for d reply....we can open the program...just look at d program beloww..Thank u once again

REPORT ZPRE_6.

TABLES:BSEG.

TABLES:RS38m.

*DATA:PGM TYPE RS38m-PROGRAMM.

*PGM = 'ZPRE_5'.

DATA:ITAB LIKE STANDARD TABLE OF BSEG WITH HEADER LINE.

PARAMETERS:p_WERKS TYPE BSEG-WERKS.

Select * From bseg into corresponding fields of table itab up to 10 rows where werks = p_werks .

*sort itab by wrbtr.

Loop at itab.

Write:/ itab-werks,itab-wrbtr.

endloop.

AT LINE-SELECTION.

*SET PARAMETER ID 'ZPRE_6.

*Move PGM to RS38M-PROGRAMM.

rs38m-programm = 'ZPRE_6'.

*SET PARAMETER ID 'RID' FIELD RS38M-PROGRAMM.

SET PARAMETER ID 'RID' FIELD 'ZPRE_6'.

Call transaction 'SE38' and skip first screen.

END-OF-SELECTION.

Vijay

Read only

0 Likes
1,153

hi,

I am into the initial screen only

and i am not able to see the code....

I have seen the code in ABAP GENERAL.... thats working fine.....

thanq for the good question you have posted......

regards

prasanth

Read only

0 Likes
1,153

Hi prashant...

Sorry posted the wrong code...here is the correct code

REPORT ZPRE_8.

*REPORT z75694.

WRITE 'Test'.

DATA: bdcdata TYPE TABLE OF bdcdata,

wa TYPE bdcdata.

AT LINE-SELECTION.

CLEAR wa.

wa-program = 'SAPLWBABAP'.

wa-dynpro = '0100'.

wa-dynbegin = 'X'.

APPEND wa TO bdcdata.

CLEAR wa.

wa-fnam = 'BDC_OKCODE'.

wa-fval = '=SHOP'.

APPEND wa TO bdcdata.

CLEAR wa.

wa-fnam = 'RS38M-PROGRAMM'.

wa-fval = 'ZPRE_5'.

APPEND wa TO bdcdata.

CALL TRANSACTION 'SE38' USING bdcdata MODE 'E'.

Vijay