cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Issue with system Tcode value i.e sy-tcode.

karan007
Product and Topic Expert
Product and Topic Expert
0 Likes
1,274

I have a requirement to check sy-tcode value in some of the Popup but in debugger mode I am getting sy-tcode value as blank. So I tried with Import and export statement I wrote the code as below:
Type of Lv_tcode is sy-tcode.
EXPORT lv_tcode = lv_tcode1 TO MEMORY ID 'ZPMTCODE'.
IMPORT lv_tcode to lv_tcode1 FROM MEMORY ID 'ZPMTCODE'.

but I am getting same blank value . I tried with set and get parameter ID, cl_abap_syst class too but not working
Can anyone suggest some solution?

View Entire Topic
Sandra_Rossi
Active Contributor
0 Likes

The transaction code is blank because at the place you execute your code, you're no more directly in a transaction, your code runs maybe in the update task.

The ABAP memory (EXPORT/IMPORT) can't pass values from the dialog to the update task.

To pass some values from the dialog to the update task, you need to create an "Update Task" Function Module, call it and pass the parameters you want.

Depending on the exact transaction code you are using, there can be more easy solutions.