Skip to Content
avatar image
Former Member

Table Parameter & JCO

Hi Experts,

I'm using JCO to access BAPIs from our SAP-System. Now I'm trying to use a wrapper BAPI for CHANGE_POINTERS_CREATE_DIRECT to create an entry for the table BDCPV. The wrapper has exactly the same parameters as CHANGE_POINTERS_CREATE_DIRECT. Here is a part of my coding:

f=jco.getFunction("Z_CP_CREATION");//my own method to retrieve a function

f.getImportParameterList().setValue("message", "MESSAGE_TYPE");

table=f.getTableParameterList().getTable("T_CP_DATA");

table.appendRow();

table.setValue("someValue","TABNAME");

table.setValue("someValue","TABKEY");

table.setValue("someValue","FLDNAME");

table.setValue("someValue","CDOBJCL");

table.setValue("someValue","CDOBJID");

table.setValue("someValue","CDCHGID");

jco.execute_function("Z_CP_CREATION");

My problem now is, that the parameters, which are set in the table, are not getting to the BAPI. When I debug the BAPI while running this code, I see, that the import parameter (message) is received but the table T_CP_DATA is empty.... So what the heck am I doing wrong?

Regards

Torsten

Edited by: Torsten Nordmann on Jan 22, 2008 5:00 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 22, 2008 at 03:58 PM

    Hello

    AFAIK you need to append a row to the table before inserting values

    try table.appendRow()

    regards franz

    reward points if useful

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      No, because I've already rewritten the code, so the Z_CP_CREATION gets all it needs via Import Parameters, now, to call CHANGE_POINTERS_CREATE_DIRECT. Actually this way works, but that's not satisfying. There has to be a way to use tables to get data into BAPIs.