Skip to Content
author's profile photo Former Member
Former Member

How NOT to harcode user and password in the code using SAP Jco

Hi, I have successfully used SAP Jco to call from a Java Mapping program in XI to a Function Module in SAP.

But there is a MAJOR problem, the User and Password from the SAP user are harcoded in the Java program, is there a SECURE way to get and use the user and password without being harcoded in the java program?

Regards.

Mariano.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    Posted on Mar 17, 2009 at 03:23 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 17, 2009 at 03:18 PM

    Use RFC lookup concept instead.

    In RFC lookup you will call the RFC communication channel. So password will not be exposed.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 17, 2009 at 03:20 PM

    PI mapping provides an API where you can use RFC look-ups based on a communication channel.

    If possible, you should rather use that API instead of JCo.

    Regards

    Stefan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 17, 2009 at 04:36 PM

    just to add to the above comments the lookup will be the best option as mentioned by all.

    providing you the link for the lookup API that should help you more - http://help.sap.com/javadocs/NW04S/current/pi/index.html (also look at the document provided by Mike to see how a RFC lookup is implemented)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 17, 2009 at 04:47 PM

    Hi

    Please look at this blog how to hide the connection parameters in JCO calls

    /people/sameer.shadab/blog/2008/07/15/jco-lookup--hide-the-connection-parameters-from-source-code

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 17, 2009 at 05:10 PM

    Mariano,

    Apart from all suggestion from xperts, one more simple way. If your function module is present on XI server, with xslt on abap mapping you do not need to provide sap server details. You can call this function module directly in xslt on abap mapping. Transaction Code for xslt on abap : xslt_tool.

    Just for info.

    Thanks,

    Nilesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.