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

Function Module

abdulazeez12
Active Contributor
0 Likes
451

Hii All,

I am working on an object where it is desired that system id and mandt is to be checked and if the server is DEV and client is 200, then, the processing is to be done. Else, it should throw an error message. This type of functionality is configured in the client level settings.

Now, to resolve this, I can use

if sy-sysid = DEV and sy-mandt = 200

-


-


else

error message.

endif.

But, I dont want to hardcode these system variable values to check the condition.

Can anyone tell me how is it possible without hardcoding thevalues? Is there any function module for this? Howis client level configuration changes be prevented? any table exixts where i can check if i can go ahead or not?

Appreciate your replies..

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
381

HI,

You can use <b>SUSR_ZBV_CLIENTSYSTEMS_GET</b> Function module,

Goto SE37 and execute this transaction, and give username in the column <b>Delivery_mode</b> , then press F8. you will get Export Parameters, click the table Icon,You will get Client and System. Client is the first Column and the System is 4th Column,

You will get here what you want, but i do not know whether it is the correct way or not....

Regards

Sudheer

Read only

sridhar_k1
Active Contributor
0 Likes
381

Try the following code:

tables t000.

select single * from t000 client specified

where mandt = sy-mandt

and ccnocliind eq space.

if sy-subrc ne 0.

Raise error.

endif.

check the allowed values of t000-ccnocliind and adjust your select statement accordingly.

Regards

Sridhar

Read only

ferry_lianto
Active Contributor
0 Likes
381

Hi Shakir,

Perhaps you can use table TVARV to store the system information for your validation instead of hardcoded.

To maintain table TVARV, please use transaction code <b>STVARV</b>. Click on Change button and create a variant by entering the value and save the variant. Before check the button "Include changed entries in transport request".

SELECT SINGLE * 
FROM TVARV
WHERE NAME = 'REPORT_XYZ_SYSTEM_INFO'. 

IF SY-MANDT = TVARV-LOW AND    <-- "DEV 
   SY-SYSID = TVARV-HIGH.      <-- "200
   ...                         "Perform activity 
ELSE.
   ...                         "Error message
ENDIF.

Hope this will help.

Regards,

Ferry Lianto