cancel
Showing results for 
Search instead for 
Did you mean: 

Need Purchase order Approval Status on output form template in SAP S/4HANA Cloud

arhd236
Member

Hello Communities,

Hope you are well...

The purchase order approval status on the PDF form template data source header data is required once the workflow is finished.

  • The FDP_EF_PURCHASE_ORDER_SRV standard data source header does not include the approval status field.
  • I made a new custom field called YY1_PO_STATUS and added it to the Procurement: Purchasing Document business context.
  • In my form template, YY1_ZMM_PUR_PURCHASE_ORDER_SA, I have enabled that custom field.
  • I have now updated the Modify Purchase Order Header BADI with custom logic. To obtain the PO_STATUS from CDS VIEW, write the query.
  • I then publish everything and view the XML output after that. I can see my custom fields, but there is no data in them.
  • I also checked the data source extension option but FDP_EF_PURCHASE_ORDER_SRV standard data source is not available there.

Start here is the primary problem:

  • Once the purchase order is in the workflow approval cycle, the BADI Modify Purchase Order Header is not executed.

I want to know if, once the workflow is finished, it is possible to add approval status to the standard data source.

if someone has gone through the same or similar type of requirement can suggest some solution, it will be really helpful.

Thanks for Listening, have a great day, always stay Happy.

The expected data in field YY1_PO_STATUS_PDH is 05.

Enda
Product and Topic Expert
Product and Topic Expert
0 Kudos

adding tag S/4HANA CLoud For sourcing and procurement + extensibility

Daisy_Zhang
Advisor
Advisor
0 Kudos

We helped you to accept the answer, since there were no updates after 7 days.

You can unaccept it anytime if you have further questions.

View Entire Topic
Matheus_Boneli
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Armir,

Thank you for your query about adding the approval status to purchase orders (POs) and other post-creation fields. Here's a concise response to address your concerns:

  • The BADI "Modify Purchase Order Header" is not triggered during the PO approval process for performance reasons.

  • There's currently no BADI called after PO approval. However, a new BADI for output processing is planned for SAP release 2408.

  • As of now, you can consider two options:

    1. Configure the Output: Instead of setting the output to be immediate when the PO is created, you can schedule it to run at a specific time or through a batch job. This can help ensure that the output generation occurs after the PO has been approved

    2. Force BADI Invocation: As a workaround, you can force the BADI to be called by making a mass change in the PO application. This involves temporarily modifying a "dummy" field in the purchase orders and then changing it back. This manipulation will trigger the BADI and allow you to obtain the values in your custom fields.

Please keep in mind that the second option is manual but can serve as a workaround until a more automated solution is available in the future.

If you have more questions or need assistance, please feel free to reach out to us.

2838428 - Request for New Features for Procure in SAP S/4HANA Cloud.

Best Regards,
Matheus