2007 Nov 02 3:22 PM
Hi,
I have a simple write statement which gives a PO number and a description about it. When i click on the PO number, it should directly go to transaction ME22N. Please note that i know how to implement the same requirement from the output ALV grid. But now iam not knowing how to go to the transaction from a output write statement. Please suggest what can be done ?
2007 Nov 02 3:24 PM
Hi,
You need to use AT LINE-SELECTION event for that. See the below help for details
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/content.htm
Regards,
Atish
2007 Nov 02 3:23 PM
In list displays we use hotspots as well. Here is an example.
report zrich_0002 no standard page heading.
data: ivbak type table of vbak with header line.
data : cursor_field(30),
field_value(30) .
select-options: s_vbeln for ivbak-vbeln.
start-of-selection.
select * into corresponding fields of table ivbak
from vbak
where vbeln in s_vbeln.
loop at ivbak.
format hotspot on.
write:/ ivbak-vbeln.
hide ivbak-vbeln.
format hotspot off.
endloop.
at line-selection.
set parameter id 'AUN' field ivbak-vbeln.
call transaction 'VA03' and skip first screen.
Regards,
Rich Heilman
2007 Nov 02 3:24 PM
Hi,
You need to use AT LINE-SELECTION event for that. See the below help for details
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba3ae35c111d1829f0000e829fbfe/content.htm
Regards,
Atish
2007 Nov 03 10:04 AM
Hi,
I had already tried your suggestion. But when i click on a PO, i get a message on the status bar that Choose a valid Function. Not knowing what to do with this only, i had posted a query here. I would request everybody trying to answer my query, to first try out their solution and then only suggest. thanks in advance.
2007 Nov 03 10:07 AM
Paste your code so that we can tell you what is wrong in it.
Regards,
Atish
2007 Nov 03 10:22 AM
Hi Aiswarya,
I believe you are setting PF-STATUS in your program.
The reason for that error is the 'PICK' function code (sy-ucomm) is not present in your GUI Status. If you are setting your own PF-Status then I recommend you open your GUI-Status and assign 'PICK' for Function Key F2.
In case you are not setting your own PF-Status then as Atish said, paste your code so that we can tell what's wrong.
Regards
Nishant
And I hope you are using HIDE for the field that you want to be picked up when you double click.
Message was edited by:
Nishant Rustagi
2007 Nov 03 10:38 AM
Hi Nishant,
Thanks a lot for ypur valuable suggestion. My code is now working as expected. Thanks again.
2007 Nov 03 10:41 AM
Hi Nishant,
Could you please explain the purpose of using PICK function ? is it necessary to assign PICK function only and in particular for F2 key ? Kindly explain so that people like me can benefit.
2007 Nov 03 10:44 AM
Hi,
This is standard SAP fcode need to be assigned to F2 only so that the same can be used in AT LINE SELECTION.
Regards,
Atish
2007 Nov 03 11:27 AM
Hi ,
as mentioned by Atish, PICK is standard SAP FCode which is used by AT LINE-SELECTION which is same as pressing F2.
Now this doesn't mean you cannot use any other FCODE.
Actually if you assign any other FCODE to F2 Function key it will work but in that case 'AT LINE-SELECTION' will not work.
In that case you'll have to handle this in AT USER-COMMAND.
Cheers
Nishant
2007 Nov 02 3:25 PM
You can also refer below sample program
http://www.sapfans.com/sapfans/qstart/zhello7.html
Regards,
Atish
2007 Nov 02 3:28 PM
Hi ..
Check this..
AT LINE-SELECTION.
READ LINE sy-lilli FIELD VALUE itab-po_num. "PO field
IF itab-po_num NE SPACE.
CALL FUNCTION 'ME_DISPLAY_PURCHASE_DOCUMENT'
EXPORTING
i_ebeln = itab-po_num
i_enjoy = 'X'
i_edit = 'X'
* i_etenr =
EXCEPTIONS
not_found = 1
no_authority = 2
invalid_call = 3
preview_not_possible = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
"PS: with enjoy transaction like ME22n it works perfect
Message was edited by:
Perez C
2007 Nov 02 3:30 PM
REPORT ZRP_TEST3.
data : gt_ekpo type standard table of ekpo,
gs_ekpo type ekpo.
start-of-selection.
SELECT * UP TO 5 ROWS into table gt_ekpo FROM ekpo .
loop at gt_ekpo into gs_ekpo.
write:/, gs_ekpo-ebeln,gs_ekpo-ebelp.
HIDE gs_ekpo-ebeln. "<<<<<<<<<
endloop.
at line-selection.
SET PARAMETER ID 'BES' FIELD gs_ekpo-ebeln.
CALL TRANSACTION 'ME23N'.
The HIDE statement does the job.