cancel
Showing results for 
Search instead for 
Did you mean: 

How to create backend Reservation or Purchase Order from Shopping Cart?

Former Member
0 Kudos

Hi,

While ordering in Shopping Cart, depending upon business logic, I would like to create either a Reservation or Purchase order in the backend.

I have implemented BADI - 'BBP_TARGET_OBJTYPE' for determining the target objects in the backend system.

However, on clicking the Order button, this BADI is not getting triggered.

Can anybody help me resolve this?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

konstantin_anikeev
Active Contributor
0 Kudos

Dear Kumar,

this BADI is called after approval and usually in background task.

Best Regards

Konstantin

Former Member
0 Kudos

Dear Konstantin,

Can you tell me how exactly can I create the follow on document from this BADI? I have checked online and in most of the blogs it is mentioned that we need to pass appropriate values in ITEM_DATA-OBJ_TO_GEN. However, I am unable to view this field in method DETERMINE_TARGET_OBJECT_TYPES.

Thanks for your time and help.

konstantin_anikeev
Active Contributor
0 Kudos

Dear Kumar,

sorry for misunderstanding. You should implement BADI BBP_TARGET_OBJECTS, not BBP_TARGET_OBJTYPE.

Best Regards

Konstantin

Former Member
0 Kudos

Dear Konstantin,

Can you please send me some source code for the same? I have to create either a Purchase order or Reservation in backend based on some business criteria.

Let us not concentrate on the business criteria but only on creation of Purchase order and Reservation in the backend.

Thanks again

konstantin_anikeev
Active Contributor
0 Kudos

    LOOP AT item_data ASSIGNING <fs_item>.

      IF <fs_item>-zz_force_req IS NOT INITIAL.

        <fs_item>-obj_to_gen = '2'. "PREQ if CUF = 'X'.

      ELSE.

        <fs_item>-obj_to_gen = '3'. "PO when CUF = space.

      ENDIF.

    ENDLOOP.

For reservation U should use obj_to_gen = 1.

Former Member
0 Kudos

Got it... Thanks

My logic is also based on the account assignment Category. Trying to figure that out.

If account assignment Category is 'Cost Center' then got to create Reservation and if  account assignment Category is 'Asset' then got to create Purchase Order.

konstantin_anikeev
Active Contributor
0 Kudos

Please, mark the question as answered.

Former Member
0 Kudos

I have passed <fs_item>-obj_to_gen = '3' for Purchase Order Creation.

BE_OBJECT_TYPE           BUS2012
BE_OBJECT_ID             0072000149

But I am unable to view the Purchase order in the backend.

Answers (0)