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

interactive report question

Former Member
0 Likes
683

hi,

there is a requirement in interactive reporting that in secondary screen, there are few fields . material number ,inventory management field, etc.

when i click Material number it should go to MM02 and when i click inventory management field it should go to inventory management transaction .

how to code this plz answer , thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
651

Hi..,

this is my program ,, which can fulfill your requirement.. just change the field names...and transaction names..

"----


  • AT USER-COMMAND EVENT

"----


at user-command.

if sy-lsind le 1.

case sy-ucomm.

when 'ORDER'.

perform order_info.

when 'CUSTOMER'.

perform customer_info.

endcase. " Case sy-ucomm.

endif.

&----


*& Form order_info

&----


  • This subroutine calls the transaction VA03 Order details

----


  • There are no interface parameters to be passed to this *subroutine. *

----


form order_info.

data lw_field(20) type c.

<b> get cursor field lw_field.</b>

if lw_field eq 'WA_CUSTOMER-VBELN'.

if lw_field is not initial.

set parameter ID 'AUN' field wa_customer-vbeln.

call transaction 'VA03'.

else.

message text-015 type 'E'.

endif. " if lw_field is not initial.

else.

message 'Place cursor on a sales order number'(017) type 'E'.

endif. " if lw_field eq...

clear:

wa_customer, lw_field.

endform. " Order_info

&----


*& Form customer_info

&----


*This subroutine calls the transaction XD03 customer ----


  • There are no interface parameters to be passed to this *subroutine. *

----


form customer_info.

data lw_field(20) type c.

<b> get cursor field lw_field.</b>

if lw_field eq 'WA_CUSTOMER-KUNNR'.

if lw_field is not initial.

set parameter ID 'KUN' field wa_customer-kunnr.

call transaction 'XD03'.

else.

message text-015 type 'E'.

endif. " if lw_field is not initial.

else.

message 'Place cursor on a customer number'(016) type 'E'.

endif. " if lw_field eq...

clear:

wa_customer, lw_field.

endform.

plz do remember to close the thread when ur problem is solved !!!

<b>reward if it helps u..

sai ramesh</b>

5 REPLIES 5
Read only

Former Member
0 Likes
651

AT USER-COMMAND.

SET PARAMETER ID 'MAT' FIELD MARA-MATNR.

CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.

Same way call the INVENTORY MGMT TRANSACTION.

REGARDS,

HIMANSHU

Read only

Former Member
0 Likes
652

Hi..,

this is my program ,, which can fulfill your requirement.. just change the field names...and transaction names..

"----


  • AT USER-COMMAND EVENT

"----


at user-command.

if sy-lsind le 1.

case sy-ucomm.

when 'ORDER'.

perform order_info.

when 'CUSTOMER'.

perform customer_info.

endcase. " Case sy-ucomm.

endif.

&----


*& Form order_info

&----


  • This subroutine calls the transaction VA03 Order details

----


  • There are no interface parameters to be passed to this *subroutine. *

----


form order_info.

data lw_field(20) type c.

<b> get cursor field lw_field.</b>

if lw_field eq 'WA_CUSTOMER-VBELN'.

if lw_field is not initial.

set parameter ID 'AUN' field wa_customer-vbeln.

call transaction 'VA03'.

else.

message text-015 type 'E'.

endif. " if lw_field is not initial.

else.

message 'Place cursor on a sales order number'(017) type 'E'.

endif. " if lw_field eq...

clear:

wa_customer, lw_field.

endform. " Order_info

&----


*& Form customer_info

&----


*This subroutine calls the transaction XD03 customer ----


  • There are no interface parameters to be passed to this *subroutine. *

----


form customer_info.

data lw_field(20) type c.

<b> get cursor field lw_field.</b>

if lw_field eq 'WA_CUSTOMER-KUNNR'.

if lw_field is not initial.

set parameter ID 'KUN' field wa_customer-kunnr.

call transaction 'XD03'.

else.

message text-015 type 'E'.

endif. " if lw_field is not initial.

else.

message 'Place cursor on a customer number'(016) type 'E'.

endif. " if lw_field eq...

clear:

wa_customer, lw_field.

endform.

plz do remember to close the thread when ur problem is solved !!!

<b>reward if it helps u..

sai ramesh</b>

Read only

Former Member
0 Likes
651

you have to use get cursor field f1 value v1.

in f1 you can get the field name like 'ITAB_MATNR'

and in v1 the value like 12345.

now you have to set parameter id

at line-selection.

get cursor field f1 value v1.

if f1 = 'ITAB-MATNR'.

SET PARAMETER ID 'MAT' FIELD v1.

call transaction 'MM03' and skip first screen.

elseif f1 = 'ITAB-inv'.

<some other tcode>

endif.

regards

shiba dutta

Read only

learnsap
Active Participant
0 Likes
651

Hi Zareen,

You will be handling the double click event right...there you get cursor field name and value using the get cursor statement, split that field to get the field name...

if it is material number.

call transaction mm02.

elseif it is inventory management.

call transaction inventory management transaction.

endif.

feel free to contact me for further information...

Regards,

Ramesh S

*Reward points if reply is useful

Read only

Former Member
0 Likes
651

Zareen,

If It is ALV report below is code .

If it is classical report general interactive and calling procedure is same like below code.

  • 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.

Don't forget to reward if useful.....