Skip to Content
0
Former Member
Nov 21, 2006 at 12:45 PM

Badi's on vi01. Pls Its very urgent

1119 Views

Hi Experts,

I have given the requirement below I am not aware of badi's. Pls tell me the info about Business event 1120P. And also post the coding for this functionality . Its very urgent

Enhancement Summary

Two user exits are needed to determine the correct G/L Account and Cost Center on Shipment Cost documents and post the Material Group on the Accounting document. BADI_SCD_ACCTG and Business Event 1120P can be used to accommodate the new functionality.

Business Process

Specific G/L Accounts and Cost Centers have to be determined to post on the Shipment Cost document. This is needed to provide accurate management reporting capabilities on shipments for Sales Order or Stock Transfer Order. A new custom table must be created which contains the following information: Distribution, Mode of Transport, Account, Cost Center Material group. Distribution is an identifier here if this shipment originated from an SO or STO.

There are no screens involved in this enhancement.

Components

Table: ZTABLE1

Field Data Element Type Length Description

MANDT MANDT CLNT (key) 3 Client

DISTRIBUTION Z_DISTRIBUTION CHAR (key) 1 Distribution

MOT ZZDEF_MOT CHAR (key) 2 Mode of Transportation

MATKL MATKL CHAR (key) 9 Material group

SAKNR SAKNR CHAR 10 G/L Account Number

KOSTL KOSTL CHAR 10 Cost Center

This table gets updated manually by the FI team.

Values for Distribution are:

‘1’ = Primary Distribution to Refinery

‘2’ = Primary and Secondary– Excluding refinery

All entries must be checked against SAP config and master tables

User exit BADI BADI_SCD_ACCTG will be used to determine the correct G/L Account, Cost Center and Product Group based on Distribution and Mode of Transport. This BADI gets called only when a new Shipment Cost document get created.

Once the BADI determined the new values it populates field c_vfkn-sakto with the G/L account, field c_vfkn-kostl with the Cost Center and exports the Product group to memory.

There is no field on the Shipment Cost Document to store the Product group. Therefore another mechanism must be used to get the Product Group on the accounting document.

Business Event 1120P can be used to import the Product group out of memory and put it on BSEG-MATNR. Structure BSEG_SUBST must be enhanced with field MATNR for this purpose.

Function, Rules, Exits Description of Functionality, Rules, Exits

BADI_SCD_ACCTG Business Add-In for Shipment Cost Account Assignment

Business Framework Business Event 1120P can be used to import the Product Group from memory and to populate field BSEG_SUBST-MATNR.

This event gets called from different places. It needs to be ensured that it only populates the value when it was called from BADI_SCD_ACCTG.

Custom Table A look-up Table needs to be maintained for Distribution, Mode of Transport, G/L Account, Cost Center and Material Group

Transaction code To maintain the new table

Append Structure To enhance structure BSEG_SUBST with MATNR

Business Add-In BADI_SCD_ACCTG can be used to determine the account assignments for a shipment cost item to set the G/L Account and Cost Center. All data needed to determine the new information gets provided in this BADI.

Logic:

• Determine if STO or SO based on Document Category from internal table I_REFOBJ-VTRLP field VGTYP If is C then Distribution type is Sales Order (Primary and Secondary – Excluding Refinery – ‘2’ ) else we need to check the receiving plant. If the receiving plant (I_REFOBJ-VTRLK field WERKS) is a refinery the Distribution type is Primary (1) else it’s a (Primary and Secondary – Excluding Refinery – ‘2’ ). Refineries can be identified via Function Module Z_M_GET_PLANTCLASSIFICATION. The plant must be passed into Import Parameter IP_SAPPLANT and field INT_PLANTCHAR-ATNAM must be looked up with value SAPTYPE. If it exists and field ATWRT contains ‘RFY’, the plant is a refinery.

• Product Group can be determined from the Material master through Material group field MARA-MATKL.

• Mode of Transport will be passed in the BADI in VTRLK-OIC_MOT.

• Select single entry from table ZTABLE1based on Distribution, Mode of Transport and Material Group. If nothing gets selected, error message ‘No entry exists in table ZTABLE1for Distribution (distribution), MOT (MOT) & Mat. Group (material group)’ should be triggered.

• Move ZTABLE1-SAKNR to c_vfkn-sakto and ZTABLE1-KOSTL to c_vfkn-kostl

• The Material group must be exported to memory in BADI_SCD_ACCTG

• The Material group must be imported from memory in Business Event BP1120P

• Free Memory in Business Event BP1120P

This is VI01 – Creation of Freight Cost Item screen