cancel
Showing results for 
Search instead for 
Did you mean: 

PO release/distribution (from SRM to backend) FModules?

matteo_montalto
Contributor
0 Kudos

Hi experts,

I need to create a report that allows the user to release/distribute (sorry if these are not the right words to call the process) a PO ... My report actually retrieves the header of the purchase order ,that has status "waiting" ("park") in SRM (a change version)... so, given the header, is there a FM to release easily the po ?

(excuse the terminology, I'm not sure that's correct: I talk about release/distribute a PO meaning the process that brings a correct po from SRM to the backend).

Accepted Solutions (1)

Accepted Solutions (1)

former_member206968
Active Contributor
0 Kudos

Hi,

You can send the PO to backend using fm-bbp_pd_po_transfer_exec. But this will simply send the PO and status will not get updated from parked/awaiting approval. For status change and realese simultaneously you can check BBP_PD_PO_STATUS_CHANGE_WF.

Regards,

Sanjeev

matteo_montalto
Contributor
0 Kudos

Hi sanjeev, tried your solution without success. I get an error message, BBP_PD381.... I call the FM in this way:

CALL FUNCTION 'BBP_PD_PO_STATUS_CHANGE_WF'
  EXPORTING
    iv_guid                        = srm_change_header_guid
    iv_status                      = 1

where srm_change_header_guid is the header's guid of the change version on my PO, the one I'd like to release.

Some infos from debugging.... the error comes from the call function that follows:

CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIVITY'

(source report: LBBP_PDF0Y)

values of the parameters in debug are:

check_only = X;

client = sy-mandt;

objnr = p_new_guid (which is the guid of the header of the change version)

vrgng = 'RELP'

XNOAUTO = 'X'.

The message is hard to translate in english, anyway says something like "error on modify state RELP. "Release purchase order not allowed".

Any hint?

Thanks in advance.

matteo_montalto
Contributor
0 Kudos

Additional notes: i tried to release the same order by sapGUI (trans. bbppo01) and tried to trace in debug the codes associated with the iv_activity flag, which in the case of the FM used was set to 'RELP'. Well, releasing manually the PO via sapGUI I've seen that the call:

PERFORM call_status_change

is called four times, with these parameters:

i_guid 49AD35292BB000BE000000000A101966

i_activity CFCR (first and third pass) | IVCR (second and fourth pass)

space BLANK

c_on X

c_update U .

As far as I can see, the i_activity code seems to be the problem... but the FM BBP_PD_PO_STATUS_CHANGE_WF associate the value for i_activity on the basis of the iv_status value... so I can't see a way to solve.

former_member206968
Active Contributor
0 Kudos

Hi,

Check if the user you are passing has proper authority to change release status of PO. Secondly, what is current status of PO. May be the current status is not allowing to change. You can use this fm, if your po is in awaiting approval status. Again important thing is you need to pass the change version guid instead of active version guid if you want to approve a change po.

Regards,

Sanjeev

Answers (0)