2013 May 22 1:07 PM
Hi,
I know this is a repetitive question in SCN. But I couldn't resolve the issue using the solution already provided here.
I have an ALV output, in which one field is for Process Order, which is shown as hyperlink.
When you click on any process order, it should call COR3 with the selected Process order.
My problem is always the first process order is getting displayed always.
i.e. I select order O1 and it goes to COR3 to display O1. If I come back and select O2, it goes to COR3 to display O1 again.
I am using the following code for this requirement.
v_aufnr = wa_final1-proc_order.
SET PARAMETER ID 'ANR' FIELD v_aufnr.
CALL TRANSACTION 'COR3' AND SKIP FIRST SCREEN.
CLEAR v_aufnr.
SET PARAMETER ID 'ANR' FIELD v_aufnr.
Still it is not working.
Any help will be greatly appreciated.
Regards,
Shail.
2013 May 22 3:17 PM
Just curious because I have done this many times and never had this problem.
I have been debugging and found out that after your statement parameter id BR1 is used.
so if you change your code to:
v_aufnr = wa_final1-proc_order.
SET PARAMETER ID 'BR1' FIELD v_aufnr.
CALL TRANSACTION 'COR3' AND SKIP FIRST SCREEN.
don't clear anything here, not bnecessary
2013 May 22 3:13 PM
I believe issue is with the way you get process order number from ALV.
No matter which line is clicked, first process order number gets set.
Put a breakpoint to confirm that when you click on line 3, process order of line 3 reaches v_aufnr or not.
After confirming this, you can focus on getting selected row index (cl_gui_alv_grid->get_selected_rows if using classes), and fetching correct process order number.
2013 May 22 3:17 PM
Just curious because I have done this many times and never had this problem.
I have been debugging and found out that after your statement parameter id BR1 is used.
so if you change your code to:
v_aufnr = wa_final1-proc_order.
SET PARAMETER ID 'BR1' FIELD v_aufnr.
CALL TRANSACTION 'COR3' AND SKIP FIRST SCREEN.
don't clear anything here, not bnecessary
2013 May 22 3:30 PM
Thanks Peter.
Your solution is working fine for me now.
But, do you know how you came across 'BR1' instead of 'ANR' , as I could see only 'ANR' if I goto COR3 and press F1 on Order number ?
Regards,
Shail.
2013 May 22 3:48 PM
Well I created a small program in which I select a few process orders, display in alv and implement method handle_doubleclick.
I used the same parameter-id as you did and set a breakpoint at statement set parameter id.
The after that I go in debugging in COR3 and in the PBO event for the first screen, the first perform is called: MODULE get_parameter. And when you go in there......well try out and you will see.
2013 May 22 3:29 PM
Hi ,
Hope you are populating the order number from the selected record.
Please check in debugging if you are able to see the second order being picked up during the set parameter execution.
also please check if you are looping again to read the order instead use read statement for the selected record for the right order number.
Thanks and Regards,
Sriranjani Chimakurthy.
2013 May 22 3:39 PM
PARAMETER ID 'BR1' in stead of 'ANR' WILL work. I created a test program and it works perfect.
2013 May 22 3:45 PM
Hi Peter,
I understood what you are saying.
But, how did you come to know that the parameter id 'BR1' is for AUFNR field for COR3 transaction ?
In which table,we can find the linkage between the field and the parameter id ?
I searched in DD04L table, but couldn't get the entry for parameter id 'BR1'.
Regards,
Shail.
2013 May 22 4:00 PM
Not in ddic, code in first module in the PBO of the initial screen of transaction (SE93 -> double-click on dynpro, double-click on first module)
Regards,
Raymond
2013 May 22 4:01 PM
Really only by debugging the code. If you go in the MODULE get_parameter which is called when you start TC COR3, then you see the following code:
MODULE GET_PARAMETER OUTPUT.
IF CAUFVD-AUFNR IS INITIAL.
GET PARAMETER ID 'BR1' FIELD *CAUFVD-AUFNR.
IF NOT *CAUFVD-AUFNR IS INITIAL.
CAUFVD-AUFNR = *CAUFVD-AUFNR.
ENDIF.
ENDIF.
ENDMODULE. " GET_PARAMETER OUTPUT
That made me realize that any parameter-id that needs to be set is BR1 and not ANR as you can find in F1 information on the screenfield. I honestly think this is a bug and SAP should repair it. The data element AUFNR has parameter-id ANR and I don't see the reason why SAP uses another one in this transaction.
2013 May 22 3:46 PM
Regards,
Raymond
(*) Assumed that ANR also can be checked but only if BR1 is initial, so first time you set ANR, and COR3 will set BR1, and during following calls; COR3 will only read BR1, let you test...
2013 May 22 3:59 PM
Hi Raymond,
- I used HOTSPOT_CLICK event to do the processing . I use the OO ALV method for the same.
- I found out that the parameter id is ANR, by pressing F1 at Order number in COR3 and proceeded
by setting it in the program.
I was not aware of this Parameter id 'BR1'.
I would definitely be interested to know if there is some place where we link BR1 and Process order number.
Regards,
Shail.
2013 May 23 8:17 AM
Alas PARAMETER ID can be used in Abap statement, so you can not always find the information in ddic nor in dynpro field definition but in module of the program. So usually I look at initial transaction dynpro for modules with names like 'INIT_TRANSACTION' or 'GET_PARAMETER'.
So, small list of tricks than can do the job
Regards,
Raymond
2013 May 22 4:26 PM
Just set it to space. A workaround.
SET PARAMETER ID 'ANR' FIELD space.
Regards,
Manu
2013 May 22 5:05 PM
FREE is for clearing up memory occupied by internal tables.
DELETE from memory ID is to clear data from SAP memory (Parameter ID's)
Syntax
FREE MEMORY ID id.
Effect
This statement has the same effect as the statement
DELETE FROM MEMORY ID id.
2014 Apr 15 9:37 PM
Hello:
First of all, thank you for the information about the BR1 value, instead of ANR.
Now, I'm trying to call the IW39 transaction, but there is a field called "Period", which refers to Dates "DATUV" and "DATUB".
These dates are filled when the transaction starts, and they don't have any PARAMETER ID defined by SAP.
My question is, how could I erase those values from this transaction, so I can see the Maintenance Order correctly? Right now, the transaction is telling me that there are no orders, but it's because of the dates.
Thanks in advance.
Greetings.
Teresa.