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: 

unable to clear Parameter ID in ABAP code

former_member405801
Discoverer
0 Kudos

I have an interactive ALV report using Factory method in which when the Order Number is clicked it should call the Transaction COR2.

on click of the event I have the code as below:

DATA(lv_aufnr) = wa_final-aufnr.

SET PARAMETER ID 'ANR' FIELD lv_aufnr.
CALL TRANSACTION 'COR2' AND SKIP FIRST SCREEN.
SET PARAMETER ID 'ANR' FIELD space.

The user will click on the Process Order Number and do some modification in the Order and after save the program will direct it back to the ALV list. This part is working fine.

In debug I have checked that on each click of the row, the correct Order number is passed to lv_aufnr.

However the problem is that while the first click calls the COR2 with correct order number, second time onwards even when the variable lv_aufnr has correct order number, the Call Transaction happens with the first order number only.

Clearly the value set to the PARAMETER ID first time isnt getting refreshed even when I have explicitly set it to Space. And hence the interactive part is not working correctly for the next click onwards.

Is there any other way or some FM to clear the PARAMETER ID? How do I resolve this?

2 REPLIES 2

Sandra_Rossi
Active Contributor

I'd say that your concern is not SET PARAMETER that you do after CALL TRANSACTION, but the SET PARAMETER before CALL TRANSACTION. So, I guess that you did a debug and LV_AUFNR had the value '2' but the transaction code uses value '1' (the previous one). Weird. Contact SAP support.

Hi Prajwal Kumar ,

I debugged program COR2, I think you can use parameter ID 'BR1' as follows:

DATA(lv_aufnr) = '1000000'.
SET PARAMETER ID 'BR1' FIELD lv_aufnr.
CALL TRANSACTION 'COR2' AND SKIP FIRST SCREEN.

lv_aufnr = '1000001'.
SET PARAMETER ID 'BR1' FIELD lv_aufnr.
CALL TRANSACTION 'COR2' AND SKIP FIRST SCREEN.

Please let me know if the above is working for you.

Regards,

Dhabya