You are on page 1of 10

TECHNICAL

SPECIFICATION
PARKING AND POSTING
G/L ACCOUNT FOR CREDIT MEMO
T-CODE: ZCKFI67  For parking the Document
ZCKFI68  For Posting the Document

Created by

Thiyagarajan J, Prasath R, Subramanian M


PREVIOUS VERSION:

ZCKFI67 (PARKING THE DOCUMENT):

Parks the Data provided in Excel document into Database table custom table Header
(zpark_cust_hdr), item (zpark_cust_itm) and also updates in validating table (zpark_cn_val) for post the
G/L Account for Customer Credit Memo.
ZCKFI68 (Posting the Document):
Fetches data from the respective Header an Item table based on the Customer Number (ACCNT)
and posting the G/L Account for Customer Credit Memo through BAPI
(BAPI_ACC_DOCUMENT_POST).

CHANGES DONE:

ZCKFI67 (PARKING THE DOCUMENT):

Parks the Data provided in Excel document into Respective Database Tables with additional
fields
 Cost Centre(KOSTL) [after the field Order Number(AUFNR)]
 Tax Code(MWSKZ)
 Business Place(BUPLA)

ZCKFI68 (POSTING THE DOCUMENT):


Fetches data from the respective Header an Item table based on Customer Number (ACCNT) and
Reference(XBLNR).
If there is any Tax Code given in Parked Document, respective calculations have to be done for
given Tax Code.
TCODE: ZCKFI68

PROGRAM: ZFV75_PARK_CUST_CREDIT_MEMO

Declaration:

Record: (structure for storing all the data from Excel)

Added three New fields

 KOSTL “Cost Center


 MWSKZ “Tax Code
 BUPLA “Business Place

Header: (for storing the header data)

Added a new field

 BUPLA “Business Place

Item: (for storing the item data)

Added two new fields

 KOSTL “Cost Center


 MWSKZ “Tax Code

Credit_note: (for displaying the parked datas)

Added three New fields

 KOSTL “Cost Center


 MWSKZ “Tax Code
 BUPLA “Business Place

START-OF-SELECTION:

Form excel_to_internal_table: (fetch the data from the excel and stores it to internal table)

Moved 13th position’s value to the Cost center(KOSTL)

WHEN '0013'.
MOVE <lfs_excel>-value TO record-kostl.

Moved 19th position’s value to Tax Code (KOSTL)


WHEN '0019'.
MOVE <lfs_excel>-value TO record-mwskz.

Moved 19th position’s value to Business Place(BUPLA)

WHEN '0020'.
MOVE <lfs_excel>-value TO record-bupla.

Deleted header data based on Account Number(accnt) and Reference(xblnr)

DELETE ADJACENT DUPLICATES FROM header COMPARING xblnr accnt.

Form park_customer_credit_note: (stores the data from internal table to Database table)

Moved Business Place (BUPLA) to header table (zpark_cust_hdr)

Loop at item based on Account Number and Text.

Moved Cost Center (KOSTL) to ITEM table (zpark_cust_ITM)

Moved Tax Code (MWSKZ) to ITEM table (zpark_cust_ITM)

Calculated amount for all the line item for storing the amount(WRBTR) in the header
table.

Append the amount to Header table

End of the Loop.

Modified Header’s Amount(WRBTR) for displaying in the ALV.

Form build_catalog: (for building catalog for displaying the parked data)

A new field catalog added for Business Place(BUPLA)

PERFORM fldcat USING itname 'BUPLA' 'L' '4' '8' 'Business place'.

Form pick: (for getting the line items for selected header value)

Modified Loop at item based on Header’s Account Number(ACCNT) AND Reference.

Form build_catalog1: (for building the catalog for displaying line item)

A new field catalog added for Cost Center(KOSTL) and Tax Code(MWSKZ).
TCODE: ZCKFI68

PROGRAM: ZFV75_POST_GL_ACCNT_CUST_CKL

Declaration:

Header: (for storing the header data)

Added two extra fields

 MWSKZ “Tax code


 BUPLA “Business Place

Item: (for storing the item data)

Added three extra fields

 KOSTL “Cost Center


 MWSKZ “Tax Code
 XBLNR “Reference

Park_itab: (used when user is going for deleting the parked document)

Added three New Fields

 KOSTL “Cost Center


 MWSKZ “Tax Code
 BUPLA “Business Place

Park_itab1: (used when user is going for deleting the parked document)

Added three New Fields

 MWSKZ “Tax Code


 BUPLA “Business Place

Park_itab2: (used when user is going for deleting the parked document)

Added three New Fields

 KOSTL “Cost Center


 MWSKZ “Tax Code
 XBLNR “Reference

Gl_header: (stores the header data)

Added three New Fields

 BUPLA “Business Place

Gl_item: (for storing the item data)


Added three extra fields

 KOSTL “Cost Center


 MWSKZ “Tax Code
 XBLNR “Reference

START-OF-SELECTION:

Form build_catalog: (for building the fieldcat for displaying the header Information)

Added an extra fieldcat for Business Place

PERFORM fldcat USING itname 'BUPLA' 'L' '4' '11' 'Business Place'.

Form Pick: (for fetching the item details based on the seolected header)

Fetches the item details based on the Account Number(accnt) and Reference (xblnr).

The below modified code gets only the header data which matches the selected Row’s Account
Number(accnt) and Reference(xblnr)

LOOP AT header WHERE accnt EQ selfield-value AND xblnr EQ wa_hdr-xblnr.

Fetching the item details based on the Header’s Account Number(accnt) and Reference (xblnr) .

LOOP AT item WHERE accnt EQ selfield-value AND sgtxt EQ wa_hdr-xblnr.

Form Bild_catalog1: (for building the fieldcat to display the item details)

Added field catalog for displaying three new fields (Cost Centre, Reference Number, Tax Code)
Form posting_gl_account: (for posting the Items fetched)

Added Business place(BUPLA) to accountreceivable[] table.

accountreceivable-businessplace = gl_header-bupla .

Getting the Line item based on AccountNumber(ACCNT) and Reference(XBLNR)

LOOP AT gl_item WHERE accnt EQ gl_header-accnt AND xblnr EQ gl_header-xblnr.

Pass the Tax_code and itemno_tax to accountgl[] table.

accountgl-tax_code = gl_item-mwskz. "New field tax code


accountgl-itemno_tax = count. “New field itemno_tax

Fill the cost center if the orderid for the given ordernumber is not there in the aufk table.

accountgl-costcenter = gl_item-kostl.

Tax Calculations: (for calculating the Tax amount)

If the line item has Tax Code

Get the amount of the line item in a local variable.

Call the function module 'CALCULATE_TAX_FROM_GROSSAMOUNT' to calculate


the tax and get the result in an internal table.

Loop at the Internal table that we got in above function Module into a workarea

Fill the currencyamount[] with the required values in workarea.

lv_count = lv_count + 1.
currencyamount-itemno_acc = lv_count.
currencyamount-currency = 'INR'.
currencyamount-amt_doccur = ls_mwdat-wmwst.
currencyamount-amt_base = ls_mwdat-kawrt.
DATA(lv_base_amt) = ls_mwdat-kawrt.
currencyamount-tax_amt = ls_mwdat-wmwst.

Fill the accounttax[] with the required values in workarea.

accounttax-itemno_acc = lv_count.
accounttax-gl_account = ls_mwdat-hkont.
accounttax-cond_key = ls_mwdat-kschl.
accounttax-acct_key = ls_mwdat-ktosl.
accounttax-tax_code = gl_item-mwskz.
accounttax-itemno_tax = count.

Get the ktosl value of the workarea and store it in a local variable for finding their
respective G/L Account.

CONCATENATE ls_mwdat-ktosl '.' lv_ktosl INTO DATA(lv_ktosl).

End of the Loop

If the line item does not have any Tax Code

Fill the currencyamount[] without any Tax data.

Modifications done for BAPI:

Declare a variable for Extension

Pass a structure name and the Business place(BUPLA) of the line item to extension

wl_extension2-structure = 'ZBAPI_BUPLA'.
wl_extension2-valuepart1 = gl_header-bupla.

Pass a structure name and the KTOSL of the line item to extension

wl_extension2-structure = 'ZKTOSL'.
wl_extension2-valuepart1 = lv_ktosl. " Value

Modifications done in BAPI ('CALCULATE_TAX_FROM_GROSSAMOUNT)

Pass the accounttax[] and extension to the BAPI

accounttax = accounttax
extension2 = tl_extension2
Modifications done inside BAPI ('CALCULATE_TAX_FROM_GROSSAMOUNT)

In ZBADI_ACC_DOCUMENT_FB60

Read the extension[] table with key structure for Business Place value(BUPLA)

If Successful

Get the valuepart of the extension in a local variable

Read the extension[] table with key structure for KTOSL value

If Successful

Split the values in the KTOSL valuepart and store it in a Range table

Get the G/L Account from J_1IT030K table where KTOSL in Values in Range
table

If Successful.

Loop at c_accit

Get the G/L Account for the respective KTOSL

Fill the G/L account for the Tax Line Items

End of the Loop

Endif

Endif.

Endif.

Form parking_document_delete: (for deleting the line item from database table)

Moved extra three fields

 Cost Center
 Reference
 Tax Code

Form build_catalog2: (catalog for displaying the data in delete operation)

Added Extra field catalog for Cost Center

PERFORM fldcat2 USING itname2 'KOSTL' 'L' '10' '16' 'Cost Center'.

You might also like