‎2010 Jan 19 5:44 PM
Hi all,
we are developing a tool in order to update users info (SU01).
The BAPI involved is BAPI_USER_CHANGE.
We have a table which contains a set of actions. Each action change one field at time. So, if I nedd to change the first name and last name, I call the BAPI two times.
More or less it works but, some time, it seems that a buffer (some where) is not cleared and one user is filled with the data of the previous user in the table of actions.
To specify the USER ID we use:
Set paramUserName = rfcFunction.Exports("USERNAME")
paramUserName.VALUE = USER_ID
To specify one filed value we use the structures (ADDRESS, LOGONDATA, DEFAULTS, ecc):
Set paramFieldName = rfcFunction.Exports("ADDRESS")
paramFieldName("FIRSTNAME") = "Wallace"
Of course we set the corresponding X in the fileld name involved of the structure ADDRESSX.
We have used other BAPI (eg. PRGN_RFC_DEL_AGRS_IN_COLL_AGR) which invold tables.
In such case we use the freetable statement to clear the table.
Is the a correspoind statement to clear a structure (like ADDRESS in BAPI_USER_CHANGE) ?
Where I can find a detailed documentation of SAP DLL used to make RFC calls ?
Thanks in advance.
Andrea
‎2010 Jan 19 6:04 PM
I have seen in other post that calling BAPI_TRANSACTION_COMMIT could be necessary.
When is mandatory call BAPI_TRANSACTION_COMMIT ?
Thanks
Andrea
‎2010 Jan 19 6:09 PM
BAPI_TRANSACTION_COMMIT is neccesary... the Logical Unit of Work of changing the user details need to be committed in SAP.
when is it mandatory:
when the change what you wanted to make is successfull, than BAPI_TRANSACTION_COMMIT need to be called to commit the work.
‎2010 Jan 19 6:20 PM
‎2010 Jan 19 6:38 PM
Do I need to call BAPI_TRANSACTION_COMMIT for each call of BAPI_USER_CHANGE of only once at the end.
In other words:
Case 1:
while not .eof actions
BAPI_USER_CHANGE
BAPI_TRANSACTION_COMMIT
wend
Case 2
while not .eof actions
BAPI_USER_CHANGE
wend
BAPI_TRANSACTION_COMMIT
‎2010 Jan 19 7:03 PM
It would be your call, but the Logical Unit of work need to be committed before coming out of the Unit..
‎2010 Jan 19 8:24 PM
I have added the BAPI_TRANSACTIONS_COMMIT but the results is not changed.
My loop have 11670 actions (12 filelds to update for 1000 users).
It seems tha the some fields values are not refreshed and the value is the same as the previous users.
The e-mail field is changed for alla users but always with the value of the first user.
My opinion is that is necessary to clear the input parameters of the structure ADDRESS and ADDRESSX before fill it again and call tha BAPI again.
I have tried to use the freetable statement but it is not accepted by VBA.
Any suggestions ?
Thanks
Andrea