‎2008 Oct 31 11:55 AM
Hi Guys,
I have a query regarding CRM Tables. Those are:
CRMD_ORDERADM_H
CRMD_ORDER_INDEX
CRMD_ORDERADM_I
While retrieving the data from CRMD_ORDERADM_I do we need the middle table CRMD_ORDER_INDEX..? OR we can retrieve directly through the header table: CRMD_ORDERADM_H. Pls let me know what is the purpose of this table..CRMD_ORDER_INDEX..? pls see the code below.
SELECT * FROM crmd_orderadm_h INTO TABLE it_crmd_orderadm_h.
IF NOT it_crmd_orderadm_h[] IS INITIAL.
SELECT * FROM crmd_order_index
INTO TABLE it_crmd_order_index
FOR ALL ENTRIES IN it_crmd_orderadm_h
WHERE header EQ it_crmd_orderadm_h-guid.
ENDIF.
IF NOT it_crmd_order_index[] IS INITIAL.
SELECT * FROM crmd_orderadm_i INTO TABLE it_crmd_orderadm_i
FOR ALL ENTRIES IN it_crmd_order_index
WHERE guid EQ it_crmd_order_index-item.
ENDIF.
OR
IF NOT it_crmd_orderadm_h[] IS INITIAL.
SELECT * FROM crmd_orderadm_i INTO TABLE it_crmd_orderadm_i
FOR ALL ENTRIES IN it_crmd_orderadm_h
WHERE header EQ it_crmd_orderadm_h-guid.
ENDIF.
‎2008 Oct 31 12:00 PM
Hello,
I will give on FM which will retrive all the data Into the internal tables instead of going to each select statement.
read table y_i_qtno into y_wa_qtno with key object_id = y_p_ordr.
insert y_wa_qtno-guid into table y_i_guid_h.
data : y_wa_qtno type y_t_qtno,
y_i_orderadm_i type crmt_orderadm_i_wrkt,
y_i_guid_h type crmt_object_guid_tab,
select guid
object_id
from crmd_orderadm_h
into table y_i_qtno
where object_id eq y_p_ordr.
call function 'CRM_ORDER_READ'
exporting
it_header_guid = y_i_guid_h
importing
et_orderadm_i = y_i_orderadm_i
et_product_i = y_i_product_i
et_sales = y_i_sales_i
et_partner = y_i_partner
et_status = y_i_status_i
exceptions
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
others = 7.
First call the FM and in the improting take all the tables which you required then loop that internal table with requirements.
Still if you need some other data you can select the data directly.
‎2008 Oct 31 12:02 PM
Im not expecting that answer. Do we need intermediate table or not, if S why what is the reason..?
Akshitha.