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

Call R/3 transactions and pass of parameters using java sapgui

Hi all,

We need to execute R/3 transactions and passing parameters (for example parter number, contract number...) using java sapgui 6.40 inside an applet. But we have several problems :

1--> We are using the following connection string:

. The transaction is executed correctly but we need to pass the parter number, and we don´t know how.

2--> We don´t know where to place java sapgui on the web application server in order to deploy it to the users.

In addition, some of documentation will be great, could someone tell me where I could find it?

Thanks in advance

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 03:04 PM

    Hello,

    Maybe the better solution would be to create named transaction variants for your users to choose. But if you insist on specifying field values in the connection string this also is possible.

    Please note that this is an obscure feature and therefore not documented.

    1.) You can add parameter lists to your tran parameter:

    let's take the example of transaction "se38" and the corresponding entry field "RS38M-PROGRAMM".

    You could start the transaction and fill in your parameter values like this:

    conn=/H/server/S/port&tran=se38 RS38M-PROGRAMM=report&clnt=002&fast=true

    in general the syntax is:

    tran=<transaction> [variant] <param1>=<value1>;<param2>=<value2>

    the

    [variant]

    parameter is optional

    You can get the field name from the names shown in the screen painter and you can test the transaction string in the ok code field i.e.:

    /nse38 RS38M-PROGRAMM=report

    2.) Since you are serving the applet somehow you have a running web server. There are no restrictions at all where to place the gui. Just unpack the installation jars for the needed platforms at some directory your web server can access. See chapter 8 of the installed documentation for further information.

    3.) The terse but complete documentation in HTML format is installed inside the gui directory:

    /path/to/installation/SAPGUI6.40/doc the main document is manual.htm

    with kind regards

    Michael Barth

    (SAPGUI for Java Development)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 03:58 PM

    Hello Michael,

    First of all, thank you very much for your quick response.

    We tried to do what your suggested, but it only works for transaction se38. We tested it for transaction CIC0 and it doesn´t work and for transactions developped by us it doesn´t work either.

    Could you please tell us if the transaction to be executed should have special features?

    We marked in properties for these transactions the flag SAP GUI for JAVA.

    Did we forget to do something else?

    Thanks in advance.

    Best regards.

    Carmen Rodríguez

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2005 at 07:05 AM

    Hello,

    Parameter transfer should not depend on the target transaction or the gui. The critical things are the names of the fields in the program, and the transaction code syntax with one space between transaction name and parameter list.

    I would suspect you get the parameter names wrong.

    with kind regards

    Michael Barth

    (SAPGUI for Java Development)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2005 at 08:51 AM

    Hello Michael,

    The sintax of the connection string is correct, finally we found the problem.

    For example, we tried to pass parameters to transaction se11 and it didn´t work. We started looking for differences between se38 and se11 and we discovered the following point. If you go to trans

    action se93 and enter the se11 transaction, and F7 to see properties, you can see an standard program: DD_START: If you see the code of this program, the following appears:

    if sy-tcode = 'SE11'.

    call transaction 'SE11_OLD'.

    else.

    call transaction 'SE12_OLD'.

    Inside the code, when you execute se11 transaction, the transaction that is really executed is se11_old. So, we tried to pass the parameters using this transaction, and finally it worked!!!!

    But unfortunately, we have a new problem. When we execute

    /n se11_old RSRD1-TBMA_VAL=TADIR it works, but if we launch this transaction from the connection string, it doesn´t work. Do you know what is due to?

    Thanks in advance and sorry for our insistence.

    Best regards

    Carmen Rodríguez

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2005 at 09:29 AM

    Hello Michael,

    Sorry, I think I did´t explained the problem well before and maybe for that you didn´t understand it.

    What I meant before is that when we test the transaction string in the ok code field, it goes well, but if we execute our applet, where is placed the connection string, the parameters are not passed.

    We are using this connection string:

    /M/172.16.20.53/S/3610/G/SPACE&tran SE11_OLD RSRD1-TBMA_VAL=tadir

    Thanks in advance Michael.

    Carmen Rodríguez

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      > /M/172.16.20.53/S/3610/G/SPACE&tran SE11_OLD

      > RSRD1-TBMA_VAL=tadir

      I don't know if this is a typo in the forum but here we are missing a "="

      tran=/M/172.16.20.53/S/3610/G/SPACE&tran<b>=</b>SE11_OLD RSRD1-TBMA_VAL=tadir

      this connection string works happily with my applet:

      var connectionData 'conn=/R/<system>/G/<group>&tran=se11_old RSRD1-TBMA_VAL=TADIR&fast=true';

      (yeah I actually tested this before replying 😉)

      with kind regards

      Michael Barth

      (SAPGUI for Java Development)

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2005 at 03:24 PM

    Thank you Michael!!!!!

    The problem was solved!!!!

    We have one more (and last)question: we must pass also the ok_code of the screen. Do you know what is the parameter? I mean, to pass a transaction you must use 'tran'. What is the code to pass the ok_code if that is possible?

    Thanks, thanks, thanks.

    Carmen Rodríguez

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello,

      Although the technical details are somewhat different, what you are doing when filling the tran parameter in your connection document is connecting to the system, and after logon filling the value of the tran parameter into the ok-code field and pressing enter. So there is not really a possibility to fill in the ok-code field after you have reached the target transaction.

      The only way to automate the gui over more than one screen is client side scripting as described in Chapter 1.3 of the gui documentation but I do not see an easy way to do this from an HTML page.

      with kind regards

      Michael Barth

      (SAPGUI for Java Development)

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.