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

GET/SET Parameter ID problem

0 Likes
3,397

Hi,

Can you help me with this?

I have set parameter ID in user exit.

FREE MEMORY ID 'SGTXT'.

lv_sgtxt = 'TEST'.

SET PARAMETER ID 'SGTXT' FIELD lv_sgtxt.

In my smartforms

CLEAR gv_text.

GET PARAMETER ID 'SGTXT' FIELD gv_text.

the problem is after get parameter id, i didn't get any data.

Thanks.

Regards,

JB

1 ACCEPTED SOLUTION
Read only

VenkatRamesh_V
Active Contributor
0 Likes
2,854

Sir,

Did u Declared same Internal Table in both User Exit and Smartforms?.

Can you send your userExit name(which t-code you are using For ).

Regards,

Venkatramesh.V

19 REPLIES 19
Read only

FredericGirod
Active Contributor
0 Likes
2,854

Hi,

did you print your smartform in background ?

regards

Fred

Read only

Former Member
0 Likes
2,854

are the fields typed the same?

Can you check in the debugger of the Smartform initialisation routine - look at the global PIDs and see if they are set

Also, follow up previous suggestion - how is the form printed - in background or foreground?

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
2,853

Hello JB,

In this case you need to use export and import keywords.


EXPORT lv_sgtext  to memory id ''SGTXT'..

in your smartform

IMPORT lv_sgtext  FROM memory id ''SGTXT'..

GET/SET parameter id syntax will only work when a parameter id is assiged to a data element.

Example

Thanks

Read only

0 Likes
2,853

Hi All,

the form is run in foreground.

same data types.

I also used EXPORT/IMPORT but still not working.

Read only

0 Likes
2,853

Hello JB ,

Kindly share your code for export and import statement.

Thanks

Read only

0 Likes
2,853

Hi,

here is my code

DATA; lv_sgtxt type mseg-sgtxt.

EXPORT lv_sgtxt TO MEMORY ID 'SGTXT'. "user exit

IMPORT lv_sgtxt FROM MEMORY ID 'SGTXT'. "smartforms

Read only

0 Likes
2,853

Sir,   

Export/Import Syntex.

Data: begin of  itab,

         vbeln type vbap-vbeln,

         end of itab.

EXPORT  ITAB TO MEMORY ID 'ITAB'.


IMPORT ITAB TO ITAB FROM MEMORY ID 'ITAB'.



Regards,

Venkat

Read only

0 Likes
2,853

Still not working.

Read only

0 Likes
2,853

Hello JB.

Please follow below approach to findout if SGTXT is exported to ABAP memory.

1. Set break-point before Export and Import statements.

2. Follow below navigation to see if SGTXT is exported to memory in debugging mode after EXPORT statement

   GOTO->SYSTEM AREAS->ABAP Memory(classical debugger)

3.Follow the same steps after IMPORT statement to see if same memory id is available in ABAP memory.

THanks

Read only

0 Likes
2,853

Hi,

Have you checked wheather the smartform is called after the user exit,

once place Break-point in both exit and smartform and check the smartform is called after exit or not.

And where u r importing your lv_sgtxt in smartform.

Regards,

Pavan

Read only

VenkatRamesh_V
Active Contributor
0 Likes
2,855

Sir,

Did u Declared same Internal Table in both User Exit and Smartforms?.

Can you send your userExit name(which t-code you are using For ).

Regards,

Venkatramesh.V

Read only

0 Likes
2,853

EXIT name: EXIT_SAPMM07M_001

I did not declare internal table, i only need to get the value of e_sgtxt. i'm using this in MIGO

Read only

0 Likes
2,853

Hello JB,

I assume that you are trying to import from memory in update task.

Please use below statements


EXPORT lv_sgtxt TO SHARED MEMORY indx(xx) ID  'SGTXT'.

IMPORT lv_sgtxt FROM SHARED MEMORY indx(xx) ID  'SGTXT'.

  

Thanks

Read only

0 Likes
2,853

Thanks for your help. This is correct, Can you please explain this to me?

Read only

Former Member
0 Likes
2,853

Hi Jb

Are you sure your parameter id is correct?

i did not find it in TPARA table, so just try other id.

regards,

Archer

Read only

Former Member
0 Likes
2,853

see in debug mode how many times the user exixt get triggers.. The memory might have get cleared.

Please chcek if you have used same variables in exixt as well as in your smartforms.

Read only

Former Member
0 Likes
2,853

Hi JB,

*************************************your code**************************

here is my code

DATA; lv_sgtxt type mseg-sgtxt.

EXPORT lv_sgtxt TO MEMORY ID 'SGTXT'. "user exit

IMPORT lv_sgtxt FROM MEMORY ID 'SGTXT'. "smartforms

*****************************************************************************

Replace this with

DATA: lv_sgtxt type mseg-sgtxt,

          lv_sgtxt2 type mseg-sgtxt.

EXPORT lv_sgtxt TO MEMORY ID 'SGTXT'. "user exit

IMPORT lv_sgtxt TO lv_sgtxt2 FROM MEMORY ID 'SGTXT'. "smartforms

Read only

Former Member
0 Likes
2,853

JB - this should work if both parameters are typed the same, but you must check in the debug as mentioned before. Some transactions I have come across reset the PIDS internally (I don't think that is the case here but I am just adding a log to the fire of reasons why it may NOT work in some instances)

There is some alternatives to this approach...why not try using a static class attribute to retain the value? Create a utility class and create an sgtxt attribute and assign it there in user exit and read back in the smartform.

Read only

0 Likes
2,853

Can you tell me how to create this Class?