Application Development and Automation 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: 
Read only

Issue in SET PARAMETER ID ?

NR_Ranasingh
Participant
0 Likes
3,716

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.
Endcase

But 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

1 ACCEPTED SOLUTION
Read only

Former Member
2,728

Use the parameter ID CTR (Contract Number - Purchasing) instead of VRT.

Regards, Vinod

9 REPLIES 9
Read only

Former Member
2,729

Use the parameter ID CTR (Contract Number - Purchasing) instead of VRT.

Regards, Vinod

Read only

0 Likes
2,728

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 .?

Read only

0 Likes
2,728

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

Read only

0 Likes
2,728

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

Read only

0 Likes
2,728

There are multiple transactions starting with dynpro SAPMM06E(0205) like ME33K, ME33L, ME32K, etc. (perform a where-used) so table T160 translate transaction codes in control flags.

Regards,

Raymond

Read only

0 Likes
2,728

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 ..

Read only

0 Likes
2,728

Vinod,

Thank you. It solved my issue.

Thanks,

Tuncay

Read only

Former Member
0 Likes
2,728

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.

Read only

0 Likes
2,728

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,