cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BBP_DOC_CHANGE_BADI - How to Change Items if PO Header is changed

Former Member
0 Kudos
289

Hi Guys,

i have a problem regarding changing a purchase order if a custom flag is set on purchase order header level.

When i want to use BBP_DOC_CHANGE_BADI i can't change the items because nothing of the items was changed.

I only got the information from the header that for a PO the custom flag was changed an no item information.

How i can change the items if something has changed on the PO Header?

Thanks for you contribution...

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

If your items are not changed, the importing parameter IT_ITEM would be empty. However, you could use the PO header information to call BBP_PD_PO_GETDETAIL so that you get the item information and change them accordingly. Then copy all of your updated item information to ET_ITEM of the BADI interface.

Former Member
0 Kudos

Hi Jay,

thanks for your answer, but this doesn't work. i wannted to change the Subtype of the item to DP (direct material) but when it is saved it's stell get EP - Extended Local Purchase Order

Any other suggestions ?

Former Member
0 Kudos

Subtype is a field that is determined by the system based on the characteristic of the item and the technical scenario your SRM is running. It is not something that you can or should be able to easily manipulate. In another word, the item needs to be qualified in order to the a Direct Material. On the other hand, if you create an item of a backend product with a proper product ID, the "Order as Direct Material" checkbox would show up for you to check it if you would want it to be DP. I hope this makes sense to you.

Former Member
0 Kudos

Hi,

yes it makes sense for me but the requirement is, when all items in the PO are Direct material relevant, the user can mark on Header level once a checkbox that all items should be orderd as direct material.

How can i implement this without change the subtype ?

Thanks.

Former Member
0 Kudos

...when all items in the PO are Direct material relevant

How do you plan to validate this in your PO process? I'd assume you create items one by one manually. If they are "Direct Material Relevant", you could already check the "Order as Direct Material" checkbox on item level. You'd have to explain the flow of your process more clearly in order for me to understand your requirement.

Former Member
0 Kudos

You can validate that the item can be ordered as Direct Material if product_type eq '01' ( Material ) and ordered_prod is not INITIAL.Thats what someone said to me, i can't say that this is really the right approach but if this constraints are fullfilled the Button is enabled.

If now all Items of the PO can be ordered as Direct material, i want a custom Flag on PO Header which the user can activate and then all items where ordered as Direct material.

Do you understand the problem ?

Former Member
0 Kudos

What I meant was how you would envision the User Interface flow for your requirement. If you were a buyer, what buttons would you want to click and what screens / effects would you want to see?

Former Member
0 Kudos

So if all items can be ordered as Direct Material in the PO Header Screen a Flag field appears which the user can mark.

You have only on /SAPSRM/WDC_PO_DOFC_OV_HD - Purchase Order Overview Header data, this new Flag Field.

If he mark it, in backround all items where changed in order all items as Direct material (DP) (in stock). The User don't see any changes or screen effects, exept that he marks the Flag field on the PO header screen.

Former Member
0 Kudos

If he mark it, in backround all items where changed in order all items as Direct material (DP) (in stock). The User don't see any changes or screen effects,

You neglect to mention that all the items would have been created before you marked the new header field. If items are created first, all this requirement would have saved you is the one click (to mark DP) on each item which you would probably spend several minutes to create. And you would have to replicate the codes to validate that indeed all items CAN BE ordered as direct material. To me, the effort to alter the standard behavior is more than the benefit you would get from it.

Former Member
0 Kudos

Dear Jay Yang,

We also had some issue with BBP_DOC_CHECK_BADI. If possible please check below thread,

I have posted a new thread.

Ganapathi.