cancel
Showing results for 
Search instead for 
Did you mean: 

Help Needed: BAPI for Updating Custom Fields in RFQ

ankahit
Explorer
0 Kudos
342

Hi SAP Community,

I’ve added custom fields at both the header (EKKO) and item (EKPO) levels for RFQs in transactions ME41, ME42, and ME43. Via Standard T-code, it is getting update.

Could anyone advise which BAPI should be used to update these custom fields? I tried almost everything.

Thanks in advance for your assistance!

Best regards,

Sandra_Rossi
Active Contributor
0 Kudos
For information, no need saying "urgent" and no need saying it in UPPERCASE, there are only volunteers here, they will answer when they can, if they want.
View Entire Topic
umasaral
Participant
0 Kudos

Hi 

To update custom fields in the header (EKKO) and item (EKPO) levels for RFQs using BAPIs, you can use the following approach:
BAPI for RFQ Header (EKKO):For updating header-level custom fields in RFQs, you generally use the BAPI BAPI_QUOTATION_CHANGE
BAPI for RFQ Items (EKPO):For updating item-level custom fields, you can use the same BAPI, BAPI_QUOTATION_CHANGE,


Steps to Update Custom Fields:

1.Identify the Custom Fields: Ensure you know the technical names of your custom fields in EKKO and EKPO tables
2.Use the BAPI to Update:Here’s a general outline of how to use BAPI_QUOTATION_CHANGE:
DATA: lt_return TYPE TABLE OF bapiret2,
lt_quotationheader TYPE bapiquotheader,
lt_quotationitem TYPE TABLE OF bapiquotitem.

" Fill lt_quotationheader with the RFQ header data, including custom fields
" Fill lt_quotationitem with the RFQ item data, including custom fields

CALL FUNCTION 'BAPI_QUOTATION_CHANGE'
EXPORTING
quotationheader = lt_quotationheader
TABLES
quotationitem = lt_quotationitem
return = lt_return.

" Check lt_return for any errors

3. Commit the Changes:After calling the BAPI, you need to commit the changes using BAPI_TRANSACTION_COMMIT

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.


Note:
Alternative Approaches:
Custom RFC Function Module:-->If BAPI_QUOTATION_CHANGE does not fit your requirements, consider creating a custom RFC function module to handle the updates of custom fields.

User Exit or Enhancement-->For more complex scenarios, you might need to enhance the standard RFQ processing using user exits or BADIs to ensure your custom fields are updated correctly.

Always test BAPI calls in a development environment first to ensure they work as expected.
Make sure you have the necessary authorizations to make these changes.

I hope this helps you resolve the issue quickly!

ankahit
Explorer
0 Kudos
Hi umasaral, My system does not have 'BAPI_QUOTATION_CHANGE'
PRAGSMATIC
Participant
It seems like a chat gpt answer. she has been doing this for a long time @Sandra_Rossi
Sandra_Rossi
Active Contributor
0 Kudos
@PRAGSMATIC Thanks, stupid me 😄 . I like forums like Stack Overflow which have a rule to forbid any Generative AI answer (https://meta.stackoverflow.com/questions/421831/policy-generative-ai-e-g-chatgpt-is-banned).