cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a BDoc in an ABAP report ?

Former Member
0 Kudos

hello

I need to develop a report to send customer specific data from CRM to R/3. This report will be executed as a batch every to update data in R/3 from specific data in CRM (created with EEWB).

The question is : which FM do I have to use to create and process the BDoc ?

I start to develop the report and I tried to use the FM BUPA_MWX_BDOC_CREATE_MAIN.

CALL FUNCTION 'BUPA_MWX_BDOC_CREATE_MAIN'

CHANGING

CT_BP_EXTERN = t_partnerdata.

I fill the table t_partner_data which typ eis BUS_EI_EXTERN_T and the report run seems to run fine as I see the BDoc created with the data in transaction SMW01 but th Bdoc remains in state intermediate state.

When I click on button Show BDoc Msg receivers, the message "No receivers or error segments for BDoc message ..." appears.

When I check the BDoc message classic data, I see the structure CRMW_BUPA_HEAD filled with one entry but the CRMW_BUPA_SITES is empty. With standard transaction, BDoc processing runs fine.

Thanks for any help

Edited by: Jerome Munier on Dec 8, 2008 2:31 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Jerome,

This scenarios doesnt have to be this complex. Please let me know the version of CRM and ECC (or R3) which you are using. If its CRM 5.0 or above & ECC 5.0 ; you should be able to add new custom field in both CRM and R3 (or combination of custom & std fields) side with just EEW and some simple coding.

Also: few more info:

1) is it custom fields in both sides - CRM & ECC

2) is it custom field in CRM mapped to std field in R3

If you start to make custom flow (with Bdocs) it will be difficult unless you have an expert Middleware consultant.

Regards,

L

Former Member
0 Kudos

hello

I give you more details on the aim of the report.

I have created an extension with EEWB which is time-dependent : this extension is a status with validity dates. Only one value of the status is accepted during a period.

In the report, I get the value of the status for the current day. Then I get the list of status of the BP using API of the EEWB.

Then I select the valid status based on the current date.

The I fill the table t_partnerdata TYPE BUS_EI_EXTERN_T.

Then I execute the FM BUPA_MWX_BDOC_CREATE_MAIN to generate and send the BDoc.

Below the part of the code to fill the table t_partnerdata.

Thansk

s_partnerdata-header-object = 'BusinessPartner'.

  • n° du BP

s_partnerdata-header-object_instance-bpartner = w_partner-partner.

  • guid du BP

CALL FUNCTION 'BUPA_NUMBERS_GET'

EXPORTING

IV_PARTNER = w_partner-partner

  • IV_PARTNER_GUID =

  • IV_PARTNER_EXTERNAL =

IMPORTING

  • EV_PARTNER =

EV_PARTNER_GUID = v_partner_guid

  • EV_PARTNER_EXTERNAL =

ES_BUT000 = s_but000

  • TABLES

  • ET_RETURN =

  • ET_PARTNER =

.

s_partnerdata-header-object_instance-bpartnerguid = v_partner_guid.

  • type de tâche (mise à jour)

s_partnerdata-header-object_task = 'U'.

s_partnerdata-central_data-common-data-bp_control-category = s_but000-type.

s_partnerdata-central_data-common-data-bp_control-grouping = s_but000-bu_group.

s_partnerdata-central_data-common-data-bp_centraldata-searchterm1 = s_but000-bu_sort1.

s_partnerdata-central_data-common-data-bp_centraldata-partnertype = s_but000-bpkind.

s_partnerdata-central_data-common-data-BP_ORGANIZATION-name1 = s_but000-name_org1.

s_partnerdata-ZZ1RO_DATA = t_data_statut.

s_partnerdata-ZZ2RO_DATA = t_data_canal.

APPEND s_partnerdata TO t_partnerdata.

  • création d'un BDoc de mise à jour dans R/3 du statut distributeur et canal de rémunération

CALL FUNCTION 'BUPA_MWX_BDOC_CREATE_MAIN'

CHANGING

CT_BP_EXTERN = t_partnerdata.

kapilpatil
Active Contributor
0 Kudos

HI Jerome Munier,

To create a BDOC from ABAP requires some technical stuff to be kept in mind and coded suitably in ABAP report.

Just writing to triger a BDOC will not suffice.

Basically, When a BDOC is triggered from SAP CRM system, all the communication related information

like : Site information, Logical system information and destination system information.

If you debug a BDOC generation FM you will get a clear idea.

Also please check for any short dumps in the system.

Regards,

Kapil Patil

Former Member
0 Kudos

Hi

thanks for your reply.

I tried to debug the FM and found that there was no entry in table CRMM_BUT_CRMOBJ for the BP I was using. So I tried with another BP with an entry in this table then structure CRM_BUPA_SITES was filled.

But the BDoc still remains in intermediate state with no receivers message ???

I don't understand why it does not work. Is there another way to create and process an outnound message ?

kapilpatil
Active Contributor
0 Kudos

I wold suggest you to run a ABAP Trace to check if you are missing any FM which important to generate and trigger a BDOC.