2016 Jun 23 11:53 AM
Hie All.
I would like to reference a field within a deep structure but i get this error:
"INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM" is a table without a header
line and therefore has no component called "HH".
The code is below:
REPORT ZIMRA_TEST2.
DATA: PROXY TYPE REF TO ZTMSCO_ZIMRA_IMS_PROCESS_FISCA .
DATA: OUTPUT type ZTMSZIMRA_SUBMIT_INVOICES_SOAP.
DATA: INPUT type ZTMSZIMRA_SUBMIT_INVOICES_SOA1.
INPUT-INVOICE-BPN = 'TEST'.
INPUT-INVOICE-CODE = 'LINEITEM'.
INPUT-INVOICE-MACNUM = '172.16.0.50'.
INPUT-INVOICE-DECSTARTDATE = '2016-06-22'.
INPUT-INVOICE-DECENDDATE = '2016-06-22'.
INPUT-INVOICE-DETSTARTDATE = '2016-06-22'.
INPUT-INVOICE-DETENDDATE = '2016-06-22'.
INPUT-INVOICE-CPY = '1'.
INPUT-INVOICE-IND = '1'.
INPUT-INVOICE-INVOICES-RECORD-ITYPE = '1112'.
INPUT-INVOICE-INVOICES-RECORD-ICODE = 'LINEITEM'.
INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM- HH = '1'.
This is how the structure looks like:
I tried to borrow the idea from the thread https://scn.sap.com/thread/1690727 as follows:
DATA: warea TYPE ZTMSARRAY_OF_INVOICEINVOICESRE.
READ TABLE INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM INTO warea INDEX 1.
warea-HH = '1'.
I get not syntax error, but the field INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM-HH doesn't insert anything in the database. It remains blank.
Regards,
Joseph.
2016 Jun 23 12:06 PM
As message says:
"INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM" is a table.
So you need to work with it as with table (internal table). It seems you want to insert (or read?) one line and fill value of HH field in that line?
You can simply do it with basic ABAP statements - APPEND/INSERT, READ TABLE ... ASSIGNING / READ TABLE + MODIFY....
Your code example with "warea" does not checks if there really is any line on index 1. And if does exist, you would need to MODIFY table with warea you have changed after READ TABLE.
As message says:
"INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM" is a table.
So you need to work with it as with table (internal table). It seems you want to insert (or read?) one line and fill value of HH field in that line?
You can simply do it with basic ABAP statements - APPEND/INSERT, READ TABLE ... ASSIGNING / READ TABLE + MODIFY....
Your code example with "warea" does not checks if there really is any line on index 1. And if does exist, you would need to MODIFY table with warea you have changed after READ TABLE.
2016 Jun 23 12:06 PM
As message says:
"INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM" is a table.
So you need to work with it as with table (internal table). It seems you want to insert (or read?) one line and fill value of HH field in that line?
You can simply do it with basic ABAP statements - APPEND/INSERT, READ TABLE ... ASSIGNING / READ TABLE + MODIFY....
Your code example with "warea" does not checks if there really is any line on index 1. And if does exist, you would need to MODIFY table with warea you have changed after READ TABLE.
2016 Jun 23 1:01 PM
2016 Jun 23 1:22 PM
thanks. i used APPEND and it worked fine.
warea-HH = '1'.
warea-ITEMCODE = '1'.
warea-ITEMNAME1 = 'test1'.
warea-ITEMNAME2 = 'test2'.
warea-QTY = '1'.
warea-PRICE = '100'.
warea-AMT = '100'.
warea-TAX = '15'.
warea-TAXR = '15'.
APPEND warea TO INPUT-INVOICE-INVOICES-RECORD-ITEMS-ITEM.
Regards,
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |