on 06-05-2011 11:02 AM
Dear all,
We need change contract data ,now we create a program and call FM "BBP_PD_CTR_UPDATE",But when we run the program but the data didn't change and haven't any error,About our source code:
&----
*& Report ZCTR
*&
&----
*&
*&
&----
REPORT zctr.
PARAMETERS:l_no TYPE crmd_orderadm_h-object_id.
DATA:l_header TYPE bbp_pds_ctr_header_d,
l_header1 type BBP_PDS_CTR_HEADER_U,
it_item LIKE bbp_pds_ctr_item_d OCCURS 0 WITH HEADER LINE ,
it_icf LIKE bbp_pds_icf_ctr OCCURS 0 WITH HEADER LINE,
it_dis LIKE bbp_pds_dis OCCURS 0 WITH HEADER LINE,
it_mess like BBP_PDS_MESSAGES OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'BBP_PD_CTR_GETDETAIL'
EXPORTING
i_object_id = l_no
IMPORTING
e_header = l_header
ET_ATTACH =
ET_CONDITIONS =
TABLES
e_item = it_item.
LOOP AT it_item.
CALL FUNCTION 'BBP_PD_CTR_ITEM_GETDETAIL'
EXPORTING
i_guid = it_item-guid
TABLES
"e_icf = it_icf
e_dis = it_dis.
it_icf-P_GUID = it_item-guid.
it_icf-zplant = '5000'.
it_icf-GUID = 1.
append it_icf.
it_icf-GUID = 2.
it_icf-zplant = '6000'.
append it_icf.
ENDLOOP.
MOVE-CORRESPONDING l_header to l_header1.
CALL FUNCTION 'BBP_PD_CTR_UPDATE'
EXPORTING
I_PARK = 'X'
i_header = l_header1
I_SAVE = 'X'
IV_REJECT =
IT_ATTACH =
IT_CONDITIONS =
IV_WITH_CHANGE_APPROVAL = 'X'
IMPORTING
E_CHANGED =
ES_HEADER =
TABLES
i_item = it_item
I_PARTNER =
I_LONGTEXT =
I_ORGDATA =
E_MESSAGES = it_mess
I_HCF =
i_icf = it_icf
I_TOL =
I_DIS =
.
CALL FUNCTION 'BBP_PD_CTR_SAVE'
EXPORTING
IV_WORKITEM_ID =
IV_USERTYPE =
IV_HEADER_GUID = l_header-guid
IV_CREATE_HIST_VERSION =
IV_KEEP_OLD_CHANGER =
IV_NEW_CHANGED_BY =
.
If "zplant" is your custom field on item level, you don't need to use "I_ICF" table for update. You could extend the "INCL_EEW_PD_ITEM_CSF_CTR" structure and it would be embedded in the item structure "BBP_PDS_CTR_ITEM_ICU" itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.