云服务器价格_云数据库_云主机【优惠】最新活动-搜集站云资讯

企业网站_查询域名注册服务商_高性能

小七 141 0

In this blog post, you will be able to add custom fields to MM-IV screens and also you will be able to change reconciliation account via using BTE 1120.

Some of SAP customers need to change reconciliation account while posting invoices due to legal procedures. It is possible to change it in FI t-codes like FB60,FV60, etc. with using special gl indicator.

But if you are using MM-IV for all invoices, you won’t be able to change reconciliation account in MIRO/MIR7/MIRA/MIR4.

In MM-IV tcodes, Reconciliation account is being filled from Vendor master data (XK03) below.

It is seen that G/L account can not be editable in MIR7 above pic. There is also no Special GL indicator field in any tab.

What TO DO? If you need to post to another account, instead of assigned account in vendor master data.

It is possible to change reconciliation acc. from vendor master(XK02) before posting. But, another users will be affected regarding this action. For this reason, it is very dangerous to change reconciliation account from master data.

We will be able to post another accounts by below steps. I have used only BADI’S and Append structure function in this solution (no coding repair!)

1.1     Go to SE19 -> Display FI_FDCB_SUBBAS01

Copy to your notepad above called program "SAPLBADI_EXAMPLE_FDCB_BAS". This program is used for all invoice posting screens (MIRO/MIR7/FB60/FV60..etc) we will copy this program and make a new Z program.

Create a copy of FI_FDCB_SUBBAS01_EX. I did Z1_BADI* below. You can also create BADI from se18

*If you are using Subbas01 for your other requirments, you can use 02,03..,06. Go to SE18 -> Choose "BADI_FDCB_SUBBAS0*"

1.2     Go to SE38 -> Create a copy of "SAPLBADI_EXAMPLE_FDCB_BAS"

New function group is your z badi’s name. Click "Copy" system will create a new program automatically.

The screen 0100 is coming from standard program which is used in IV(Invoice verification) screens. We will create a new screen through coping 0100, it will be 0900 for my new field. Delete 0100, after creating 0900.

The Screen(0900) is created, we will write some simple abap codes to make validations and better functions for our new reconciliation account field.

After debugging MIRO, i have recognised that we need to add our new custom field to releated structures and tables below.

The structures :

BKPF_SUBST (After saving for FI document Header, we will use BTE 1120) BSEG_SUBST (After saving and simulation mode for FI document item, we will use BTE 1120) INVFO (Screen fields structure) ACMM_VENDOR_COMP (Necessary) RBKP_V (Necessary for MIR7) VBKPF (Optional for FV60-FV65)

The Tables :

BKPF RBKP (Necessary for Header, we keep new field in the header)

My new field is ZZAKONT.

After implementations of my new field, now we can add our field to MM-IV screens. Go to SE19 -> Change "Z1_BADI_FDCB_SUBBAS" and Screen "900".

3.1     Screen coding

I would like to make a search help for my new field and i want to display my field only MIRA,MIR4,MIR7,MIRO screens not FV60-FV65..etc.

Thus, I make some diffrences in the coding of screen.

Below, You can find abap codes what i wrote for my requirement for the screen.

MODULE modify_screen OUTPUT. "ONLY MM-IV"

IF NOT ( sy-tcode = ‘MIR7’ OR    sy-tcode = ‘MIRO’ OR    sy-tcode = ‘MIRA’ OR    sy-tcode = ‘MIR4’ ). LOOP AT SCREEN. IF screen-group1 = ‘ZZ1’. screen-input = ‘0’. screen-invisible = ‘1’. ENDIF. MODIFY SCREEN. ENDLOOP. ENDIF.

ENDMODULE.

—–

MODULE fill_zzakont INPUT.

DATA : LV_SAKNR TYPE SAKNR.

IF invfo-zzakont IS NOT INITIAL. CLEAR LV_SAKNR. SELECT SINGLE saknr FROM skb1 INTO LV_SAKNR WHERE saknr EQ invfo-zzakont AND bukrs EQ invfo-bukrs AND mitkz EQ ‘K’ AND ( xloeb NE ‘X’ OR xspeb  NE ‘X’) . IF sy-subrc IS INITIAL. EXPORT invfo-zzakont TO MEMORY ID ‘BKPF-ZZAKONT’. ELSE. MESSAGE ‘Incorrect account assingment!'(001) TYPE ‘E’. ENDIF. ENDIF.

ENDMODULE.

MODULE help_lfb1-akont INPUT.

DATA: akont LIKE lfb1-akont. DATA:    BEGIN OF dynpfields OCCURS 1. INCLUDE STRUCTURE dynpread. DATA:    END   OF dynpfields. DATA:             char1(1)       TYPE c.

*—— Inhalt des Feldes ‘LFB1-AKONT’ vom Dynpro besorgen ————- CLEAR   dynpfields. REFRESH dynpfields. dynpfields-fieldname = ‘INVFO-ZZAKONT’. APPEND dynpfields. CALL FUNCTION ‘DYNP_VALUES_READ’ EXPORTING dyname     = ‘SAPLMR1M’ " ‘SAPMF02K’ dynumb     = ‘0900’     "‘0210’ TABLES dynpfields = dynpfields EXCEPTIONS OTHERS     = 4. IF sy-subrc = 0. READ TABLE dynpfields INDEX 1. invfo-zzakont = dynpfields-fieldvalue. TRANSLATE invfo-zzakont TO UPPER CASE.                       "#EC TRANSLANG ENDIF.

*——- Feld ‘LFB1-AKONT’ Eingabe- oder Anzeigefeld? —————— PERFORM feldstatus_ermitteln USING ‘INVFO-ZZAKONT’ char1.