2012 Feb 07 5:56 AM
Hi,
My client is non SAP. They connect to SAP through an intermediate software , using RFC connections. My client requires that when creating a BOM through BAPI, the "created by" column should have a user name they pass, and not the username with which the RFC connected .
Is it possible to have a FM in which I can create a new user session, passing username and password, call the bapi that will create the BOM with this username, and close the session?
Kindly help.
Thanks in advance
2012 Feb 09 12:44 PM
Dear Mr. Raymond,
When I started coding I realised that I cannot get the return table that gets populated in the BAPI,which I have written inside a report that I use to submit, since a report can't return anything. Can you provide me a solution for this?
Thanks a lot in advance.
Edited by: philipte on Feb 9, 2012 1:45 PM
Hi,
My client is non SAP. They connect to SAP through an intermediate software , using RFC connections. My client requires that when creating a BOM through BAPI, the "created by" column should have a user name they pass, and not the username with which the RFC connected .
Is it possible to have a FM in which I can create a new user session, passing username and password, call the bapi that will create the BOM with this username, and close the session?
Kindly help.
Thanks in advance
2012 Feb 07 6:43 AM
Hi,
You just create an FM(RFC) to create a BOM and user name. if the user name is already exist then skip the creation part and reuse the same user. Creating a user there is some function modules try that one.
2012 Feb 07 6:58 AM
These users already exist in the system. But they connect to SAP using a common communication userid. The requirement is that, although there is only one communication userid, once connected to SAP, login again with the userid, password passed by the caller, then call the bapi.
2012 Feb 08 6:19 AM
Can anybody help me on this issue?
All i need to know is this.
If i have logged in with user 'A' , inside a FM, can i write any kind of code that would let me login with a different username 'B', so that sy-uname would be 'B' now instead of 'A' , so that all my transactions with create stuff with the "created by" field as 'B'.
Thanks in advance,This is very urgent.Please help
2012 Feb 08 8:45 AM
2012 Feb 09 9:55 AM
Thanks Mr. Raymond. That was very useful. I was able to create a Material BOM using a different username. My only question is, will this cause any audit issue, ie providing username exolicitly?
2012 Feb 09 10:42 AM
Most security audits will trigger a warning when they determinate that the RFC common user is allowed to use another logon id. Usually you can provide auditors a list of such id with explanation before the audit execution, sample of explanation to provide :
- The RFC enabled FM which create the batch job must pass the logon id to be used, and the calling application must not allow user to change this value.
- The RFC default logon, should be allowed to the minimal authorization required, and could be for example allowed to no transaction, only some RFC FM. (start with [Note 460089 - Minimum authorization profile for external RFC programs|https://service.sap.com/sap/support/notes/460089])
Regards,
Raymond
2012 Feb 09 12:44 PM
Dear Mr. Raymond,
When I started coding I realised that I cannot get the return table that gets populated in the BAPI,which I have written inside a report that I use to submit, since a report can't return anything. Can you provide me a solution for this?
Thanks a lot in advance.
Edited by: philipte on Feb 9, 2012 1:45 PM
2012 Feb 09 1:20 PM
One suggestion (many solutions to synchronioze two jobs/sessions)
In the calling report (in the RFC session)
- Submit the batch job with immediate execution
- In an endless do-loop, wait the job end (eventually abort) via BP_JOB_CHECKSTATE or similar FM and WAIT some SECONDS statement
- Read (import from database) the return table
In the called report (in the batch job)
- Execute the BAPI and COMMIT/ROLLBACK
- Store the return table in a database table (like an INDX table, insert via export to database statement) with the jon number as a key
Regards,
Raymond
2012 Feb 09 11:23 PM
Hi Philipte,
Actually this requirement is getting complex for you, better you change the created by field with the new user name, there are certain exit's available in this BAPI, or even you can modify the stack data and change this details. This will let you get the exact user name in your document also this will not look for a new session.
Best Regards,
Tapodipta Khan.
2012 Feb 13 6:16 AM
Thanks Everyone for replying, Esp. Mr. Raymond. I was able to resolve the issue. I used Export to Database & Import from Database as suggested.There is an inconsistency sometimes, but I will try to resolve that myself.
Thanks a lot once again.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |