cancel
Showing results for 
Search instead for 
Did you mean: 

REG : SC Items not splitting into PO's

Former Member
0 Kudos

Hi Gurus,

We are using SAP SRM 713 version and the scenario is Extended Classic.

I have a requirement where in the Line items in the shopping cart should be split into PO's, taking into consideration the zfield added into the item level of the shopping cart.


I tried using the below BADI's but not of them are getting triggered when the report BBP_SC_TRANSFER_GROUPED is executed manually to create the PO from SC.

BADI's used :

  1. BBP_BS_GROUP_BE.
  2. BBP_SC_TRANSFER_BE.
  3. BBP_GROUP_LOC_PO.
  4. DOC_CHECK_BADI
  5. DOC_CHANGE_BADI
  6. DOC_SAVE_BADI.

None of the BADI's are getting triggered when the SC is converted into PO, and it is failing to created multiple PO's.for multiple line items in a SC.

NOTE : We are using the report BBP_SC_TRANSFER_GROUPED, to manually transfer the PO as the background job is not scheduled for the same.

Please suggested whether I am missing anything ?

Waiting for your reply.

Regards,
AkkI

Accepted Solutions (1)

Accepted Solutions (1)

laurent_burtaire
Active Contributor
0 Kudos

Hello,

BBP_GROUP_LOC_PO BAdI is called in report BBP_SC_TRANSFER_GROUPED (BADI_GROUP_PO_LOC method from CL_BBP_SC_TRANSFER class).

Is your implementation active?


Regards.



Laurent.

Former Member
0 Kudos

Hi Laurent,

The implementation is active,

Below is my code which I used in the BADI.

INCLUDE bbp_bs_con.

   DATA: lv_badi_active  TYPE xfeld,

         ls_account      TYPE bbp_pds_acc,

         ls_proc_account TYPE bbp_bapipogna,

         ls_item         TYPE bbp_pds_sc_item_d, " bbp_pds_transfer_item,

         ls_item_data    TYPE bbp_int_item_groups,

*        lt_group          TYPE bbpt_procurement_res,

         lt_item         TYPE bbpt_pd_transfer_item,

         lt_account      TYPE bbpt_pds_acc,

         lt_proc_item    TYPE bbpt_interpr_item,

         lt_proc_account TYPE bbp_determine_target_acct,

         lo_sc           TYPE REF TO if_ex_bbp_sc_transfer_be.

*---if BAdI is active instantiate it

   CALL METHOD cl_exithandler=>get_instance

     EXPORTING

       exit_name              = 'BBP_SC_TRANSFER_BE'

       null_instance_accepted = 'X'

     IMPORTING

       act_imp_existing       = lv_badi_active

     CHANGING

       instance               = lo_sc.

   CHECK lo_sc IS BOUND.

   MOVE-CORRESPONDING ITEM_DATA[] to lt_item[].

   CALL METHOD lo_sc->group_po

     EXPORTING

       it_proc_account       = lt_proc_account

       iv_object_to_generate = c_tr_po

       it_item               = lt_item

       it_account            = lt_account

     CHANGING

       ct_proc_item          = lt_proc_item.

*

*      REFRESH: lt_item[], lt_proc_account[].

*    ENDAT.

*

*    REFRESH: lt_account[].

*  ENDLOOP.


Can  you give me any sample code, which I can use to split a SC based on the custom field in SC item level.


Waiting for your reply


Thanks,

AkkI

vinita_kasliwal
Active Contributor
0 Kudos

Hi Aakash

if you are going for BBP_BS_GROUP_BE, then method name is GROUP_RQ_BACKEND. here keep same CT_ITEM-refnumber

Below is one of the implementation for BBP_GROUP_LOC_PO BADI Method GROUP_PO

IF sy-cprog = 'ZSRM_SC_TRANSFER_GROUPED'.

LOOP AT lt_data ASSIGNING <fs_data>.

      READ TABLE lt_data INTO lwa_data INDEX sy-tabix - 1.

      IF sy-subrc NE 0.

        lv_count = '1'.

      ELSE.

        IF lv_per_req EQ 'X' AND lv_per_plant EQ 'X'.

          IF lwa_data-be_plant NE <fs_data>-be_plant OR

             lwa_data-zrequisitioner NE <fs_data>-zrequisitioner.

            ADD 1 TO lv_count.

          ENDIF.

      CONDENSE : lv_count , <fs_data>-refnumber.

      CONCATENATE <fs_data>-refnumber '.' lv_count INTO <fs_data>-refnumber.

      CONDENSE <fs_data>-refnumber NO-GAPS.

    ENDLOOP.

    item_data[] = lt_data[].

Let me know if that helps .

Regards

Vinita

Former Member
0 Kudos

Hi Vinita,

Thank you for you reply.

You mean GROUP_PO_BACKEND and not GROUP_RQ_BACKEND right ?

I didn't get you clearly, do I need to use the BADI - BBP_BS_GROUP_BE and method GROUP_PO_BACKEND for splitting for ECC and the BADI - BBP_GROUP_LOC_PO and the method GROUP_PO.

for GROUP_PO  -  In ITEM_DATA, we have a field ref number, what is the significance of this field.

the same for GROUP_PO_BACKEND.

Waiting for your reply

Thanks.


Regards,

AkkI

vinita_kasliwal
Active Contributor
0 Kudos

hi

You can use either of the BADI depending on whether you have PO in backend or local ..

and the method I mentioned..

BBP_GROUP_LOC_PO BADI Method GROUP_PO

Ref number is Number of reference document i.e the PO number ..

Ok? Let me know if that helps ?

Regards

Vinita

Former Member
0 Kudos

Hi Vinita,

Thank you for quick reply,

My problem is I am unable to get the custom field in the ITEM_DATA.

Hence I am unable to apply your above logic.

How can I get the custom field in the structure BBP_INT_ITEM_GROUP.

as per your statement :

"  lwa_data-zrequisitioner NE <fs_data>-zrequisitioner "


I am unable to get this zrequisitioner in the ITEM_DATA structure.


Please let me knw what I am missing.


Thank You Vinita,

Regards,

Aakash Awasthi

vinita_kasliwal
Active Contributor
0 Kudos

Hi aakash

No need to get that field .. You can write your own logic that code was a sample..

as the customer had a field called requisitioner on which basis they needed to code ..it was aZfield for that customer ..

Should not be relevant for you.

Please check with what the requirement is and try to build that logic .. take help from an ABAPer for doing so ..

Regards

Vinita

Former Member
0 Kudos

Hi Vinita,

In our case we too have added a field called ZZBUYER_ID, and I am trying to use this field in my logic.

But I am unable to fetch the same as per  ur code as ITEM_DATA is not having that field.

My field is visible in the portal at the PO header screen.

and I have added it in all the std include structures still I am unable to get the field using ur logic, an example is :

LOOP AT lt_data ASSIGNING <fs_data>.

      READ TABLE lt_data INTO lwa_data INDEX sy-tabix - 1.

      IF sy-subrc NE 0.

        lv_count = '1'.

      ELSE.

        IF lv_per_req EQ 'X' AND lv_per_plant EQ 'X'.

          IF lwa_data-be_plant NE <fs_data>-be_plant OR

             lwa_data-zZ_buyer_id NE <fs_data>-zzbuyer_id

          ENDIF.

      CONDENSE : lv_count , <fs_data>-refnumber.

      CONCATENATE <fs_data>-refnumber '.' lv_count INTO <fs_data>-refnumber.

      CONDENSE <fs_data>-refnumber NO-GAPS.

    ENDLOOP.

    item_data[] = lt_data[]

Please help.

Regards,
Aakash

vinita_kasliwal
Active Contributor
0 Kudos

  CALL FUNCTION 'BBP_PD_SC_ITEM_GETDETAIL'  " If it is a item field

           EXPORTING

             i_guid = lwa_item_data-guid

           IMPORTING

             e_item = lwa_e_item.

OR CALL FUNCTION 'BBP_PD_SC_GETDETAIL'   " If it is a header field

Former Member
0 Kudos

Hi Vinita,

Please check the below code :

LOOP AT item_data ASSIGNING <fs_item_data>.

     CALL FUNCTION 'BBP_PD_SC_ITEM_GETDETAIL'

       EXPORTING

         i_guid    = ls_item_data-guid

*       I_ATTACH_WITH_DOC       = ' '

       IMPORTING

         e_item    = ls_item

*       ET_ATTACH =

       TABLES

         e_account = lt_account.

     IF sy-subrc EQ 0.

       APPEND ls_item TO lt_item.

       CLEAR ls_item.

       READ TABLE lt_item INTO ls_item INDEX sy-tabix - 1.

       IF sy-subrc NE 0.

         lv_count = '1'.

       ELSE.

         IF ls_item-zz_resp_buyer NE <fs_item_data>-zz_resp_buyer.

           ADD 1 TO lv_count.

         ENDIF.

         CONDENSE : lv_count , <fs_item_data>-refnumber.

         CONCATENATE <fs_item_data>-refnumber '.' lv_count INTO <fs_item_data>-refnumber.

         CONDENSE <fs_item_data>-refnumber NO-GAPS.

       ENDIF.

     ENDIF.

   ENDLOOP.



its giving me error that <fs_item_data> does not have a component called zz_resp_buyer.

I checked and found that ITEM_DATA structure is not having my custom field.


Please let me know, how to get the data into the field.

Thanks

Aakash Awasthi



vinita_kasliwal
Active Contributor
0 Kudos

HI Aakash

You need to create an append structure .. and is done by Config in Metadata where you add the field to SC Item level .

Regards

Vinita

Answers (0)