‎2005 Oct 26 9:49 AM
Hello at all.
I've got a problem with a report which I wrote for a customer.
The report works very well and the customer wants to have an extension.
I give you a small overview of my report and the request of the customer:
With my report I give out the following fields WERKS, MATNR, MAKTX, PLNAL and PLNNR.
Now the customer wants to jump with a click on field into a given transaction. As there could be lot of rows in my output the call of transaction and the transfer of the field values has to be dynamic.
The List looks like this:
WERKS | MATNR | MAKTX | PLNAL | PLNNR |
-
0001 | 12345 | test | 01 | 789 |
0001 | 54321 | test2 | 01 | 369 |
......................and so on........ |
With a click in the field MATNR in the first row the customer wants to jump in the transaction 'MMO3' and the value of the clicked MATNR should give as PARAMETER ID to the transaction.
With a click on th PLNNR should happen the same with the small different, that the transaction CA03 should appear.
I already worked with HIDE and AT SELECTION-SCREEN.
But the problem is that I couldn't separate the call of different transactions. In my opinion it's only possible to call on transaction.
Here you can find the corresponding source code:
LOOP AT INT_DATEN.
FORMAT HOTSPOT ON.
WRITE: / INT_DATEN-WERKS,
10 INT_DATEN-MATNR,
30 INT_DATEN-MAKTX,
75 INT_DATEN-PLNAL,
90 INT_DATEN-PLNNR.
FORMAT HOTSPOT ON.
HIDE: INT_DATEN-MATNR, INT_DATEN-PLNNR, INT_DATEN-PLNAL,
INT_DATEN-WERKS.
ENDLOOP.
ENDIF.
AT LINE-SELECTION.
IF INT_DATEN-MATNR NE ''.
SET PARAMETER ID: 'MAT' FIELD INT_DATEN-MATNR,
'WRK' FIELD INT_STPOV-WERKS,
'STT' FIELD SY-DATUM,
'PAL' FIELD INT_DATEN-PLNAL,
'PLN' FIELD INT_DATEN-PLNNR.
CALL TRANSACTION 'CA03' AND SKIP FIRST SCREEN.
ENDIF.
I hope you can understand my problem and that you give me an usefull answer.
So far...
Kind regards
Christian
‎2005 Oct 26 9:56 AM
Hi,
you must differentiate by the fields:
GET CURSOR FIELD position.
CASE position.
WHEN 'PSP-POSID'.
SET PARAMETER ID 'PSP' FIELD psp-posid(8).
SET PARAMETER ID 'PRO' FIELD psp-posid.
CALL TRANSACTION 'CJ13' AND SKIP FIRST SCREEN.
WHEN 'BEST-EBELN'.
SET PARAMETER ID 'BES' FIELD best-ebeln.
CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
WHEN 'BEST'.
...
Andreas
‎2005 Oct 26 9:56 AM
Hi,
you must differentiate by the fields:
GET CURSOR FIELD position.
CASE position.
WHEN 'PSP-POSID'.
SET PARAMETER ID 'PSP' FIELD psp-posid(8).
SET PARAMETER ID 'PRO' FIELD psp-posid.
CALL TRANSACTION 'CJ13' AND SKIP FIRST SCREEN.
WHEN 'BEST-EBELN'.
SET PARAMETER ID 'BES' FIELD best-ebeln.
CALL TRANSACTION 'ME23' AND SKIP FIRST SCREEN.
WHEN 'BEST'.
...
Andreas
‎2005 Oct 26 10:22 AM
‎2005 Oct 26 10:35 AM
Hi,
or you can make more harder, you hide the column name, you get the line number selected, and with this two values you will find the information in your internal table and the transaction to launch.
Regards
Frédéric
‎2005 Oct 26 10:19 AM
I have solved such problem earlier.here is a sample code, you can simply modify the at line-selection if-endif statements.
please reward points if it helps you.
just run this code as it is to get the idea.
REPORT zanid_test3.
data: begin of itab occurs 0,
matnr like mara-matnr,
mtart like mara-mtart,
end of itab.
start-of-selection.
select matnr mtart from mara into table itab up to 10 rows.
loop at itab.
format hotspot on.
write:/10 itab-matnr,
30 itab-mtart.
hide itab. "hide the whole work area
format hotspot off.
endloop.
at line-selection.
if sy-cucol >= 10
and sy-cucol <= 28. "matnr lenght is 18
write: itab-matnr.
*----here you set parameter of this field and call transaction.
elseif sy-cucol >= 30
and sy-cucol <= 34. "mtart length is 4
write: itab-mtart.
*----here you set parameter of this field and call transaction.
endif.
‎2005 Oct 26 11:00 AM
OK, thank you all.
I made it like the way Andreas wrote me.
Now my program works fine and I can give it to the customer.
Bye Christian
‎2005 Oct 26 11:05 AM
please, can you set the question has answered and give point to Andreas
Rgd