SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

SD BAPIs and customer enhancement concept



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Dec 29, 2007 10:45 pm    Post subject: SD BAPIs and customer enhancement concept Reply with quote

Note 143580 - Information on SD BAPIs and customer enhancement concept

Symptom

This note describes how to proceed if you implemented customer fields in SD tables VBAK, VBAP, and VBEP and now want to supply these fields with the SD BAPIs that have an EXTENSIONIN parameter.
Technical information on the customer enhancement concept

The customer enhancement concept for BAPIs allows the processing of customer-specific fields by means of BAPI. In addition, SAP fields that were not taken into account by the developer during the BAPI implementation and thus do not belong to the standard functions of the BAPI can be processed customer-specifically.

!!! If you use the extension parameters according to the BAPI programming guide or the documentation for the customer enhancement concept, only character-type field types are permitted !!! !!!

If nevertheless you require a processing of non character-type types, refer to Notes 700795 and 509898.

The following description explains by means of an example how to proceed for customer enhancements to SD tables VBAK, VBKD, VBAP and VBEP.
Initial situation: The customer has attached own fields to table VBAP,
by means of INCLUDE structure CUTEST.
This structure includes two fields: CFIELD1, CHAR 10
and CFIELD2, CHAR 3.
These 2 fields should now also be maintainable via the BAPI.
Field name Data element/component type

1. Structure CUTEST is defined in table VBAP.
2. Since the BAPIs use checkbox structures, you also have to define a corresponding checkbox structure CUTESTX with the following setup for the customer structure:

CFIELD1 CHAR1
CFIELD2 CHAR1
CFIELD2 CHAR1

3. Then you must use an Include or APPEND to define these customer structures in structures VBAPKOZ and VBAPKOZX.
4. Afterwards you must use the APPEND technique to append the customer structures to BAPI structures BAPE_VBAP and BAPE_VBAPX.
5. Adjust the following structures for customer enhancements in table VBAK:
a) VBAKKOZ
b) VBAKKOZX
c) BAPE_VBAK
d) BAPE_VBAKX
6. For customer enhancements on table VBKD that may have header VBKD fields and item VBKD fields, adjust the following structures:
a) VBAKKOZ and VBAKKOZ
b) VBAPKOZ and VBAPKOZX, if the commercial customer fields have to be supplied also on item level
c) BAPE_VBAK and BAPE_VBAKX
d) BAPE_VBAP and BAPE_VBAPX, if the commercial customer fields are supposed to be filled in also on item level.
7. Adjust the following structures for customer enhancements in table VBEP:
a) VBEPKOZ
b) VBEPKOZX
c) BAPE_VBEP
d) BAPE_VBEPX
8. In general, the data in the BAPI interface is stored in the internal communication structures (VBAKKOM and others). From there, this data is processed in SD tables (VBAK and others).
9. If you fill parameter EXTENSIONIN with customer data, you must fill the corresponding standard parameters at least with the key fields.
Example: In order 4711 customer field VBAP-CFIELD2 of item 20
should be changed to 'XYZ'.

The following entries are required:

Import: BAPIVBELN-VBELN = '0000004711' document number
BAPISDHD1X-UPDATEFLAG = 'U' UPDKZ for document header
Tables: BAPISDITM-ITM_NUMBER = '000020' item number
BAPISDITMX-ITM_NUMBER = '000020' item number
+ BAPISDITMX-UPDATEFLAG = 'U' UPDKZ for item

The EXTENSION table must be filled as follows:

STRUCTURE VALUEPART1 1234567890123

BAPE_VBAP 0000004711000020 XYZ
BAPE_VBAPX 0000004711000020 X

Additional information
For additional information refer to the implementation guide for BAPI programming, chapter 'Customer enhancement concepts for BAPIs'.

Also refer to Note 170183.


BAPI_SALESORDER_CREATEFROMDAT2 - USER EXIT

You can use parameter EXTENSIONIN to transfer user-specific enhancements to a BAPI. The customer has to complete the EXTENSIONIN structure and the system automatically continues processing it.
THERE IS AN ERROR IN THE FM DOCUMENTATION. CUSTOM FIELDS START AT VALUPART1+16 not 22.
1. Maintain APPEND structure in table VBAP
2. Because the BAPIs work with checkboxes, you must also define a checkbox for the customer structure. It should be structured like this:
Field name Data element
ZFIELD1 CHAR1
ZFIELD2 CHAR1
3. Define these customer structures in the structures VBAPKOZ und
VBAPKOZX using INCLUDE or APPEND.
4. Add the customer structures to the BAPE_VBAP and BAPE_VBAPX BAPI structures using the APPEND technique.
e.g CODE.
Code:
* new table for customising fields for VBAP
BAPIPAREX type BAPIPAREX,
T_BAPIPAREX type table of BAPIPAREX,
form EDI_FIELDS .
bapiPAREX-structure = 'BAPE_VBAP'.
bapiPAREX-VALUEPART1+10 = G_POSNR.
bapiPAREX-VALUEPART1+16 = IT902-FILENAME.
bapiPAREX-VALUEPART1+27 = IT902-PTCID.
bapiPAREX-VALUEPART1+30 = IT902-LOCATION.
APPEND BAPIPAREX TO T_BAPIPAREX.
bapiPAREX-structure = 'BAPE_VBAPX'.
CLEAR bapiPAREX-VALUEPART1.
bapiPAREX-VALUEPART1+22 = 'XXX'.
APPEND BAPIPAREX TO T_BAPIPAREX.


Update customer fields in BAPI - BAPI Extension

EXAMPLE FOR ORDER CREATE:

Code:
bapiparex-structure = 'BAPE_VBAP'.
bapiparex-valuepart1+10 = g_posnr.
bapiparex-valuepart1+16 = it902-filename.
bapiparex-valuepart1+27 = it902-ptcid.
bapiparex-valuepart1+30 = it902-location.
APPEND bapiparex TO t_bapiparex.

bapiparex-structure = 'BAPE_VBAPX'.
CLEAR bapiparex-valuepart1.
bapiparex-valuepart1+22 = 'XXX'.
APPEND bapiparex TO t_bapiparex.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.