cancel
Showing results for 
Search instead for 
Did you mean: 

GR_IND and GR_BASED_IV for catalog PO

Former Member
0 Kudos

Hello,

Do you know where does the system get GR_IND and GR_BASED_IV values when SC is approved and PO is created in SRM?

I need to unflag those flags in the PO by coding. Should i modify in the method BBP_PO_CHANGE in the BADI BBP_DOC_CHANGE8BADI?

Thanks,

Hazem.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The GR indicator is set at the account assignment level in ECC and the GR_BASED_INV is set at the Vendor master data in ECC.

That is the reason when you create a limit type of cart you see the checkbox checked in SRM.

Now there are various ways of removing it.

Either change the master data in ECC and update the SRM masterdata.

Or in the bbp_doc_change badi of the SC , uncheck the indicators

Or in the PO creation badi BBP_CREATE_BE_PO_NEW if at all its used , uncheck the indicators.

Regards,

Naveen

Former Member
0 Kudos

Hello Naveen,

I tried to uncheck indicators in the BBP_PO_CHANGE method in the badi BBP_DOC_CHANGE_BADI. It works for free text SC but for catalog SC , it does not work.

After some debugging, i think that i have to enhance the include LBBP_PDIGPF0B. What do you think?

Thanks,

Hazem.

Former Member
0 Kudos

Hello everybody,

Could you please help on this request?

Thanks,

Hazem.

Former Member
0 Kudos

Hi Hazem,

Are you creating PO's in ECC system? If so then as mentioned by Naveen please un-check those flags in BBP_CREATE_BE_PO_NEW BADI which creates PO in ECC system.

Thank you

Ritesh

Former Member
0 Kudos

Hello Ritesh,

PO is created in ECC when it's validated in SRM. BBP_CREATE_BE_PO_NEW BADI is not used in our case.

My problem is the following:

I modified the method BBP_PO_CHANGE in the BBP_DOC_CHANGE_BADI to uncheck GR_IND and GR_BASED_IV for some product categories in some company codes.

When SRM PO is created from a free text SC, GR_IND and GR_BASED_IV are unchecked as needed.

When SRM PO is created from a catalog SC, GR_IND and GR_BASED_IV still checked.

Here is the code i added in the method BBP_PO_CHANGE:

DATA: it_zsrm_gr_not_expected TYPE STANDARD TABLE OF ZSRM_GR_NO_EXPEC,

          wa_zsrm_gr_not_expected LIKE LINE OF it_zsrm_gr_not_expected,

          wa_item LIKE LINE OF IT_ITEM,

          wa_partner LIKE LINE OF IT_PARTNER,

          logsys TYPE rfcdest.

   CONSTANTS: c_on type c value 'X',

              c_off type c value ''.

   IF IT_PARTNER[] IS NOT INITIAL AND IT_ITEM[] IS NOT INITIAL.

     SELECT * INTO TABLE it_zsrm_gr_not_expected FROM ZSRM_GR_NO_EXPEC.

     READ TABLE IT_PARTNER INTO wa_partner WITH KEY PARTNER_FCT = '00000075'. "get the backend logical system from BBP_LOCMAP table

     IF sy-subrc <> 0.

       MESSAGE e047(bbp_pd) WITH 'Cannot find location/plant'(002).

     ENDIF.

     SELECT SINGLE LOGSYS INTO logsys FROM BBP_LOCMAP

           WHERE PARTNER_NO EQ wa_partner-PARTNER_ID.

     IF sy-subrc <> 0.

       MESSAGE e047(bbp_pd) WITH 'Cannot determine backend destination RFC'(001).

     ENDIF.

     LOOP AT IT_ITEM INTO wa_item.

       READ TABLE it_zsrm_gr_not_expected INTO wa_zsrm_gr_not_expected WITH KEY

       LOG_SYS = logsys

       COMP_CODE = wa_item-BE_CO_CODE

       PROD_CATEGORY_ID = wa_item-CATEGORY_ID.

       IF sy-subrc = 0.

         wa_item-GR_IND = c_off.

         wa_item-GR_BASEDIV = c_off.

         wa_item-IR_IND = c_on.

         MODIFY IT_ITEM  FROM wa_item TRANSPORTING GR_IND GR_BASEDIV.

       ENDIF.

     ENDLOOP.

   ENDIF.

Thanks,

Hazem.



Former Member
0 Kudos

Hi Hazem,

Thank you for sharing the information. I have few questions what does table ZSRM_GR_NO_EXPEC stores?  as you are looping into that table it_zsrm_gr_not_expected.

Second question is are you using Function module to get data? As IT_ITEM where those information is getting fetched through?

I assume that for catalog shopping cart Buyers are not going in and converting POs? It will be auto created once SC is approved in background? Correct me if i am wrong?

Regards

Ritesh

Former Member
0 Kudos

Hello Ritesh,

- Table ZSRM_GR_NO_EXPEC company codes and product categories for which no GR is needed.

- IT_ITEM table contains the informations regarding PO items

- SRM PO (catalog or free text) is created automtically when SC is approved.

As i said, the code i added generates the desired result for free text SC but not for catalog SC.

After debugging, i think that an implicit enhancement is needed in the include LBBP_PDIGPF0B in the function group BBP_PDIGP to solve the issue but i am not sure if that is the best solution.

Please let me know your point of view.

Thanks,

Hazem.


Former Member
0 Kudos

Hi Hazem,

That is really strange as SC when it converts to PO it is stopping at your implementation but then not accepting the change which you are looking to do..

There is one another BADI with SRM 7.0 i have seen BBP_BDI_PD_PO_CHANGE that is internal BADI gets call to update PO data. Can you please try that if you are able to achieve what you are looking for catalog SC. I agree modifying the standard code with implicit enhancements will be option but not a good solution to do.

Thank you

Ritesh

Former Member
0 Kudos

Hello Ritesh,

What i can't understand is that GR_IND and GR_BASED_IV are changed in the implementation i did in the BBP_PO_CHANGE for catalog SC. But then they are changed again in LBBP_PDIGPF0B and there they become checked. The system behavior is different for free text SC.

Do you mean that i have to implement the BADI BBP_BDI_PD_PO_CHANGE and use it rather than the BADI BBP_DOC_CHANGE_BADI?

Please let me know since i am not familiar with BADIs implementation.

Thanks and best regards,

Hazem.

Former Member
0 Kudos

Hi Hazem,

I totally agree. It looks like there is some bug with the program. I have found following notes which refer to the issue which you are facing that flag is set in DOC_CHANGE_BADI but then over-written by standard program. Please refer them and see if you have these changes implemented.

Note 1698813 - GR_BASEDIV is checked when the requestor is changed

Note 1771316 - Inconsistent behavior of Vendor flags in Purchase Order THis note is for EHP2 i am not sure if you are on EHP2 or not.

Note 1757893 - GR_BASEDIV flag reset in change version of purchase order

I would also recommend you to create OSS message as it definitely looks bug in code LBBP_PDIGPF0B.

Thank you

Ritesh


Former Member
0 Kudos

Hello Ritesh,

Thanks a lot for your help. I think that i will open an oss message to sap since changes realted to those notes are already implemented in the system.

I will keep your informed.

Thanks and best regards,

Hazem.

Former Member
0 Kudos

Hello Hazem,

The GR, IR and other flags are copied from the supplier assigned to the document in SRM. In the case of a catalog item, the supplier will copied automatically. You can check these details in BBPMAININT under Supplier data.

Based on your requirement you can change the data of the supplier.

In case, if you want to do it programatically, you can uncheck these flags in DOC CHANGE BAdi and then if you are in ECS then additional code needs to be coded in the ECS PO BAdi also for keeping the consistencybetween SRM and R3.

Thanks and Regards,

Krishna Chaitanya