on 01-22-2008 3:30 PM
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
Hello
AFAIK you need to append a row to the table before inserting values
try table.appendRow()
regards franz
reward points if useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
maybe there is a problem in your Z function module
do you use a table with a work area, if so change the calling of the bapi like this
CALL FUNCTION .....
IMPORTING
....
EXPORTING
....
TABLES
T_CP_DATA = MY_CP_DATA[]
because without the [] i think you only hand over the work area of the table (which in case of RFC is initial)
also try to debug your Z function module to see if the table data arrives there
regards franz
did you try to set the table parameter with [] in your Z function module
code should look like this
CALL FUNCTION 'CHANGE_POINTERS_CREATE_DIRECT'
EXPORTING
message_type = my_message_type
tables
t_cp_data = my_cp_data[]
otherwise only the workarea (or in German 'Kopfzeile') of your internal table is submitted, an this workarea in case of RFC is empty
regards franz
Franz,
as I stated, the call for CHANGE_POINTERS_CREATE_DIRECT works just fine. This is no ABAP problem, it's a JCO problem as far as I can say.
I call Z_CP_CREATION via JCO (Java Connector for SAP). Z_CP_CREATION is just a wrapper for CHANGE_POINTERS_CREATE_DIRECT, because CHANGE_POINTERS_CREATE_DIRECT can't be called via RFC.
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.