SAP_CMLOGON 

Use

The function SAP_CMLOGON builds the logon sequence (connect string), which is needed to log on to an R/2 or an R/3 System. When the connection is built (allocate), this character sequence must be the first data sent to the target system.

Features

Parameters of the function SAP_CMLOGON:

Buffer

Pointer to the buffer of the calling program

len

Length of the user buffer

reqid

From { "CONN", "FREE", "APPC",.. }

reqtype

From { "DYNP", "RDIA", "RODC", "CPIC", "GRAF",.. }

amode

No. of the alternative mode, from { 1,.., 6 }

mand

Client

name

User name

code

Password

lang

Logon language

prog

Program to be started

modn

Form to be started

rc

Return code

To build the connect string, you have two alternatives:

The calling program must specify a valid pointer as the parameter buffer, which points to a sufficiently large buffer.

The parameter buffer must have the value 0.

Activities

CPIC_CHAR buf[200];
CPIC_INT len;
..
len = sizeof(buf);

SAP_CMLOGON(buf,
&len,
"CONN",
"CPIC",
'1',
"000",
"SMITH",
"SECRET",
'E',
"EXAMPLE",
"TEST",
&return_code);
..

The logon character string for user "SMITH" with the password "SECRET" in client "000" is built in the buffer buf. In alternative mode "1", the ABAP form "TEST" is started in program "EXAMPLE". After the call, the parameter len contains the length of the generated logon seqence. This character string can then be sent using CMSEND.