‎2008 Aug 04 6:31 PM
Hi Experts,
I have made a classical report having delivery no, sales order no and shipment no and many other details. Now I want to make three hot keys in this i.e
Delivery no (VBELN)
Sales order no (VBELV)
and Shipment no (TKNUM)
I did coding like this
at LINE-SELECTION.
DATA: l_vbeln TYPE VBELN_VL,
l_vbelv type VBELV,
l_tknum type TKNUM.
get CURSOR FIELD likp-vbeln VALUE l_vbeln.
set PARAMETER ID 'VL' FIELD l_vbeln.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
get CURSOR FIELD lips-vbelv VALUE l_vbelv.
set PARAMETER ID 'AUN' FIELD l_vbeln.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
get CURSOR FIELD vttp-tknum VALUE l_tknum.
set PARAMETER ID 'TNR' FIELD l_tknum.
CALL TRANSACTION 'VT03N' AND SKIP FIRST SCREEN.
But I am facing a probelm in this:
Whichever hot key i am clicking,it's opening all the transaction with that key for exam say I am clicking vbeln with value 'A' it's first opening VL03N. After this when i am clicking back, It's opening VAL0 with same key A (It's shoing Invalid Sales order no) and after that it's opeing VT03N with the same key.
Please tell me how I can open only the trancation for which user is clicking.
Thanks a lot
Regards
Krishan
‎2008 Aug 04 8:30 PM
Hi Krishan,
Try this logic:
For example structure of ur final table is like:
types: begin of ty_final,
vbeln like likp-vbeln,
vbelv like lips-vbelv ,
tknum like vttp-tknum,
.........
end of ty_final.
When displaying report use HIDE statement .*
loop at i_final into w_final.
write: w_final-vbeln,
w_final-vbelv,
w_final-tknum
........
........
.
hide: w_final-vbeln,
w_final-vbelv,
w_final-tknum.
endloop.
at LINE-SELECTION.
if not w_final-vbeln is initial.
set PARAMETER ID 'VL' FIELD w_final-vbeln.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
endif.
if not w_final-vbelv is initial.
set PARAMETER ID 'AUN' FIELD w_final-vbelv.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
endif.
if not w_final-tknum is initial.
set PARAMETER ID 'TNR' FIELD w_final-tknum.
CALL TRANSACTION 'VT03N' AND SKIP FIRST SCREEN.
endif.
‎2008 Aug 04 6:37 PM
Hi,
you have use the if condition before,
Please check the below code.
Shreekant
CASE UCOMM.
WHEN '&IC1'.
READ TABLE T_OUTPUT INDEX SELFIELD-TABINDEX.
IF SELFIELD-SEL_TAB_FIELD = 'T_OUTPUT-VBELN_ORD'.
SET PARAMETER ID 'AUN' FIELD T_OUTPUT-VBELN_ORD.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ELSEIF SELFIELD-SEL_TAB_FIELD = 'T_OUTPUT-VBELN_DEL'.
SET PARAMETER ID 'VL' FIELD T_OUTPUT-VBELN_DEL.
CALL TRANSACTION 'VL03' AND SKIP FIRST SCREEN.
ELSEIF SELFIELD-SEL_TAB_FIELD = 'T_OUTPUT-TKNUM'.
SET PARAMETER ID 'TNR' FIELD T_OUTPUT-TKNUM.
CALL TRANSACTION 'VT03N' AND SKIP FIRST SCREEN.
ELSEIF SELFIELD-SEL_TAB_FIELD = 'T_OUTPUT-VGBEL1'.
SET PARAMETER ID 'VF' FIELD T_OUTPUT-VGBEL1.
CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
‎2008 Aug 05 1:32 PM
Hi Shreekant,
Thanks a lot.
Can you please explain me the code:
1. UCOMM.
2 '&IC1'.
3 SELFIELD-TABINDEX.
4. SEIELD-SEL_TAB_FIELD.
Thanks a lot.
Krishan
‎2008 Aug 04 6:38 PM
at LINE-SELECTION.
DATA: l_vbeln TYPE VBELN_VL,
l_vbelv type VBELV,
l_tknum type TKNUM.
data: fieldname(10),l_value(10).
"i assume that there is some write statements
"using likp-vbeln, lips-vbelv, and vttp-tknum.
"in your basic list.
get CURSOR FIELD fieldname VALUE l_value.
case fieldname.
when 'LIKP-VBELN'.
set PARAMETER ID 'VL' FIELD l_value.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
when 'LIPS-VBELV'.
set PARAMETER ID 'AUN' FIELD l_value.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
when 'VTTP-TKNUM'.
set PARAMETER ID 'TNR' FIELD l_value.
CALL TRANSACTION 'VT03N' AND SKIP FIRST SCREEN.
‎2008 Aug 04 8:19 PM
Hi Vijay,
get CURSOR FIELD fieldname VALUE l_value.
It;s not working. when i m clicking on vbeln, nothing is happing. What should i put in place of filedname?
Thnaks
Krishan
‎2008 Aug 05 1:42 PM
‎2008 Aug 04 8:30 PM
Hi Krishan,
Try this logic:
For example structure of ur final table is like:
types: begin of ty_final,
vbeln like likp-vbeln,
vbelv like lips-vbelv ,
tknum like vttp-tknum,
.........
end of ty_final.
When displaying report use HIDE statement .*
loop at i_final into w_final.
write: w_final-vbeln,
w_final-vbelv,
w_final-tknum
........
........
.
hide: w_final-vbeln,
w_final-vbelv,
w_final-tknum.
endloop.
at LINE-SELECTION.
if not w_final-vbeln is initial.
set PARAMETER ID 'VL' FIELD w_final-vbeln.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
endif.
if not w_final-vbelv is initial.
set PARAMETER ID 'AUN' FIELD w_final-vbelv.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
endif.
if not w_final-tknum is initial.
set PARAMETER ID 'TNR' FIELD w_final-tknum.
CALL TRANSACTION 'VT03N' AND SKIP FIRST SCREEN.
endif.
‎2008 Aug 05 1:40 PM
Hi Joyjit,
I have the data whcih I am dispalying in the list in different internal tables. eg First I am displaying the Shipment no using one internal table and after that from the second internal table i m displaying VBELN and from the third table i m dipalying the sales order...
Now if after displaying all the data in the list , I am using the AT Line selection,
whether it will recognise where I have clicked and open ONLY that tocde not all the other.
Please reply.
Thanks a lot.
Krishan
‎2008 Aug 05 3:09 PM
Hi,
Pl. check this sample code..may be it will help u.
&----
*& Report Z_DEMO_JG
*&
&----
*&
*& Download graphics from BDS
&----
REPORT z_demo_jg.
data: i_mara type standard table of mara.
data: w_mara type mara.
data: i_vbak type standard table of vbak.
data: w_vbak type vbak.
start-of-selection.
select * from mara
into table i_mara
up to 10 rows.
select * from vbak
into table i_vbak
up to 10 rows.
loop at i_mara into w_mara.
write : / w_mara-matnr.
hide w_mara-matnr.
endloop.
loop at i_vbak into w_vbak.
write : / w_vbak-vbeln.
hide w_vbak-vbeln.
endloop.
clear : w_vbak,
w_mara.
at LINE-SELECTION.
if not w_vbak-vbeln is initial.
set PARAMETER ID 'VL' FIELD w_vbak-vbeln.
CALL TRANSACTION 'VL03N' AND SKIP FIRST SCREEN.
clear w_vbak-vbeln.
endif.
if not w_mara-matnr is initial.
set PARAMETER ID 'MAT' FIELD w_mara-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
clear w_mara-matnr.
endif.
Regards,
JOy.