Hi Experts,
I have a requirement to create a Service order using a BAPI.
I'm trying to use the BAPI BAPI_BUSPROCESSND_CREATEMULTI. I found some code related to this BAPI on this forum and and I've written my code based on that and while executing it i'm getting a short dump. Could anyone please help me figure out what the problem is.
My code is as follows:
data: lv_header_guid type guid_32.
data: begin of lit_header occurs 0,
include type BAPIBUS20001_HEADER_INS,
end of lit_header.
data: wa_header type BAPIBUS20001_HEADER_INS.
data: begin of lit_inputfields occurs 0,
include type BAPIBUS20001_INPUT_FIELDS,
end of lit_inputfields.
data: wa_inputfields type BAPIBUS20001_INPUT_FIELDS.
data: begin of lit_partner occurs 0,
include type BAPIBUS20001_PARTNER_INS,
end of lit_partner.
data: wa_partner type BAPIBUS20001_PARTNER_INS.
Create Contract header guid
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = lv_header_guid.
Fill orderadm_h
wa_header-guid = lv_header_guid.
wa_header-process_type = 'YSC'.
APPEND wa_header TO lit_header.
Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'0001' TO wa_partner-ref_partner_handle,
'ORDERADM_H' TO wa_inputfields-objectname,
'PROCESS_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
Fill PARTNER DETAILS
Sold to Party
MOVE: lv_header_guid TO wa_partner-ref_guid,
'A' TO wa_partner-ref_kind,
'0001' TO wa_partner-ref_partner_handle,
'CRM000' TO wa_partner-partner_fct,
'5000000288' TO wa_partner-partner_no,
'BP' TO wa_partner-no_type,
'BP' TO wa_partner-display_type,
'X' TO wa_partner-mainpartner.
APPEND wa_partner TO lit_partner.
CLEAR wa_partner.
Fill input fields
MOVE: lv_header_guid TO wa_inputfields-ref_guid,
'A' TO wa_inputfields-ref_kind,
'0001' TO wa_inputfields-logical_key,
'PARTNER' TO wa_inputfields-objectname.
MOVE 'PARTNER_FCT' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'PARTNER_NO' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'NO_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
MOVE 'DISPLAY_TYPE' TO wa_inputfields-fieldname.
APPEND wa_inputfields TO lit_inputfields.
CLEAR wa_inputfields.
CALL FUNCTION 'BAPI_BUSPROCESSND_CREATEMULTI'
TABLES
HEADER = lit_header
ITEM =
ACTIVITY =
SALES =
PARTNER = lit_partner
ORGANISATION =
SHIPPING =
APPOINTMENT =
TEXT =
SERVICE_OS =
STATUS =
INPUT_FIELDS = lit_inputfields
CREATED_PROCESS =
RETURN =
LEAD =
OPPORTUNITY =
PRODUCT =
SCHEDULELINE =
CUSTOMER_HEAD =
CUSTOMER_ITEM =
PRICING =
PRICING_ITEM =
CONDITION_CREATE =
BILLING =
CONFIG_CFG =
CONFIG_BLB =
CONFIG_INS =
CONFIG_PRT =
CONFIG_VAL =
CONFIG_VK =
CONFIG_REF =
ADDRESS =
BILLPLAN =
BILLPLAN_DATE =
EXTENSIONIN =
DOCUMENT_FLOW =
BATCH =
PRICING_AGR_CRM =
FINPROD_ITEM =
CANCEL =
CANCEL_IR =
PRODUCT_LIST =
PRODUCTS =
OBJECTS =
PAYPLAN =
PAYPLAN_DATE =
CONFIG_FILTER_CFG =
CONFIG_FILTER_INS =
CONFIG_FILTER_PRT =
CONFIG_FILTER_VAL =
ACTIVITY_I =
EXT_REF =
.
ENDFUNCTION.
I'm getting the following dump.
Runtime Errors ITAB_ILLEGAL_COMPONENT
Date and Time 07.09.2006 21:29:03
Short dump has not been completely stored (too big)
-
-
Short text |
Invalid line component &V2 in "... KEY k1 = v1 ... kn = vn". |
-
-
Error analysis |
When the ABAP/4 program "SAPLCRM_BUSPROCESSND_BAPI" attempted to process the |
internal table "HEADER[]" |
with "... KEY k1 = v1 ... kn = vn", a component "HANDLE " was specified |
dynamically as the contents |
of the field "LV_STR_HANDLE". However, the line type "u" of the internal table |
"HEADER[]" |
contains no component "HANDLE ". |
| -
Information on where terminated |
Termination occurred in the ABAP program "SAPLCRM_BUSPROCESSND_BAPI" - in |
"SET_RETURN_VALUES". |
The main program was "RS_TESTFRAME_CALL ". |
In the source code you have the termination point in line 36 |
of the (Include) program "LCRM_BUSPROCESSND_BAPIF80". |
-
-
Source Code Extract |
-
Line | SourceCde |
-
6 | &---- |
7 |
|
8 | ---- |
9 |
|
10 |
|
11 |
|
12 |
|
13 | ---- |
14 | form set_return_values tables header structure BAPIBUS20001_HEADER_INS |
15 | item structure BAPIBUS20001_item |
16 | using p_lt_orderadm_h_com type any table |
17 | p_lt_orderadm_i_com type any table |
18 | . |
19 | |
20 | data: lv_str_handle type fieldname, |
21 | lv_str_headerhandle type fieldname, |
22 | lv_str_objectid type fieldname. |
23 | |
24 | |
25 | field-symbols: <ls_orderadm_h> type crmt_orderadm_h_com, |
26 | <ls_orderadm_i> type crmt_orderadm_i_com, |
27 | <ls_header> type BAPIBUS20001_HEADER_INS, |
28 | <ls_item> type BAPIBUS20001_item. |
29 | |
30 | |
31 | lv_str_handle = 'HANDLE'. |
32 | lv_str_headerhandle = 'HEADER_HANDLE'. |
33 | lv_str_objectid = 'OBJECT_ID'. |
34 | |
35 | loop at p_lt_orderadm_h_com assigning <ls_orderadm_h>. |
>>>>> | read table header with key (lv_str_handle) = <ls_orderadm_h>-handle |
37 | (lv_str_objectid) = <ls_orderadm_h>-object_id |
38 | assigning <ls_header>. |
39 | if sy-subrc = 0. |
40 | <ls_header>-guid = <ls_orderadm_h>-guid. |
41 | endif. |
42 | endloop. |
| 43|
Could anyone please help me with this.
Thanks,
Preethi
Message was edited by: Preethi Sooth