采购之Planned delivery cost & Unplanned delivery cost

详细图片请见附件Delivery Cost.rar

  • Planned Delivery Cost

在创建PO的时候就会将运费计算进去(比如在item condition中加入FRB1 condition type)。在做GR的时候会将运费计入Freight clearing acct. 并在做IR的时候,进行清帐,将运费计算到stock科目中。


在做IR时注意如图所示的位置选择3 就是货物和运费一起输入发票,否则只会把货物的价值或者发票的价值单独带出来。


在GR IR时实际产生的会计凭证如下

  • Unplanned Delivery Cost

只在IR的时候才发现供货商有额外的运费发生,输入在发票里,则GR中只会按照正常的计入GR/IR Clearing acct.,在IR时将额外的运费直接计入stock account中。

如图,做IR时在details tab中输入运费

GR IR时产生的会计凭证如下

P.S. 可以通过系统配置,来指定unplanned delivery cost在IR时,是自动分配到各个明细项中还是计入一个特定科目。此处我们自动分配到明细项中。OBYC的UPF transaction配置这个指定科目。请参考SAP的automatic postings

IMG->Materials Management -> logistics invoice verification->incoming invoice->Configure how unplanned delivery cost are posted

如果是SPACE则会将运费分配到各明细项,如果是2,则会计入指定的G/L科目


(0) 评论    (4) 引用   

Business Area&Functional Area

Business Area

The function of business areas is to create balance sheets and Profit and Loss statements below the company code level. Some common uses of business areas are to produce divisional financial statements or SEC segment-level reporting. It is important to note that business area functionality can be duplicated using Profit Center Accounting. The decision to use or not to use business areas should be made early on in the design phase of your project. Many new projects are leaning away from business areas and toward profit centers, but ultimately, the decision is an individual project decision based on what fits in to the overall system design of the project implementation. Some of the deciding factors are the need to report on business lines across company codes, the need for full balance sheets at the divisional or business line level, as well as the cost and benefits of business areas versus profit centers.

The functional area is an organizational unit in accounting that classifies the expenses of an organization by function.

It organize your business for cost of sales accounting. It allow you to segregate and classify different types of costs within one expense account. For e.g. a single labour account to determine what amount of labour is spent directly on production as compare to sales or hr.


(0) 评论    (0) 引用   

物料主数据之Standard Price&Moving Average Price

具体图片请见附件MMPrice_SA.rar

l Posting to Standard Price

在创建新的PO,收货之前,库存和物料主数据中的状态如下。

后台OBYC中,BSX的业务配置inventory posting的账户,在系统里,valuation class 3000对应的科目为300000(Z-ROH-DV01物料的v class配置的3000,关于valuation class请参考我的相关Blog)

业务WRX配置的已收货/以收发票清算科目 配置为191100

业务PRD配置的成本价格差额科目 281500

我们创建一个收货的流程,PO->GR,采购100个,价格为2.4块。这样的话,库存应该变为200个,而因为采用S价格,所以库存价值为2 x 200 = 400 而已收货/以收发票清算科目却要按照实际的2.4 x 100 = 240元,差额为40元,这就需要用成本价格差额科目来使借贷达到平衡。

也就是说借记200元库存科目。

借记40元成本价格差额科目

贷记240GR/IR clearing acc.(已收货/以收发票清算科目)

那么我们去系统里实际查看一下。

GR/IR Clearing acc.则如下

成本价格差异科目如下

由于科目300000设置了不显示行项目,所以我们来查看实际产生的凭证

我们这时再看这个物料的moving price 已经变成了2.2 440/200 = 2.2

之后假设我们收到客户的发票,发票的每个物料单价为2.2元,则总价为220元,与GR时相差了20元。做这步之前,请TCODE OMR6确认测试的公司代码下,发票冻结相关的容差组容许有20元的发票容差。发票校验是SAP MM培训单独的一门课程,容差组也有很多选项,以后再讨论。操作截图如下:

那么相应的科目是如何记账的呢?

首先,GR/IR Clearing acc.是一个中间过渡科目,是需要清帐的。所以首先要借记这个191100科目240元。因为客户发票中物品的价格为220元,差额20元,需要贷记Expenditure/income from price differences科目20元。最后相关供货商的AP账户(这里是1000)贷记255.2(含税,并会进入相关的统驭科目)以及相关进项税科目。

产生的会计凭证如下

需要说明一下,由于我使用的系统配置为发票与库存价值差额进入了281500这个科目,一般可设置为另一个科目,叫做Expenditure from price differences

这时再查看一下物料的moving average price2.1元。 因为库存价值降低,有440元变为420元。420/200 = 2.1元。

l Posting to Moving Average Price

首先查看一下在做采购之前物料Z-ROH-DV03的状态和库存状态(初始库存可以用MB1C 移动类型561来做taking)

而用平均移动价格做posting的科目设置与之前相同。

接下来采购100个物料,PO->GR,这批物料的单价为2.4元。则在收获过后库存增加了240元,总价为440元,所以平均移动价格为440/200 = 2.2元。而GR/IR Clearing acc.240元。

由于库存增加价值与实际GR的价值没有差异,所以不需要像使用标准价格那样有一个账户记录差额。

通过生成的会计凭证可以看到这个差异

GR过后物料主数据中价格和库存状态如下

库存总价值440 平均移动价格为 440/200 = 2.2

之后收到客户发票,物料单价为2.2元,则物料总价值为220元,与之前的库存价值价额20元。与前面一样,GR/IR Clearing科目是一定要被清帐的。而物料的差额20元则贷记库存科目。其他科目与之前相同。

产生的会计凭证如下

物料的平均移动价格如图所示为 420 /200 = 2.1


(0) 评论    (12) 引用   

创建Info Record的几种方法

详细图片请参考附件。SAP info.Record.rar

创建SAP采购中重要的主数据之一info record有如下3种方式:手动(ME11);通过Quotation自动创建;通过PO或者outline agreement自动创建;

看一下后两种方式:

首先ME13确认,并不存在一个我们想创建的info record

之后创建相关物料的RFQ并作Quotation

注意Quotation中的这个字段InfoUpdate 其中有如下选项:

No update

A Update with or without plant

B Update with plant (if no plant ban)

C Update without plant (if no plant requirement)

我们首先选默认的No update 然后对报价进行保存,ME13可以看到依然没有Info Record被创建,因为是No update

如果选择A,相应的condition都会被这个报价中的price所更新。

但是更新规则如下,如果有plant level的话,相应的plant level会被更新,如果没有的话,更新general level

我们来确认一下。

但是我们会发现一个现象,那就是再次查看这个报价,会发现InfoUpdate自动变成了C,也就是without plant,而且info record中也会提示没有plant specific的数据。这是因为我们之前没有维护过任何和plant相关的数据,根据A的规则,创建通用数据的condition。而因为没有plant数据,所以这个flag也变成了C,也就是说维护与plant无关的condition

如果之前我们先创建一个与工厂相关的Info record,然后再选择flagA的报价,看看condition是如何更新的。

可以看到,如果这样做的话,与工厂相关的info rec.就被更新了,而general级别的却还是没有condition。而报价中的flag也自然而然的自动变成了B,也就是说如果没有工厂,则不做更新。

用报价来创建和更新info record就是这个道理。

如果在PO中呢?PO中并不会更新condition。而只是影响info record中的last PO number一个字段而已。如果创建

备注:

我们以上的实验前提都是在condition可以存在于Plant level的前提下。条件永远都与采购组织相关联,但是也可以设定为与plant相关。默认情况下,我们一般都会允许工厂级别的条件存在,配置更加灵活,除非需求真的是将所有工厂都统一用一个价格。这个在后台的配置中

Purchasing -Conditions-Define Condition Control at Plant Level

可以指定是否只允许工厂级别的条件存在;是否不允许工厂级别的条件存在

如果我们不允许工厂级别的条件存在,则ME11指定工厂时会得到错误消息。


(0) 评论    (45) 引用   

[收藏]sap采购价格条件技术 Purchase pricing using SAP condition tech

本来想自己写一篇关于condition的,可是发现网上有了一篇比较完善的文档。

直接参考这个就会比较清楚SAP的条件技术如何应用于定价了。sap采购价格条件技术.rar

那么价格主要存在于info record这个主数据中,关于info record我也有blog描述。

我想补充的是PO中价格的决定这一个小方面。

SAP在创建PO时,首先会搜索info record,如果维护了价格,则会应用它。如果没有维护价格,则会从Info record中搜索last PO这个字段,找到应用了此info rec.的最后一个PO,然后将这个PO中的价格应用于当前PO。

不过我们也可以通过后台设置来做一些改动。

具体通过TCODE OMFI,定义一个组,然后在price adoption选项中,有always copy; Not if price entered manually; Do not copy三个选项来定义从上一张PO中copy价格的选项。然后在SU01客户的parameter中,通过EVO这个parameter ID来配置。


(0) 评论    (17) 引用   

BC425(Enhancements and Modifications)总结

BC425读过有年头了,不过一直没有总结出来。今天上午把大概比较重要的知识点总结出来,有很多是即使做过enhancement的人也不是很清楚的。具体图片请参考BC425.rar

Table Enhancement

l Append Structure

l Append structures are created for use with a specific table

l Multiple append structures can be used with a single table

l Append structures can be used just like any other structure

一个structure只能append给一个table,但是一个table可以append很多structure.

如果copy一个有append structuretable,那么append structure里的字段都将成为新表中的普通字段。

可以对poolclusterappend structure,但是如果表中有LCHR LRAW字段则不行。

Structurefield的名字用customer namespace(ZZ YY)防止SAP系统升级时产生冲突,SAP系统升级时,会自动保留append structure

l Customizing include

n Must be specified by the SAP developer

n Is created by the customer

Include可以同时插入到很多表中。命名规约为以CI_开头,确保不与SAP标准冲突。Include中的字段名字以ZZ YY开头。

Text Enhancements

l Data Element Keywords

l Documentation

Customer Exit

TCODE: CMOD SMOD(参考Tim的讲解)

l Function Module Exit

SAP标准程序用,用CALL CUSTOMER-FUNCTION来调用,而且后面只是一个号码,比如001.

系统自动调用EXIT_<Programe_name>_001这个函数。其中program name便是拥有function module exitSAP标准程序名。另外,这些function都是存在于X开头的function group中。Function中都有一个zx开头的include语句,为客户开发预留。

对于X function groupSAP也有一些规定:如果function group的程序名为SAPLXAAA,则全局数据存储在LXAAATOP中,所有的function module存储在LXAAAUXX中,每一个function module对应存储在LXAAAU01…XX中。Subroutine存储在LXAAAF01…LXAAAFXX中。Group中的include要么以LX开头,要么以ZX开头,我们只能编辑以ZX开头的。比如自己定义的TOP include ZXAAATOP用来保存全局数据。自己创建的其他Object:ZXAAAO01(PBO) ZXAAAI01(PAI)ZXAAAE01(ABAP Events)

l Menu Exit

Menu Exit允许将自定义的功能附着在SAP菜单之上。这些为客户预留的menu exitSAP中,FCode以‘+’开头,在激活project之前不会显示。Menu Exit一般都会有预留的function module exit与之配合一起工作。

l Screen Exit

Screen Exit允许我们在SAP预留的screen area中定义自己的subscreen。在系统程序中,调用screen exit的方法为:
PBO CALL CUSTOMER-SUBSCREEN <area> INCLUDING <X-function-pool> <screen_number>

PAI CALL CUSTOMER-SUBSCREEN <area>

我们要在相应的function group中创建PBO PAI相应的module.而系统程序主屏幕与subscreen调用顺序如下:

而使用screen exit的一个最大问题在于数据的交换。因为标准系统程序并不会知道用户自定义屏幕中会有什么字段,所以不会预定义全局变量给它。需要在PBO系统预留的function module exit中讲subscreen可能需要的当前数据传输给子屏幕。而子屏幕经过处理再通过在系统程序PAI中预留的function module exit传输回来。具体过程如下图:

l BTE

Business Transaction Events (BTE) are enhancements that were developed for the Financial Accounting (FI) component of R/3.

BTE是专门为FI准备的,在执行某些动作是触发。我应用不是特别多,有时间再仔细研究一下,写出来细节。

BTE调用的细节图如下:

BTE的一个特点就是可以有多个实现。多个被激活的实现在执行中被逐一调用

在程序找到一个BTE的方法为:在程序中搜索 OPEN_FI_PERFORM 以及在IMGFI下找到Use business transaction events子菜单。

BTEcustomer exit相比有如下不同:

BTE只提供源代码级别的exit,没有menu screenBTE可以重用,不是跨client的,并且可以过滤。

l BAdIs(Business Add-Ins)

关于BAdI tim有过不错的介绍。可以简单的认为是一个OO版本的enhancement,但是它有很多新的特性。比如BAdl可以指定过滤条件,可以重用,只有被筛选出来的BAdl才会被执行。

BAdl的执行序列如下图

BAdl的命名规约为:BAdlinterface IF_EX_<badi> ZIF_EX_<baid>或者自定义namespace/IF_EX_<badi>

实现的类为CL_IM_<badi> ZCL_IM_<baid>或者自定义namespace/CL_IM_<badi>


(0) 评论    (4) 引用   

[收藏]ALV Grid Demo(OO ALV)

http://www.abaptech.com/?p=357 翱翔云天写的例子。真是不错!!

 查看全文

(0) 评论    (24) 引用   

[收藏]关于日期 数字 单位等转换和check的函数

从翱翔云天处看到一个整理的列表,十分的好

http://www.abaptech.com/?p=347

我单独补充一个根据用户的parameter设置(SU01)来检查数字格式合法性的

CATS_NUMERIC_INPUT_CHECK 不过这个没有release


(0) 评论    (18) 引用   

SAP FI中的反记账

在SAP FI的company code全局设置和document type中都有一个 negative posting allowed的checkbox。因为正常我们做一张会计凭证时只能输入正值。但是有时候冲销,SAP的FB08并不能满足财务账面上的需求。所以需要在相应的科目上做负值(反记账checkbox),进行冲销对账面调整。

有关这方面,SAP屠夫讲得十分详尽,可以参考

http://community.kingdee.com/pages/sapguru/blog/archive/2008/01/25/273972.aspx?CommentPosted=true

http://blog.vsharing.com/rayrain/A659274.html

------------------------------------------------------------------

补充知识: 红字冲销法 http://baike.baidu.com/view/1456215.htm

红字更正法 http://baike.baidu.com/view/1684147.htm


(0) 评论    (0) 引用   

[收藏]动态创建内表的示例程序

*&---------------------------------------------------------------------*
*& Report ZDAVID_DYNAMIC_TABLE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT zdavid_dynamic_table.


TABLES: vbak, mara, vbap.

TYPE-POOLS: slis.

**********
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>,
<dyn_field>,
<dyn_table1> TYPE STANDARD TABLE,
<dyn_wa1>,
<dyn_field1>.


DATA: dy_table TYPE REF TO data,
dy_line TYPE REF TO data,
ifc TYPE lvc_t_fcat,
xfc TYPE lvc_s_fcat,
dy_table1 TYPE REF TO data,
dy_line1 TYPE REF TO data.

DATA: BEGIN OF list_protype OCCURS 0,
extwg LIKE mara-extwg,
END OF list_protype.

DATA: show_protype LIKE list_protype OCCURS 0 WITH HEADER LINE.

DATA: l_title TYPE string.

CONSTANTS: tab_key TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
**********************
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
wa_layout TYPE slis_layout_alv,
it_extab TYPE slis_t_extab.
DATA: name(20).

DATA: BEGIN OF it_item OCCURS 0,
vkorg LIKE vbak-vkorg, "Sales organization
vtweg LIKE vbak-vtweg, "distribution channel
kunnr LIKE vbak-kunnr, "sold-to party
name1 LIKE kna1-name1, "Customer name
bstnk LIKE vbak-bstnk, "PO number
vbeln LIKE vbak-vbeln, "sales document
erdat LIKE vbak-erdat, "document date
extwg LIKE mara-extwg, "product type
posnr LIKE vbap-posnr, "order item
matnr LIKE vbap-matnr, "Material
kwmeng LIKE vbap-kwmeng, "Order Qty
vrkme LIKE vbap-vrkme, "Sales Unit
netwr LIKE vbap-netwr, "Order Net Value
waerk LIKE vbap-waerk, "Currency
za_kbetr LIKE konv-kbetr, "ZA01 %Discount
ra_kbetr LIKE konv-kbetr, "RA00 %Discount
za_kwert LIKE konv-kwert, "ZA01 discount amount
ra_kwert LIKE konv-kwert, "ZA01 discount amount
knumv LIKE vbak-knumv, "condition number
vbtyp LIKE vbak-vbtyp, "SO type
END OF it_item.

DATA: BEGIN OF it_output OCCURS 0,
vkorg(4) TYPE c, "Sales organization
vtweg(2), "distribution channel
kunnr(10), "sold-to party
name1(35), "Customer name
bstnk(20), "PO number
vbeln(10), "sales document
erdat(8), "document date
extwg(18), "product type
posnr(6), "order item
matnr(18), "Material
kwmeng(15), "Order Qty
vrkme(3), "Sales Unit
netwr(15), "Order Net Value
waerk(13), "Currency
za_kbetr(11), "ZA01 %Discount
ra_kbetr(11), "RA00 %Discount
za_kwert(13), "ZA01 discount amount
ra_kwert(13), "ZA01 discount amount
END OF it_output.

DATA: BEGIN OF it_op_sum OCCURS 0,
vkorg(4) TYPE c, "Sales organization
vtweg(2), "distribution channel
kunnr(10), "sold-to party
name1(35), "Customer name
bstnk(20), "PO number
vbeln(10), "sales document
erdat(8), "document date
extwg(18), "product type
kwmeng(15), "Order Qty
vrkme(3), "Sales Unit
netwr(15), "Order Net Value
waerk(13), "Currency
za_kwert(13), "ZA01 discount amount
ra_kwert(13), "ZA01 discount amount
END OF it_op_sum.


TYPES: BEGIN OF ty_sum,
vkorg LIKE vbak-vkorg, "Sales organization
vtweg LIKE vbak-vtweg, "distribution channel
kunnr LIKE vbak-kunnr, "sold-to party
name1 LIKE kna1-name1, "Customer name
bstnk LIKE vbak-bstnk, "PO number
* vbeln like vbak-vbeln, "sales document
erdat LIKE vbak-erdat, "document date
extwg LIKE mara-extwg, "product type
kwmeng LIKE vbap-kwmeng, "Order Qty
vrkme LIKE vbap-vrkme, "Sales Unit
netwr LIKE vbap-netwr, "Order Net Value
waerk LIKE vbap-waerk, "Currency
za_kwert LIKE konv-kwert, "ZA01 discount amount
ra_kwert LIKE konv-kwert, "ZA01 discount amount
END OF ty_sum.

DATA: BEGIN OF sel OCCURS 0,
knumv LIKE vbrk-knumv,
posnn LIKE vbfa-posnn,
vbtyp_n LIKE vbfa-vbtyp_n,
END OF sel.

DATA: wa_sum TYPE ty_sum.

DATA: BEGIN OF it_protype OCCURS 0,
extwg LIKE mara-extwg,
netwr LIKE vbap-netwr,
END OF it_protype.

DATA: it_sum TYPE STANDARD TABLE
OF ty_sum INITIAL SIZE 10 WITH HEADER LINE.

SELECTION-SCREEN BEGIN OF BLOCK fname1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_vkorg FOR vbak-vkorg DEFAULT '4800' TO '4801',
s_vtweg FOR vbak-vtweg DEFAULT '31',
s_kunnr FOR vbak-kunnr,
s_erdat FOR vbak-erdat DEFAULT sy-datum,
s_extwg FOR mara-extwg.
SELECTION-SCREEN END OF BLOCK fname1.

SELECTION-SCREEN BEGIN OF BLOCK fname3 WITH FRAME TITLE text-003.
PARAMETER: rbank RADIOBUTTON GROUP rd1,
rintake RADIOBUTTON GROUP rd1 DEFAULT 'X',
rinvoice RADIOBUTTON GROUP rd1.
SELECTION-SCREEN END OF BLOCK fname3.

SELECTION-SCREEN BEGIN OF BLOCK fname4 WITH FRAME TITLE text-004.
PARAMETER: rabap RADIOBUTTON GROUP rd2 DEFAULT 'X',
rfile RADIOBUTTON GROUP rd2,
v_file LIKE rlgrap-filename
DEFAULT 'c:tempacdelco-statis.txt',
rserver RADIOBUTTON GROUP rd2,
v_server TYPE filepath-pathintern
DEFAULT '/icsdata/acdelco/acdelco-statis.txt'.
SELECTION-SCREEN END OF BLOCK fname4.

START-OF-SELECTION.

PERFORM selectdata.
PERFORM output.

*&---------------------------------------------------------------------*
*& Form selectdata
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM selectdata .
IF rbank = 'X'.
PERFORM selectrbank.
ELSEIF rintake = 'X'.
PERFORM selectintake.
ELSEIF rinvoice = 'X'.
PERFORM selectrinvoice.
ENDIF.
ENDFORM. " selectdata
*&---------------------------------------------------------------------*
*& Form output
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM output .
IF rabap = 'X'.
PERFORM outputabap.
ELSEIF rfile = 'X'.
PERFORM outputfile.
ELSEIF rserver = 'X'.
PERFORM outputfile.
ENDIF.

ENDFORM. " output
*&---------------------------------------------------------------------*
*& Form selectintake
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM selectintake .

* select basic order data
PERFORM selectbasic.


LOOP AT it_item.

* get customer name
SELECT SINGLE kna1~name1 FROM kna1
INTO it_item-name1
WHERE kna1~kunnr = it_item-kunnr.


* If SO is 'H'(return)
IF it_item-vbtyp = 'H'.
it_item-netwr = - it_item-netwr.
ENDIF.

MODIFY it_item.

MOVE-CORRESPONDING it_item TO wa_sum.
COLLECT wa_sum INTO it_sum.

ENDLOOP.

PERFORM dynamictable.

ENDFORM. " selectintake
*&---------------------------------------------------------------------*
*& Form selectrbank
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM selectrbank .
PERFORM selectbasic.
LOOP AT it_item.

* get customer name
SELECT SINGLE kna1~name1 FROM kna1
INTO it_item-name1
WHERE kna1~kunnr = it_item-kunnr.

* clear: it_item-kwmeng, it_item-netwr.
DATA: t_kwmeng LIKE it_item-kwmeng,
t_netwr LIKE it_item-netwr.

* When SD document category (VBAK~VBTYP) is 慍?(Order)
IF it_item-vbtyp = 'C'.
* If VBFA-VBTYP_N = M (invoice) ++
SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (t_kwmeng, t_netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'M'.
* If VBFA-VBTYP_N = N (invoice cancellation) --

it_item-kwmeng = it_item-kwmeng - t_kwmeng.
it_item-netwr = it_item-netwr - t_netwr.

CLEAR: t_kwmeng, t_netwr.

SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (t_kwmeng, t_netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'N'.

it_item-kwmeng = it_item-kwmeng + t_kwmeng.
it_item-netwr = it_item-netwr + t_netwr.

IF it_item-kwmeng = 0.
DELETE it_item.
CONTINUE.
ENDIF.

* When SD document category (VBAK~VBTYP) is H (Returns)
ELSEIF it_item-vbtyp = 'H'.
* If VBFA-VBTYP_N = O (Credit memo) ++
SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (t_kwmeng, t_netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'O'.

it_item-kwmeng = it_item-kwmeng - t_kwmeng.
it_item-netwr = it_item-netwr - t_netwr.


* If VBFA-VBTYP_N = S (Credit memo cancellation)
CLEAR: t_kwmeng, t_netwr.
SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (t_kwmeng, t_netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'S'.

it_item-kwmeng = it_item-kwmeng + t_kwmeng.
it_item-netwr = it_item-netwr + t_netwr.

IF it_item-kwmeng = 0.
DELETE it_item.
CONTINUE.
ENDIF.

ENDIF.

* If SO is 'H'(return)
IF it_item-vbtyp = 'H'.
it_item-netwr = - it_item-netwr.
ENDIF.


MODIFY it_item.

MOVE-CORRESPONDING it_item TO wa_sum.
COLLECT wa_sum INTO it_sum.


ENDLOOP.

PERFORM dynamictable.

ENDFORM. " selectrbank
*&---------------------------------------------------------------------*
*& Form selectrinvoice
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM selectrinvoice .
PERFORM selectbasic.

LOOP AT it_item.

* get customer name
SELECT SINGLE kna1~name1 FROM kna1
INTO it_item-name1
WHERE kna1~kunnr = it_item-kunnr.

CLEAR: it_item-kwmeng, it_item-netwr.
DATA: t_kwmeng LIKE it_item-kwmeng,
t_netwr LIKE it_item-netwr.

* When SD document category (VBAK~VBTYP) is 慍?(Order)
IF it_item-vbtyp = 'C'.
* If VBFA-VBTYP_N = M (invoice) ++
SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (it_item-kwmeng, it_item-netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'M'.
* If VBFA-VBTYP_N = N (invoice cancellation) --
CLEAR: t_kwmeng, t_netwr.

SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (t_kwmeng, t_netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'N'.

* M (invoice) - N (invoice cancellation)
it_item-kwmeng = it_item-kwmeng - t_kwmeng.
it_item-netwr = it_item-netwr - t_netwr.

IF it_item-kwmeng = 0.
DELETE it_item.
CONTINUE.
ENDIF.


* When SD document category (VBAK~VBTYP) is H (Returns)
ELSEIF it_item-vbtyp = 'H'.
* If VBFA-VBTYP_N = O (Credit memo) ++
SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (it_item-kwmeng, it_item-netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'O'.

* If VBFA-VBTYP_N = S (Credit memo cancellation)
CLEAR: t_kwmeng, t_netwr.
SELECT SUM( vbfa~rfmng ) SUM( vbrp~netwr )
FROM vbfa JOIN vbrp ON vbfa~vbeln = vbrp~vbeln AND vbfa~posnn =
vbrp~posnr
INTO (t_kwmeng, t_netwr)
WHERE vbfa~vbelv = it_item-vbeln
AND vbfa~posnv = it_item-posnr
AND vbfa~vbtyp_n = 'S'.

* O (Credit memo) - S (Credit memo cancellation)
it_item-kwmeng = it_item-kwmeng - t_kwmeng.
it_item-netwr = it_item-netwr - t_netwr.

IF it_item-kwmeng = 0.
DELETE it_item.
CONTINUE.
ENDIF.


ENDIF.

* If SO is 'H'(return)
IF it_item-vbtyp = 'H'.
it_item-netwr = - it_item-netwr.
ENDIF.


MODIFY it_item.

MOVE-CORRESPONDING it_item TO wa_sum.
COLLECT wa_sum INTO it_sum.
ENDLOOP.

PERFORM dynamictable.

ENDFORM. " selectrinvoice
*&---------------------------------------------------------------------*
*& Form selectbasic
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM selectbasic .

* select basic order data
SELECT vbak~kunnr vbap~kwmeng vbak~vbeln
vbap~posnr vbap~matnr mara~extwg vbap~netwr vbap~waerk vbak~vbtyp
FROM vbak JOIN vbap ON vbap~vbeln = vbak~vbeln JOIN mara ON vbap~matnr =
mara~matnr
INTO CORRESPONDING FIELDS OF TABLE it_item
WHERE vbak~vkorg NE '4802'
AND vbak~vkorg NE '4803'
AND ( vbak~vbtyp EQ 'C' OR vbak~vbtyp EQ 'H')
AND vbap~abgru = ''
AND vbak~vkorg IN s_vkorg
AND vbak~vtweg IN s_vtweg
AND vbak~kunnr IN s_kunnr
AND vbak~erdat IN s_erdat
AND mara~extwg IN s_extwg
AND vbap~abgru EQ ''
AND mara~extwg NE ''.


ENDFORM. " selectbasic
*&---------------------------------------------------------------------*
*& Form outputabap
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM outputabap .
DEFINE a_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = &1.
wa_fieldcat-seltext_l = &2.
* wa_fieldcat-just = 'C'.
* wa_fieldcat-outputlen = &3.
wa_fieldcat-key = &3.
append wa_fieldcat to it_fieldcat.
END-OF-DEFINITION.

a_fieldcat 'KUNNR' 'Sold-to Party' 'X'.
a_fieldcat 'NAME1' 'Name' ''.
a_fieldcat 'PERIOD' 'Period Required' ''.

* a_fieldcat 'ERDAT' 'Period Required' ''.
* a_fieldcat 'EXTWG' 'Product Type' ''.

DATA: name1(20),
count TYPE i.

LOOP AT list_protype .
count = count + 1.
CONCATENATE list_protype-extwg 'RMB' INTO name.

READ TABLE show_protype INDEX count.
CONCATENATE show_protype-extwg '(RMB)' INTO name1.
a_fieldcat name name1 ''.

CONCATENATE list_protype-extwg 'USD' INTO name.
CONCATENATE show_protype-extwg '(USD)' INTO name1.
a_fieldcat name name1 ''.

CONCATENATE list_protype-extwg 'EURO' INTO name.
CONCATENATE show_protype-extwg '(EURO)' INTO name1.
a_fieldcat name name1 ''.
ENDLOOP.

a_fieldcat 'TOTALRMB' 'Total(RMB)' ''.
a_fieldcat 'TOTALUSD' 'Total(USD)' ''.
a_fieldcat 'TOTALEURO' 'Total(EURO)' ''.

* if rbank = 'X'.
* a_fieldcat 'NETWR' 'Bank Net Value' ''.
* elseif rintake = 'X'.
* a_fieldcat 'NETWR' 'Order Net Value' ''.
* elseif rinvoice = 'X'.
* a_fieldcat 'NETWR' 'Invoiced Net Value' ''.
* endif.
*
* a_fieldcat 'WAERK' 'Currency' ''.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = wa_layout
it_fieldcat = it_fieldcat
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = <dyn_table>.
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ENDFORM. " outputabap
*&---------------------------------------------------------------------*
*& Form outputfile
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM outputfile .

*loop at show_protype.
* concaterate
*endloop.


******* print head **********
CLEAR xfc.
REFRESH ifc.

xfc-fieldname = 'kunnr'.
xfc-datatype = 'CHAR'.
xfc-intlen = '13'.
APPEND xfc TO ifc.
xfc-fieldname = 'name1'.
xfc-datatype = 'CHAR'.
xfc-intlen = '35'.
APPEND xfc TO ifc.
xfc-fieldname = 'period'.
xfc-datatype = 'CHAR'.
xfc-intlen = '25'.
APPEND xfc TO ifc.

LOOP AT list_protype.


REPLACE '/' WITH '' INTO list_protype-extwg.
REPLACE '-' WITH '' INTO list_protype-extwg.
CONDENSE list_protype-extwg NO-GAPS.

CONCATENATE list_protype-extwg 'RMB' INTO name.
xfc-fieldname = name.
xfc-datatype = 'CHAR'.
xfc-intlen = 18.
* xfc-decimals = 2.
APPEND xfc TO ifc.

CONCATENATE list_protype-extwg 'USD' INTO name.

xfc-fieldname = name.
xfc-datatype = 'CHAR'.
xfc-intlen = 18.
* xfc-decimals = 2.
APPEND xfc TO ifc.

CONCATENATE list_protype-extwg 'EURO' INTO name.
xfc-fieldname = name.
xfc-datatype = 'CHAR'.
xfc-intlen = 18.
* xfc-decimals = 2.
APPEND xfc TO ifc.

MODIFY list_protype.

ENDLOOP.

** total ****

xfc-fieldname = 'TotalRMB'.
xfc-datatype = 'CHAR'.
xfc-intlen = 18.
* xfc-decimals = 2.
APPEND xfc TO ifc.

xfc-fieldname = 'TotalUSD'.
xfc-datatype = 'CHAR'.
xfc-intlen = 18.
* xfc-decimals = 2.
APPEND xfc TO ifc.

xfc-fieldname = 'TotalEURO'.
xfc-datatype = 'CHAR'.
xfc-intlen = 18.
* xfc-decimals = 2.
APPEND xfc TO ifc.

** total ****

CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table1.

ASSIGN dy_table1->* TO <dyn_table1>.

CREATE DATA dy_line LIKE LINE OF <dyn_table1>.

ASSIGN dy_line->* TO <dyn_wa1>.


DATA: count TYPE i.
count = 1.

ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
<dyn_field1> = 'Sold-to Party'.
count = count + 1.

ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
<dyn_field1> = 'Name'.
count = count + 1.

ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
<dyn_field1> = 'Period Required'.
count = count + 1.


LOOP AT show_protype .
ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
CONCATENATE show_protype-extwg '(RMB)' INTO <dyn_field1>.
count = count + 1.
ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
CONCATENATE show_protype-extwg '(USD)' INTO <dyn_field1>.
count = count + 1.
ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
CONCATENATE show_protype-extwg '(EURO)' INTO <dyn_field1>.
count = count + 1.

ENDLOOP.

ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
<dyn_field1> = 'Total(RMB)'.
count = count + 1.
ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
<dyn_field1> = 'Total(USD)'.
count = count + 1.
ASSIGN COMPONENT count OF STRUCTURE <dyn_wa1> TO <dyn_field1>.
<dyn_field1> = 'Total(EURO)'.
count = count + 1.


APPEND <dyn_wa1> TO <dyn_table1>.

LOOP AT <dyn_table> INTO <dyn_wa>.
MOVE-CORRESPONDING <dyn_wa> TO <dyn_wa1>.
APPEND <dyn_wa1> TO <dyn_table1>.
ENDLOOP.


* a_fieldcat 'TOTALRMB' 'Total(RMB)' ''.
* a_fieldcat 'TOTALUSD' 'Total(USD)' ''.
* a_fieldcat 'TOTALEURO' 'Total(EURO)' ''.

******* print head **********

IF rserver = ''.
CALL FUNCTION 'Z_UT_DOWNLOAD'
EXPORTING
i_path_file = v_file
i_local_pc = 'X'
i_fileformat = 'TAB'
* I_DELIMITER =
* IT_FIELD_CATALOG =
TABLES
it_input = <dyn_table1>
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_WRITE_ERROR = 2
* INVALID_FILESIZE = 3
* INVALID_TYPE = 4
* NO_BATCH = 5
* UNKNOWN_ERROR = 6
* INVALID_TABLE_WIDTH = 7
* GUI_REFUSE_FILETRANSFER = 8
* CUSTOMER_ERROR = 9
* DATASET_NO_AUTHORITY = 10
* DATASET_CANT_OPEN = 11
* DATASET_CANT_CLOSE = 12
* DATASET_NO_PIPE = 13
* DATASET_READ_ERROR = 14
* DATASET_TOO_MANY_FILES = 15
* DATASET_WRITE_ERROR = 16
* EXPORT_DATASET_CANNOT_OPEN = 17
* EXPORT_DATASET_WRITE_ERROR = 18
* OPEN_DATASET_NO_AUTHORITY = 19
* OPEN_PIPE_NO_AUTHORITY = 20
* USER_DEFINED_DELIMITER_MISSING = 21
* DELIMITER_NOT_IDENTIFIED = 22
* INCONSISTENT_FIELD_CATALOG = 23
* OTHERS = 24
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc = 0.
MESSAGE s999(fr) WITH 'Downloaded succesfully'.
ENDIF.

ELSE.
CALL FUNCTION 'Z_UT_DOWNLOAD'
EXPORTING
i_path_file = v_server
* I_LOCAL_PC = 'X'
i_fileformat = 'TAB'
* I_DELIMITER =
* IT_FIELD_CATALOG =
TABLES
it_input = <dyn_table1>
* EXCEPTIONS
* FILE_OPEN_ERROR = 1
* FILE_WRITE_ERROR = 2
* INVALID_FILESIZE = 3
* INVALID_TYPE = 4
* NO_BATCH = 5
* UNKNOWN_ERROR = 6
* INVALID_TABLE_WIDTH = 7
* GUI_REFUSE_FILETRANSFER = 8
* CUSTOMER_ERROR = 9
* DATASET_NO_AUTHORITY = 10
* DATASET_CANT_OPEN = 11
* DATASET_CANT_CLOSE = 12
* DATASET_NO_PIPE = 13
* DATASET_READ_ERROR = 14
* DATASET_TOO_MANY_FILES = 15
* DATASET_WRITE_ERROR = 16
* EXPORT_DATASET_CANNOT_OPEN = 17
* EXPORT_DATASET_WRITE_ERROR = 18
* OPEN_DATASET_NO_AUTHORITY = 19
* OPEN_PIPE_NO_AUTHORITY = 20
* USER_DEFINED_DELIMITER_MISSING = 21
* DELIMITER_NOT_IDENTIFIED = 22
* INCONSISTENT_FIELD_CATALOG = 23
* OTHERS = 24
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

IF sy-subrc = 0.
MESSAGE s999(fr) WITH 'Downloaded succesfully'.
ENDIF.

ENDIF.

ENDFORM. " outputfile

*&--------------------------------------------------------------------*
*& Form dynamictable
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM dynamictable.
LOOP AT it_sum.
MOVE-CORRESPONDING it_sum TO it_protype.
APPEND it_protype.
MOVE-CORRESPONDING it_sum TO list_protype.
APPEND list_protype.
ENDLOOP.

DATA period(25) TYPE c.

READ TABLE s_erdat INDEX 1.
CONCATENATE s_erdat-low '~' s_erdat-high INTO period.


SORT list_protype BY extwg.
DELETE ADJACENT DUPLICATES FROM list_protype.

*************** sold to party, name **********
xfc-fieldname = 'kunnr'.
xfc-datatype = 'CHAR'.
xfc-intlen = '10'.
APPEND xfc TO ifc.
xfc-fieldname = 'name1'.
xfc-datatype = 'CHAR'.
xfc-intlen = '35'.
APPEND xfc TO ifc.
xfc-fieldname = 'period'.
xfc-datatype = 'CHAR'.
xfc-intlen = '25'.
APPEND xfc TO ifc.

LOOP AT list_protype.
MOVE list_protype TO show_protype.
APPEND show_protype.

REPLACE '/' WITH '' INTO list_protype-extwg.
REPLACE '-' WITH '' INTO list_protype-extwg.
CONDENSE list_protype-extwg NO-GAPS.

CONCATENATE list_protype-extwg 'RMB' INTO name.
xfc-fieldname = name.
xfc-datatype = 'CURR'.
xfc-intlen = 15.
xfc-decimals = 2.
APPEND xfc TO ifc.

CONCATENATE list_protype-extwg 'USD' INTO name.

xfc-fieldname = name.
xfc-datatype = 'CURR'.
xfc-intlen = 15.
xfc-decimals = 2.
APPEND xfc TO ifc.

CONCATENATE list_protype-extwg 'EURO' INTO name.
xfc-fieldname = name.
xfc-datatype = 'CURR'.
xfc-intlen = 15.
xfc-decimals = 2.
APPEND xfc TO ifc.

MODIFY list_protype.

ENDLOOP.

** total ****

xfc-fieldname = 'TotalRMB'.
xfc-datatype = 'CURR'.
xfc-intlen = 15.
xfc-decimals = 2.
APPEND xfc TO ifc.

xfc-fieldname = 'TotalUSD'.
xfc-datatype = 'CURR'.
xfc-intlen = 15.
xfc-decimals = 2.
APPEND xfc TO ifc.

xfc-fieldname = 'TotalEURO'.
xfc-datatype = 'CURR'.
xfc-intlen = 15.
xfc-decimals = 2.
APPEND xfc TO ifc.

** total ****

CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table.

ASSIGN dy_table->* TO <dyn_table>.

CREATE DATA dy_line LIKE LINE OF <dyn_table>.

ASSIGN dy_line->* TO <dyn_wa>.

SORT it_sum BY kunnr.


************ period time***********
DATA: sumrmb LIKE it_sum-netwr,
sumusd LIKE it_sum-netwr,
sumeuro LIKE it_sum-netwr,
isfirst.

LOOP AT it_sum.

AT NEW kunnr.
isfirst = ''.
AT FIRST.
isfirst = 'X'.
ENDAT.

IF isfirst <> 'X'.
APPEND <dyn_wa> TO <dyn_table>.
CLEAR: <dyn_wa>, sumrmb, sumusd, sumeuro.
ENDIF.
ENDAT.

ASSIGN COMPONENT 1 OF STRUCTURE <dyn_wa> TO <dyn_field>.
<dyn_field> = it_sum-kunnr.
ASSIGN COMPONENT 2 OF STRUCTURE <dyn_wa> TO <dyn_field>.
<dyn_field> = it_sum-name1.

ASSIGN COMPONENT 3 OF STRUCTURE <dyn_wa> TO <dyn_field>.
<dyn_field> = period.

REPLACE '/' WITH '' INTO it_sum-extwg.
REPLACE '-' WITH '' INTO it_sum-extwg.
CONDENSE it_sum-extwg NO-GAPS.

CONCATENATE it_sum-extwg it_sum-waerk INTO name.
ASSIGN COMPONENT name OF STRUCTURE <dyn_wa> TO <dyn_field>.
<dyn_field> = it_sum-netwr.

IF it_sum-waerk = 'RMB'.
sumrmb = sumrmb + it_sum-netwr.
ELSEIF it_sum-waerk = 'USD'.
sumusd = sumusd + it_sum-netwr.
ELSEIF it_sum-waerk = 'EURO'.
sumeuro = sumeuro + it_sum-netwr.
ENDIF.

ASSIGN COMPONENT 'TOTALRMB' OF STRUCTURE <dyn_wa> TO <dyn_field>.
<dyn_field> = sumrmb.
ASSIGN COMPONENT 'TOTALUSD' OF STRUCTURE <dyn_wa> TO <dyn_field>.
<dyn_field> = sumusd.
ASSIGN COMPONENT 'TOTALEURO' OF STRUCTURE <dyn_wa> TO <dyn_field>.
<dyn_field> = sumeuro.


AT LAST.
APPEND <dyn_wa> TO <dyn_table>.
CLEAR: <dyn_wa>, sumrmb, sumusd, sumeuro.
ENDAT.

ENDLOOP.

ENDFORM. "dynamictable

---------------------------------------------------------------------------------------------------------

*&---------------------------------------------------------------------*
*& Report ZDAVID_DYNAMIC_TABLE_2
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT zdavid_dynamic_table_2.

TYPE-POOLS : abap.
FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
<dyn_wa>,
<dyn_field>.

DATA: dy_table TYPE REF TO data,
dy_line TYPE REF TO data,
xfc TYPE lvc_s_fcat,
ifc TYPE lvc_t_fcat.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_table(30) TYPE c DEFAULT 'T001'.
SELECTION-SCREEN END OF BLOCK b1.

START-OF-SELECTION.

PERFORM get_structure.

PERFORM create_dynamic_itab.
**********Creates a dyanamic internal table**********
PERFORM get_data.

PERFORM write_out.

*&--------------------------------------------------------------------*
*& Form get_structure
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM get_structure.

DATA : idetails TYPE abap_compdescr_tab,
xdetails TYPE abap_compdescr.
DATA : ref_table_des TYPE REF TO cl_abap_structdescr.

* DATA : ref_table_des TYPE REF TO "cl_abap_structdescr
* CL_ABAP_TABLEDESCR.

* Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails[] = ref_table_des->components[].
LOOP AT idetails INTO xdetails.
CLEAR xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
APPEND xfc TO ifc.
ENDLOOP.

* TYPES: BEGIN OF typ_01,
* clo1,
* clo2,
* END OF typ_01.
*
* DATA: it_01 TYPE TABLE OF typ_01.
* DATA: wa_01 TYPE typ_01.
* wa_01 = '11'.
* APPEND wa_01 TO it_01.
* ref_table_des ?=
* cl_abap_typedescr=>describe_by_data( it_01 ).


ENDFORM. "get_structure
*&--------------------------------------------------------------------*
*& Form create_dynamic_itab
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM create_dynamic_itab.
* Create dynamic internal table and assign to FS
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = ifc
IMPORTING
ep_table = dy_table.
ASSIGN dy_table->* TO <dyn_table>.
* Create dynamic work area and assign to FS
CREATE DATA dy_line LIKE LINE OF <dyn_table>.
ASSIGN dy_line->* TO <dyn_wa>.
ENDFORM. "create_dynamic_itab

*&--------------------------------------------------------------------*
*& Form get_data
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM get_data.
* Select Data from table.
SELECT * INTO TABLE <dyn_table>
FROM (p_table).
ENDFORM. "get_data
"get_data
*&--------------------------------------------------------------------*
*& Form write_out
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM write_out.
* Write out data from table.
LOOP AT <dyn_table> INTO <dyn_wa>.
DO.
ASSIGN COMPONENT sy-index
OF STRUCTURE <dyn_wa> TO <dyn_field>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF sy-index = 1.
WRITE:/ <dyn_field>.
ELSE.
WRITE: <dyn_field>.
ENDIF.
ENDDO.
ENDLOOP.
ENDFORM. "write_out


(0) 评论    (91) 引用   

赋值语句的两种方式

我们赋值的时候可以 destination = source 比如 gc_d = gc_s 有时候可以看到等号前有个问好

gc_d ?= gc_s 这是因为gc_s不是一个静态类型,而是一个引用类型,而且gc_d的类型要比gc_s更加泛化一些。

更加详细内容,参见ABAP文档

Syntax
MOVE source {TO|?TO} destination.

destination {=|?=} source.


Effect
Both these statements assign the content of the operand source to the data object destination. The variants with the language element TO or the assignment operator = are valid for all assignments between operands that are not reference variables, and for assignments between reference variables for which the static type of source is more specific than or the same as the static type of destination(narrowing cast).

Variants with the language element ?TO or the assignment operator ?= (casting operator ) must be used if the source and destination are reference variables and the static type of source is more general than the static type of destination (widening cast). For assignments between operands that are not reference variables, use of the question mark ? is not permitted.

The data object destination can be any data object that can be listed at a write position, and the data object source can be a data object, a predefined function or a functional method (as of release 6.10). The data type of the data object destination must either be compatible with the data type of source, or it must be possible to convert the content of source into the data type of destination according to one of the conversion rules.


Notes
If source and/or destination are field symbols, then, as in all ABAP commands, the system works with the content of the data objects to which the field symbols point. The actual pointer content of a field symbol can only be changed using the statement ASSIGN or the addition ASSIGNING when processing internal tables (value semantics). If source and destination are reference variables, the reference contained in source is assigned to destination (reference semantics).

Strings and internal tables are addressed internally using references. When assignments are made between strings and between internal tables (as of release 6.10), only the reference is transferred, for performance reasons. After the assignment, the actual string or the actual table body of the source as well as the target object are addressed (sharing). When the object is accessed to change it, the sharing is canceled and a copy of the content is made. The sharing is displayed in the memory consumption display of the ABAP debugger and in the Memory Inspector tool (as of release 6.20).

Obsolete Form: MOVE PERCENTAGE


Exceptions
Catchable Exceptions

CX_SY_CONVERSION_NO_NUMBER

Cause: Operand cannot be interpreted as number
Runtime Error: CONVT_NO_NUMBER (catchable)

CX_SY_CONVERSION_OVERFLOW

Cause: Overflow with arithmetic operation (type P, with specified length)
Runtime Error: BCD_FIELD_OVERFLOW (catchable)

Cause: Operand too large or (intermediate) result too large
Runtime Error: CONVT_OVERFLOW (catchable)

CX_SY_MOVE_CAST_ERROR

Cause: Source or target variable are not reference variables
Runtime Error: MOVE_CAST_REF_ONLY

Non-Catchable Exceptions

Cause: Source field (type P) does not contain correct BCD format.
Runtime Error: BCD_BADDATA

Cause: Assignment for deep structures not permitted if these overlap.
Runtime Error: MOVE_COMPLEX_OVERLAP

Cause: Type conflict with the assignment between object references.
Runtime Error: MOVE_INTERFACE_NOT_SUPPORTED,
Runtime Error: MOVE_IREF_NOT_CONVERTIBLE,
Runtime Error: MOVE_IREF_TO_OREF,
Runtime Error: MOVE_OREF_NOT_CONVERTIBLE

Cause: Type conflict with the assignment between data references.
Runtime Error: MOVE_DREF_NOT_COMPATIBLE

Cause: Assignment between the types involved not supported.
Runtime Error: MOVE_NOT_SUPPORTED

Cause: Constants and literals must not be overwritten.
Runtime Error: MOVE_TO_LIT_NOTALLOWED

Cause: onstants and literals must not be overwritten.
Runtime Error: MOVE_TO_LIT_NOTALLOWED_NODATA

Cause: During a loop in an internal table, an attempt was made to overwrite a reference variable that is linked with the internal table by REFERENCE INTO.
Runtime Error: MOVE_TO_LOOP_REF


(0) 评论    (92) 引用   

SAP收货时自动创建采购订单

http://www.itpub.net/viewthread.php?tid=1072763

在实际业务中,常常出现到货物料没有订单或订单未批准的现象,按照SAP的标准流程,应该拒绝收货。但在实际业务中,这些物料可能是紧急采购的急件,如不及时处理,将会影响生产计划的安排。对于这种特殊情况,其实SAP有很灵活的处理方式,即由收货自动创建订单。需要说明的是,这种操作方式并不是SAP推荐的,不应在实际业务中大量采用。
  具体流程如下:
   1.移动类型101已在后台设置为自动创建定单。具体方法是:进入IMG后台,物料管理->总量控制->收货->自动创建采购订单,双击进入后,将101 GR收货的第三项“自动产生的采购订单”勾上。
  2.准备采用自动创建订单的工厂已指派给一个标准的采购组织。正常使用的SAP系统这项应该是已配置的,如未配置请到IMG后台,企业结构->分配->物料管理->给工厂分配标准采购组织。
   3.供应商主数据在采购组织下已设置成允许自动创建采购订单。例如,在事务XK03的“采购数据”视图的“控制数据”栏,将“自动产生的采购订单”勾上。
   4.要采用自动创建订单的工厂在后台货源清单的工厂层应激活。具体方法是,进入IMG后,物料管理->采购->货源清单->定义工厂层的货源清单需求,双击进入后,将需启用的工厂第三栏“货源清单”勾上。
   5.物料在工厂的货源清单已建立。经实际试验,其实只要能保证物料的货源清单被建立,第4项实际上可以省略。
   6.物料主数据中已设置为允许自动创建采购订单。例如,在事务MM02的“采购”视图,将“自动采购单”勾上。
   7.物料的相应信息记录已创建,价格条件正确。
  完成了以上设置,在MB01做101收货时,当未输入采购订单时,系统将为你自动创建采购订单。以上在SAP/R3 4.5B上测试通过。

(0) 评论    (8) 引用   

物料主数据之shelf life data

如果想在GR时进行shelf life检查先要在系统中进行配置

The shelf life expiration date of a material can only be checked if

  • the minimum remaining shelf life is maintained in the material master record
    The minimum remaining shelf life is the time the material must still be usable, so that the goods receipt is accepted by the system.
    You can define the time unit the system uses in the storage data of the material master record in the Period ind. field.
  • the shelf life expiration date check is active in the plant
  • the shelf life expiration date check is active for the movement type

配置路径为IMG->Materials Management->Inventory Management and Physical Inventory->Goods Receipt->Set Expiration Date Check

在对PO进行goods receipt的时候会有如下基本的几个check:

  • 是否是正确的物料
  • 是否是正确的数量,或者有没有交付多了
  • 易腐败食物是否在其保质期内

那么我们看这个质保期的check是如何实现的。
首先,要在后台配置哪些收货的过程与质保期check相关。


其次,质保期首先要在物料主数据的plant data/stor.1 view里进行维护。
这里面有两个字段比较重要:Min. Rem. Shelf Life和Total shelf life

SAP Help的解释如下

Minimum Remaining Shelf Life

Minimum amount of time for which the material must keep upon goods receipt for the goods receipt to be accepted by the system.

Total shelf life

Period for which the material will keep in total, that is, from the date of production to the shelf life expiration date.

Use

  • Value entered in the material master record
    The system assumes that the date entered upon goods receipt is the material's date of production. It then calculates a shelf life expiration date from the date of production plus the total shelf life.
  • No value entered in the material master record
    The system assumes that the date entered upon goods receipt is the material's shelf life expiration date.

In both cases, the system updates the shelf life expiration date in the batch master record and in the material document if the goods receipt is accepted.

我们用具体的实例看看这两个字段是如何影响收获的质保期CHECK的。

首先,只配置Min. Rem. Shelf Life。如果只配置了这个字段,则必须在GR FOR PO时输入过期时间。如果过期时间与入库时间的期间段少于配置的Min. Rem. Shelf Life,则系统会报错。

在此示例中,因为从入库到过期这段时间短于物料主数据中配置的Min. Rem. Shelf Life

下面我们在物料主数据中维护Total Shelf Life 设置为5天。

如果这个字段被维护了,则在GR时必须输入物料的生产日期,否则系统会报错。

那么从生产日期到收货日期,不能超过物料的total shelf life,否则系统会报错。这证明还没有收货,货物就过期了。

而如果自己此时手动在GR过程中输入了过期时间,这个时间如果与物料主数据维护的数据所计算的结果不同,系统会产生消息,提醒被改为系统计算的时间。至于会报E还是W型,取决于系统配置。


(0) 评论    (1) 引用   

vendor主数据之vendor subrange

Vendor Sub-Ranges(VSRs)在SAP中的解释为

A subdivision of the full range of products offered by a vendor (e.g. the Henkel company has the subranges "adhesives" and "washing powder").

Individual conditions apply for each individual subrange. If a vendor has subranges, each item offered by the vendor must be assigned to the appropriate subrange to enable the system to correctly determine the conditions for the subrange.

举个简单的例子,我创建了一个叫做DELL的供货商,会向其采购台式机和笔记本,但是台式机和笔记本这两种物料在采购过程中有很多不同,比如生产的工厂不同,比如付款的条件不同,等等,但是理论上这都属于DELL这个vendor,那么为了在采购中有所区别,可以为vendor主数据建立sub-range 每一个sub-range可以维护不同的purchasing和partner数据。

首先,我们新建一个account group,其中配置这个acct grp中的vendor是与sub-range相关的

之后配置这个account group所允许的partner role。此处配置与sub-range无关,但是是acct grp配置的必须步骤。以后会介绍partner决定相关的配置。

之后我们创建一个演示用的vendor,对其建立sub-range

之后在purchasing相关数据编辑中,有一个sub-range的按钮,点击以后可以创建sub-range

这里我们创建两个sub-range

之后点击alternative data会提示我们并没有数据被创建,我们选择Yes创建sub-range的数据

其中在popup中会有checkbox让我们选择,哪些数据需要被创建。这里我们把purchasing data和partner都创建。

我们对不同的sub-range设置不同的Order address

之后,假设有两个物料,分别属于此vendor的两个sub-range。则为他们创建Info. record时,可以指定sub-range。这样在创建PO的时候,就会自动带入,purchasing data以及partner等都会不同。这样sub-range便完成了对vendor的分隔。如果对order address方有confirm letter等发出,则系统会自动分辨。另外,condition价格配置方面,也可应用sub-range


(0) 评论    (6) 引用   

Creating SPRO Display only

Creating SPRO Display only.
You might be asked to give SPRO display while implementing your SAP. Igenerally give these authoriztion to make it display only. Please test it.

ObjectFieldValue
S_PROJECTPROJECT_ID*
S_PROJECTPROJ_CONF*
S_RFCACTVT03
S_RFCRFC_NAME*
S_RFCRFC_TYPE*
S_TABU_CLICLIIDMAINT'
S_TABU_DISACTVT03
S_TABU_DISDICBERCLS*
S_TRANSPRTTTYPEDeactivate or remove PIEC and TASK
S_CODEREMOVESPRO

(0) 评论    (55) 引用   

物料主数据之Configurable Materials

我们采购一个物料的时候,有可能这个物料有很多可变的参数。比如SAP为汽车制造业提供的解决方案就充分的利用了LO Variant Configuration 比如汽车的颜色。如果参数很多,为每一个可能都建立一个物料主数据是十分麻烦的,所以SAP提供了物料配置的功能。使得我们在采购和销售物料时,可以指定参数。

那么在SAP关于采购的help中提供了一个最简单的示例,就是配置公司采购的信封,信封有尺寸和是否具有logo等可配置属性。

具体操作步骤可以参考 http://help.sap.com/saphelp_47x200/helpdata/en/9f/fb79385feddf6ae10000009b38f8cf/content.htm

最终配置的效果如下


(0) 评论    (35) 引用   

物料主数据之Variable Units of Measure

在物料主数据的purchasing view中,有Variable Units of Measure这么一个字段。

SAP Help的解释是

Variable Units of Measure

In the material master record, you can specify that the material can be procured in a unit of measure that differs from the order unit.

If the material can be ordered in more than one unit of measure, enter

1

in the Variable order unit field.

让我们来做下实验。

如果此字段为空,采购单位为BAG,则在建立PO时,如果将单位改为PC,则系统会自动改回BAG并提示无法改为PC。

如果此字段设为1,建立PO时,将单位改为PC,则可以通过。


(0) 评论    (7) 引用   

配置consumable material采购时,G/L科目的自动确定

我们知道PO的采购有三种,第一种 stock material 第二种 consumble material 第三种 external service

那么stock material我们可以在新建物料主数据的时候,建立accouting view,然后在acct view 1中,指定valuation class来达到account determination的目的,这个我之前的BLOG也有简单的介绍。

可是在consumable material采购的时候,我们知道是可以不输入物料号,直接输入short text 然后输入account assignment category来直接进行采购,因为此种物料没有库存,直接POST到FI的会计科目中。那么比如我们acct assignment cat.选择K(cost center) 如何让G/L account自动带出来呢? 这个可以通过对material group的配置来达到

IMG - Material Management -> Purchasing -> Material Master -> Entry aids for items without a Material Master

通过这个路径,对不同的material grp配置不同的valuation class.这里我们对007 group分配了3200,其他的保持空白default值

之后就像stock material一样,我们配置valuation class 我们将用COST CENTER做测试,所以transaction选择GBB 其中general modification选择VBR 我们看到valuation class是空白的 G/L acct 400000以及3200的G/L Acct 417000

之后我们ME21N建立一个PO 采购消费物料,material group选择001,由于001没有设置valuation class 所以在控制中默认是空白,我们看到G/L Acct被正确设置了

我们再来测试一下007这个group,看到 G/L Acct也被正确设置了。整个配置就是这个过程


(0) 评论    (4) 引用   

SAP Note 496082 - FAQ: Account assignment in purch

This note provides answers to frequently asked questions concerning account assignment in purchasing documents.

List of questions

1. Why is the G/L account for a sales order with non-valuated customer sales order stock different from the account with valuated customer sales order stock?
2. Can I create several assets in the new purchasing transactions at the same time?
3. You create a purchase order with account assignment using Transaction ME22. You enter a material group, from which a G/L account is determined via the valuation class. If you go to a material group that does not determine a G/L account via the valuation class, the system deletes the previous G/L account and prompts you to enter a G/L account. If you cancel the account assignment screen and change back the material group on the item detail screen, the previously determined G/L account is not determined again. Why is that?
4. Is there an easy way of entering the same account assignments for different items in the new Enjoy transactions?
5. Why does the repeat account assignment function not work in the new Enjoy transactions when I create new account assignments in the multiple account assignment?
6. Why does the system generate message KI161 'Cost center does not exist on &' when I change the account assignment of an existing purchase order? The same thing happens for other account assignment objects (for example, profit center).
7. Can I create assets from within the single account assignment screen?
8. Why does the system not display an account assignment tab page even though I have entered an account assignment category?
9. Why does the system sometimes derive account assignment objects even though the corresponding field on the account assignment tab page is hidden??
10. You create a purchase order with reference to a subcontracting purchase requisition. This purchase requisition was created with an unknown account assignment, that is, account assignment category 'U'. When you change the account assignment category in the purchase order, the system issues error message ME453 'Changing consump. or spec.
11. Why can I not select a valuated goods receipt together with multiple account assignment in a purchase order/purchase requisition?
12. Funds Management is active. Why are the fields EBAN-FISTL, -GEBER, -KBLNR, -GRANT und -FKBER (as in table EKPO) empty?
13. You want to change a purchase order item with account assignment category 'A' which contains a locked asset. The system displays error message AA 334: 'You cannot post to this asset (Asset & & blocked for acquisitions)'.
14. What is the meaning of the indicator for the account assignment screen that I can set in Customizing for Single account assignment/Multiple account assignment?
15. Is there an unknown account assignment for standard purchase orders?
16. You change data in a purchase order item (for example, purchase order value, delivery date, and so on). The system does not check the account assignment again.
17. If you delete all entered account assignment lines in the account assignment screen, the system exits the account assignment tab title and goes to the material data. In addition, the system displays an error message telling you to enter account assignment data for the item in case of an account assignment.
18. Which account assignment categories should I enter in schedule line categories for third-party order processing (CS) and individual purchase order processing (CB)?
19. You subsequently change the material group in a limit purchase order or in a purchase requisition assigned to an account. Even though the new material group is assigned to another G/L account via the valuation class, the system does not redetermine the account assignment of the item. The old G/L account remains.
20. In Customizing, you can set the account assignment fields as mandatory, optional or display fields or as completely hidden fields, depending on the account assignment category. These settings also determine whether or not the system deletes the values of the account assignment fields when you change the account assignment category in a purchase order item.
21. You create a purchase order item assigned to an account with reference to a purchase requisition. You create a second schedule line for this purchase order item with reference to another purchase requisition. The system ignores the account assignment data of the purchase requisition for the second schedule line.
22. Why can I undelete an item in a purchase requisition if the corresponding account assignment data is no longer valid?
23. You create a purchasing document with reference to a reference document. What account assignment data is transferred?
--------------------------

1. Question:
Why is the G/L account for a sales order with non-valuated customer sales order stock different from the account with valuated customer sales order stock?

Answer:

Refer to Note 458270.
--------------------------

1. Question:
Can I create several assets in the new purchasing transactions at the same time?

Answer:

It is possible to create several assets at the same time. However, you must ensure that there are enough account assignment lines for the number of assets you want to create. You can insert additional lines using the copy function.
--------------------------

1. Question:
You create a purchase order with account assignment using Transaction ME22. You enter a material group, from which a G/L account is determined via the valuation class. If you go to a material group that does not determine a G/L account via the valuation class, the system deletes the previous G/L account and prompts you to enter a G/L account. If you cancel the account assignment screen and change back the material group on the item detail screen, the previously determined G/L account is not determined again. Why is that?

Answer:

Unfortunately, we cannot change this system behavior. First, enter any G/L account so that the item is valid. If you then go to the old material group again, the system determines the correct G/L account.
--------------------------

1. Question:
Is there an easy way of entering the same account assignments for different items in the new Enjoy transactions?

Answer:

Ensure that Note 315676 is implemented in your system and follow the procedure described there.
--------------------------

1. Question:
Why does the repeat account assignment function not work in the new Enjoy transactions when I create new account assignments in the multiple account assignment?

Solution:

Use the copy function in the multiple account assignment to create identical account assignment lines. With the repeat account assignment function you can create similar account assignments for different items with the same account assignment category. To do this, proceed as described in question 4.
--------------------------

1. Question:
Why does the system generate message KI161 'Cost center does not exist on &' when I change the account assignment of an existing purchase order?
The same thing happens for other account assignment objects (for example, profit center).

Solution:

Refer to Note 193371.
--------------------------

1. Question:
Can I create assets from within the single account assignment screen?

Solution:

Assets can only be created from the multiple account assignment screen ('Account assignment' tab page).
You can change between single account assignment and multiple account assignment in the 'Account assignment' tab page by clicking the icon in the upper left corner.
--------------------------

1. Question:
Why does the system not display an account assignment tab page even though I have entered an account assignment category?

Solution:

When you have implemented Note 520149, the system only displays the account assignment tab page when you have entered all required information, for example, the company code.
--------------------------

1. Question:
Why does the system sometimes derive account assignment objects even though the corresponding field on the account assignment tab page is hidden??

Solution:

Refer to Note 619203.
--------------------------

1. Question:
You create a purchase order with reference to a subcontracting purchase requisition. This purchase requisition was created with an unknown account assignment, that is, account assignment category 'U'. When you change the account assignment category in the purchase order, the system issues error message ME453 'Changing consump. or spec.

Solution:

Refer to Note 205597.
--------------------------

1. Question:
Why can I not select a valuated goods receipt together with multiple account assignment in a purchase order/purchase requisition?

Solution:

Refer to Note 204252.
--------------------------

1. Question:
Funds Management is active. Why are the fields EBAN-FISTL, -GEBER, -KBLNR, -GRANT und -FKBER (as in table EKPO) empty?

Solution:

The system only fills these fields if the account assignment category is set to 'blank'. If you maintain an account assignment category in the purchasing document, the system transfers the information in these fields to the EBKN table (as in EKKN).
--------------------------

1. Question:
You want to change a purchase order item with account assignment category 'A' which contains a locked asset. The system displays error message AA 334: 'You cannot post to this asset (Asset & & blocked for acquisitions)'.

Solution:

This is standard system design. To change this purchase order item, you have the following two options:

a) If you no longer require the purchase order item with the blocked asset, delete the purchase order item.
b) Otherwise, activate the asset, make the required changes to the purchase order item and then block the asset again.
--------------------------

1. Question:
What is the meaning of the indicator for the account assignment screen that I can set in Customizing for Single account assignment/Multiple account assignment?

Solution:

The indicator determines the account assignment screen that is generally used for maintaining the account assignment of a purchase order item.
For the EnjoySAP transactions, this value is a proposal that you can change in the purchasing document.
For the old transactions, this value is the only value you can use.
--------------------------

1. Question:
Is there an unknown account assignment for standard purchase orders?

Solution:

In general, this is not allowed, and the system displays message ME 069 'Unknown account assignment not assigned for user here'. Service items that you create with item category D (Service) or B (Limit) are an exception in this respect.
--------------------------

1. Question:
You change data in a purchase order item (for example, purchase order value, delivery date, and so on).
etc.). The system does not check the account assignment again.

Solution:

This is standard system design. If the system has already checked the account assignment without errors when you created the purchase order item, it only checks the account assignment again if you change a field that is relevant for the account assignment (for example, quantity, material number, and so on).
If this system response does not meet your requirements, implement the account assignment check in the ME_PROCESS_PO_CUST BAdI. The system calls the BAdI each time the purchase order is changed.
--------------------------

1. Question:
If you delete all entered account assignment lines in the account assignment screen, the system exits the account assignment tab title and goes to the material data. In addition, the system displays an error message telling you to enter account assignment data for the item in case of an account assignment.

Answer:

If you delete all account assignment lines, the system assumes that you do not want to maintain account assignment data.
This is in conflict with the account assignment category and the system issues error message 06436. You can remove the account assignment indicator.
Procedure:
If you want to delete all entered account assignment data, you can simply remove the account assignment category. The system then automatically deletes all account assignment data.
If you only want to change the account assignment data, make the changes in the corresponding account assignment lines and delete the lines you no longer require.
--------------------------

1. Question:
Which account assignment categories should I enter in schedule line categories for third-party order processing (CS) and individual purchase order processing (CB)?

Solution:

See Note 210997.
--------------------------

1. Question:
You subsequently change the material group in a limit purchase order or in a purchase requisition assigned to an account. Even though the new material group is assigned to another G/L account via the valuation class, the system does not determine the account assignment of the item again. The old G/L account remains.

Solution:

See Note 449216.
--------------------------

1. Question:
In Customizing, you can set the account assignment fields as mandatory, optional or display fields or as completely hidden fields, depending on the account assignment category. These settings also determine whether or not the system deletes the values of the account assignment fields when you change the account assignment category in a purchase order item.

Answer:

In MM Customizing, when you maintain the account assignment categories (IMG: Materials Management-> Purchasing -> Account Assignment-> Maintain Account Assignment Categories), you can control the different account assignment fields as follows:
Required entry: You must make an entry in the field, otherwise the system displays error message ME 083.

Optional entry: You may make an entry in the field.

Display: The field is displayed, but it is not ready for input.

Hidden: The field is hidden.

For example:
Account assignment category K, the cost center field is optional, the cost center field is filled with value 1000;
you change the account assignment category to P.
Depending on the field settings for the cost center with account assignment category P, the system response is as follows:
The cost center is a required entry or an optional entry field: The system transfers the value 1000 for the cost center

Displaying the cost center: first, the value 1000 is deleted for the cost center. If the system can determine a value again after you enter the changed account assignment category, this value is transferred.

The cost center field is hidden: The system deletes the value 1000 for the cost center.

--------------------------

1. Question:
You create a purchase order item assigned to an account with reference to a purchase requisition. You create a second schedule line for this purchase order item with reference to another purchase requisition. The system ignores the account assignment data of the purchase requisition for the second schedule line.

Solution:

This is standard system design. The system does not create a multiple account assignment in the purchase order item, even if the two referenced purchase requisitions are assigned to different CO objects.
Also refer to Note 47150 for the old transactions and to Notes 422609 and 771045 for the EnjoySAP transactions.
--------------------------

1. Question:
Why can I undelete an item in a purchase requisition, if
the corresponding account assignment data is no longer valid?

Solution:

When you undelete an item in a purchase requisition, the system does not run a new account assignment check. Therefore, the system does not check the account assignment data again.
Nevertheless, errors occur if you try to create a purchase order with reference to this purchase
requisition.
When you undelete an item in a purchase order, however, the system does run
another account assignment check.
--------------------------

1. Question:
You create a purchasing document with reference to a reference document. What account assignment data is transferred?

Solution:

The account assignment data is derived from the reference document.
If you delete the account assignment category and enter it again, a new automatic general ledger account determination occurs.


(0) 评论    (8) 引用   

[收藏]OBYC中的Transaction key详细解释以及用法

The following list shows the individual transactions with examples of how they are used:

  • Agency business: income (AG1)

This transaction can be used in agency business for income deriving from commission (e.g. del credere commission). The account key is used in the calculation schemas for agency business to determine the associated revenue accounts.

  • Agency business: turnover (AG2)

This transaction can be used in agency business if turnover (business volume) postings are activated in Customizing for the payment types. The account key is specified in Customizing for the billing type.

  • Agency business: expense (AG3)

This transaction can be used in agency business for commission expenses. The account key is used in the calculation schemas for agency business to determine the associated expense accounts.

  • Expense/revenue from consumption of consignment material (AKO)

This transaction is used in Inventory Management in the case of withdrawals from consignment stock or when consignment stock is transferred to own stock if the material is subject to standard price control and the consignment price differs from the standard price.

  • Expenditure/income from transfer posting (AUM)

This transaction is used for transfer postings from one material to another if the complete value of the issuing material cannot be posted to the value of the receiving material. This applies both to materials with standard price control and to materials with moving average price control. Price differences can arise for materials with moving average price if stock levels are negative and the stock value becomes unrealistic as a result of the posting. Transaction AUM can be used irrespective of whether the transfer posting involves a transfer between plants. The expenditure/income is added to the receiving material.

  • Provisions for subsequent (end-of-period rebate) settlement (BO1)

If you use the "subsequent settlement" function with regard to conditions (e.g. for period-end volume-based rebates), provisions for accrued income are set up when goods receipts are recorded against purchase orders if this is defined for the condition type.

  • Income from subsequent settlement (BO2)

The rebate income generated in the course of "subsequent settlement" (end-of-period rebate settlement) is posted via this transaction.

  • Income from subsequent settlement after actual settlement (BO3)

If a goods receipt occurs after settlement accounting has been effected for a rebate arrangement, no further provisions for accrued rebate income can be managed by the "subsequent settlement" facility. No postings should be made to the account normally used for such provisions. As an alternative, you can use this transaction to post provisions for accrued rebate income to a separate account in cases such as the one described.

  • Supplementary entry for stock (BSD)

This account is posted when closing entries are made for a cumulation run. This account is a supplementary account to the stock account; that is, the stock account is added to it to determine the stock value that was calculated via the cumulation. In the process, the various valuation areas (for example, commercial, tax), that are used in the balance sheet are taxed separately.

  • Change in stock (BSV)

Changes in stocks are posted in Inventory Management at the time goods receipts are recorded or subsequent adjustments made with regard to subcontract orders.

If the account assigned here is defined as a cost element, you must specify a preliminary account assignment for the account in the table of automatic account assignment specification (Customizing for Controlling) in order to be able to post goods receipts against subcontract orders. In the standard system, cost center SC-1 is defined for this purpose.

  • Stock posting (BSX)

This transaction is used for all postings to stock accounts. Such postings are effected, for example:

  • In inventory management in the case of goods receipts to own stock and goods issues from own stock
  • In invoice verification, if price differences occur in connection with incoming invoices for materials valuated at moving average price and there is adequate stock coverage
  • In order settlement, if the order is assigned to a material with moving average price and the actual costs at the time of settlement vary from the actual costs at the time of goods receipt

Because this transaction is dependent on the valuation class, it is possible to manage materials with different valuation classes in separate stock accounts.

Caution

Take care to ensure that:

  • A stock account is not used for any transaction other than BSX
  • Postings are not made to the account manually
  • The account is not changed in the productive system before all stock has been booked out of it

Otherwise differences would arise between the total stock value of the material master records and the balance on the stock account.

  • Revaluation of "other" consumptions (COC)

This transaction/event key is only relevant to Brazil. It is used if a revaluation report is used for company codes in Brazil.

The revaluation report uses the actual prices determined by the material ledger/actual costing t

  • Revaluate costs on the basis of actual prices
  • Post the price differences arising from "other" consumptions (e.g. consumption to cost center) to a collective account

This transaction/event key is needed to post the price differences. The account specified here is posted with the price differences for "other" consumptions.

  • Del credere (DEL)

Transaction/event key for the payment/invoice list documents in Purchasing. The account key is needed in the calculation schema for payment/settlement processing to determine the associated revenue accounts.

  • Small differences, Materials Management (DIF)

This transaction is used in Invoice Verification if you define a tolerance for minor differences and the balance of an invoice does not exceed the tolerance.

  • Purchase account(EIN), purchase offsetting account (EKG), freight purchase account (FRE)

These transactions are used only ifPurchase Account Managementis active in the company code.

Note

Due to special legal requirements, this function was developed specially for certain countries (Belgium, Spain, Portugal, France, Italy, and Finland).

Before you use this function, check whether you need to use it in your country.

  • Freight clearing (FR1), provision for freight charges (FR2), customs duty clearing (FR3), provision for customs duty (FR4)

These transactions are used to post delivery costs (incidental procurement costs) in the case of goods receipts against purchase orders and incoming invoices. Which transaction is used for which delivery costs depends on the condition types defined in the purchase order.

You can also enter your own transactions for delivery costs in condition types.

  • External service (FRL)

The transaction is used for goods and invoice receipts in connection with subcontract orders.

If the account assigned here is defined as a cost element, you must specify a preliminary account assignment for the account in the table of automatic account assignment specification (Customizing for Controlling) in order to be able to post goods receipts against subcontract orders. In the standard system, cost center SC-1 is defined for this purpose.

  • External service, delivery costs (FRN)

This transaction is used for delivery costs (incidental costs of procurement) in connection with subcontract orders.

If the account assigned here is defined as a cost element, you must specify a preliminary account assignment for the account in the table of automatic account assignment specification (Customizing for Controlling) in order to be able to post goods receipts against subcontract orders. In the standard system, cost center SC-1 is defined for this purpose.

  • Offsetting entry for stock posting (GBB)

Offsetting entries for stock postings are used in Inventory Management. They are dependent on the account grouping to which each movement type is assigned. The following account groupings are defined in the standard system:

  • AUA: for order settlement
  • AUF: for goods receipts for orders (without account assignment)
    and for order settlement if AUA is not maintained
  • AUI: Subsequent adjustment of actual price from cost center directly
    to material (with account assignment)
  • BSA: for initial entry of stock balances
  • INV: for expenditure/income from inventory differences
  • VAX: for goods issues for sales orders without
    account assignment object (the account is not a cost element)
  • VAY: for goods issues for sales orders with
    account assignment object (account is a cost element)
  • VB for consumption from stock of material provided to vendor
  • VBR: for internal goods issues (for example, for cost center)
  • VKA: for sales order account assignment
    (for example, for individual purchase order)
  • VKP: for project account assignment (for example, for individual PO)
  • VNG: for scrapping/destruction
  • VQP: for sample withdrawals without account assignment
  • VQY: for sample withdrawals with account assignment
  • ZOB: for goods receipts without purchase orders (mvt type 501)
  • ZOF: for goods receipts without production orders
    (mvt types 521 and 531)

You can also define your own account groupings. If you intend to post goods issues for cost centers (mvt type 201) and goods issues for orders (mvt type 261) to separate consumption accounts, you can assign the account grouping ZZZ to movement type 201 and account grouping YYY to movement type 261.

Caution

If you use goods receipts without a purchase order in your system (movement type 501), you have to check to which accounts the account groupings are assignedZOB

If you expect invoices for the goods receipts, and these invoices can only be posted in Accounting, you can enter a clearing account (similar to a GR/IR clearing account though without open item management), which is cleared in Accounting when you post the vendor invoice.

Note that the goods movement is valuated with the valuation price of the material if no external amount has been entered.

As no account assignment has been entered in the standard system, the assigned account is not defined as a cost element. If you assign a cost element, you have to enter an account assignment via the field selection or maintain an automatic account assignment for the cost element.

  • Purchase order with account assignment (KBS)

You cannot assign this transaction/event key to an account. It means that the account assignment is adopted from the purchase order and is used for the purpose of determining the posting keys for the goods receipt.

  • Exchange rate differences in the case of open items (KDM)

Exchange rate differences in the case of open items arise when an invoice relating to a purchase order is posted with a different exchange rate to that of the goods receipt and the material cannot be debited or credited due to standard price control or stock undercoverage/shortage.

  • Differences due to exchange rate rounding, Materials Management (KDR)

An exchange rate rounding difference can arise in the case of an invoice made out in a foreign currency. If a difference arises when the posting lines are translated into local currency (as a result of rounding), the system automatically generates a posting line for this rounding difference.

  • Exchange rate differences from lower levels (KDV)

In multi-level periodic settlement in the material ledger, some of the exchange rate differences that have been posted during the period in respect of the raw materials and semi-finished products used in the manufacture of a semi-finished or finished product are debited or credited to that semi-finished or finished product.

  • Consignment liabilities (KON)

Consignment liabilities arise in the case of withdrawals from consignment stock or from a pipeline or when consignment stock is transferred to own stock.

Depending on the settings for the posting rules for the transaction/event key KON, it is possible to work with or without account modification. If you work with account modification, the following modifications are available in the standard system:

  • None for consignment liabilities
  • PIP for pipeline liabilities
  • Offsetting entry for price differences in cost object hierarchies (KTR)

The contra entry for price difference postings (transaction PRK) arising through settlement via material account determination is carried out with transaction KTR.

  • Accruals and deferrals account (material ledger) (LKW)

If the process of material price determination in the material ledger is not accompanied by revaluation of closing stock, the price and exchange rate differences that should actually be applied to the stock value are contra-posted to accounts with the transaction/event key LKW.

If, on the other hand, price determination in the material ledger is accompanied by revaluation of the closing stock, the price and exchange rate differences are posted to the stock account (i.e. the stock is revalued).

  • Price differences (PRD)

Price differences arise for materials valuated at standard price in the case of all movements and invoices with a value that differs from the standard price. Examples: goods receipts against purchase orders (if the PO price differs from the standard pricedardpreis), goods issues in respect of which an external amount is entered, invoices (if the invoice price differs from the PO price and the standard price).

Price differences can also arise in the case of materials with moving average price if there is not enough stock to cover the invoiced quantity. In the case of goods movements in the negative range, the moving average price is not changed. Instead, any price differences arising are posted to a price difference account.

Depending on the settings for the posting rules for transaction/event key PRD, it is possible to work with or without account modification. If you use account modification, the following modifications are available in the standard system:

  • None for goods and invoice receipts against purchase orders
  • PRF for goods receipts against production orders and
    order settlement
  • PRA for goods issues and other movements
  • PRU for transfer postings (price differences in the case
    of external amounts)
  • Price differences in cost object hierarchies (PRK)

In cost object hierarchies, price differences occur both for the assigned materials with standard price and for the accounts of the cost object hierarchy. In the course of settlement for cost object hierarchies after settlement via material account determination, the price differences are posted via the transaction PRK.

  • Price differences, product cost collector (PRP)

During settlement accounting with regard to a product cost collector in repetitive manufacturing, price differences are posted with the transaction PRP in the case of the valuated sales order stock.

This transaction is currently used in the following instances only:

- Production cost collector in Release 4.0

- Product cost collector in IS Automotive Release 2.0 (product cost collector in connection with APO)

  • Offsetting entry: price differences, product cost collector (PRQ)

The offsetting (contra) entry to price difference postings (transaction PRP) in the course of settlement accounting with respect to a product cost collector in repetitive manufacturing in the case of the valuated sales order stock is carried out via transaction PRQ.

This transaction is currently used in the following instances only:

- Production cost collector in Release 4.0

- Product cost collector in IS Automotive Release 2.0 (product cost collector in connection with APO)

  • Price differences from lower levels (PRV)

In multi-level periodic settlement in the material ledger, some of the price differences posted during the period in respect of the raw materials and semi-finished products used in a semi-finished or finished product are debited or credited to that semi-finished or finished product.

  • Price differences for material ledger (PRY)

In the course of settlement in the material ledger, price differences from the material ledger are posted with the transaction PRY.

  • Expense and revenue from revaluation (retroactive pricing, RAP)

This transaction/event key is used in Invoice Verification within the framework of the revaluation of goods and services supplied for which settlement has already taken place. Any difference amounts determined are posted to the accounts assigned to the transaction/event key RAP (retroactive pricing) as expense or revenue.

At the time of the revaluation, the amounts determined or portions thereof) are posted neither to material stock accounts nor to price difference accounts. The full amount is always posted to the "Expense from Revaluation" or "Revenue from Revaluation" account. The offsetting (contra) entry is made to the relevant vendor account.

  • Invoice reductions in Logistics Invoice Verification (RKA)

This transaction/event key is used in Logistics Invoice Verification for the interim posting of price differences in the case of invoice reductions.

If a vendor invoice is reduced, two accounting documents are automatically created for the invoice document. With the first accounting document, the amount invoiced is posted in the vendor line. An additional line is generated on the invoice reduction account to partially offset this amount. With the second accounting document, the invoice reduction is posted in the form. of a credit memo from the vendor. The offsetting entry to the vendor line is the invoice reduction account. Hence the invoice reduction account is always balanced off by two accounting documents within one transaction.

  • Provision for delivery costs (RUE)

Provisions are created for accrued delivery costs if a condition type for provisions is entered in the purchase order. They must be cleared manually at the time of invoice verification.

  • Taxes in case of transfer posting GI/GR (TXO)

This transaction/event key is only relevant to Brazil (nota fiscal).

  • Revenue/expense from revaluation (UMB)

This transaction/event key is used both in Inventory Management and in Invoice Verification if the standard price of a material has been changed and a movement or an invoice is posted to the previous period (at the previous price).

  • Expenditure/income from revaluation (UMD)

This account is the offsetting account for the BSD account. It is posted during the closing entries for the cumulation run of the material ledger and has to be defined for the same valuation areas.

  • Unplanned delivery costs (UPF)

Unplanned delivery costs are delivery costs (incidental procurement costs) that were not planned in a purchase order (e.g. freight, customs duty). In the SAP posting transaction in Logistics Invoice Verification, instead of distributing these unplanned delivery costs among all invoice items as hitherto, you have the option of posting them to a special account. A separate tax code can be used for this account.

  • Input tax, Purchasing (VST)

Transaction/event key for tax account determination within the "subsequent settlement" facility for debit-side settlement types. The key is needed in the settlement schema for tax conditions.

  • Inflation posting (WGB)

Transaction key, which posts inflation postings to a different account within the handling of inflation for the period-end closing.

  • Goods issue, revaluation (inflation) (WGI)

This transaction/event key is used if already-posted goods issues have to be revaluated following the determination of a new market price within the framework of inflation handling.

  • Goods receipt, revaluation (inflation) (WGR)

This transaction/event key is used if already-effected transfer postings have to be revaluated following the determination of a new market price within the framework of inflation handling. This transaction is used for the receiving plant, whereas transaction WGI (goods receipt, revaluation (inflation)) is used for the plant at which the goods are issued.

  • GR/IR clearing (WRX)

Postings to the GR/IR clearing account occur in the case of goods and invoice receipts against purchase orders. For more on the GR/IR clearing account, refer to the SAP Library (documentationMM Material Valuation).

Caution

You must set theBalances in local currency onlyindicator for the GR/IR clearing account to enable the open items to be cleared. For more on this topic, see the field documentation.

  • GR/IR clearing for material ledger (WRY)

This transaction/event key is not used from Release 4.0 onwards.

Prior to 4.0, it was used for postings to the GR/IR clearing account if the material ledger was active. As of Release 4.0, the transaction is no longer necessary, since postings to the GR/IR account in parallel currencies are possible.

Customers who used the transaction WRY prior to Release 4.0 must make a transfer posting from the WRY account to the WRX account in order to ensure that the final balance on the WRY account is zero.


(0) 评论    (17) 引用   

[收藏]SAP系統BUG - info recorde的價格與Condition的不統一

http://ssgang.itpub.net/post/10314/397943

Info Record中價格欄位: EINE-NETPR與Condition的欄位:KONP-KBETR有時會出現不統一的現象, 特別是在批量上傳Info Record時, 系統沒有同時更新兩個欄位, 造成不匹配. 系統有提供一個修正此BUG的程式: RM06INP0


處理建議:

1.Old Price和New Price均顯示"Not found"的 =>不要處理.

2.Old Price有,New Pirce "not found"的 =>無最新Infor.Record,給相關采購處理

3.Old Price和new price均有,且不一至的 =>去掉"Test Run",讓程式來更新價格.

最好給足條件,一個一個跑,且及時到內表中查看結果.不要一大批地跑,一旦發現錯誤,可以及時回復


祥見SAP Notes:

Symptom

After the change of the info record currency, the conversion factors between the order unit and the purchase order price unit are no longer correct on the purchasing view.The conversion factors between the base unit of measure and the order unit on the general view are, however, possibly correct.

However it is also possible that there are incorrect values in database table EINE.

A similar behavior can also occur for contracts.

Other terms

MEKPE, MEKP, EURO, WEWU, BME, BPRME, EINE, EINA, EINA-MEINS, EINA-LMEIN, KONP, KUMZA, KUMNE, LMEIN, MEKL, MEKLE, scheduling agreement, outline agreement, MEKRE, MEKR, EINE-NETPR

Solution

Implement the program correction.

Note:

Bear in mind that this note only has a preventive effect and cannot correct already existing data inconsistencies.

Proposed solution:

To eliminate possible data inconsistencies, we recommend that you carry out the currency conversion again.

Alternative:

Provided that, in the conditions of the affected purchasing documents, the conversion factors between the order unit and the purchase order price unit and also the prices in the conditions are correct, it is possible to carry out a correction using the following reports:

For info records: RM06INP0; also refer to Note 392988

For contracts: RM06ENP0

The 'No date check' indicator should be set for both reports.

After using the reports, it is not necessary to carry out a further currency conversion


(0) 评论    (10) 引用   

查询不同business transaction(BKPF-GLVOR)的意义

Business Transaction

The data from the different SAP application areas is subdivided into transactions according to business views.

If an application calls up direct posting in accounting, data is transferred with an appropriate transaction. Depending on the transaction, you can process this transferred data in different ways (for example, with ledger selection, field movement).

也就是说,通过不同的module或者途径post到SAP-FI的document,通过此字段来区分。比如通过SD模块的billing,则此字段为SD00

那么我们如何知道各种各样的business transaction是什么意思呢?

可以通过T022T这个表查询到不同语言的解释。暂时我还不知道更好的办法。


(0) 评论    (0) 引用   

[收藏]SAP系統BUG - info recorde的價格與Condition的不統一

http://ssgang.itpub.net/post/10314/397943

Info Record中價格欄位: EINE-NETPR與Condition的欄位:KONP-KBETR有時會出現不統一的現象, 特別是在批量上傳Info Record時, 系統沒有同時更新兩個欄位, 造成不匹配. 系統有提供一個修正此BUG的程式: RM06INP0


處理建議:

1.Old Price和New Price均顯示"Not found"的 =>不要處理.

2.Old Price有,New Pirce "not found"的 =>無最新Infor.Record,給相關采購處理

3.Old Price和new price均有,且不一至的 =>去掉"Test Run",讓程式來更新價格.

最好給足條件,一個一個跑,且及時到內表中查看結果.不要一大批地跑,一旦發現錯誤,可以及時回復


祥見SAP Notes:

Symptom

After the change of the info record currency, the conversion factors between the order unit and the purchase order price unit are no longer correct on the purchasing view.The conversion factors between the base unit of measure and the order unit on the general view are, however, possibly correct.

However it is also possible that there are incorrect values in database table EINE.

A similar behavior can also occur for contracts.

Other terms

MEKPE, MEKP, EURO, WEWU, BME, BPRME, EINE, EINA, EINA-MEINS, EINA-LMEIN, KONP, KUMZA, KUMNE, LMEIN, MEKL, MEKLE, scheduling agreement, outline agreement, MEKRE, MEKR, EINE-NETPR

Solution

Implement the program correction.

Note:

Bear in mind that this note only has a preventive effect and cannot correct already existing data inconsistencies.

Proposed solution:

To eliminate possible data inconsistencies, we recommend that you carry out the currency conversion again.

Alternative:

Provided that, in the conditions of the affected purchasing documents, the conversion factors between the order unit and the purchase order price unit and also the prices in the conditions are correct, it is possible to carry out a correction using the following reports:

For info records: RM06INP0; also refer to Note 392988

For contracts: RM06ENP0

The 'No date check' indicator should be set for both reports.

After using the reports, it is not necessary to carry out a further currency conversion


(0) 评论    (6) 引用   

一个sold-to-party,多个ship-to-party的问题

虽然这个被大家称为是经典问题,但是依然有很多人在问,所以还是简单的演示一下好,其实就是几个图片而已。

SAP不但提供了header的partner功能,item也有的 所以只需要在item的partner功能里,给不同的item设置不同的ship-to-party就好了。至于partner determination的配置,计划近期写一篇简单讲解一下。


(0) 评论    (0) 引用   

material master物料主数据field selection的配置

在使用物料主数据相关TCODE进入相关屏幕时(以MM01为例),我们会发现在不同的项目里,有些屏幕字段是必输项,有些不是,有些干脆被隐藏。这个是通过一个叫做field selection的进行配置来起作用的。

field selection与transaction code(MM01 MM02 MM03屏幕字段表现各不相同) material type; procurement type;industry section;plant;SAP delivery相关。

Field selection在后台的相关配置路径如图所示

所有的field不是单独被控制的,而是被组成了group,对整个group进行必输 可输 隐藏等设定

首先我们运行Assign Fields to Field Selection Groups 可以看到MARA-MEINS在group 1里面

点击后面绿色的按钮,可以进入到相应的GROUP的设定。走菜单的Maintain Field Selection for Data Screens也可以进入的配置屏幕。

我们进入到material type的配置屏幕,可以看到ROH原材料的field reference配置的是ROH

那么我们回到field selection group的配置画面,找到field ref.为ROH的一行,将其改为隐藏,看看是否可以有效果

我们看到,这个basic unit字段被隐藏了

其他关于Industry Sector的配置可以简单的看一下配置画面,也十分简单。

其他,关于procurement type是内制还是外购,是固定的,field ref是E和F

关于TCODE呢,可以在field ref. MM01 MM02等找到相应的配置。

而和plant有关的配置,只在有Plant有关的view里才会工作


(0) 评论    (6) 引用   

关于material master物料主数据的valuation class

在物料主数据的会计1视图中,有一个重要的屏幕字段valuation class 这个选项将会决定此物料的财务记账的科目。

那么这是如何起作用,如何配置的呢?为什么search help会自动带出几个相关的valuation class?

这其中有一个起到桥梁作用的,叫做account category reference

也就是说,一个物料类型,会配置一个account category reference,而一个account category referenceH会对应多个valuation class。那么定义一个物料,相关的物料类型就决定了可以选择的valuation class了。

下面我们看一下实际操作

在后台的配置路径如下

第一个Define Valuation Control 会让我们选择是否激活valuation group code 因为SAP的配置十分灵活,我们可能很多工厂的记账方式和科目都是一样的,这样避免重复配置,可以将他们group在一起,然后将这个group进行配置。我们还是重点讲解valuation class

执行Define Valuation Classes

我们可以看到三个push button 那么第一个就是可以定义account category ref.

第二个定义valuation class 并assign一个act category ref.

第三个将每个物料类型assign一个act category ref. 这样便形成了最开始我们讲解的那个结构

当然,从物料类型的配置画面,也可以指定

之后我们来运行Configure Automatic Postings 进行自动记账的配置

进入这个画面以后,我们看到有三个按钮

acct assignment就是我们要进行G/L ledger与valuation class进行关联配置的功能

而simulation是个十分重要和好用的功能,它可以让我们模拟某个物料在某个工厂下,进行各种业务操作时,各种自动记账账户的一个概览

而最后一个按钮可以让我们看到,某个公司代码下的某个value area下,有哪些G/L科目在被使用

我们首先看第一个功能,我们要讲解的功能

可以看到SAP将各种业务操作进行了分类,我们随便选取一个没有被配置过的BSD

进入后,系统会首先提示我们配置rule 也就是科目决定过程的一个规则

因为我们要根据valuation class进行不同科目的POST 所以将最后一个checkbox勾选

再点击accounts就可以看到 有一个两列的table 第一列便是valuation class 后面是相对应的账户

我们还可以在rules里面勾选debit/credit选项,则同一个valuation class,可以设置在作为借方和贷方是不同的账户

最后我们show一下前面提过的simulation功能 可以看到,一个物料的自动记账账户,一目了然


(0) 评论    (42) 引用   

采购组织的典型配置形式

Plant-Specific Purchasing Organization
每一个采购组织只为一个工厂采购,将采购组织分配给固定工厂

Cross-Plant Purchasing Organization
采购组织为多个工厂采购,可能多个工厂出产相同的产品,需要一样的原材料等。将采购组织分配给company code即可,此company下的所有工厂都可以由此采购组织负责

Cross-Company Code Purchasing Organization
采购组织可以为多个公司的不同工厂采购,配置的关键是,不要将采购组织分配company code,在新建PO的时候,系统会提示,将要为哪个company code采购


(0) 评论    (3) 引用   

SD面试问题及解答

I BASIS KNOWLEDGE AND SYSTEM NAVIGATION
1. Name two ways to start a transaction.
i. Dynamic Menu
ii. Command Field

2. Why do you create user-specific parameters?
i. They supply defaults to R/3 fields.
If a field is indicated, the system automatically fills in default value. Depending on the field definition, the entry can also be replaced with a value entered by the user. (Concept of PARAMETER ID)

3. Name the three different kinds of messages in the R/3 system. What is the difference between them?
i. A message can have five different types. These message types have the following effects during list processing:
ii. A (=Abend):
a. The system displays a message
of this message type in a dialog window. After the user confirms the message using ENTER, the system terminates the entire transaction (for example SE38).
iii. E (=Error) or W (=Warning):
a. The system displays a message of this message
type in the status line. After the user chooses ENTER, the system acts as follows:
b. While creating the basic list, the system terminates the report.
c. While creating a secondary list, the system terminates the corresponding processing block and keeps displaying the previous list level.
iv. I (=Information):
a. The system displays a message of this message type in a dialog window. After the user chooses ENTER , the system resumes processing at the current program position.
v. S (=Success):
a. The system displays a message of this message type on the output screen in the status line of the currently created list.

4. What is a data dictionary or repository?
i. Central catalog that contains
the descriptions of an organization's data and provides information about the relationships between the data and its use in programs and screens.
ii. The data descriptions in a Data Dictionary is also called metadata, i.e., data that describes
other data.
iii. The ABAP/4 Dictionary stores system-wide data definitions. When you create a new data definition, the Dictionary tool does all the processing necessary to create the definition. You can use the Dictionary tool to look up the "definition" of objects in your R/3 System.

5. What is a matchcode?
i. Comparsion key. A matchcode allows
you to locate the key of a particular database record (e.g. account number) by entering any field value contained in the record. The system then displays a list of records matching the specifications.

6. If you want an end user to see a
specific menu after logging on the R/3 system, how could you do that?
i. User maintenance transactions allow the system administrator to create and maintain user master records. This includes the generation and assignment of authorizations and authorization profiles.

II CORPORATE STRUCTURE
8. In R/3 you can represent a company's
structure by defining and assigning corporate structure elements. What is the purpose of doing that?
i. Enterprise organization diagram. Chart showing the organizational structure of an enterprise, its organization units and how they are related. A combined structure can be created from the point of view of accounting, MM, SD. This structure forms a framework in which all business transactions can be processed.

9. Which three organizational elements make up a sales area and briefly explain their function?
i. Sales organization: An organizational unit that sells and distributes products, negotiates terms of sale, and is responsible for these transactions.
ii. Distribution channel: Channel through which salable materials or services reach customers. Typical distribution channels include wholesale, retail and direct sales. You can assign a distribution channel to one or more sales organizations.
iii. Division: Product groups can be defined for a wide-ranging spectrum of products. For every division you can make customer-specific agreements on, for example, partial deliveries, pricing and terms of payment. Within a division you can carry out statistical analyses or set up separate
marketing.

10. Name the three internal organizational elements within a sales organization and briefly explain their function.
i. Sales Office. Geographical aspects of the organization in business development and sales are defined using the term sales office. A sales office can be considered as a subsidiary.
ii. Sales offices are assigned to sales areas. If you enter a sales order for a sales office within a certain sales area, the sales office must be assigned to that area.
iii. Sales Group. The staff of a sales office may be subdivided into sales groups. For example, sales groups can be defined for individual divisions.
iv. Salespersons. Individual personnel master records are used to manage data about salespersons. You can assign a sales person to a sales group in the personnel master record.

11. What does the term "business area" refer to and how can it be used?
i. Business Area. The system posts costs and revenue according to the business area. The business area can be equivalent to the:
ii. sales area (if the accounts are to be posted according to sales)
iii. plant/division (if the accounts are to be posted according to products)
iv. The business area is defined in Customizing for Sales.
- Business area. A unit in an enterprise, grouping product and market
combinations as homogeneously as possible for the purpose of developing unified business policy.
- Financial Accounting (FI). A business area is an organizational unit within financial accounting which represents a separate area of operations or responsibilities within an organization. Financial accounting transactions can be allocated to a specific business area.

12. Briefly explain the relationship between sales organizations and company codes.
i. Many to One.

13. What is the central organizational element in purchasing?
i. Purchasing Organization.

14. Explain the relationship between sales organizations and plants.
i. Many to Many.

15. Explain the relationship between sales organizations, plants and company codes.
i. Many to Many to One.

16. Can one business area be assigned to several company codes? Which (sub) module of SAP could make business areas obsolete?
i. Yes in CO .

17. What is a credit control area? What relationship exists between credit control areas and company codes?
i. Credit control area. Organizational unit in an organization that specifies and checks credit limits for customers. A credit control area can include one or more company codes. It is not possible to assign a company code to more than one credit control areas.

18. Which organizational element is central in shipping? Give a definition of it.
i. Shipping Point: Organizational unit at a fixed location that carries out shipping activities. A shipping point could, for example, be a company's mail department or a plant's rail depot. Each delivery is processed by only one shipping point.

19. Give a definition of plant (in SAP).
i. Organizational unit within Logistics, serving to subdivide an enterprise according to production,
procurement, maintenance, and materials planning aspects.
ii. A plant is a place where either materials are produced or goods and services provided.
iii. Classification: Business object
iv. Structure: A plant can assume a variety of roles:
v. As a maintenance plant, it includes the maintenance objects that are spatially located within this plant. The maintenance tasks that are to be performed are specified within a maintenance planning plant.
vi. As a retail or wholesale site, it makes merchandise available for distribution and sale.
vii. As a rule, the plant is the organizational unit for material valuation.
viii. The preferred shipping point for a plant is defined as the default shipping point, which depends on the shipping condition and the loading condition.
iii. For the placement of materials in storage (stock put-away), a storage location is assigned to a plant. The storage location depends on the storage condition and the stock placement situation.
iv. The business area that is responsible for a valuation area is determined as a function of the division. As a rule, a valuation area corresponds to a plant.

4. Can you assign two different sales organization to the same company code?
i. Yes.

5. To what do you assign distribution channels and divisions?
i. Sales Organizations.

6. What are the highest organizational units in SD, MM.PP,FI,CO?
i. SD: Sales Organizations.
ii. M: Plant
iii. PP: Plant
iv. FI: Company Code
v. CO: Controlling Area

7. Can you further subdivide a plant? If yes into what ?
i. A plant can be subdivided into storage locations, allowing stocks of materials to be broken down according to predefined criteria (e.g., location and materials planning aspects).
ii. A plant can be subdivided into locations and operational areas. Subdivision into locations
takes geographical criteria into account, whereas subdivision into operational areas reflects responsibilities for production.

8. Can a sales organization sell from a plant belonging to a different company code?
i. Yes.

9. How many shipping points can you assign to a plant?
i. Many.

10. How many shipping points can you assign to a sales organization?
i. None.

11. If you have a warehouse management system active, to what would you assign
the warehouse number?
i. Plant & Storage Location.

III MASTER DATA
13. Why does the customer master have different views?
i. In addition to the sales and distribution data, the accounting data is also important for a payer. Therefore one can create a customer master record centrally for the following partner functions:
ii. For the payer
a. For the sold-to party who, in addition to the other partner functions, also takes on the function of the payer.

14. Which different partner functions can a customer master record serve?
i. Customer:
- sold-to party
- ship-to party
- payer
- bill-to party
- One-time customer including all partner functions.

15. What is the structure of data in the customer master record?
i. Different data is maintained
in each of the three areas:
ii. General data, like address and telephone number, etc., is maintained for every customer. This data is only identified by the customer number, not by company code or sales area. Maintaining the data is possible from both the accounting view and the sales and distribution view.
iii. Company code data is only of interest for the accounting department. It includes, for example, information on insurance or account management. This data applies to only one company code.
iv. Sales and distribution data is only of interest for the sales and distribution department. It includes, for example, data on pricing or shipping. This data only applies to one sales area, and therefore is dependent on the sales structure (sales organization, distribution channel, division).

16. Would you have different customer numbers if your customer was serviced by more than one company code?
i. No.

17. Would you have different customer numbers if your customer was serviced by more than one sales organization?
i. No.

18. A material is produced in plant Boston, plant Dallas and in plant Chicago. How many different material master number do you need?
i. Only one.

19. Is it possible to have different data for the same customer for different sales areas?
i. Yes.

20. Give examples of general data in the customer master record ?
i. Address, Control data, Marketing, Payment transactions, Contact person, Unloading points.

21. Give examples of general data in the material master record ?
i. This level contains the data applicable to all individual group companies, all plants, and all warehouses/stores belonging to an enterprise (corporate group). Examples of general data are details on a material's design (CAD drawings, for instance) and storage conditions (temperature range, whether the material is explosive or perishable, and so on).

22. Give examples of company -code-specific data in the customer master record?
i. This data is only of importance to the accounting department. It includes, for example, data on insurance and account management. Company code data only applies to one company code. If you edit the customer master record you must specify customer number and company code in order to
access the screens containing company code data.

23. Which plant-specific data do you find in the material master record?
i. This level contains the data for each branch or plant location within a certain company. The data important to Purchasing is stored at this level. Examples of this data are the maximum and minimum order quantities of a material and the reorder level. You access the plant data by entering the plant key.

24. If a customer wishes to receive goods on Tuesdays only, how could you ensure that in the SAP R/3 system?
i. This can be done by specifying goods receiving hours - Time schedule of ship-to party which specifies the days and times that goods can be delivered.

25. Do you find any sales prices in the material master record?
i. Yes.

26. Name at least five different partner functions.
i. Examples of partner functions in Sales and Distribution:
ii. sold-to party, ship-to party, bill-to party, payer.
iii. Examples of partner functions (roles) in Materials Management:
iv. ordering address, supplier of goods, invoicing party, different payee.

27. Which are the two partner functions in SD that have to be maintained in FI too ?
i. sold-to party, payer.

28. Can you assign a material to more than one division?
i. No.

29. If you want to create language specific sales texts for your material master, would you have to create a new material master record?
i. No.

30. What is a material type and which material types do you know?
i. Raw materials, semi-finished products, finished products, trading goods, operating supplies.

31. Name the four standard industry sectors in SAP for the material master. For what do you use them?
i. Branch of industry.
ii. The industry sector groups together companies according to their activities (for example, plant engineering and construction, mechanical engineering, the chemical industry, and the pharmaceutical industry).
iii. Table-driven program support is provided via the industry sector: for example, for the selection of data fields on-screen, for the sequence of the screens, and for the allocation of a material to a material type.

32. For what or why do you use the classification system in sales? Give examples of objects you can classify in R/3.
i. For e.g., Variant Pricing of configurable products. Objects can be customers, products, condition types.

33. Does storage-location specific data in the material master record apply for each plant?
i. This level contains the data specific to a storage location. Stock levels are an example of the data
maintained for each storage location. You access the storage location data by entering the plant and storage location codes.
ii. This data structure facilitates the organization of material-related information within the entire
enterprise. It prevents redundant storage of material data when the same material is used in more than one plant or stored at more than one storage location.
iii. Example: Suppose the same metal casting is stored at two different locations. The design and purchasing data for this material would be identical. However, the data on the stock levels at each location would differ.

34. Name at least four views of the material master record.
i. Accounting : Valuation and costing information. Examples: standard price, past and future price, and current valuation.
ii. Materials planning and control: Information for material requirements planning (MRP) and consumption-based planning/inventory control. Examples: safety stock level, planned delivery time, and reorder level for a material.
iii. Purchasing: Data provided by Purchasing for a material. Examples: purchasing group responsible for a material, over- and underdelivery tolerances, and the order unit.
iv. Engineering: Engineering and design data on a material. Examples: CAD drawings, basic dimensions, and design specifications.
v. Storage: Information relating to the storage/warehousing of a material. Examples: unit of
issue, storage conditions, and packaging dimensions.
vi. Forecasting: Information for predicting material requirements. Examples: how the material is procured, forecasting period, and past consumption/usage.
vii. Sales and distribution: Information for sales orders and pricing. Examples: sales price, minimum order quantity, and the name of the sales department responsible for a certain material.

35. What are the possible units of measure for a material?
i. A material can be stored, transported and sold in various units of measure. In the SAP R/3 System, you can therefore define various units of measure which are maintained in the sales and distribution screens. However, you only need to maintain the fields of the units of measure if they deviate from the base unit of measure. If no other fields with units of measure are maintained, the system automatically takes the base unit of measure as a basis for its calculations. You can enter the following units of measure in the sales and distribution screens:
ii. Base unit of measure : Stocks of a material are managed in the base unit of measure. All quantity movements in other units of measure are converted automatically by the system into the base unit of measure.
iii. Alternative unit of measure: If a product is managed in the base unit of measure "Piece" but is sold in the sales unit "Box", you must define the conversion factor. The alternative unit of measure
can define, for example, that 1 box of this material contains 12 pieces.
iv. Sales unit : The unit of measure in which materials are sold is referred to as a sales unit (for example, piece or bottle). The value you define in the material master record is proposed during business transactions relevant for sales, such as the sales order. You can replace them with other
alternative units of measure in the sales order.
v. Delivery Unit : The delivery unit refers to the unit in which materials can be delivered. Only exact multiples of the delivery unit can be delivered. For example, with a delivery unit of 30 bottles, 30, 60 or 90 bottles can be delivered, but not 100 bottles.
vi. Quantity Specifications: Two different quantity specifications are used:
vii. Minimum order quantity: The minimum order quantity refers to the minimum quantity the customer must order. A warning message appears if the minimum order quantity is not reached during order entry. The order can be entered in spite of the warning message.
viii. Minimum delivery quantity : The minimum delivery quantity refers to the minimum quantity you must deliver to the customer. The minimum delivery quantity is automatically checked during delivery processing. A warning message appears during delivery processing if you enter a delivery quantity lower than the minimum delivery quantity. The delivery can be created in spite of this warning message.

36. What is a Bill of material?
i. A bill of material is a complete, formally structured list of the components that make up a product or assembly. The list contains the object number of each component, together with the quantity and unit of measure. The components are known as BOM items. A bill of material can only refer to a quantity of at least 1 of an object.

37. Is the BOM used in the PP module only?
i. No. Also used in SD.

38. Explain what a routing is?
i. Routing contains the operations required in production, and the production resources/tools, material components, and test equipment required to produce the product.

39. What is a work center?
i. A work center is an organizational unit where a work step is carried out, producing an output. The work center defines where and by whom an operation is to be carried out. A cost center is assigned to each work center in the work center master record. The work center has a particular
available capacity. The activities performed at or by the work center are valuated by charge rates, which are determined by cost centers and activity types. Work centers can be: Machines, People, Production lines, Groups of craftsmen .
ii. IN Personnel Planning and Development (PD) work centers are the physical locations where tasks are carried out. A work center can represent anything as general as a geographic location, for example, the New York branch office. Or work centers can be very precisely defined. For example, a work center could represent a specific workstation, with specific tools and equipment, on a specific floor, of a specific building.
iii. IN Workflow Management a work center is a particular place which has been set up specifically so that employees can perform their duties within the corporate work system using working materials.

40. What does the account group of the customer /vendor control?
i. A collection of properties of accounts which determine the creation of master records.
ii. The account group determines the data that is relevant for the master record and a number range from which numbers are selected for the master records.
iii. Each master record must be assigned to an account group.
iv. Changes to the account group and the accompanying partner functions can only be made from a lower level to a higher level. For example, this means that a sold-to party cannot be assigned the function of a payer as fields which have already been maintained for this sold-to party would have to be masked. However, you can assign the sold-to party function to a payer.
v. The account group ensures that for the different partner functions of a customer only the necessary screens and fields are displayed for input.

41. What are the two possible ways of control for the cost of a material in the material master record?
i. Standard Price, Moving Average Price.

42. What is a valuation class?
i. Allocation of a material to a group of G/L accounts.
ii. Along with other factors, the valuation class determines the G/L accounts to be updated as a result of a valuation-relevant transaction (for example, a goods movement).
iii. Which valuation classes are valid depends on the material type. Several valuation classes can
be valid for one material type. A valuation class can be valid for several material types.

43. A customer master
record in SD is also an A/R(accounts receivables)in FI. When you create a customer master record you also have to specify the reconciliation account. For what is the reconciliation account used?
i. Account in G/L accounting, to which automatic entries are posted during a business activity. It is generally the case that several subledger accounts post to a common reconciliation account. This ensures that the developments in the subledger accounts are accurately reflected in the general
ledger (i.e. in line with balance sheet conventions). You can set up a reconciliation account for, say, all overseas customers.

IV INRTRODUCTION TO ORDER MANAGEMENT & SALES
45. Briefly describe the types and structure of the sales document and give examples of data that you find on the different levels.
i. Sales-related business transactions are recorded in the system as sales documents. There are, broadly speaking, four different groupings of sales documents:
ii. Sales queries, such as inquiries and quotations
iii. Sales orders
iv. Outline agreements, such as contracts and scheduling agreements
v. Customer problems and complaints, such as free of charge deliveries
and credit memo requests.
vi. Header Data
vii. The general data that is valid for the entire document is recorded in the document header. This data includes the:
viii. number of the sold-to party
ix. number of the ship-to party and the payer
x. document currency and exchange rate
xi. pricing elements for the entire document
xii. delivery date and shipping point
xiii. Item Data
xiv. Whereas data in the document header applies to all items in the document, some data applies only to specific items. This data is stored at item level and includes the:
xv. material number
xvi. target quantity for outline agreements
xvii. number of the ship-to party and the payer (an alternative ship-to party or payer can be defined for a particular item)
xviii. plant and storage location specifications
xix. pricing elements for the individual items
xx. Schedule Line Data
xxi. An item consists of one or more schedule lines. The schedule line contains all the data that is needed for a delivery. For example, a customer orders 20 pieces of a material and you enter this as an item in the sales order. However, you can only deliver 10 pieces now and the remaining 10 pieces next month. In other words, you need to schedule two deliveries. The data for these deliveries (dates, confirmed quantities) are stored in two separate schedule lines. In sales documents where delivery data is not relevant -for example: contracts, credit and debit memo requests - the system does not create any schedule lines.
xxii. Data recorded in the schedule lines includes the:
xxiii. schedule line quantity
xxiv. delivery date
xxv. confirmed quantity

46. What is the difference between an inquiry and quotation ?
i. Inquiry: Request made to a vendor for a quotation for required materials or services.
ii. No availability check is done for inquiry.
iii. Quotation: Offer from a vendor to a purchasing organization regarding the supply of materials or performance of services subject to predefined terms and conditions.
iv. A quotation consists of a number of items, in which the total quantity and delivery date of an offered material or service are specified.
v. The total quantity can be subdivided into several partial quantities with different delivery dates in the lines of a delivery schedule.

47. Do you always have to have a material master record number when you enter an item on a sales document (inquiry and quote)? If not what would you have to use to be able to enter information at item level?
i. No. Customer Material Information or Material Description.

48. If a customer doesn't place an order with you after you have sent him a quotation, what happens to the quotation document?
i. Remains active till the end of validity period.

49. Can you have alternative items in a sales order?
i. Yes.

50. If you reference an inquiry when creating a quotation ,would the inquiry be updated?
i. Yes.

51. Can you copy one inquiry to many quotations ?
i. No.

52. Can you copy several previous documents into one sales order?
i. Yes.

53. Do you always have to copy the entire quantities at item level when you reference a previous document?
i. No.

54. Can you make sure that business data in a sales order is only possible to maintain at header level?
i. Yes.

55. From where is the delivering plant transferred into the sales order?
i. Customer Master, Material Master.

56. Which partner function is relevant for the delivering plant? The sold-to-party , bill-to-party, payer, carrier or the ship- to- party?
i. Ship-to party.

57. Can you manually change the delivering plant in the sales order once it was defaulted from the master data?
i. Yes.

58. For what or why do you use the incompletion log?
i. To have a complete document so that it doesn’t affect subsequent processes.

59. Can you have different incompletion logs for different item categories? Schedule line categories?
i. Yes.

60. If a document is incomplete can you still save the document?
i. Yes.
61. Which reference statuses can a document have at item level? Which statuses at header level?
i. Item level: Partial, Full.
ii. Header level: Full.

62. What's the advantage of using text as a reference instead of duplicating it?
i. Can be modified if needed.

63. What three sources provide data for the creation of a sales document?
i. Material Master, Customer Master, Previous referenced documents.

64. Can you change addresses of partners manually in the sales document?
i. Yes.

65. Name several input tools that make order entry faster and give a definition of them?
i. Customer Material Information, Product Proposal , Referencing Documents.

66. In which business environment would you use only the single-line entry screen to create and save the order?
i. Telephone Sales, Simple Business.

67. If you do not specify the delivering plant in the sales order, what could the system then not
do?
i. Delivery Scheduling.

68. For what would you use the fast change function in sales entry?
i.
Alternate Plants, Delivery or Billing Blocks
69. Name two ways to control that customers can receive only certain materials?
i. Material Listing, Exclusion.

70. What does the item category control?
i. General Data
- Should pricing be carried out for the item?
- When should an item be regarded as completed? A quotation item, for example, can only be regarded as completed if the entire quantity has been copied into a sales order.
- Is it an item that refers to a material or is it a text item?
- Are schedule lines allowed for the item?
- May general business data, for example, the terms of payment at the item level, deviate from those at the header level?
- Should a system message appear if the item cannot be fully delivered?
- Which fields are relevant for the incompletion log?
- Which partner functions are allowed at the item level and which are mandatory?
- Which output (for example, an order confirmation) is allowed for the business transaction and which output determination procedure is used?
i. Shipping Data
- Is an item relevant for delivery?
- Should the weight and the
volume of an item be determined?
i. Billing Data
- Is an item relevant for billing?
- Should the cost of the item be determined?
- Is it a statistical item? Pricing is carried out for statistical items. However, they are not
added to the value of the order, that is, the customer is not charged for them.
- Should a billing block be set automatically for an item? For example, this may be important for items whose prices have to be clarified before billing.

72. Name the influencing factors for determining the item category in the sales document?
i. Sales Document type, Item Category Group, Higher Level Item, Item Usage.

73. Name the influencing factors for determining the scehdule line category in the sales document?
i. Item Category, MRP Type.

74. What does the sales document type control?
i. General Data
- Can the document be entered only with reference to a preceding document?
- Should the existing customer-material info record be taken into consideration?
- Should the delivery date be proposed?
- Must a customer number be entered when creating a document? For example, product proposals can be entered without reference to a particular customer.
- Which order probability is defined?
- Should the division be taken from the material master record for every item or should an alternative division specified in the header take precedence over the item specifications?
- How should the system respond if the division entered in the header deviates from the division in the items?
- Should a credit limit check be made?
- From which number range should the document number for internal or external number assignment come?
- Which fields are relevant for the incompletion log? The validity period, for example, is important for contracts and must therefore be specified in the document.
- Can an incomplete document be saved or must all data be complete?
- Which partner functions are allowed and which ones are mandatory?
i. Shipping Data
- Which delivery type should the delivery resulting from the order have?
- Should delivery scheduling be carried out?
- Should transportation scheduling be carried out?
- Should a delivery block be set automatically for a specific reason? For example, a delivery block may be appropriate for a free-of-charge delivery.
- You can define shipping conditions for a sales document type. These are copied into the document regardless of what is defined in the customer master record.
i. Billing Data
ii. Which billing type
should the invoice resulting from the order or the delivery have?
iii. Should a billing block be set automatically for a specific reason? For example, a billing block may be appropriate if a credit memo request should first be checked before it is used as the basis for a credit memo.

75. Can the sales document type be determined by the system?
i. No.

76. In R/3, can you automatically substitute one product for another? How? What would you have to create?
i. Yes. Product Selection / Material Determination.

77. Give a definition of replenishment lead time?
i. Total time for the in-house production or for the external procurement of a product. In in-house production the replenishment lead time is determined to cover all BOM levels.

78. What's the difference between checking availability with or without replenishment lead time (RLT)?
i. With RLT : Availability check is done only upto end of RLT. If material is not available the date on which RLT ends is displayed as Material Availability Date.
ii. Without RLT : Availability check is unrestricted. Displays Delivery Dates as on which partial deliveries can be made with available stock.

79. Name at least three item categories?
i. Standard Items : AFN, AGN, TAN.
ii. Free of charge Items: AFNN, AGNN, TANN.
iii. Non-stock Items : AFX, AGX, TAX.
iv. Text Items : AFTX, AGTX, TATX.

80. Why would you use different item and schedule line categories?
i. Item categories are defined to provide additional control functions for the sales documents and thus meet the demands resulting from the different business transactions.
ii. The items in a sales document are divided into one or more schedule lines. These schedule lines differ from each other with respect to date and quantity. For some schedule lines, material requirements planning is not carried out; for other schedule lines, it is carried out. Also goods receipt, not goods issue, is posted for a schedule line defined in a returns document.

81. Can you change existing standard item categories?
i. Yes.

82. Can you create new sales order types?
i. Yes.

83. Different dates will be calculated in order entry scheduling . Can you name the lead time variables that will be taken into account?
i. Transportation lead time, Pick/pack time, Loading time, Transit time .

84. If you run out of stock in a specific plant can you check if there are quantities available in other plants?
i. Yes.

85. When you carry out availability check, which quantities or movements can the system take into consideration?
i. The following elements can be included in the availability check:
ii. Stocks : safety stock, stock in transfer, stock in quality inspection, blocked stock.
iii. Inward and outward movements : purchase orders, purchase requisitions, planned orders, production orders, reservations, dependent reservations, dependent requirements, sales requirements, delivery requirements.

86. Give some examples of sales document types (description, not necessary the short code) that already set up in the standard system?
i. Indicator used to control the processing of the various sales documents which are defined in the system. E.g., OR, SO, BV, KR. Document types allow the system to process different kinds of business transactions, such as standard orders and credit memo requests, in different ways.

87. Can you maintain texts for a specific customer and store them in the system? If yes, where?
i. Yes. Customer Material Information.

88. When the system checks availability which scheduling would it use first?
i. Backward Scheduling.

89. Name the influencing factors for the determination of the availability date?
i. The following data is required for determining this date:
- Route from the shipping point to the ship-to party location
- Shipping point from which the goods are issued
- Loading group from the material master record
- Weight group determined from the order using the order quantity.

90. Name the three delivery possibilities when there is not enough stock available?
i. One Time Delivery, Complete Delivery, Partial Deliveries.

91. Can you think of an example why you would have to create a text for a customer and copy it to the sales order?
i. Customer specific instructions.

92. What is the function of item category group?
i. The item category group determines how a material is processed in the sales order. It defines, for example, that pricing does not take place for a free of charge item, such as a business gift; or that inventory management is not carried out for a service. When processing sales and distribution documents, the system uses the item category group to determine the item category. The system determines the item category based on the item category group of the material and the current business transaction, and proposes it in the respective document.
ii. When creating the material types non-stock material and services, DIEN is proposed in both
cases for the item category group, because the order processing for both material types is identical: for example, pricing is carried out for both, but no availability check.

93. On sales order, when the system confirms 20 pieces to be available at a certain date, would these 20 pieces still be available for other new sales order coming in later?
i. No.

94. What is a delivery group and why would you use it?
i. The complete delivery and delivery group functions enable you to combine some or all of the items in a sales order so that they are delivered to the customer together. The system determines automatically the latest delivery date possible for the delivery group and adjusts the schedule lines accordingly. Corresponding requirements for material requirements planning (MRP) are changed or re-determined.

95. What is backorder processing?
i. The backorder processing functions enable you to list relevant sales documents for specific
materials and process them from the point of view of availability. You can assign available to promise (ATP) stock to outstanding order quantities. In addition, you can withdraw already confirmed quantities and reassign them to different items.
ii. Backorder processing is only available for materials with individual requirements.

96. Can you link items in a sales order? If yes, when would you do that?
i. Yes. Promotional Items.

97. For what would you use BOM’s in sales? What two methods of BOM processing do you have in sales order entry? How can you control if the system should/should not explode a BOM in the sales order.
i. A bill of material (BOM) describes the different components that together create a product. A BOM for a bicycle, for example, consists of all the parts that make up the bicycle: the frame, the saddle, wheels, and so on. When you enter the material number of a bill of materials that is relevant for sales order processing, the system displays the material that describes the whole bill of materials as a main item. The components are displayed as sub-items.
- Processing by Main Item : ERLA & Processing by Sub-Item : LUMF
- BOM explosion can be prevented by specifying Item Category Group as NORM.

98. Credit limit checks is an example of a very close link between which two SAP modules?
i. SD & FI.

99. What are the two techniques in delivery scheduling?
i. Backward Scheduling & Forward Scheduling.

100. How does a third party deal work? Do you use a special sales order type for that? How could the system know that you want to process a third party deal?
i. By specifying item category as TAS using double-line entry in the sales order.
ii. No special order type is available.
iii. By the item category group and/or material type in Material Master .

101. Name the several steps in consignment processing.
i. Consignment fill-up, Consignment issue, Consignment pick-up, Consignment return.

102. What’s the difference between consignment pick-up and consignment return?

103. In consignment pick-up, customer returns consignment stock. When goods issue is posted, the relevant quantity is deducted from the customer's special stock and is added back to regular stock at the plant where the goods are returned. Total valuated stock remains the same since the
returned stock was regarded as part of inventory even while it was at the customer's premises.This transaction is not relevant for billing.

104. In consignment return, customer wishes to claim on consignment goods which have already been issued. When goods issue is posted, the relevant quantity is added to the customer's special stock at the plant where the goods are returned. Since the ownership of the goods is passed from the customer back to the company, the transaction is relevant for billing. In this case, the customer receives a credit memo for the returned goods.

105. Can you control that an end user cannot copy a quote of customer A to a sales order for customer B? If yes, where?
i. Yes. By customizing Copying Control for header data.

106. Give some example for data that is copied from the customer (sold-to, payer, ship-to) to the sales order as well as for data that is copied from the material?

107. General data, payment terms, shipping details, delivery agreements, delivering plant.

108. What is returnable packaging processing?
i. Returnable packaging consists of materials that are stored at the customer location but which remain the property of the company. The customer is only required to pay for the returnable packaging if he does not return it by a specified time.

109. Name the two outline agreements in R/3 standard and explain the difference between them.
i. Agreements are arrangements between business partners regarding the granting of conditions over a specified time period. The agreement contains conditions which apply over a particular time period and which are settled together at the same points in time. An agreement can be settled once or periodically. The two outline agreements include Contracts and Scheduling Agreements.
ii. Unlike a contract - which only contains an overall target quantity or value - a scheduling agreement also contains specific order quantities and delivery dates.

110. How many documents do you create when you release, deliver and invoice the first order from a contract?
i. Three : Sales order, Delivery note, Invoice.

111. What types of output can you have in sales?
i. Printer, Telex, Fax, Mail, EDI.

112. Can you automate output processing ? Do you always have to specify it manually?
i. yes. No.

113. Where would you specify which data should be copied (at header, item and schedule line level)when you copy from one document to another one?
i. Customizing Copy Control.

SHIPPING
115. Describe the flow of data from the sales order into the delivery for header
and item and schedule line level data?
i. Header --> Header
ii. Item --> Header, Item.
iii. Schedule line --> Item.

116. Can you combine several sales orders into one delivery document ? If no, why not? If yes, would the system check certain criteria? What criteria?
i. No. When ship-to party or plant is different.
ii. Yes. Availability of all items are confirmed.

117. Name a few prerequisites that have to be fulfilled if you want to create a delivery for the order.
i. Header Level
a. There cannot be a delivery block at header level.
b. The sales document must contain at least one item due for delivery before a delivery can be created for this document.
ii. Item Level and Schedule Line Level
a. The schedule line must be due for shipping on the specified selection date.
b. A schedule line becomes due for shipping as soon as the material availability date or the transportation scheduling date is reached.
c. The schedule line cannot be blocked for delivery.
d. The delivery quantity must be greater than one.
e. The items in the order must be fully processed.
f. If they are incomplete, you must first edit the incompleteness log in the order. You will find information on the incompleteness log in the R/3 SD online documentation on sales.
g. The product status of the material must permit delivery.
iii. For example, the product status for new products which have not been released for delivery does not allow them to be included in a delivery.
iv. Sufficient quantity of the material must be available.

118. If you create a delivery, would this automatically update the sales order?
i. Yes. The delivery status of the entire order results from the delivery status of the items. Until all items in the order have been fully delivered, the order has the status "Partially delivered". The entire document acquires the status of fully delivered once all the items have been fully delivered.

119. Name the different ways of creating deliveries.
i. Partial Deliveries, Complete Deliveries, Deliveries without reference, Grouped Deliveries.

120. How does the system determine the shipping point and the route in the sales order?
i. A shipping point can be determined for each order item. How the shipping point is determined depends on three factors:
ii. The shipping conditions from the customer master record (Shipping screen). A condition might be that the goods are to be delivered to the customer as soon as possible.
iii. The loading group from the material master record (Sales/Plant Data screen).You could, for example, specify a loading group that defines that the goods must always be loaded with a crane or a fork lift.
iv. The delivering plant. This plant is determined per order item either from the customer master record or from the material master record. However, you can also enter it manually for each order item. You will find detailed information on determining the delivering plant in the sales order in the R/3 SD online documentation on sales.

121. Can you change the shipping point determined in the sales order manually?
i. Yes.

122. If you have several shipping points in a sales order at item level. What would that have on the delivery?
i. Each item will individual deliveries.

123. Why would you carry out route determination in the delivery again?
i. To reconfirm the weight of the item.

124. At which different levels can you specify pick/pack and loading time?
i. Shipping point determination level : loading time.
ii. Route determination level : pick/pack time.

125. Where do you specify the departure zone and the arrival zone for route determination?
i. Shipping point, Ship-to party.

126. How can the route influence the material availability date?
i. Transit time & Transportation lead time.

127. Why would you carry out availability check in the delivery?
i. The availability check is calculated using planned inward and outward movements of goods. Therefore the delivery situation might have changed in the meantime due to unforeseen circumstances, such as lost output. The availability check in the delivery takes any such changes into account.

128. Where would you store partial/complete shipment agreements and over/under delivery tolerances?
i. Customer Master and Customer Material Information.

129. Explain the effects of printing out the picking list.
i. Updates the picking quantity in the delivery.

130. How does the system automatically determine the picking storage location in the delivery?
i. Storage Condition.
ii. Shipping Point.
iii. Plant.

131. What is a transfer order and for what would you use it?
i. Document used to support every stock movement in the warehouse.
ii. It contains all the important movement data, such as the material to be transferred, the quantity to be transferred, the storage bins involved, and so on.

132. Define a shipping unit?
i. Combination of materials which are packed together in a shipping material at a particular time.
Shipping units contain items which in turn are made up of shipping units or delivery items.

133. What effects does goods issue have?
i. When the goods have left your plant, the business transaction is regarded as completed from the point of view of shipping. When goods are issued, the following functions take place in the system:
ii. The material stock is reduced by the goods issue quantity and the corresponding value changes take place in accounting. This ensures that the quantity and value flows are parallel.
iii. Material requirements for the delivery are reduced
iv. The delivery status is updated
v. If you bill after goods issue, the delivery enters the billing work list

134. How can you delete a good issue?
i. You cannot cancel a goods issue posting in isolation. You are also unable to change goods
issue quantities. If you make a mistake when processing a delivery, or if the goods are damaged leaving your plant and cannot be delivered, you must cancel the entire business transaction.
ii. Procedure
iii. After you have invoiced the delivery, for which the incorrect goods issue posting was carried out, proceed as follows:
• Enter a returns order (order type RE) for the customer and the material involved.
• Create a returns delivery for the returns order. The system proposes the delivery type. The delivery quantities in the returns delivery must correspond to the goods issue quantities in the incorrect goods issue document.
• Post "goods issue" for the returns delivery. The system automatically recognizes the returns delivery as goods receipt and clears the original goods issue posting by carrying out reverse posting.
• Invoice the business transaction with a returns credit memo. The system proposes billing type. The original billing document for the incorrect goods issue document is cleared by this credit memo.

139. Is it possible to work without specifying a pick/pack or loading time for a shipping point?
i. Yes.

140. When do you initiate packing activity-before or after goods issue? What is the material type for shipping material?
i. Before goods issue . VERP.

141. When you post goods issue after packing, which two documents do you create?
i. Picking List, Invoice.

142. Can the delivery quantity and the picking quantity in the delivery document be -different?
i. Yes.
PRICING
144. Could you explain what condition technique in SAP is?
i. Hierarchy of elements defining a data combination which leads to certain actions.
ii. In pricing the condition technique refers to the method by which the system determines prices from information stored in condition records. In Sales and Distribution, the various elements used in the condition technique are set up and controlled in Customizing. During sales order processing, the system uses the condition technique to determine a variety of important pricing information.

145. Name three areas/processes which use condition technique in SD?
i. Material determination, Output determination, Account determination.

146. What are the four basic elements of condition technique?
i. Condition Types, Condition Tables, Access Sequences, Pricing Procedures.

147. Please explain graphically the relationship between the four basic elements in condition techniques?
i. Procedures --> Condition Types --> Access Sequence --> Condition Tables --> Condition Records.

148. Explain what a pricing procedure is?
i. The primary job of a pricing procedure is to define a group of condition types in a particular sequence. The pricing procedure also determines:
- Which sub-totals appear during pricing
- To what extent pricing can be influenced manually
- Which method the system uses to calculate percentage discounts and surcharges
- which requirements for a particular condition type must be fulfilled before the system takes the condition into account.

149. Explain what a condition table and an access sequence is and the relationship between them?
i. A condition table defines the combination of fields (the key) that identifies an individual condition record. A condition record is how the system stores the specific condition data that you enter in the system as condition records. For example, when you enter the price for a product or a special discount for a good customer, you create individual condition records.
ii. An access sequence is a search strategy that the system uses to find valid data for a particular condition type. It determines the sequence in which the system searches for data. The access sequence consists of one or more accesses. The sequence of the accesses establishes which condition records have priority over others.
The accesses tell the system where to look first, second, and so on, until it finds a valid condition record. You specify an access sequence for each condition type for which you create condition records.

150. What is a condition type? What are the two main groups of condition types?
i. A condition type is a representation in the system of some aspect of your daily pricing activities. For example, you can define a different condition type for each kind of price, discount, or surcharge that occurs in your business transactions.
ii. Fixed Amount & Percentage.

151. Is SD the only module that uses condition technique?
i. No.

152. What is a condition supplement and why would you use it?
i. A condition supplement is a supplement for a particular condition type. For example, you can include a supplement every time you apply a material price. The supplement can contain various discounts. During pricing, the system automatically applies the discounts defined in the supplement every time it accesses a material price. You define for which condition types you
want to use condition supplements in Customizing for Sales.

153. Which partner function is relevant when it comes to tax calculation in the sales order?
i. Ship-to party.

154. Name at least three different condition types in pricing?
i. Price, Discounts, Freight. PROO, K007, KF00.

155. You can create scales for prices and discounts. Name the four possible scale basis in R/3.
i. Value, Quantity, Gross weight, Net weight, Volume.

156. Where would you specify that a condition type is a discount or a surcharge?
i. In Condition Type Details Screen.

157. If somebody adds price elements manually in the sales order or if somebody changes a discount the system determined automatically, do you have a possibility to see that in the sales order?
i. Yes.

158. You want to list all condition records for a certain material or a certain sales organization. How would you do that?
i. By creating Pricing Reports.

159. Does the pricing procedure apply for the pricing data at item level or for the pricing data at header level?
i. Both.

160. When you create a header condition manually in the sales order the system can copy the values in different ways to the items. Where would you specify how the system should process?
i. Condition Type.

161. Which data do you have to maintain in SD so that the system can determine the sales taxes in the sales order automatically?
i. Tax rate with or without Jurisdiction.

162. What does the condition exclusion indicator do for you?
i. The system can exclude conditions so that they are not taken into account during pricing in sales documents.

163. Can you explain what a statistical condition is? Give an example for a statistical condition?
i. VPRS.

164. For what do you use customer hierarchies?
i. Pricing , Rebate.

165. Can you track cumulative values in R/3? If yes, it could be based on what?
i. Yes. Maximum Value, Maximum Orders, Maximum Quantity.

166. If you want to make sure that conditions records apply for a certain time period only what would you have to do?
i. Validity Period to be specified in condition record.

167. What is a group condition?
i. Condition which can be used to determine a scale value based on more than one item in a document. The system groups the items using either the condition key for the appropriate condition record or a separately defined condition key.

168. Name the influencing factors for pricing procedure determination during sales order entry?
i. Customer, Sales Document Type and Sales Area.

169. Can you copy condition records? If yes, are there any restrictions?
i. Yes. Field specific.

170. If you create a new condition type-do you also have to create a new condition table and a new access sequence?
i. Yes.

171. Where can you specify that a condition is mandatory?
i. In Pricing Procedure.

172. Tax jurisdiction processing is a close link between which two modules?
i. FI & SD.

173. Do you have to create a condition record for taxes in the SD application?
i. Yes.

BILLING
175. Name several billing types?
i. F1 : Order related Invoice F2 : Delivery related invoice.
ii. F5 : Proforma Invoice for Sales Order F8 : Proforma Invoice for Delivery.

176. Can you delete an invoice?
i. No. You can cancel it and create cancellation document.

177. When you create an invoice in SD, how do you post it to FI?
i. Select Billing document --> Release To Accounting.
ii. The system displays a message that the accounting document has been saved. If the billing document contains an error, the reason for not forwarding the document is displayed. If the release was successful, the posting status in the billing document is set to C (accounting document has been created). You find the posting status by selecting Header --> Details in the billing document.

178. When you create an invoice can you carry out pricing again?
i. Yes.

179. From which documents can you create a proforma invoice?
i. Based on sales order or delivery.

180. Do you transfer a proforma invoice to FI ? If yes, how? If no, how do you customize the system in a way that the proforma invoice is not transferred to FI?
i. No. Billing status not assigned to proforma invoice. Posting bock in the billing document.

181. When you create a credit memo request do you always have to refer to a sales order or any other previous document?
i. Only sales order.

182. In R/3 how can you make sure that invoices for a customer are always created at a specific date?
i. Billing Schedule.

183. Can you combine deliveries into one invoice? When would you do that?
i. Yes. If the header data and header partners for specified delivery or sales order are
identical and if requirements for splitting do not apply.

184. Can you combine orders into one invoice?
i. Yes.

185. Can you split deliveries into several invoices? When would you do that?
i. Yes . If the data from the related reference documents differs in the header fields of the billing document. The system will automatically split the invoice.

186. For what do you use the billing due list? What previous step in the process is necessary that a
delivery appears in the billing due list?
i. Selection criteria – sold-to party, billing date or receiving partner.
a) separate invoice for each delivery
b) split one sales order for delivery into several invoices.
c) combine several sales orders for delivery into one invoice.

189. Name the five possible influencing factors for account determination for invoices?
i. Chart of accounts of the company code
ii. Sales organization
iii. Account assignment group of the customer (from the customer master record, Billing screen, Account group field)
iv. Account assignment group of the material (from the material master record, Sales 2 screen, Account assignment group field)
v. Account key (from the pricing procedure)

190. Can one business area be valid for several company codes?
i. Yes.

191. What are the two possible ways to transfer sales data to business areas? Where do you specify which way you want to use?
i. sales area (if the accounts are to be posted according to sales)
ii. plant/division (if the accounts are to be posted according to products)

192. There is an interface between SD and FI in invoicing . can you think of another interface between SD and FI?
i. Credit check, Tax calculation, Cost estimate.

193. What is rebate processing?
i. A rebate is a special discount which is paid retroactively to a customer. This discount is based on the customer's sales volume over a specified time period

194. What is an invoice list? Which prerequisite are necessary to use an invoice list? How does an invoice list differ from a collective invoice?
i. Invoice lists let you create, at specified time intervals or on specific dates, a list of billing documents (invoices, credit and debit memos) to send to a particular payer.
ii. The billing documents in the invoice list can be single or collective documents (collective invoices combine items from more than one delivery).
iii. The standard version of the SAP R/3 System includes two types of invoice lists:
- for invoices and debit memos
- for credit memos
i. If you wish, you can process invoices, debit memos, and credit memos at the same time. The system automatically creates a separate invoice list for credit memos.
ii. Prerequisites for Invoice Lists
iii. You can
process invoice lists providing that the following prerequisite data is defined by your system administrator in Customizing for Sales:
- Condition type RL00 (factoring discount) must be maintained and, if required, condition type MW15 (VAT: factoring discount tax)
- An invoice list t


(0) 评论    (0) 引用   

[收藏]关于COMMIT和ROLLBACK语句的使用注意事项

作者:莫怀远 1. COMMIT WORK 语句执行许多与任务的同步执行有关的功能。 ROLLBACK WORK语句“取消”任务同步执行的所有请求。 COMMIT WORK 语句进行下列处理: • 执行所有由PERFORM ON COMMIT 请求的FORM 例程。按优先级的升序执行这些例程,顺序由 PERFORM 语句的LEVEL 参数指定。 • 如果请求,触发所有更新任务功能模块。 • 如果请求,触发所有后台任务功能模块。 • 触发数据库提交(依次释放数据库锁定)。 • 清空反转日志。反转日志包含应用更改前的表格快照。执行反转时,该快照用来将表格复位到原值。 • 关闭所有打开的数据库光标。 • 将所有TEMSE 对象写入永久性文件或数据库。 TEMSE文件是由于性能原因在执行事务期间缓存的临时序列文件。TEMSE文件的示例有假脱机对象或作业日志。 • 将时间片计数器(用于访问工作进程)复位到0。系统中的时间片计数器限制工作进程中程序运行的时间量。如果程序常常超过时间片限制,则可以使用COMMIT WORK为程序获得更多时间。但是,要达此目的,必须很容易将处理分为更小单元(全部或没有操作)。然后可以在每个单元之后插入COMMIT WORK 语句。当然处理单元逻辑上必须独立,因为在发生错误时,不能取消前面的单元中所提交的更新。 ROLLBACK WORK“抛弃”当前事务的所有更新: • 抛弃所有以前用PERFORM ON COMMIT 登录的FORM例程 • 在更新任务队列中将所有以前请求的更新任务功能标记为错误 • 抛弃所有以前请求的后台任务功能 • 从缓冲存储中删除所有TEMSE对象(临时 连续文件,如假脱机对象和作业日志) • 触发数据库反转操作(依次释放所有数据库锁定) • 关闭所有打开的数据库光标 2. 以下情况需使用使用COMMIT和ROLLBACK语句。 1) 通过INSERT、UPDATE和MODIFY语句对数据库进行更新事务后。 2) 执行BAPI处理后。一般使用BAPI函数BAPI_TRANSACTION_COMMIT(内含COMMIT语句) 。 3. 如果要保证数据库中当前所作的更改立即被确认,那么就必须使用COMMIT WORK 语句结束LUW。COMMIT WORK 在程序代码中标记了 LUW(几个作业联系在一起形成作业的逻辑单元) 结束并启动更新任务。在COMMIT WORK 语句以后,对数据库所作的所有更改都不能再取消。但是,如果在LUW 中出现了错误,就必须取消已经执行的部分。这意味着当前没有任何插入的行能永久地保存在数据库中。要撤销当前LUW 对数据库的更改,请使用ROLLBACK WORK,它将取消前一次数据库提交后的所有更改。 4. COMMIT WORK [AND WAIT(同步)]. 如果使用AND WAIT选项,那么在程序继续执行以前,它要等到更新任务的结束。如果更新是成功的,SY-SUBRC 就设置为0。如果 SY-SUBRC 返回一个非零值,就没有成功的存储所作的更改。 ROLLBACK WORK. 如果对更改的取消是成功的,SY-SUBRC 就设置为0。如果 SY-SUBRC 返回一个非零值,就没有成功地取消所作的更改

(0) 评论    (95) 引用