cancel
Showing results for 
Search instead for 
Did you mean: 

Create confirmation

Former Member
0 Kudos

Hi Experts

I'm creating conformations using BAPI_CONFEC_CREATE. I'm getting the PO data using BBP_PD_PO_GETDETAIL.

I'm passing

Header:

ls_header_conf-BUSINESSPROCESS = '00000000000000000000000000000001'.

ls_header_conf-PROCESS_TYPE = 'CONF'.

ls_header_conf-SUBTYPE = ls_header_po-SUBTYPE.

Item:

ls_item_conf-ITEM_NUMBER = <fs_item_po>-NUMBER_INT.

ls_item_conf-PARENT = '00000000000000000000000000000001'.

ls_item_conf-PO_NUMBER = IM_PO_NUM.

ls_item_conf-PO_GUID = IM_PO_GUID.

ls_item_conf-PO_ITEM_NUMBER = <fs_item_po>-NUMBER_INT.

ls_item_conf-PO_ITEM_GUID = <fs_item_po>-guid.

partner:

ls_partner_conf-PARTNER_FCT = <fs_partner_po>-PARTNER_FCT.

ls_partner_conf-PARTNER_guid = <fs_partner_po>-PARTNER_no.

(which are only on the header level)

I'm getting these 2 errors in the return table:

1)E BS 013 Active status of document Confirmation 5100000099 is Complete . No changes are possible 000000 COMP Confirmation 5100000099 Complete Rejected in Part 0

2)E BS 013 Active status of document Confirmation 5100000099 is Confirmed . No changes are possible 000000 CONF Confirmation 5100000099 Confirmed Rejected in Part 0

Can anyone help me.

Please provide a sample code so that I can pass the correct data.

Points will be rewarded.

Thanks

Ankit Pradhan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

pls check OSS note 1090580 may be it is usefull

Former Member
0 Kudos

Hi Raghu,

I have seen the note in 1090580, but does not apply to my problem ... If I create a confirmation through the portal, the confirmation is created without any error in the SRM and replicated in ECC.

This error only occurs when I try to create a confirmation in my development through function

BAPI_CONFEC_CREATE.

Probably the problem is in filling of the parameters of the function.

Have you any idea what is causing the error?

If you have, please provide me a sample of code so that I can pass the correct data.

Thanks,

Leonel

Former Member
0 Kudos

Hi all,

After a little more research, I discovered that I can also create confirmations through the class / SAPSRM / IF_PDO_BO_CONF.

Below is the code I used to do a test. Some variables are hardcoded:

CONSTANTS: lc_cf      TYPE bbp_h_subtype    VALUE 'CF',
           lc_bus2012
TYPE swo_objtyp       VALUE 'BUS2012',
           lc_bus2201
TYPE swo_objtyp       VALUE 'BUS2201',
           lc_profi  
TYPE bbp_iv_user_type VALUE 'PROFI'.

DATA: lv_po_guid  
TYPE bbp_guid,
      lv_po_logsys
TYPE bbp_logsys,
      lv_objtyp   
TYPE swo_objtyp,
      lv_qty      
TYPE bbp_pds_conf_item_icu-quantity.

DATA: lo_bo_conf_adv
TYPE REF TO /sapsrm/if_pdo_bo_conf_adv,
      lo_bo_conf    
TYPE REF TO /sapsrm/if_pdo_bo_conf.

DATA: ls_conf_header    
TYPE bbp_pds_conf_header_d,
      ls_conf_header_upd
TYPE bbp_pds_conf_header_u,
      lt_conf_item      
TYPE /sapsrm/t_pdo_conf_item_app,
      ls_conf_item      
TYPE bbp_cf_item_app,
      lt_conf_item_upd  
TYPE bbpt_pd_conf_item_icu,
      ls_conf_item_upd  
TYPE bbp_pds_conf_item_icu.

DATA: p_lo_message_consumer
TYPE REF TO /sapsrm/if_pdo_msg_consumer.

lv_po_guid   =
'E198700062ACB7F18FA7000C2991C497'.

lv_po_logsys = 'SRDCLNT100'.

* Check if PO exists in backend
IF lv_po_logsys IS INITIAL.
  lv_objtyp = lc_bus2201.
ELSE.
  lv_objtyp = lc_bus2012.

ENDIF.

* Create confirmation object
CALL METHOD /sapsrm/cl_pdo_fact_conf_adv=>create_new_instance
 
EXPORTING
    iv_subtype         = lc_cf
    iv_header_guid     = lv_po_guid
    iv_object_type     = lv_objtyp
    iv_logsys          = lv_po_logsys
    iv_object_id       =
'0020000854'

    iv_user_type       = lc_profi
 
IMPORTING
    eo_instance        = lo_bo_conf_adv
 
CHANGING
    co_message_handler = p_lo_message_consumer.

* Cast to PDO object
lo_bo_conf ?= lo_bo_conf_adv.

* Get header data from PO
CALL METHOD lo_bo_conf->get_header_detail
 
IMPORTING
    es_header          = ls_conf_header
 
CHANGING
    co_message_handler = p_lo_message_consumer.

* Add header data
CLEAR: ls_conf_header_upd.

ls_conf_header-posting_date =
'20120316'.
ls_conf_header-posting_date_fi =
'20120316'.
ls_conf_header-ref_doc_no =
'0020000854'. "PO Nr.

MOVE-CORRESPONDING ls_conf_header TO ls_conf_header_upd.

*Update header
CALL METHOD lo_bo_conf->update_header
 
EXPORTING
    is_header          = ls_conf_header_upd
 
CHANGING
    co_message_handler = p_lo_message_consumer.

* Get item data from PO
CALL METHOD lo_bo_conf->get_item_details
 
IMPORTING
    et_item            = lt_conf_item
 
CHANGING
    co_message_handler = p_lo_message_consumer.

LOOP AT lt_conf_item INTO ls_conf_item.
 
MOVE-CORRESPONDING ls_conf_item TO ls_conf_item_upd.

  ls_conf_item_upd-quantity = 
'1.000'. "lv_qty.
  ls_conf_item_upd-selected = abap_true.

 
APPEND ls_conf_item_upd TO lt_conf_item_upd.
 
CLEAR  ls_conf_item_upd.
ENDLOOP.

* Update item
CALL METHOD lo_bo_conf->update_item
 
EXPORTING
    it_item            = lt_conf_item_upd
 
CHANGING
    co_message_handler = p_lo_message_consumer.

* Submit update
CALL METHOD lo_bo_conf->/sapsrm/if_pdo_base~submit_update
 
CHANGING
    co_message_handler = p_lo_message_consumer.

* Set save flag
CALL METHOD lo_bo_conf->set_save_or_park_flag
 
EXPORTING
    iv_save_flag = abap_true.

* Confirm document
CALL METHOD lo_bo_conf->confirm
 
CHANGING
    co_message_handler = p_lo_message_consumer.

COMMIT WORK.

Former Member
0 Kudos

Hi Ankit,

I have a same issue... Did you solve this problem?

Can you help me?

Thanks,

Leonel