2012 Jun 28 6:10 PM
Guys,
Some days ago i do this code:
RANGES:
r_vkorg for vbak-vkorg.
t_term[] = r_term[].
(T_TERM HAS NO TYPE, IT WAS DECLARED IN TABLE TAB IN FM WITH NO TYPE)
And this code, works well.
Today i try to do something like that, but whitout sucess:
DATA: BEGIN OF t_ps OCCURS 0.
INCLUDE STRUCTURE ZTBSD_VMOI_PS.
DATA: VGBEL LIKE ZTBSD_VMOI_PS_VS-VGBEL.
DATA: END OF t_ps.
T_ALV[] = T_PS[].
(T_ALV HAS NO TYPE TOO , IT WAS DECLARED IN TBALE TAB IN FM WITH NO TYPE)
But SAP is showing me a DUMP ( Cannot Convert ) :
OBJECTS_TABLES_NOT_COMPATIBLE
SAPLZGSD_VMOI
Nicht zugeordnet
28.06.2012 14:08:43
Two internal tables are neither compatible nor convertible.
Can anyone help me with this? I don't want to create a structure in DDIC just to use one time.
2012 Jun 28 6:58 PM
Hi,
First of all, keep in mind that TABLES parameters in FM are now obsolete (prefer CHANGING). Same for OCCURS key word (better use a TYPES statement to define your table fields)
Now I guess if you declare the table with type STANDARD TABLE in the FM, this could fix your issue... (if you opt for a CHANGING parameter instead, you can use the type ANY TABLE).
Kr,
Manu.
2012 Jun 28 6:58 PM
Hi,
First of all, keep in mind that TABLES parameters in FM are now obsolete (prefer CHANGING). Same for OCCURS key word (better use a TYPES statement to define your table fields)
Now I guess if you declare the table with type STANDARD TABLE in the FM, this could fix your issue... (if you opt for a CHANGING parameter instead, you can use the type ANY TABLE).
Kr,
Manu.
2012 Jun 29 12:32 PM
Thanks for your help , stardard table is a charlike structure and my table is non charlike structure.
I think that's the problem, sap can't convert.
I solved creating a structure in DDIC , but it was a fast solution.
Ps.: Ranges tables are charlike structure too.
2012 Jun 29 12:57 PM
Passing a non charlike structured table should not give any issue...
I tried by using a complex structure including VBAP struture+some other DEC fields witout any issue... how is your Z structure defined?
Another workaround for this could be to use a data reference (TYPE REF TO DATA) and dereference it within the FM with a field-symbols...
e.g:
GET REFERENCE of itab into lo_data.
"pass lo_data to changing parameter of FM (ch_data type ref to data)
"Then, In the FM:
FIELD-SYMBOLS <itab> type any table.
ASSIGN ch_data->* to <itab>.
Kr,
Manu.
2012 Jun 29 1:57 PM
| MANDT | CLNT |
| CLIENTE | CHAR |
| MATERIAL | CHAR |
| PO_VENDOR | NUMC |
| PO_ITEM | NUMC |
| VERSAO | NUMC |
| PO_CUSTOMER | NUMC |
| BASE_DT | DATS |
| ETA_DT | DATS |
| ETA_TIME | TIMS |
| QUANTIDADE | QUAN |
| UNIDADE | UNIT |
| TP_TRANSPORT | CHAR |
| PO_PARCEIRO | NUMC |
| VENDOR | NUMC |
| UPLOAD_DATE | CHAR |
| USUARIO | CHAR |
2012 Jun 29 2:08 PM
Hi,
So this should not give any issue with a TABLES parameter of type STANDARD TABLE....(or with a CHANGING parameter of type ANY).
To stick to your code, I did try this:
DATA: BEGIN OF itab OCCURS 0,
fld TYPE string.
INCLUDE STRUCTURE vbap.
DATA: END OF itab.
CALL FUNCTION 'ZZTEST'
TABLES
it_tab = itab.
With function ZZTEST beeing defined like:
*"----------------------------------------------------------------------
*"*"Local Interface:
*" TABLES
*" IT_TAB TYPE STANDARD TABLE
*" (or
*" CHANGING
*" REFERENCE(IT_TAB) TYPE ANY TABLE )
*"----------------------------------------------------------------------
This is fully working...
Kr,
Manu.
2012 Jun 29 2:59 PM
2012 Jun 29 3:03 PM
Hello Eduardo,
The only missing piece of the jigsaw is the type of the actual param bound to the tables param
Can you check the compatibility between the row types of:
Are they same (read: compatible)? You can post a screenshot if it's possible!
BR,
Suhas
2012 Jul 05 6:59 PM
T_ALV
T_PS
A solved my problem creating a structure in DDIC and declaring T_ALV TYPE MY_STRUCT.