Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

adding new fields in BAPI

Former Member
0 Likes
9,063

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,898

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

9 REPLIES 9
Read only

Former Member
0 Likes
4,899

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

Read only

Former Member
0 Likes
4,898

Hi Siva,

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

Sameer.

Read only

0 Likes
4,898

hi sameer,

how to check whether the standard code is enhanced or not?

Read only

Former Member
0 Likes
4,898

Hi Siva,

see docu of BAPI parameter EXTENSIONIN.

see sap wiki for using this parameter:

[https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=71368708&decorator=printable|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=71368708&decorator=printable]

regards

REA

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
4,898

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]

Read only

Former Member
0 Likes
4,898

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

Read only

former_member191735
Active Contributor
0 Likes
4,898

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

Read only

former_member206439
Contributor
0 Likes
4,898

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

Read only

Former Member
0 Likes
4,898

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