‎2011 May 12 10:48 AM
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
‎2011 May 12 11: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
‎2011 May 12 11: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
‎2011 May 12 11: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.
‎2011 May 12 12:56 PM
hi sameer,
how to check whether the standard code is enhanced or not?
‎2011 May 12 1:14 PM
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
‎2011 May 12 1: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]
‎2011 May 12 2: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
‎2011 May 12 4: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
‎2011 May 12 4: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
‎2015 Jan 11 5: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