Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CRM Query..?

Former Member
0 Likes
423

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.

2 REPLIES 2
Read only

Former Member
0 Likes
381

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.

Read only

0 Likes
381

Im not expecting that answer. Do we need intermediate table or not, if S why what is the reason..?

Akshitha.