on 08-16-2007 9:37 PM
Hi,
In the ABAP inbound (server) proxy, I have written code like this.
DATA: lt_material TYPE TABLE OF zxdt_material,
ls_material TYPE zxdt_material,
ls_input type zxmt_cam.
ls_input = input.
lt_material = ls_input-mt_cam-material.
Here, material is a table type which should have 10 records of material. But it has only one records always eventhough I am passing 10 records in the input xml.
What could be the reason?
Any help is really appreciated since I am trying this for a long time now.
Thanks
Ricky
Example code...
here header has simple structure type (non repeating) so we directly assigning fields
INPUT-ACCOUNTLIST-ACCOUNTDETAILINFO has proxy table structure(repeating structure) ,.... so we have used internal table for that..
FUNCTION Z_00FI_ACCOUNTS_RECON_DAT.
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(INPUT) TYPE ZDT_ACCOUNT_RECON_INFO_TARGET4
*"----
TABLES:ZT00FI_ACCDATA, "Accounts Data
ZT00FI_ACCHEAD.
DATA:
LT_ACCOUNTLIST TYPE TABLE OF ZDT_ACCOUNT_RECON_INFO_TARGET3,
LT_ACCDATATAB TYPE TABLE OF ZT00FI_ACCDATA,
LT_ACCHEADERTAB TYPE TABLE OF ZT00FI_ACCHEAD,
LS_ACCOUNTLIST TYPE ZDT_ACCOUNT_RECON_INFO_TARGET3,
LS_ACCDATATAB TYPE ZT00FI_ACCDATA,
LS_ACCHEADERTAB TYPE ZT00FI_ACCHEAD,
LS_HEADER TYPE ZDT_ACCOUNT_RECON_INFO_TARGET.
SELECT SINGLE * FROM ZT00FI_ACCHEAD
WHERE BATCHID = INPUT-HEADER-BATCHID AND
SUBBATCHID = INPUT-HEADER-SUBBATCHID.
*
*IF SY-SUBRC NE 0.
MOVE:
INPUT-HEADER-SOURCEREF TO LS_ACCHEADERTAB-SOURCEREF,
INPUT-HEADER-BATCHID TO LS_ACCHEADERTAB-BATCHID,
INPUT-HEADER-SUBBATCHID TO LS_ACCHEADERTAB-SUBBATCHID,
INPUT-EXTRACTIONINFO-DATAVERSION TO LS_ACCHEADERTAB-DATAVERSION,
INPUT-EXTRACTIONINFO-SOURCESYSTEM TO LS_ACCHEADERTAB-SOURCESYSTEM,
INPUT-EXTRACTIONINFO-COUNTRYCODE TO LS_ACCHEADERTAB-COUNTRYCODE,
INPUT-EXTRACTIONINFO-NUMBEROFACCOUNTS TO LS_ACCHEADERTAB-NUMBEROFACCOUNTS,
INPUT-EXTRACTIONINFO-STARTTIMESTAMP TO LS_ACCHEADERTAB-STARTIMESTAMP,
INPUT-EXTRACTIONINFO-ENDTIMESTAMP TO LS_ACCHEADERTAB-ENDTIMESTAMP,
INPUT-EXTRACTIONINFO-DELTAINDICATOR TO LS_ACCHEADERTAB-DELTAINDICATOR,
INPUT-EXTRACTIONINFO-LASTBATCHINDICAT TO LS_ACCHEADERTAB-LASTBATCHINDICAT.
MOVE 'N' TO LS_ACCHEADERTAB-PROCESSINDICATOR.
APPEND LS_ACCHEADERTAB TO LT_ACCHEADERTAB.
INSERT ZT00FI_ACCHEAD FROM TABLE LT_ACCHEADERTAB.
MOVE INPUT-ACCOUNTLIST-ACCOUNTDETAILINFO TO LT_ACCOUNTLIST.
LOOP AT LT_ACCOUNTLIST INTO LS_ACCOUNTLIST.
MOVE:
INPUT-HEADER-BATCHID TO LS_ACCDATATAB-BATCH_ID,
INPUT-HEADER-SUBBATCHID TO LS_ACCDATATAB-SUBBATCH_ID.
MOVE-CORRESPONDING LS_ACCOUNTLIST TO LS_ACCDATATAB.
APPEND LS_ACCDATATAB TO LT_ACCDATATAB.
CLEAR:LS_ACCOUNTLIST,
LS_ACCDATATAB.
ENDLOOP.
INSERT ZT00FI_ACCDATA FROM TABLE LT_ACCDATATAB.
COMMIT WORK.
*ENDIF.
ENDFUNCTION.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in case of proxy ... first thing you need to check is that . whether data under INPUT is of structure type or proxy table type..
for data having a structure type you have to assign each field separatly..but in case data have proxy table structure then you need to assign the whole data to a internal table and then loop on the internal table and do the assignment and inserting ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Has the table "material" lines of zxdt_material type?
Regards,
Jakub
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.