Application Development 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: 

Assigning Transaction Code to each field in a report

adeel_sarwar
Contributor
0 Kudos

Hi,

I have a query report which displays for example

Purchase Order, Material etc

Now via abap i want to assign a transaction code to both fields so when the the query runs and if the user double clicks Purchase Order it goes to ME23N if the user double clicks Material it goes to MM03 etc

<REMOVED BY MODERATOR>

Thanks

Adeel

Edited by: Alvaro Tejada Galindo on Mar 3, 2008 4:54 PM

11 REPLIES 11

Former Member
0 Kudos

Hi,

We can use two buttons in the screen via screen painter SE51 and in the processing logic of the program we can call the transaction using statement

CALL TRANSACTION

Calls a transaction.

Syntax

CALL TRANSACTION <tcod>

[AND SKIP FIRST SCREEN]

[USING <itab>].

Calls the transaction <tcod> while retaining the data in the calling program. At the end of the transaction, control returns to the point from which the transaction was called. The additions allow you to skip the first screen of the transaction or pass an internal table for batch input to it.

<REMOVED BY MODERATOR>

Thanks,

Ramya.R

Edited by: Alvaro Tejada Galindo on Mar 3, 2008 4:55 PM

0 Kudos

Hi Ramya,

Thanks for your reply, i am trying to call a transaction in a query, can you please be specific with the code that i need to right in the query?

Example

IF EKPO-EBELN is double clicked on go to ME23N

IF EKPO-MATNR is double clicked on go to MM03,

Can you provide the full coding for this as the below doesnt help

thanks

Former Member
0 Kudos

In ur report use the following code:

  • DEFINE VARIABLES FOR GET CURSOR LOGIC.

DATA: fname(10), fval(10).

.........

.........

  • PROVIDE LOGIC TO MOVE THE CURSOR FROM REPORT TO TRANSACTION.

GET CURSOR FIELD fname VALUE fval.

  • PROVIDE THE MEMORY ID OF THE FIELD.

SET PARAMETER ID 'XYZ' FIELD fval. " WHERE XYX IS THE PARAMETER I.D OF THE PURCHASE ORDER FIELD( FRST 3 LETTERS OF THE FIELD )

  • PROVIDE LOGIC TO MOVE TO SCREEN.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDCASE.

Do the same for the Material Field.

<REMOVED BY MODERATOR>

Cheers,

Chandra Sekhar.

Edited by: Alvaro Tejada Galindo on Mar 3, 2008 4:55 PM

0 Kudos

Hi Chandra,

thanks for your help, i have entered the code which is ok but when i run the report now it goes to me23n straight away

what do i have to do in order for my current report to run and then only when I click EKPO-EBELN then it goes to ME23N

0 Kudos

Hi,

Its just a simple report made by a query don't want to use screen painted its a query via SQ01

Former Member
0 Kudos

Hi ,

Can you tell me that you are using screen painter for the field you mentioned or its selection screen?

Regards,

Ramya

former_member667836
Active Participant
0 Kudos

Hi Adeel,

no need to assign transaction code for each field.Enable "Respond To Double Click" for the field it will trigger PAI of the screen.Then Assign one OK_CODE.Then You can check which field User Clicked using Get Cursor.

Hope this will help

Message Edited

shibu

Former Member
0 Kudos

Hi Adeel,

GET CURSOR FIELD FIELD1.

read table jtab with key obj_name = sy-lisel+1(20).

move jtab-object to wf_object.

case wf_object.

when 'MM03'.

SET PARAMETER ID 'AUS' FIELD SY-LISEL+1(10).

CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.

when 'ME23N'.

SET PARAMETER ID 'EXN' FIELD SY-LISEL+1(20).

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

endcase.

If it is helpfull,

Pls reward pts.

Regards

Srimanta

0 Kudos

Hi All,

Thanks for all your replys still not working. I would like to emphasize that it is a query via SQ01.

The code below is working but as mentioned before when i run the query it goes straight to me23n what i want is the report to run and then when i click on the below it goes to transaction codes

IF EKPO-EBELN is double clicked on go to ME23N

IF EKPO-MATNR is double clicked on go to MM03,

I think we are nearlly there i just need a statement to say if a field is double clicked then go to the report. I know you have given codes but they bring up errors if you can give me the full code it would be helpful as I am basic at ABAP

Thanks

DATA: fname(10), fval(10).

.........

.........

  • PROVIDE LOGIC TO MOVE THE CURSOR FROM REPORT TO TRANSACTION.

GET CURSOR FIELD fname VALUE fval.

  • PROVIDE THE MEMORY ID OF THE FIELD.

SET PARAMETER ID 'BES' FIELD fval. " WHERE XYX IS THE PARAMETER I.D OF THE PURCHASE ORDER FIELD( FRST 3 LETTERS OF THE FIELD )

  • PROVIDE LOGIC TO MOVE TO SCREEN.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN

adeel_sarwar
Contributor
0 Kudos

Doesn't work, you can't do this on a query,

adeel_sarwar
Contributor
0 Kudos

Doesn't work, you can't do this on a query,