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

Problem with 'HIDE' and 'AT SELECTION-SCREEN'

Former Member
0 Likes
843

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

1 ACCEPTED SOLUTION
Read only

andreas_mann3
Active Contributor
0 Likes
805

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

6 REPLIES 6
Read only

andreas_mann3
Active Contributor
0 Likes
806

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

Read only

0 Likes
805

Hi,

I will go with Andreas way.

Ravi.

Read only

0 Likes
805

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

Read only

Former Member
0 Likes
805

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.

Read only

Former Member
0 Likes
805

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

Read only

0 Likes
805

please, can you set the question has answered and give point to Andreas

Rgd