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

Create User with BAPI using "BAPI_USER_CREATE1" from Excel Macros/VBA.

Former Member
0 Likes
8,236

Hello All,

I am trying to create user at R/3 level using Excel Macros/VBA.

I am able to logon to system from the code.

But i am unable to pass values to parameters for BAPI funtion "BAPI_USER_CREATE1".

I am getting error "Structure member not found" : in second line of code ...

sample code :

     Set objBAPIFunc = objBAPIControl.Add("BAPI_USER_CREATE1")

    objBAPIFunc.exports("USERNAME") = "support123"

    objBAPIFunc.exports("PASSWORD") = "password@123"

    objBAPIFunc.exports("LASTNAME") = "support"

Any help on passing parameters to "BAPI_USER_CREATE1" is highly appreciated.

Thanks,

Sudeep

2 REPLIES 2
Read only

Former Member
0 Likes
4,172

Hi ,

Can you pass  the data to USERNAME,LOGONDATA,PASSWORD and ADDRESS Import Parameter as per sequence , these import field's are mandatory , so maintain these fields in VBA Code .

also check below link ....

How to connect to SAP R/3 and call BAPI from MS Excel VBA...

Regard's

Smruti

Read only

0 Likes
4,172

Hello Smruti,

I am able to call the BAPI Fuction and pass parameter.

I was passing "PASSWORD" as plain text but later found that it needs to be passed as structure like Logondata & Address.

Thanks for your reply.

But now i am stuck with other error.

I am not able to call BAPI function for releases 710 & beyond.

I am facing error "Form of address key  is not defined "  when i calling BAPI function with  :

" objBAPIFunc.Call ".

I found one post to check SAP note 1002015  but is not applicable for releases 710 & beyond.

Please help to resolve the issue.

Thanks,

Sudeep