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

Input Tables on BAPI_xxx_CREATEFROMDATA

Former Member
0 Likes
955

I'm a newbie (what a surprise!) and I've been looking at various CREATEFROMDATA BAPIs. Some of them, such as SALESDOCU look like they take a number of tables as input. E.g. SALES_ITEMS_IN and SALES_CONDITIONS_IN.

Is the information in those tables part of the SALESDOCUMENT-object/database-table itself, or is it storedd in some sort of subsidiary objects/database-tables? Does that make any sense, or am I completely clueless?

Thanks.

3 REPLIES 3
Read only

Former Member
0 Likes
936

Hello

The data you fill in these internal tables (like you fill the line item data in SALES_ITEMS_IN is used to create the sales document in R/3. So all the header and line item data eventually does gets stored in database table or the other. In the process of creating the document the BAPI also derives some calculated fields which may not get stored in the database but is calculated everytime you access the document for change or display.

Regards

Shounak

Read only

former_member221770
Contributor
0 Likes
936

Hi Bob,

The data you pass into the "tables for input" (eg SALES_ITEMS_IN) will eventually get stored in the relevant SAP tables (eg VBAP). Don't forget the "X" tables, eg SALES_ITEMS_INX. These tables generally contain similiar field names as the non X tables (eg SALES_ITEM_IN). By putting a "X" into the relevant field in the "X" table indiocates that this field should be updated.

eg.


  tbl_poitem-po_item     = tbl_item-ebelp.
  tbl_poitem-plant       = tbl_item-werks.
  tbl_poitem-stge_loc    = tbl_item-lgort.
  tbl_poitem-quantity    = tbl_item-menge.
  tbl_poitem-po_unit     = tbl_item-meins.
  APPEND tbl_poitem.

  tbl_poitemx-po_item     = tbl_item-ebelp.
  tbl_poitemx-po_itemx    = 'X'.
  tbl_poitemx-plant       = 'X'.
  tbl_poitemx-stge_loc    = 'X'.
  tbl_poitemx-quantity    = 'X'.
  tbl_poitemx-po_unit     = 'X'.
  APPEND tbl_poitemx.

This logic is common for alot of the BAPI's in SAP.

Hope this helps.

Cheers,

Pat.

Read only

Former Member
0 Likes
936

Hi Bob,

At a little higher level, any document in SAP...Sales order, Purchase order, Invoice, etc. is stored in the database in a hierarchical relationship of database tables.

Information about a sales document for example is stored in a number of tables.

VBAK is the header data table. This contains basic information about the document. Doc number, creation date, sales org, etc. Basically it contains general data about the order.

VBAP is the table that contains the meat of the order. VBAP holds the actual line items of the order and data about these items. If you enter a sales order for customer XYZ for 1 ea Item 1 and 1 ea of item 2. That will give you a single entry in VBAK for the order and 2 entries in VBAP (one for each line item).

In addition to these tables there are many others that hold data about the status of the order, related documents, delivery information, etc.

One of the easiest ways to find these tables is to look in transaction SE36 (Logical databases) These are pre programed table joins from SAP. Select the LDB (which for sales document I think is VAV or BRM) click the structure radio button and display. This will give you a tree structure showing the relationship of the various tables.

Hope this helps.

Brent