cancel
Showing results for 
Search instead for 
Did you mean: 

Can I put a SID variable into a variant?

0 Kudos

Does SAP supply a way to pull the SAP System ID (SID) into a variant?

We used transaction STVARVC to create a variable Z_SID with value PRD, but when we do system copies, we have the extra step of fixing STVARVC which we want to avoid.  It causes problems when that extra step is forgotton.  Is there a simpler way such as putting $SID or <SYSID> into a variant or is there some trick?

Accepted Solutions (0)

Answers (1)

Answers (1)

isaias_freitas
Advisor
Advisor
0 Kudos

Hello Jordan,

Maybe this can help you:

DATA: LocalInstance TYPE RFCDES-RFCDEST,

          Len TYPE i,

          SysID TYPE CHAR3.

CALL 'C_SAPGPARAM'

  ID 'NAME' FIELD 'rdisp/myname'

  ID 'VALUE' FIELD LocalInstance.

Len = STRLEN( LocalInstance ).

Len = Len - 6.

SysID = LocalInstance+Len(3).

"SysID" will have the SID .

Regards,

Isaías