Skip to Content
avatar image
Former Member

help for a JCO rookie: How to feed import parameter into BAPI_USER_CREATE1

Hi,

I want to use JCO and BAPI_USER_CREATE1 to create users in SAP systems, following the steps in the JCO tutorial.

I have difficulties with suppying the import parameters, for example "PASSWORD"

function.getImportParameterList().setValue("XYZ","USERNAME");

is working, but

function.getImportParameterList().setValue("SECRET","PASSWORD");
-->Cannot convert a value of 'GEHEIM' from type java.lang.String to STRUCTURE at field PASSWORD

runs into an error.

Can someone be so kind to provide a code snippet or a link to "how to deal with import structures in JCO"??

Thanx in advance, Dieter

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 08, 2008 at 10:39 AM

    Moin Dieter,

    the field password is of type Structure. Hence you will need to something like the following -

    JCO.Structure passStructure = function.getImportParameterList().getStructure("PASSWORD");
    passStructure.setValue("GEHEIM", "BAPIPWD");
    

    That should do the trick.

    T00th

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 08, 2008 at 11:59 AM

    Thanx, this is exactly what I was looking for...!

    Add comment
    10|10000 characters needed characters exceeded