09-05-2009 11:26 AM
Dear Abapers,
I have developed an ALV report where when double click on a
Process Order number the report will call a standard TRANSACTION
COR3 using call transaction method. I have use the following
attached code to do the same. But the report always takes the
first selected Process Order value in the cor3 transaction.
Whenever i click on any other process Order number it always take
the first click value.
But i have checked that the parameter ID field is taking the
correct value.. But in the program it is not taking, it only
takes the first clicked value from the alv report.
FORM user_cor3 USING u_ucomm LIKE sy-ucomm
us_selfield TYPE slis_selfield.
IF us_selfield-fieldname = 'AUFNR'.
DATA: i_aufnr LIKE AFKO-aufnr.
READ TABLE i_final INDEX us_selfield-tabindex.
IF SY-SUBRC = 0.
i_aufnr = i_final-aufnr.
CASE u_ucomm.
WHEN '&IC1'.
SET PARAMETER ID 'ANR' FIELD i_aufnr .
CALL TRANSACTION 'COR3' AND SKIP FIRST SCREEN .
ENDCASE.
ENDIF.
ENDIF.
ENDFORM.
"USER_COR3
09-05-2009 3:02 PM
Hi THILAGARAJ,
please check in debugger if i_aufnr hast the correct value before
SET PARAMETER ID 'ANR' FIELD i_aufnr .
.
Also make sure that PARAMETER ID 'ANR' is used in transaction COR3 to set the value.
To check this, analyse start screen 5110 . Here you can see that
GET PARAMETER ID 'BR1'
is used to initialize field CAUFVD-AUFNR.
And if you post any code, please use the above <_> code marker and see the preview before posting, thanks.
Kind regards,
Clemens
09-05-2009 11:56 AM
TYPE-POOLS : slis.
DATA : fcat TYPE slis_t_fieldcat_alv.
DATA : it_sflight TYPE TABLE OF sflight WITH HEADER LINE.
SELECT * FROM sflight INTO TABLE it_sflight.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'SFLIGHT'
TABLES
t_outtab = it_sflight
FORM user_command USING u_ucomm LIKE sy-ucomm
us_selfield TYPE slis_selfield.
IF US-ucomm = '&IC1'.
READ TABLE it_sflight INDEX us_selfield-tabindex.
Here try to clear the i_aufnr and try------>
IF sy-subrc IS INITIAL.
WRITE : it_sflight-carrid.
SET PARAMETER ID 'CAR' FIELD IT_SFLIGHT-CARRID.
DATA : CAR TYPE SPFLI-CARRID.
GET PARAMETER ID 'CAR' FIELD CAR.
ENDIF.
ENDIF.
ENDFORM. "user_COMMAND
Check the above program is working fine with your logic.
Check which internal table you are using is it same as i_final in the FM
Cheers
09-05-2009 12:04 PM
Hi,
Try like below:
IF us_selfield-fieldname = 'AUFNR'.
i_aufnr = us_SELFIELD-VALUE.
CASE u_ucomm.
WHEN '&IC1'.
SET PARAMETER ID 'ANR' FIELD i_aufnr .
CALL TRANSACTION 'COR3' AND SKIP FIRST SCREEN .
ENDCASE.
endif.
Regards,
Himanshu
09-05-2009 2:20 PM
Im notsure abou this ...
Just check
FREE MEMORY ID 'ANR' .
SET PARAMETER ID 'ANR' FIELD i_aufnr .
09-05-2009 3:02 PM
Hi THILAGARAJ,
please check in debugger if i_aufnr hast the correct value before
SET PARAMETER ID 'ANR' FIELD i_aufnr .
.
Also make sure that PARAMETER ID 'ANR' is used in transaction COR3 to set the value.
To check this, analyse start screen 5110 . Here you can see that
GET PARAMETER ID 'BR1'
is used to initialize field CAUFVD-AUFNR.
And if you post any code, please use the above <_> code marker and see the preview before posting, thanks.
Kind regards,
Clemens
09-21-2009 2:27 PM
Definitly the ID for the process order in COR3 is ANR, as you can see in the technical settings. Maybe BR1 is reading for whatever purpose, but the process order is ANR.
07-02-2014 5:22 PM
This is an excellent answer. I've been figuring out this issue and I finally found out how to solve it. Thank you very much.
09-21-2009 2:13 PM
Hello
You can refer to the following links to know all about SET/GET parameters.
[Using SET/GET Parameter ID in SAP|http://www.how2sap.com/blog/sap-abap/using-setandget-parameter-id-in-sap/]
[Associating SET/GET Parameters to Screen elements|http://www.how2sap.com/blog/sap-abap/associating-setget-parameters-to-screen-elements/]
[Persisting SET/GET Parameter values|http://www.how2sap.com/blog/sap-abap/persisting-setget-parameter-values-in-user-profile/]
Happy Reading,
Anand.
[How2SAP.com|http://www.how2sap.com/blog/]
09-22-2009 1:20 PM
Below statement is used to resolved the problem.
SET PARAMETER ID 'BR1' FIELD G_T_GT_OUTTAB-AUFNR.
GET PARAMETER ID 'BR1' FIELD G_BR1.
CALL TRANSACTION 'COR3' AND SKIP FIRST SCREEN.