Application Development 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: 

getting passing parameter globally

Former Member
0 Kudos

Hi all,

how to set and get the parameter globally. If user1 call this program, user1 can get the parameter. If user2 call this program concurrent, user2 also can get the parameter. How to create this session where the parameter is store globally for all users to access?

thks

6 REPLIES 6

former_member223537
Active Contributor
0 Kudos

Hi Gary,

Each User Session is a different Logical Unit of Work (LUW).

SAP doesnt share the buffer/memory details across LUW.

Hence the required functionality is not possible using SET/GET of Memory.

You need to store the details in same table & USER2 can retrieve from the same table.

Best regards,

Prashant

0 Kudos

What is the package i need to insert when i double click on the:

set parameter id <b>'XYZ'</b> field var.

to create the object. I put my package ZGARY. It says:

SAP object PARA XYZ cannot be assigned to package ZGARY.

What is the right package?

Former Member
0 Kudos

goto su01 transcation.

parameters tab assizn u default global parameter.

ex cost center kot 'cost'.

using get parameters assizn through user.

0 Kudos

i go in su01

i gt this parameter ID xyz in my Parameter Tab.

But this parameterID xyz does not exist. How to clear this ID xyz?

0 Kudos

The parameters are maintained in the table TPARA.

For ex:

Goto SU01, give the user name and then go to the Parameters Tab

there give in the parameter id as BUK and the parameter Value with a valid company code name.

then later in your program you can default it like this

  select single * from USR05
                  into IS_USR05
                  where BNAME = SY-UNAME
                    and PARID = 'BUK'.
  if SY-SUBRC = 0.
    ZES_RFQ-BUKRS = IS_USR05-PARVA.
  else.
    message E138(ZSM) with 'Company Code not maintained for User ' SY-UNAME.
  endif.

Regards

Gopi

Former Member
0 Kudos

Hi gary,

You can use the EXPORT and IMPORT statements for your

requirement with a memory ID, which can be any string of characters.

this is the declaration reqd.


DATA: wa_indx TYPE indx.

this is the export statement


*here variables cname and projname have to be of dame type
*project name
      projname = 'some value'.
      EXPORT cname = projname TO DATABASE indx(xy) FROM wa_indx CLIENT
            sy-mandt ID 'ABCD'.

after this the parameter will be set in memory and you can import into

any program on this server using...

data: wa_indx type indx.

this is the import statement.


*here cname and projname are again declared in new prog.
*and imported value will come into projname variable.
*REMEMBER to keep the ID same.
  import cname = projname from database indx(xy) to wa_indx client
        sy-mandt id 'ABCD'.

Regards,

Samson Rodrigues.