cancel
Showing results for 
Search instead for 
Did you mean: 

Change PO number/document type

Former Member
0 Kudos

Hi,

we are using SRM 5.0, extended classic scenario.

We have defined three document(transaction) types for PO in srm.

One of them is a Dummy type-when this one is selected i need to change the type (and a number because of number ranges) of this PO depending on some conditions for items. I need to do this change propably when the PO should be stored in the backend. How can i do it? should i use outbound badi and change the number of PO? how can i get the next "free" number of PO with specified type? but i think that i will loose connection between srm PO and backend PO-so how should i update SRM PO?

thanks

JJ

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

You can probably do the changes already when saving the PO. I think what you can do best is to use BBP_DOC_CHANGE_BADI with filter BUS2201 (for PO). Do a check on sy-ucomm to decide whether the save button has been pressed or not. Here you have most of your item data available. Sometimes however some of your item data is not present in the BADI (quite annoying really), use FM BBP_PO_MEMORY_GET to get the order that is stored in memory (all screen changes are already reflected in the return data. Check the FM in

The reason I advice to use DOC_CHANGE is because you have all data available you need. In the other BADI that comes to mind BBP_DOC_SAVE_BADI you have to call several FMs to get an updated PO.

I don't know if the correct number is retrieved then, just see if it does. If so, great, if not, you can probably do something with FM GET_NEXT_NUMBER (or any variation of those words as I don't have access to a system right now).

Former Member
0 Kudos

Hi,

thanks for ur answer. But for the badi BBP_DOC_CHANGE_BADI, method BBP_PO_CHANGE there is not attribute in is_header(es_header) for document type/process type. Or am i blind?

thanks

JJ

Former Member
0 Kudos

I programmed your same requirement the way I told in my previous post. However seems there has been a change from SRM4.0 to SRM5.0.

Probably what you can do is use function modules BBP_PO_MEMORY_GET and BBP_PO_MEMORY_SET, in those 2 FMs the process_type field is available.

Former Member
0 Kudos

Any resolution on this issue? I am encountering the same issue.

Thanks!

Cindy Sy

Former Member
0 Kudos

Hi JJ,

We use a BADI in the R/3 system to enrich an incoming SRM PO, after which the changes are automatically replicated back to the SRM PO. Your situation seems a bit trickier, but perhaps it's worth investigating that option too.

Thanks, kind regards,

KZ