‎2011 Aug 29 10:22 AM
Hi Gurus,
I am calling ME33K tcode from Program.
My program is showing Contract No in Output.
My requirement is when user will Double click on Contract no, the corresponding Contract will display in ME33K .
I have done coding like this .
CASE ucomm.
WHEN '&IC1'. "--* "Double Click" Check field clicked on ALV report
IF rs_selfield-fieldname = 'EVRTN'.
READ TABLE t_temp INTO wa_temp INDEX rs_selfield-tabindex.
* SET PARAMETER ID 'VTR' FIELD '' .
SET PARAMETER ID 'VRT' FIELD wa_temp-evrtn .
CALL TRANSACTION 'ME33K' AND SKIP FIRST SCREEN.
Endif.
EndcaseBut problem is it's opening the contract that was last opened in System.
Suppose i am Passing Contract no CON11 , instead of opening this , its opening the contract no CON55 .
where as CON55 was opened last time in ME33K,
but if now i open the Contract CON11 in ME33K tcode manually and then close that, and run the program and from Output doubleclick on the contract CON11 , its going to correctly .
I found the value in Debugging mode, that is CON11 was passing . but not able to find the error, Why system is opening Last Opened Contract . ?//
Please look into this issue ?
Thanks
‎2011 Aug 29 10:39 AM
Use the parameter ID CTR (Contract Number - Purchasing) instead of VRT.
Regards, Vinod
‎2011 Aug 29 10:39 AM
Use the parameter ID CTR (Contract Number - Purchasing) instead of VRT.
Regards, Vinod
‎2011 Aug 29 10:51 AM
Yes, its working, But frm ME33k screen, the parameter id i got is VRT .
from where u got this,
The same problem is with ME13 tcode for info-record also.
IF rs_selfield-fieldname = 'EVRTN'.
READ TABLE t_temp INTO wa_temp INDEX rs_selfield-tabindex.
* SET PARAMETER ID 'VTR' FIELD '' .
SET PARAMETER ID 'VRT' FIELD wa_temp-evrtn . "--'CTR' VRT
CALL TRANSACTION 'ME33K' AND SKIP FIRST SCREEN.
ELSEIF rs_selfield-fieldname = 'INFNR' .
READ TABLE t_temp INTO wa_temp INDEX rs_selfield-tabindex.
SET PARAMETER ID 'EKO' FIELD c_medi.
SET PARAMETER ID 'INF' FIELD wa_temp-infnr.
CALL TRANSACTION 'ME13' AND SKIP FIRST SCREEN.
Endif .For inforecord whats the new Parameter Id .?
‎2011 Aug 29 12:59 PM
To get true parameter id (when those transactions are not report transactions but dialog transactions) so analyze the PBO of the initial screen.
You could also perform some where used on those transactions in standard programs (look at FM like RV_CALL_DISPLAY_TRANSACTION or CK50_INFORECORD_DISPLAY)
Regards,
Raymond
‎2011 Aug 29 1:50 PM
hey i analyzed the PBO of initial screen in debugging.
I got three ID's CTR , VRT , SAG .
let me Analyze in details how they are behaving in background,
Can you please throw some idea in details ??
Thanks for your help
Edited by: sagar singh on Aug 29, 2011 6:20 PM
‎2011 Aug 29 2:48 PM
‎2011 Aug 30 2:16 PM
Thanks Raymond and Vinod,
its solved now,,
As per Raymond, after analysing in debugging mode , i did solve it like below ,
CASE ucomm.
WHEN '&IC1'. "--* "Double Click"
IF rs_selfield-fieldname = 'EVRTN'. "-- Contract No
SET PARAMETER ID 'CTR' FIELD '' . "-- Clear All Parameter ID used in ME33K Tcode to free last values
READ TABLE t_temp INTO wa_temp INDEX rs_selfield-tabindex.
SET PARAMETER ID 'CTR' FIELD wa_temp-evrtn .
CALL TRANSACTION 'ME33K' AND SKIP FIRST SCREEN.
SET PARAMETER ID 'CTR' FIELD '' . "-- Clear for Future use
ELSEIF rs_selfield-fieldname = 'INFNR' . "--- Inforecord No
SET PARAMETER ID 'LIF' FIELD '' . "-- Clear All Parameter ID used in ME13 Tcode to free last values
SET PARAMETER ID 'MAT' FIELD '' .
SET PARAMETER ID 'EKO' FIELD SPACE .
SET PARAMETER ID 'INF' FIELD '' .
READ TABLE t_temp INTO wa_temp INDEX rs_selfield-tabindex.
SET PARAMETER ID 'EKO' FIELD c_medi.
SET PARAMETER ID 'INF' FIELD wa_temp-infnr.
CALL TRANSACTION 'ME13' AND SKIP FIRST SCREEN.
SET PARAMETER ID 'LIF' FIELD '' . "---* Clear All Parameter ID For further use
SET PARAMETER ID 'MAT' FIELD '' .
SET PARAMETER ID 'EKO' FIELD SPACE .
SET PARAMETER ID 'INF' FIELD '' .
ENDIF.
ENDCASE.Thnks people for your help ..
‎2013 Aug 22 4:58 PM
‎2011 Aug 29 10:53 AM
Hi Sagar,
The global, user-specific SAP memory is available to a user for the duration of a single terminal session. Values written to it are retained even when the user exits a program.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm
Also check pid "VRT" if it is not used anywhere later in the program because If there was already a value stored under <pid>, it gets overwriten by calling the statement SET PARAMETER.
‎2011 Aug 29 12:35 PM
hey,
i have tried like below also, clearing the Parameter ID.
SET PARAMETER ID 'VTR' FIELD SPACE
And i am using this in same session,