cancel
Showing results for 
Search instead for 
Did you mean: 

Error "BBP_BD 002: An Exception occured" when changing doc type

Former Member
0 Kudos

Hi All,

We are using the BADI BBP_TARGET_OBJTYPE to determine a PR or PO and change the doc type if PR is determined.

PR/PO is determined correctly but when we tried to assign new doc type for PR getting error "BBP_BD 002: An Exception occured" .

Below is the code.

IF wa_item-be_doc_type='ECPO'

IF wa_item-catalogid IS INITIAL OR wa_item-catalogid CO space

wa_item-pack_objtype = 'BUS2105'. "PR

wa_item-be_doc_type = 'ECPR'

ELSE.

wa_item-pack_objtype = 'BUS2012'. "PO

ENDIF.

MODIFY ct_item FROM wa_item TRANSPORTING pack_objtype.

END IF

Can any one tell is this correct or do we need to modify anything?

Thanks in advance,

Jagadish

Edited by: Jagdish Reddy on Aug 17, 2008 3:47 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi. You just need to update item_data field obj_to_gen.

If obj_to_gen = 2 then you get a req, 3 is a PO.

Regards,

Dave.

Former Member
0 Kudos

Hi Dave,

Thanks for the prompt response!

We are able to create PR but we want to tie the PR to doc type 'ECPR'. That is why added wa_item-be_doc_type='ECPR'

If we take out this code it works fine and system creates a PR with doc type 'ECPO'. We do not want this. We want doc type 'ECPR'

Where is obj_to_gen in the BADI? I do not see that. Is this ina any structure?

Thanks again.

Jagadish

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Jagdish,

Could you please let me know as to how you changed the document type of the PR created in backend using the BADI,

bbp_create_be_rq_new.

Thanks,

Binu

Former Member
0 Kudos

Resolved by self.

Former Member
0 Kudos

Please use the user exit function EXIT_SAPLMEWQ_001 in the BAPI BAPI_REQUISITION_CREATE for document type mapping.

Regards

Kathirvel

Former Member
0 Kudos

Hi Kathirvel,

Thanks for your suggestion.

Is it not possible in BADI BBP_TARGET_OBJTYPE to map the doc type? Because this BADI works fine if we do not map the doc type to different doc type. Any way I will try with the BAPI you mentioned.

Thnx,

Jagadish

Former Member
0 Kudos

The BADI is meant for Object Type and no where in the documentation I can see anything regarding the Document Type. But the logic of exit should hold good as the documents are avaibale in the backend.

Please reply back with results. Thanks in advance.

Regards

Kathirvel

Former Member
0 Kudos

Kathirvel,

Thanks for your response. We resolved it by using BADI BBP_CREATE_BE_RQ_NEW to change the doc type.

Regards,

Jagadish