Skip to Content
author's profile photo Former Member
Former Member

adding new fields in BAPI

Hi all

Can we add new fields in standard BAPI's like BAPI_PO_CREATE1 , etc...? If possible to add then can you tell how to do it?

With regards,

Siva

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 12, 2011 at 10:16 AM

    Hi,

    It's possible to change the standard BAPI incase you have the authorized access key for the object.

    In tcodes SE37 or BAPI

    Regards,

    Satish Kanteti

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 12, 2011 at 10:18 AM

    Hi Siva,

    If the standard tcode is enhanced means new fields were added then Extension Structures are available to add new fields.

    Sameer.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 12, 2011 at 12:14 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 12, 2011 at 12:56 PM

    New fields in Signature or to pass custom fields to bapi ...which is your requirement ?

    If its the first option then check the second link available in [Link|http://www.google.co.in/search?hl=en&biw=1004&bih=635&q=enhancementspotsfunctionmoduleinterface&oq=enhancementspotsfunctionmoduleinterface&aq=f&aqi=&aql=&gs_sm=e&gs_upl=10871l18587l0l26l19l0l10l0l0l640l1046l4-1.1]

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 12, 2011 at 01:20 PM

    hi

    first of all change the req fields or add fields than u can crate the correct bapi

    so that when u enter BAPI t.code there u records will present

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 12, 2011 at 03:00 PM

    First of all changing SAP Code is not recommended. Second, even if you enhance the BAPI, you will have to write code to update the related fields in database. Again, if it is SAP tables, better analyze it before.

    Use extensionin parameter and handle the same in user exit to update the ZTABLE (If it is ZTABLE).....

    last but not least, write your own RFC

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 12, 2011 at 03:56 PM

    By using the BAPI Extension you can update the custom fields data .

    Here below is the example . Step 1 : First extend the table EKKO with custom fileds .

    Step 2 : Extend Structure BAPI_TE_MEPOHEADER and BAPI_TE_MEPOHEADERZ with same fields.

    Step 3 : While extending BAPI_TE_MEPOHEADERX , make sure that for custom fields you have to give 1 CHAR ( BAPI UPDATE ).

    Step 4 : In program you have collect the custom field values and pass append both structures ( ie BAPI_TE_MEPOHEADER and BAPI_TE_MEPOHEADERX ) to EXTENSIONIN Structure and values to EXTENSIONIN VALUEPART1.

    Example :

    DATA : BEGIN OF T_EXTENSIONIN OCCURS 0.

    INCLUDE STRUCTURE BAPIPAREX .

    DATA: END OF T_EXTENSIONIN .

    DATA : T_BAPI_TE_MEPOHEADER TYPE BAPI_TE_MEPOHEADER.

    DATA : T_BAPI_TE_MEPOHEADERX TYPE BAPI_TE_MEPOHEADERX.

    DATA : T_CUSTDATA_IN TYPE BAPI_TE_MEPOHEADER.

    DATA : T_CUSTDATA_INX TYPE BAPI_TE_MEPOHEADERX.

          • Customer Data

          T_CUSTDATA_IN-ZZRLDATE = '20040110'.

          T_CUSTDATA_IN-ZZRADATE = '20041210'.

          T_CUSTDATA_IN-ZZPOSTATUS = 'OPEN'.

          T_CUSTDATA_IN-ZZSTATE = 'TN'.

          T_CUSTDATA_IN-ZZCITY = 'MEP'.

          T_CUSTDATA_INX-ZZRLDATE = 'X'.

          T_CUSTDATA_INX-ZZRADATE = 'X'.

          T_CUSTDATA_INX-ZZPOSTATUS = 'X'.

          T_CUSTDATA_INX-ZZSTATE = 'X'.

          T_CUSTDATA_INX-ZZCITY = 'X'.

          ********move custom data

          MOVE 'BAPI_TE_MEPOHEADER' TO T_EXTENSIONIN-STRUCTURE.

          *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.

          MOVE-CORRESPONDING T_CUSTDATA_IN TO T_BAPI_TE_MEPOHEADER.

          MOVE T_BAPI_TE_MEPOHEADER TO T_EXTENSIONIN-VALUEPART1.

          APPEND T_EXTENSIONIN.

          MOVE 'BAPI_TE_MEPOHEADERX' TO T_EXTENSIONIN-STRUCTURE.

          *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.

          MOVE-CORRESPONDING T_CUSTDATA_INX TO T_BAPI_TE_MEPOHEADERX.

          MOVE T_BAPI_TE_MEPOHEADERX TO T_EXTENSIONIN-VALUEPART1.

          APPEND T_EXTENSIONIN.

                                            Finally pass this T_EXTENIONIN to BAPI_PO_CREATE1 ( EXTENSIONIN )..

                                            Edited by: Naresh Nelapatla on May 12, 2011 5:56 PM

                                            Add a comment
                                            10|10000 characters needed characters exceeded

                                          • author's profile photo Former Member
                                            Former Member
                                            Posted on Jan 11, 2015 at 05:24 AM

                                            Hi,

                                            if you want to add custom fields in bapi then open the structure used in bapi through se11. then using append structure, append the fields you want to add to that structure. then while calling the bapi give values for custom fields in BAPI_extension parameter. it will be updated .

                                            thanks

                                            Add a comment
                                            10|10000 characters needed characters exceeded

                                          Before answering

                                          You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
                                          You must be Logged in to submit an answer.

                                          Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.