Text field in FI Document automatically from MIRO line item

When a purchase order is created to a cost centre, G/L account and cost centre are entered manually. Often Purchase Order only uses short text field as reference, i.e., Material is not mandatory.

 

MIRO process is then done for PO after GR, and the PO text (short text) is copied into MIRO.

 

G/L account line items can be displayed in FBL3N, detailing the document numbers related to the invoice/PO once posted.

 

The field "Text" is defaulted as blank, even if created with reference to a PO, which contains text. Does anybody know of a way to automate process so that the text field is populated with the text from MIRO?

 

 

You can transfer what ever the data from the MIRO to accounting document-using BTE.

 

Go to SE37 - SAMPLE_PROCESS_00001120 (this is the standard BTE for account document posting). Copy this with ZSAMPLE_PROCESS_00001120.

 

In this you cannot modify the tables t_bkpf and t_bseg. you can use t_bkpfsub and t_bsegsub.

 

For this a little bit config is required.

 

1) Go to t-code FIBF-> settings->Products->... of a customer.

Click new entries -> product name- ZPRODUCT, text - any text, RFC dest - ZSAMPLE_PROCESS_00001120, A - enable check box -> save.

2) Go back -> settings -> P/S Modules -> ... of a customer.

Click new entries -> event - 00001120, Product - ZPRODUCT, Ctr - Country key, Appl - FI-FI, Function module - ZSAMPLE_PROCESS_00001120 -> save.

3) Go back -> settings -> Process Modules -> ... of a customer.

Click new entries ->Process - 00001120, Ctr - Country key, Appl - FI-FI, Function module - ZSAMPLE_PROCESS_00001120, Product - ZPRODUCT -> save.

 

Now go to SE37->ZSAMPLE_PROCESS_00001120 logic.

 

loop at t_bkpf.

loop at t_bkpfsub.

move 'your value' to t_bkpfsub-value.

modify t_bkpfsub index sy-tabix.

endloop.

endloop.

 

loop at t_bseg.

loop at t_bsegsub.

move 'your value' to t_bsegsub-value.

modify t_bsegsub index sy-tabix.

endloop.

endloop.

 

''Your value' is imported value.

 

No need to worry about modified values. After execution of BTE it will go to standard program and copy the values of t_bkpfsub] and t_bsegsub to SAP tables. So please be perfect with code. SAP wouldn't allow change the values in t_bkpf and t_bseg values. you can add your own fields in bkpf_subst and bseg_subst.

 

But make sure that; please write the code in FM with conditions like company code doc type etc. because this BTE is very important. It will execute before acc doc is posted. If you do not specify any conditions it will execute for all co codes in acc doc. it will affect business. You can debug this BTE. Put a break point in FM and see the values while post the MIRO.

 

Once import the values free memory id and clear the variables whatever you used in BTE.

SAP Tables for Technical Consultants & also for Function Consultants !!!

Tables on below topics :
 
Authorisation, objects, Batch input map's, Batch jobs,Correction & transport, Countries, Currency, Data elements, Development classes, Domains, Dynpro areas,  Filenames, Function modules, Function groups, Icons, Logical databases, Matchcodes, Messages, Programs, Repository objects, Purchase Requisition, SAPscript, Spool, Status (menu), Switch objects, Tables and views, Texts, Transactions, User parameters, Variants, Accounting, Accounting documents, Bill Of Material, Classification, Classification characteristics, Configurator, Cost elements, centers, activities, Customer,Equipment, Equipment status, Function location, Customising tables, General ledger accounts, Goods movement, Customising, Inventory document, Maintenance Order, Material, Material document, Notifications, Orders,Personel, Production resource tools, Customising tables, Project, Purchase Requisition, Purchasing document, Purchasing info record, Reservation, Sales Document, Sales requirements, Storage locations and stocks, Tasklist, Transfer requirement, User data, Vendor master, WM transfer, Other tables, Useful Transactions, Function modules, Standard data transfer, Helpful reports.
 
Click on SAP Tables for the document.

 

Why do we need to DEBUG : BREAK POINT : WATCH POINT

DEBUG
 
We write programs to achieve certain functionality and like other actions, we make mistakes while writing the code. If they are not trapped at the right time, problem becomes bigger, and bigger and bigger.
 
Read more in ... DEBUG
 

BREAK POINT

 

The BREAK POINT is a debugging aid. When we run a program normally, it is interrupted at the statement, and the system automatically starts the debugger, allowing you to display the contents of any fields in the program and check how the program continues. If the program is running in the background or in an update task, the system generates a system log message. 
 
Read more in ... BREAK POINT
 
WATCH POINT
 
Indicator in a program that tells the ABAP runtime processor to interrupt the program at a particular point.
 
Read more in ...WATCH POINT