SAP PP Extending BAPI Function Module BAPI - ALM - ORDER - MAINTAIN' - SAP Blogs

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

5/15/23, 4:24 PM Extending BAPI Function Module ‘BAPI_ALM_ORDER_MAINTAIN’ | SAP Blogs

Community Topics Groups Answers Blogs Events Programs Resources What's New Explore SAP

 SAP Community Log-in Update 


Get started with SAP Universal ID
In a few months, SAP Community will switch to SAP Universal ID as the only option to login. Don’t wait, create your
SAP Universal ID now! If you have multiple accounts, use the Consolidation Tool to merge your content.

Ask a Question Write a Blog Post Login

Former Member
August 9, 2012 | 2 minute read

Extending BAPI Function Module ‘BAPI_ALM_ORDER_MAINTAIN’


 6  2  13,091

Follow This document helps how to extend the BAPI function module ‘BAPI_ALM_ORDER_MAINTAIN’ for Z fields.

In order to extend the BAPI, we should have EXTENSION_IN table which is type of BAPIPAREX.
 Like
Please follow the below steps to extend the BAPI.

 RSS Feed 1. In AUFK table, we have custom include with name ‘CI_AUFK’. So add the Z field ZZLEG_PM_ORD in structure CI_AUFK and activate it. Now we have a custom field
ZZLEG_PM_ORD in standard table AUFK.

2. Create a append structure with the Z field ZZLEG_PM_ORD which should be type of BAPIUPDATE and append to the BAPI structure ‘IBAPI_CAUFVD_UPDATE’.

3. Now we should implement the BADI ‘IBAPI_ALM_ORD_MODIFY’ to push the custom field ZZLEG_PM_ORD value to table AUFK. Use the method
IF_EX_IBAPI_ALM_ORD_MODIFY~MODIFY_INPUT_DATA to pass the Z field ZZLEG_PM_ORD value from EXTENSION_IN table to Order header data.

Please use the below logic for updating order header data.

Read the table CT_HEADER_INT into LS_HEADER_INT index 1. Pass the value from EXTENSION_IN-VALUEPART1+0(12) to LS_HEADER_INT-ZZLEG_PM_ORD and modify
the table CT_HEADER_INT.

4. Once we have completed the above steps, while calling the BAPI function module ‘BAPI_ALM_ORDER_MAINTAIN’, we should populate the EXTENSION_IN table and pass
to BAPI as below.

   The EXTENSION_IN structure has two fields with name STRUCTURE and VALUEPART1. So pass the STRUCTURE name as

   ‘BAPI_TE_AUFK’ and VALUEPART1 should be the custom field value.

    

   Now pass the LT_EXTENSION_IN to the BAPI function module.

    CALL FUNCTION ‘BAPI_ALM_ORDER_MAINTAIN’


    TABLES
      IT_METHODS         = PT_METHOD_BAPI
      IT_HEADER            = PT_HEADER_BAPI
      IT_HEADER_UP      = LT_HEADER_BAPIX
      IT_OPERATION      = PT_OPERATION_BAPI
      IT_COMPONENT    = PT_COMPONENT_BAPI
      IT_TEXT                 = PT_TEXT_BAPI
      IT_TEXT_LINES      = PT_TEXT_LINES_BAPI

https://blogs.sap.com/2012/08/09/extending-bapi-function-module-bapialmordermaintain/ 1/3
5/15/23, 4:24 PM Extending BAPI Function Module ‘BAPI_ALM_ORDER_MAINTAIN’ | SAP Blogs
      RETURN                = PT_RETURN
      EXTENSION_IN      = P_LT_EXTENSION_IN
      ET_NUMBERS      = LT_ORD_NUM.

Alert Moderator

Assigned Tags

ABAP Development | abap

Similar Blog Posts 


Embedded Steampunk – Some more details for ABAP developers How to find the extension structure of a given BAPI
By Boris Gebhardt Sep 05, 2022 By Thanga Prakash Thanga Raj Feb 21, 2014

Adding Field in standard Fiori apps of S/4HANA with Custom Fields and Logic
By Masaaki Arai Feb 01, 2020

Related Questions 
BAPI_ALM_ORDER_MAINTAIN Zfields Upadate AUFK with BAPI_ALM_ORDER_MAINTAIN
By Maria João Paulo Rocha May 31, 2022 By Krsto Gjergja Aug 01, 2016

BAPI_ALM_ORDER_MAINTAIN in background for iw41


By chet sap Jul 28, 2018

6 Comments

You must be Logged on to comment or reply to a post.

Madhu Vadlamani
September 13, 2012 at 7:56 am

Good.Can you explain where you placed these custom fields in the transaction.

Regards,

Madhu.

Like 0 | Share

Vamsi Krishna C V
October 5, 2015 at 3:35 pm

Hi Madhu, we need to follow the steps outlined in the below note

669370 - BAPI_ALM_ORDER_MAINTAIN: BAdI not for append structures

Like 0 | Share

Former Member
October 21, 2012 at 9:13 am

It's work!!! Thank you.

Like 0 | Share

Former Member
December 11, 2012 at 9:37 am

Hi Lakshmi,

This document is really helpful.

Thankyou for sharing.

Gaurav

Like 0 | Share

https://blogs.sap.com/2012/08/09/extending-bapi-function-module-bapialmordermaintain/ 2/3
5/15/23, 4:24 PM Extending BAPI Function Module ‘BAPI_ALM_ORDER_MAINTAIN’ | SAP Blogs
Former Member
March 22, 2013 at 9:05 pm

Very helpful. Thanks for posting.

Paul

Like 0 | Share

Former Member
November 11, 2013 at 8:17 pm

Lakshmi,

Thanks for sharing this document. It's really helpful.

Regards,

Satbir

Like 0 | Share

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2012/08/09/extending-bapi-function-module-bapialmordermaintain/ 3/3

You might also like