Material documents&Accounting documents
Dear Experts,
Is there any standard T-code is there to display Material documents (MIGO, MIRO..) and related accounting documents in the same screen?
if not please suggest me from which table we can fetch both documents?
Regards
babu.
Dear Chintan Joshi, thank you for the reply,
I need to have a list of Material documents, In MB03 we can see only one material document and accounting document.
moreover i need to have it in a list format (side by side) not to select another button or tab to display related to accounting document.
Similarly we can get details in MB51 or MR51 also but we can't get both documents side by side
Regards
babu.
Similar Messages
-
Material document & Accounting document
Hi Friends,
Please explain me difference between Material document & Accounting document.
Vipul.Hi Vipul,
Material document
In the Inventory Management system, when a goods movement is posted, a material document is generated that serves as proof of the movement and as a source of information for any applications that follow.
A material document consists of a header and at least one item. The header contains general data about the movement (for example, its date). Each item describes one movement.
Accounting document
If the movement is relevant for Financial Accounting (that is, if it leads to an update of the G/L accounts), an accounting document is created parallel to the material document.
In some cases, several accounting documents are created for a single material document. This might be the case, for example, if you have two material document items with different plants that belong to different company codes.
The G/L accounts involved in a goods movement are updated through an automatic account assignment.
For goods receipts for purchase orders, goods movements for stock transport orders and consignment withdrawals, business partners may have different local currencies. Therefore, as well as the local currency, the accounting document must also contain another currency for processing and postings. For this purpose, accounting documents created as a result of these goods movements will automatically be managed in the local currency and in the document currency. You can switch between both currencies by choosing Settings ® Currency display.
Regards,
Raja. -
Report for Material and accounting document
Hi all,
Is there any report to show the fields as listed below:
Mvt type Material Doc Accounting doc Posting date Quantity Ammount
thanks & regards
Chaitanyahi,
You can check with the many reports like MB5B, MB51 etc...as suggested above...
But along with this you can check the table also like MSEG for your requirement... and MKPF for the material document...
Pls check ...
Hope it helps...
Regards
Priyanka.P -
Material and accounting document on same screen
Dear all,
Is there any way to see material document as well as accounting document on same screen??
Thanks
PrabhashHi,
Using T.code mb03 you can see the material document.
In the same screen if you click the accounting document tab, it will take you another screen (T.code FB03). Here you can see the accounting document,profit center document etc.)
Regards,
SDS -
In MIGO two seperate entry for the same Material in Accounting Document
Dear Expert,
Hi
Business is doing stock transfer transaction. Here with reference to stock transfer PO when business is doing Goods Issue.
here there is two stock transfer PO. in one PO there is two line items for the same material. in the second PO again same material with two line items.
but at the tme of Goods issue it is showing two seperate line for same material stock account credit in accounting document. but in the other Goods issue with reference to second PO it is showing only one line for inventory account credit in the accounting dcoument.
so pl. guide me on this.
thanks
H shahHi,
Step 1 : First we create the Stock transfer PO.
Step 2 : Goods issue with ref to above stock transfer PO ( Movement type 351) - MIGO
Step 3 : Goods Receipt with ref to above stock transfer PO ( Movement Type 101 )- MIGO
Thanks
H shah -
Material and accounting document
Dear Friends,
Can you Explain When the Material Document and Accounding
created. How the boths are function in MM Area.
Please Explain Clearly.
Regards,
Rajan.Hello Rajan,
The material document is the documented 'proof' that goods movements have occurred for a Material in a Plant and a Storage Location. It has header data which affects to all items in the document and item data, which is specific for each line. The information that this document contains can hardly be changed (only some informatory fields like the texts can be changed in MB02). If data is wrong, the document must be canceled and re-posted again.
If, as a consequence of this goods movement, there is also a value change in the system, an accounting document is generated automatically to reflect the changes in accounting. This document is automatically posted since the warehouse clerk who registers the goods movement in the storage should not have information about prices and accounts, therefore, the process is automatized to avoid manual errors.
I hope this helps,
Esther -
After cancelling the billing document accounting document not generated
hi,
we released the billing and accounting document generated but customer needed changes in the billing values so we cancel the billing document but accounting document not generated(reversal accounting not happen)....in document flow it shows in cancel document in blocking state ....we try to release in VF02 but it throws the error "Client 200 does not contain an active application area" . but the other sales order we test in qulaity server the scenorio is working fine...............for specific one sales order creating problem now.....
try to solve the issue ..
Thanks
Muthuraman.DDear all,
I have noticed this problem in my company system.
Problem descripion:
- you creates an invoice and the system doesn't post it for any reason
- then you create the cancel of the invoice, BEFORE forcing the posting of the invoice
--> user creates Cancel, Cancel is not posted as well.
--> from now it is impossible to post both invoices: if you try to post the Invoice after the cancel creation, the VF02 recongnise that a CANCEL exists and do not allow for the posting
--> standard VFX3 doesn't signal this kind of not posted documents situation.
Ok, The right procedure for thes user should be: create invoice, if not posted then try to understand why not posted, and not CANCEL it.
But in this case VFK3 was not able to detect the invoice was not posted: it was not in the list.
So the 2 ways must be:
1) one possibility could be undestand in VFX3 could be enhanced: I checked in OSS but I didn't find anything.
2) other possibility: add a further check in interface between SD and FI in order to check if original invoice is not posted to FI and in this case block the cancel creation, as instead standard SAP does.
Could you please give me an idea on how it would be better proceed?
Thank You very much.
Raffaella -
MIRO - Parked document - Accounting document
Dear all,
When parking document with transaction MIRO, I would like that no accounting document is created, just logistic one.
(up to now my research show that when it happens it is likely an error).
Do you think it's possible (user-exit, Badis, ...) ?
Thanks for your help.
Best regards.
Didier GOBLET.Is there any Business reason you want to hide the accounting document.It is not possible not to display accounting document when you park.It will just show you what the the accounting entries gets generated.
-
Link between Material Document number & Accounting document number
Hi All,
For material document there is a corresponding accounting document number generated.However this is not the rule in all cases.
Where is the link between the two(Material Document & Accounting Document) ?
In other words i want to list those material documents only, for which accounting documents are generated.
Regards
Piyush KothariSTEP 1
SAP query way to extract your information.
Create an infoset SQ02 with a single table MKPF. (include key fields in the field group)
Step 2
From Extras
Create an additional field called zawkey (like bkpf-belnr) which will concatenate the MM document number MKPF-MBLNR and MKPF_MJAHR. The sequencing shall be number 1.
You may use this code below and paste also (this needs authorization as well)
data: zzawkey like bkpf-awkey.
clear: zawkey, zzawkey.
concatenate mkpf-mblnr mkpf-mjahr into zzawkey.
zawkey = zzawkey.
Add another field called ACCDOCNO (accounting documnet number) with sequencing number 2 with following code.
data: zaccdocno like bkpf-belnr..
clear: zaccdocno, accdocno.
select belnr from bkpf into zaccdocno where
bukrs = ccode and
GJAHR = MKPF-MJAHR and
awkey = zawkey.
endselect.
accdocno = zaccdocno.
Step 3
Include the additional fields into the field group.
Step 4
Click on the selection tab and create a parameter called ccode with a description Company Code and against
LIKE BKPF-BUKRS
Extras OBLIGATORY
Step 5
Click on the selection tab and create a seelction criteria pdate with a description Posting Date for the field MKPF-BUDAT
Extras OBLIGATORY
Step 6
Save, Generate and assign the infoset to a user group.
Step 6
Create a SQ01 query under the usergroup with all the fields in the infoset. and Execute. Enter a company code and one date of a working day where you expect material transactions.
The result will be all the material documents and their corresponding accounting documents, if available. If you want to see only those material document that do not have corrsponding accounting documnet, then while you are in the selection screen say accounting document number is not equal to blank. -
Accounting Document Number in invoice
Dear all,
just trying to find out, when successfully posted an invoice, some users are able to see both the material and accounting document numbers generated at the status bar, while some can only see the material document number. May i know is there any settings for us to customised in order to view both document numbers at the status bar?
Thanks in advance
YimingHi sudarshan,
In the parameters tab of the user profile, you need to add the value of IVFIDISPLAY in the PARAMETER ID and with a value of X in order to see both the accounting and material document #.
Hope this helps.
Regards
Yiming -
Migo & Miro Accounting Documents Report
Hello Abapers,
I have made the new ALV report as shown below :-
Report zaccounting no standard page heading line-size 300 line-count 40.
tables : mkpf, "Header: Material Document
mseg, "Document Segment: Material
bkpf, "Accounting Document Header
ekbe. "PO History Table
type-pools slis.
*DATA DECLARATION
data : pos type i,
l_layout type slis_layout_alv.
data gt_fieldcat type slis_t_fieldcat_alv.
data gt_sort type slis_t_sortinfo_alv.
data ls_fieldcat type slis_fieldcat_alv.
data is_print type slis_print_alv.
data it_events type slis_alv_event occurs 5.
data gs_variant type disvariant.
data t_list_top_of_page type slis_t_listheader.
data title like sy-title.
data : l_title(105) type c,
l_list(105) type c, "Store the Top-of-page headings
l_date(10) type c, "Store date in top-of-page
l_time(8) type c, "Store time in top-of-page
title1 like sy-title,
title2 like sy-title,
title3 like sy-title.
*-- Data Declaration
data : repid like sy-repid.
constants: x type c value 'X'.
data zawkey like bkpf-awkey.
types : begin of x_mkpf,
mblnr like mkpf-mblnr,
mjahr like mkpf-mjahr,
budat like mkpf-budat,
ebeln like mseg-ebeln,
ebelp like mseg-ebelp,
bwart like mseg-bwart,
matnr like mseg-matnr,
gsber like mseg-gsber,
werks like mseg-werks,
bukrs like bkpf-bukrs,
belnr like bkpf-belnr,
gjahr like bkpf-gjahr,
bukrs1 like bkpf-bukrs,
belnr1 like bkpf-belnr,
gjahr1 like bkpf-gjahr,
belnr2 like bkpf-belnr,
gjahr2 like bkpf-gjahr,
end of x_mkpf.
data : t_mkpf type standard table of x_mkpf with header line.
S E L E C T I O N - S C R E E N *
selection-screen begin of block b1 with frame title text-009.
select-options: s_budat for mkpf-budat obligatory.
select-options: s_bwart for mseg-bwart.
select-options: s_matnr for mseg-matnr.
select-options: s_gsber for mseg-gsber.
select-options: s_werks for mseg-werks.
selection-screen end of block b1.
start-of-selection.
break abapdev1.
select msegmblnr msegmjahr mkpf~budat
msegebeln msegebelp msegbwart msegmatnr mseggsber msegwerks
into table t_mkpf
from mkpf inner join mseg
on mkpfmblnr = msegmblnr
where budat in s_budat
and bwart in s_bwart
and matnr in s_matnr
and gsber in s_gsber
and werks in s_werks.
loop at t_mkpf.
select single belnr gjahr into (t_mkpf-belnr, t_mkpf-gjahr) from ekbe where ebeln = t_mkpf-ebeln
and ebelp = t_mkpf-ebelp
and lfbnr = t_mkpf-mblnr
and lfgja = t_mkpf-mjahr
and bewtp = 'Q'.
modify t_mkpf transporting belnr gjahr.
endloop.
loop at t_mkpf.
clear : zawkey.
concatenate t_mkpf-mblnr t_mkpf-mjahr into zawkey.
select single belnr gjahr into (t_mkpf-belnr1,t_mkpf-gjahr1) from bkpf
where awtyp = 'MKPF'
and awkey = zawkey.
break abapdev1.
clear : zawkey.
concatenate t_mkpf-belnr t_mkpf-gjahr into zawkey.
select single belnr gjahr into (t_mkpf-belnr2,t_mkpf-gjahr2) from bkpf
where awtyp = 'RMRP'
and awkey = zawkey.
modify t_mkpf transporting belnr1 gjahr1 belnr2 gjahr2.
endloop.
ls_fieldcat-col_pos = '1'.
ls_fieldcat-fieldname = 'BUDAT'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'BUDAT'.
ls_fieldcat-ref_tabname = 'MKPF'.
ls_fieldcat-seltext_l = 'PSG DATE'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '2'.
ls_fieldcat-fieldname = 'MBLNR'.
ls_fieldcat-tabname = 'X_MSEG'.
ls_fieldcat-ref_fieldname = 'MBLNR'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'MIGO MAT DOCNO.'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '3'.
ls_fieldcat-fieldname = 'BELNR1'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'BELNR1'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'FI DocNo.'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '4'.
ls_fieldcat-fieldname = 'GJAHR1'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'GJAHR1'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'FI FiscalYr'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '2'.
ls_fieldcat-fieldname = 'MJAHR'.
ls_fieldcat-tabname = 'X_MKPF'.
ls_fieldcat-ref_fieldname = 'MJAHR'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'MIGO MATERIAL DOC. YEAR'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '5'.
ls_fieldcat-fieldname = 'EBELN'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'EBELN'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'PO No.'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '6'.
ls_fieldcat-fieldname = 'EBELP'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'EBELP'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'PO ItemNo.'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '7'.
ls_fieldcat-fieldname = 'BWART'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'BWART'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'Mvt.Type'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '8'.
ls_fieldcat-fieldname = 'BELNR'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'BELNR'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'MIRO DocNo.'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '9'.
ls_fieldcat-fieldname = 'GJAHR'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'GJAHR'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'MIRO FiscalYr'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '10'.
ls_fieldcat-fieldname = 'GSBER'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'GSBER'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'BUS.AREA'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '11'.
ls_fieldcat-fieldname = 'WERKS'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'WERKS'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'PLANT'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '12'.
ls_fieldcat-fieldname = 'MATNR'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'MATNR'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'MAT.NO'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '13'.
ls_fieldcat-fieldname = 'BELNR2'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'BELNR2'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'MIRO FI Doc.No'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
ls_fieldcat-col_pos = '14'.
ls_fieldcat-fieldname = 'GJAHR2'.
ls_fieldcat-tabname = 'T_MSEG'.
ls_fieldcat-ref_fieldname = 'GJAHR2'.
ls_fieldcat-ref_tabname = 'MSEG'.
ls_fieldcat-seltext_l = 'MIRO FI FiscalYr'.
append ls_fieldcat to gt_fieldcat.
clear ls_fieldcat.
*& Form ALV_GRID_DISPLAY
form alv_grid_display .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid " 'ZRD_DD'
it_fieldcat = gt_fieldcat "catalogue field
i_callback_top_of_page = 'TOP_PAGE'
is_layout = l_layout
it_sort = gt_sort
i_default = 'X'
i_save = 'A'
is_variant = gs_variant
it_events = it_events
is_print = is_print
tables
t_outtab = t_mkpf
exceptions
program_error = 1
others = 2
if sy-subrc <> 0.
message id sy-msgid type 'I' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " ALV_GRID_DISPLAY
**& Form ALV_LAYOUT
*FORM alv_layout USING ps_layout TYPE slis_layout_alv.
ps_layout-get_selinfos = x.
ps_layout-colwidth_optimize = x.
ps_layout-detail_popup = x.
ps_layout-no_keyfix = x.
ps_layout-coltab_fieldname = 'CLR'.
ps_layout-key_hotspot = x.
ps_layout-group_change_edit = x.
ps_layout-zebra = 'X'.
*ENDFORM. " ALV_LAYOUT
**& Form ALV_PRINT
*FORM alv_print .
is_print-no_print_selinfos = x. " display no selection infos
is_print-no_coverpage = x.
is_print-no_new_page = x.
is_print-no_print_listinfos = x. " display no listinfos
*ENDFORM. " ALV_PRINT
**& Form TOP_OF_PAGE
form top_page.
data: ls_line type slis_listheader,
i_top_of_page type slis_t_listheader.
title = sy-title.
ls_line-typ = 'H'.
ls_line-info = title.
append ls_line to i_top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = i_top_of_page.
endform. "TOP_OF_PAGE
In this report , i have faced some problems :-
1. In MIGO numbers some cases MIRO doc. numbers are not shown against some migo doc. numbers whereas actually MIRO is already done.
2. The Problem in downloading the report, its not accurate download & the MIGO Document Number not shown when we download the report.
Thanks,
Sumit.Hi Sumit,
Im not sure if it will completely support ur needs but check it out
This is for MIRO.Note here business area is hardcoded.
REPORT zmm_miro_track.
TABLES : rseg, bkpf, bseg, lfa1, ekbe, skat, bsis .
AlV related data declarations
Type Pools
TYPE-POOLS: slis.
CONSTANTS:
gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
Data Declaration file *
DATA : BEGIN OF it_rseg OCCURS 0,
belnr TYPE rseg-belnr,
gjahr TYPE rseg-gjahr,
ebeln TYPE rseg-ebeln,
ebelp TYPE rseg-ebelp,
bukrs TYPE rseg-bukrs,
awkey TYPE bkpf-awkey,
END OF it_rseg.
DATA : BEGIN OF it_bkpf OCCURS 0,
belnr TYPE bkpf-belnr,
gjahr TYPE bkpf-gjahr,
xblnr TYPE bkpf-xblnr,
budat TYPE bkpf-budat,
awkey TYPE bkpf-awkey,
bukrs TYPE bkpf-bukrs,
belnr1 TYPE bkpf-belnr,
blart TYPE bkpf-blart,
END OF it_bkpf.
DATA : BEGIN OF it_bseg OCCURS 0,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
bupla TYPE bseg-bupla,
lifnr TYPE bseg-lifnr,
hkont TYPE bseg-hkont,
koart TYPE bseg-koart,
mwskz TYPE bseg-mwskz,
pswbt TYPE bseg-pswbt,
ebeln TYPE bseg-ebeln,
ebelp TYPE bseg-ebelp,
xref3 TYPE bseg-xref3,
bschl TYPE bseg-bschl,
shkzg TYPE bseg-shkzg,
miro_accnt TYPE bseg-hkont,
xblnr TYPE bkpf-xblnr,
budat TYPE bkpf-budat,
belnr1 TYPE bseg-belnr,
acdes(50),
belnr2 TYPE bseg-belnr,
belnr3 TYPE bseg-belnr,
gjahr1 TYPE bseg-gjahr,
hkont1 TYPE bseg-hkont,
pswbt1 TYPE bseg-pswbt,
budat1 TYPE ekbe-budat,
acdes1(50),
END OF it_bseg.
DATA : it_bseg1 LIKE it_bseg OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF it_bsis OCCURS 0,
belnr TYPE bsis-belnr,
gjahr TYPE bsis-gjahr,
bschl TYPE bsis-bschl,
xref3 TYPE bsis-xref3,
END OF it_bsis.
DATA : BEGIN OF it_lfa1 OCCURS 0,
lifnr TYPE lfa1-lifnr,
name1 TYPE lfa1-name1,
spras TYPE lfa1-spras,
END OF it_lfa1.
DATA : BEGIN OF it_skat OCCURS 0,
saknr TYPE skat-saknr,
txt20 TYPE skat-txt20,
txt50 TYPE skat-txt50,
spras TYPE skat-spras,
ktopl TYPE skat-ktopl,
END OF it_skat.
DATA : BEGIN OF it_ekbe OCCURS 0,
ebeln TYPE ekbe-ebeln,
ebelp TYPE ekbe-ebelp,
budat TYPE ekbe-budat,
bewtp TYPE ekbe-bewtp,
END OF it_ekbe.
DATA : fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_repid LIKE sy-repid.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_layout TYPE slis_layout_alv ,
gs_print TYPE slis_print_alv,
gt_sort TYPE slis_t_sortinfo_alv ,
gt_filter TYPE slis_t_filter_alv,
gt_sp_group TYPE slis_t_sp_group_alv,
gt_alv_graphics TYPE dtc_t_tc,
gt_excluding TYPE slis_t_extab ,
gt_events TYPE slis_t_event .
DATA: g_repid LIKE sy-repid.
DATA: gt_list_top_of_page TYPE slis_t_listheader.
DATA: g_boxnam TYPE slis_fieldname VALUE 'BOX',
p_f2code LIKE sy-ucomm VALUE '&ETA',
p_lignam TYPE slis_fieldname VALUE 'LIGHTS',
g_save(1) TYPE c,
g_default(1) TYPE c,
g_exit(1) TYPE c,
gx_variant LIKE disvariant,
g_variant LIKE disvariant.
USER ENTRY PARAMETERS *
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_belnr FOR rseg-belnr OBLIGATORY,
s_gjahr FOR rseg-gjahr OBLIGATORY,
s_budat FOR bkpf-budat.
SELECTION-SCREEN END OF BLOCK blk1.
START-OF-SELECTION *
START-OF-SELECTION.
PERFORM data_retrive.
PERFORM data_call_alv.
PERFORM build_layout.
END-OF-SELECTION.
*& Form DATA_CALL_ALV
text
--> p1 text
<-- p2 text
FORM data_call_alv .
g_repid = sy-repid.
PERFORM e01_fieldcat_init USING gt_fieldcat[].
PERFORM eventtab_build CHANGING gt_events.
PERFORM e04_comment_build USING gt_list_top_of_page[].
PERFORM display_report.
ENDFORM. " DATA_CALL_ALV
*& Form E01_FIELDCAT_INIT
text
-->P_GT_FIELDCAT[] text
FORM e01_fieldcat_init USING e01_lt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: gs_sort TYPE slis_sortinfo_alv.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BELNR'.
ls_fieldcat-key = 'X'. "SUBTOTAL KEY
ls_fieldcat-col_pos = '1'.
ls_fieldcat-seltext_l = 'Accounting Doc'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BELNR1'.
ls_fieldcat-col_pos = '2'.
ls_fieldcat-seltext_l = 'IR Doc'.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'XBLNR'.
ls_fieldcat-col_pos = '3'.
ls_fieldcat-seltext_l = 'IR Reference'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BUDAT'.
ls_fieldcat-col_pos = '4'.
ls_fieldcat-seltext_l = 'IR Posting Date'.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BUPLA'.
ls_fieldcat-col_pos = '5'.
ls_fieldcat-seltext_l = 'Business Place'.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'HKONT'.
ls_fieldcat-col_pos = '6'.
ls_fieldcat-seltext_l = 'G/L accounts Posted'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ACDES'.
ls_fieldcat-col_pos = '7'.
ls_fieldcat-seltext_l = 'G/L description'.
ls_fieldcat-outputlen = 20.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'MWSKZ'.
ls_fieldcat-col_pos = '8'.
ls_fieldcat-seltext_l = 'Tax Code'.
ls_fieldcat-outputlen = 8.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'PSWBT'.
ls_fieldcat-col_pos = '9'.
ls_fieldcat-seltext_l = 'G/L Amount'.
ls_fieldcat-outputlen = 20.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EBELN'.
ls_fieldcat-col_pos = '10'.
ls_fieldcat-seltext_l = 'Purchase Order'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'EBELP'.
ls_fieldcat-col_pos = '11'.
ls_fieldcat-seltext_l = 'P.O.Line Item'.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BELNR2'.
ls_fieldcat-col_pos = '12'.
ls_fieldcat-seltext_l = 'GRN Doc '.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BELNR3'.
ls_fieldcat-col_pos = '13'.
ls_fieldcat-seltext_l = 'GRN FI Doc No.'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BUDAT1'.
ls_fieldcat-col_pos = '14'.
ls_fieldcat-seltext_l = 'GR Posting Date '.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
ENDFORM. "e01_fieldcat_init
*& Form EVENTTAB_BUILD
text
<--P_GT_EVENTS text
FORM eventtab_build CHANGING lt_events TYPE slis_t_event.
CONSTANTS:
gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.
READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gc_formname_top_of_page TO ls_event-form.
APPEND ls_event TO lt_events.
ENDIF.
ENDFORM. " EVENTTAB_BUILD
*& Form E04_COMMENT_BUILD
text
-->P_GT_LIST_TOP_OF_PAGE[] text
FORM e04_comment_build USING e04_lt_top_of_page TYPE slis_t_listheader.
DATA : v_time(5) TYPE c.
DATA: ls_line TYPE slis_listheader.
DATA: ls_colr TYPE slis_specialcol_alv.
DATA : v_text(90) TYPE c.
CONCATENATE ' Report for MIRO track ':' ' INTO v_text SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = v_text.
APPEND ls_line TO e04_lt_top_of_page.
ENDFORM. " E04_COMMENT_BUILD
FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. "TOP_OF_PAGE
**& Form DATA_RETRIVE
text
FORM data_retrive.
fetching Accounting Document Number and Fiscal year from Incoming Invoice table
SELECT belnr gjahr ebeln ebelp bukrs
INTO CORRESPONDING FIELDS OF TABLE it_rseg
FROM rseg
WHERE belnr IN s_belnr
AND gjahr IN s_gjahr
AND bukrs = '1000'.
LOOP AT it_rseg.
CONCATENATE it_rseg-belnr it_rseg-gjahr INTO it_rseg-awkey.
MODIFY it_rseg.
CLEAR it_rseg.
ENDLOOP.
IF it_rseg[] IS NOT INITIAL.
SELECT belnr gjahr xblnr budat awkey
INTO CORRESPONDING FIELDS OF TABLE it_bkpf
FROM bkpf
FOR ALL ENTRIES IN it_rseg
WHERE awkey = it_rseg-awkey
AND budat IN s_budat
AND bukrs = '1000'
AND blart <> 'ML'.
ENDIF.
IF it_bkpf[] IS NOT INITIAL.
SELECT belnr gjahr bupla lifnr hkont koart mwskz pswbt ebeln ebelp xref3 bschl shkzg
INTO CORRESPONDING FIELDS OF TABLE it_bseg
FROM bseg
FOR ALL ENTRIES IN it_bkpf
WHERE belnr = it_bkpf-belnr
AND gjahr = it_bkpf-gjahr.
ENDIF.
fetching G/L account description
IF it_bseg[] IS NOT INITIAL.
SELECT lifnr name1
INTO CORRESPONDING FIELDS OF TABLE it_lfa1
FROM lfa1
FOR ALL ENTRIES IN it_bseg
WHERE lifnr = it_bseg-lifnr
AND spras = 'EN'.
SELECT saknr txt20 txt50
INTO CORRESPONDING FIELDS OF TABLE it_skat
FROM skat
FOR ALL ENTRIES IN it_bseg
WHERE saknr = it_bseg-hkont
AND spras = 'EN'
AND ktopl = 'HRJL'.
SELECT ebeln ebelp budat
INTO CORRESPONDING FIELDS OF TABLE it_ekbe
FROM ekbe
FOR ALL ENTRIES IN it_bseg
WHERE ebeln = it_bseg-ebeln
AND ebelp = it_bseg-ebelp
AND bewtp = 'E'.
ENDIF.
LOOP AT it_bseg.
IF it_bseg-koart = 'K'.
it_bseg-miro_accnt = it_bseg-lifnr.
ELSE.
it_bseg-miro_accnt = it_bseg-hkont.
ENDIF.
IF it_bseg-shkzg = 'H'.
it_bseg-pswbt = it_bseg-pswbt * -1.
ENDIF.
it_bseg-belnr2 = it_bseg-xref3+4(10).
MODIFY it_bseg.
READ TABLE it_ekbe WITH KEY ebeln = it_bseg-ebeln
ebelp = it_bseg-ebelp.
IF sy-subrc = 0.
it_bseg-budat1 = it_ekbe-budat.
ENDIF.
READ TABLE it_bkpf WITH KEY belnr = it_bseg-belnr
gjahr = it_bseg-gjahr.
IF sy-subrc = 0.
it_bseg-belnr = it_bkpf-belnr.
it_bseg-gjahr = it_bkpf-gjahr.
it_bseg-xblnr = it_bkpf-xblnr.
it_bseg-budat = it_bkpf-budat.
it_bseg-belnr1 = it_bkpf-awkey+0(10).
ENDIF.
IF it_bseg-koart = 'K'.
READ TABLE it_lfa1 WITH KEY lifnr = it_bseg-miro_accnt.
IF sy-subrc = 0.
it_bseg-acdes = it_lfa1-name1.
ENDIF.
ELSE.
READ TABLE it_skat WITH KEY saknr = it_bseg-miro_accnt.
IF sy-subrc = 0.
IF it_skat-txt20 IS NOT INITIAL.
it_bseg-acdes = it_skat-txt20.
ELSE.
it_bseg-acdes = it_skat-txt50.
ENDIF.
ENDIF.
ENDIF.
MODIFY it_bseg.
CLEAR it_bseg.
ENDLOOP.
it_bseg1[] = it_bseg[].
LOOP AT it_bseg1.
IF it_bseg1-xref3 = ''.
DELETE it_bseg1.
CLEAR it_bseg1.
ENDIF.
ENDLOOP.
IF it_bseg1[] IS NOT INITIAL.
SELECT belnr gjahr bschl xref3
FROM bsis
INTO CORRESPONDING FIELDS OF TABLE it_bsis
FOR ALL ENTRIES IN it_bseg1
WHERE xref3 = it_bseg1-xref3
AND gjahr = it_bseg1-gjahr
AND bschl = '96'.
ENDIF.
LOOP AT it_bseg.
READ TABLE it_bsis WITH KEY xref3 = it_bseg-xref3.
IF sy-subrc = 0.
it_bseg-belnr3 = it_bsis-belnr.
it_bseg-gjahr1 = it_bsis-gjahr.
ENDIF.
MODIFY it_bseg.
CLEAR it_bseg.
ENDLOOP.
ENDFORM. "data_retrive
*& Form DISPLAY_REPORT
text
--> p1 text
<-- p2 text
FORM display_report .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = ''
i_callback_program = g_repid
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_special_groups = gt_sp_group[]
it_sort = gt_sort[]
it_filter = gt_filter[]
i_save = g_save
is_variant = g_variant
it_events = gt_events[]
is_print = gs_print
it_alv_graphics = gt_alv_graphics[]
it_excluding = gt_excluding
TABLES
t_outtab = it_bseg.
ENDFORM. " DISPLAY_REPORT
*& Form build_layout
text
--> p1 text
<-- p2 text
FORM build_layout.
gs_layout-no_input = 'X'.
gs_layout-colwidth_optimize = 'X'.
gs_layout-totals_text = 'Totals'(201).
gs_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " BUILD_LAYOUT
This is for MIGO.
REPORT zmm_migo_track.
TABLES : bseg, ekbe, skat, bsis.
AlV related data declarations
Type Pools
TYPE-POOLS: slis.
CONSTANTS:
gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
Data Declaration file *
DATA : BEGIN OF it_bseg OCCURS 0,
belnr TYPE bseg-belnr,
gjahr TYPE bseg-gjahr,
bukrs TYPE bseg-bukrs,
hkont TYPE bseg-hkont,
pswbt TYPE bseg-pswbt,
ebeln TYPE bseg-ebeln,
ebelp TYPE bseg-ebelp,
xref3 TYPE bseg-xref3,
shkzg TYPE bseg-shkzg,
budat TYPE ekbe-budat,
acdes(50),
belnr1 TYPE bseg-belnr,
END OF it_bseg.
DATA : it_bseg1 LIKE it_bseg OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF it_bsis OCCURS 0,
belnr TYPE bsis-belnr,
gjahr TYPE bsis-gjahr,
bschl TYPE bsis-bschl,
xref3 TYPE bsis-xref3,
END OF it_bsis.
DATA : BEGIN OF it_skat OCCURS 0,
saknr TYPE skat-saknr,
txt20 TYPE skat-txt20,
txt50 TYPE skat-txt50,
spras TYPE skat-spras,
ktopl TYPE skat-ktopl,
END OF it_skat.
DATA : BEGIN OF it_ekbe OCCURS 0,
ebeln TYPE ekbe-ebeln,
ebelp TYPE ekbe-ebelp,
budat TYPE ekbe-budat,
bewtp TYPE ekbe-bewtp,
END OF it_ekbe.
DATA : fiscal_year_low(4),
fiscal_year_high(4).
DATA : fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_repid LIKE sy-repid.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
gs_layout TYPE slis_layout_alv ,
gs_print TYPE slis_print_alv,
gt_sort TYPE slis_t_sortinfo_alv ,
gt_filter TYPE slis_t_filter_alv,
gt_sp_group TYPE slis_t_sp_group_alv,
gt_alv_graphics TYPE dtc_t_tc,
gt_excluding TYPE slis_t_extab ,
gt_events TYPE slis_t_event .
DATA: g_repid LIKE sy-repid.
DATA: gt_list_top_of_page TYPE slis_t_listheader.
DATA: g_boxnam TYPE slis_fieldname VALUE 'BOX',
p_f2code LIKE sy-ucomm VALUE '&ETA',
p_lignam TYPE slis_fieldname VALUE 'LIGHTS',
g_save(1) TYPE c,
g_default(1) TYPE c,
g_exit(1) TYPE c,
gx_variant LIKE disvariant,
g_variant LIKE disvariant.
USER ENTRY PARAMETERS *
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_belnr FOR bseg-belnr OBLIGATORY,
s_budat FOR ekbe-budat OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
AT SELECTION-SCREEN.
IF s_budat-low IS NOT INITIAL.
CALL FUNCTION 'GM_GET_FISCAL_YEAR'
EXPORTING
i_date = s_budat-low
i_fyv = 'V3'
IMPORTING
e_fy = fiscal_year_low
EXCEPTIONS
FISCAL_YEAR_DOES_NOT_EXIST = 1
NOT_DEFINED_FOR_DATE = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
IF s_budat-high IS NOT INITIAL.
CALL FUNCTION 'GM_GET_FISCAL_YEAR'
EXPORTING
i_date = s_budat-high
i_fyv = 'V3'
IMPORTING
e_fy = fiscal_year_high
EXCEPTIONS
FISCAL_YEAR_DOES_NOT_EXIST = 1
NOT_DEFINED_FOR_DATE = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
START-OF-SELECTION *
START-OF-SELECTION.
PERFORM data_retrive.
PERFORM data_call_alv.
PERFORM build_layout.
END-OF-SELECTION.
*& Form DATA_CALL_ALV
text
--> p1 text
<-- p2 text
FORM data_call_alv .
g_repid = sy-repid.
PERFORM e01_fieldcat_init USING gt_fieldcat[].
PERFORM eventtab_build CHANGING gt_events.
PERFORM e04_comment_build USING gt_list_top_of_page[].
PERFORM display_report.
ENDFORM. " DATA_CALL_ALV
*& Form E01_FIELDCAT_INIT
text
-->P_GT_FIELDCAT[] text
FORM e01_fieldcat_init USING e01_lt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: gs_sort TYPE slis_sortinfo_alv.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BELNR1'.
ls_fieldcat-col_pos = '1'.
ls_fieldcat-seltext_l = 'GRN Doc '.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BELNR'.
ls_fieldcat-col_pos = '2'.
ls_fieldcat-seltext_l = 'GRN FI Doc No.'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BUDAT'.
ls_fieldcat-col_pos = '3'.
ls_fieldcat-seltext_l = 'GR Posting Date '.
ls_fieldcat-outputlen = 10.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'HKONT'.
ls_fieldcat-col_pos = '4'.
ls_fieldcat-seltext_l = 'Account Assignment'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'ACDES'.
ls_fieldcat-col_pos = '5'.
ls_fieldcat-seltext_l = 'Description'.
ls_fieldcat-outputlen = 20.
APPEND ls_fieldcat TO e01_lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'PSWBT'.
ls_fieldcat-col_pos = '6'.
ls_fieldcat-seltext_l = 'G/L Amount'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO e01_lt_fieldcat.
ENDFORM. "e01_fieldcat_init
*& Form EVENTTAB_BUILD
text
<--P_GT_EVENTS text
FORM eventtab_build CHANGING lt_events TYPE slis_t_event.
CONSTANTS:
gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lt_events.
READ TABLE lt_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE gc_formname_top_of_page TO ls_event-form.
APPEND ls_event TO lt_events.
ENDIF.
ENDFORM. " EVENTTAB_BUILD
*& Form E04_COMMENT_BUILD
text
-->P_GT_LIST_TOP_OF_PAGE[] text
FORM e04_comment_build USING e04_lt_top_of_page TYPE slis_t_listheader.
DATA : v_time(5) TYPE c.
DATA: ls_line TYPE slis_listheader.
DATA: ls_colr TYPE slis_specialcol_alv.
DATA : v_text(90) TYPE c.
CONCATENATE ' Report for MIGO track ':' ' INTO v_text SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = v_text.
APPEND ls_line TO e04_lt_top_of_page.
ENDFORM. " E04_COMMENT_BUILD
FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_list_top_of_page.
ENDFORM. "TOP_OF_PAGE
**& Form DATA_RETRIVE
text
FORM data_retrive.
fetching migo G/L account
IF fiscal_year_high IS NOT INITIAL.
SELECT belnr gjahr hkont pswbt ebeln ebelp xref3 shkzg
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg
WHERE belnr IN s_belnr
AND gjahr BETWEEN fiscal_year_low AND fiscal_year_high
AND bukrs = '1000'.
ELSE.
SELECT belnr gjahr hkont pswbt ebeln ebelp xref3 shkzg
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg
WHERE belnr IN s_belnr
AND gjahr = fiscal_year_low
AND bukrs = '1000'.
ENDIF.
fetching G/L account description
IF it_bseg[] IS NOT INITIAL.
SELECT saknr txt20 txt50
INTO CORRESPONDING FIELDS OF TABLE it_skat
FROM skat
FOR ALL ENTRIES IN it_bseg
WHERE saknr = it_bseg-hkont
AND spras = 'EN'
AND ktopl = 'HRJL'.
SELECT ebeln ebelp budat
INTO CORRESPONDING FIELDS OF TABLE it_ekbe
FROM ekbe
FOR ALL ENTRIES IN it_bseg
WHERE ebeln = it_bseg-ebeln
AND ebelp = it_bseg-ebelp
AND bewtp = 'E'.
ENDIF.
LOOP AT it_bseg.
IF it_bseg-shkzg = 'H'.
it_bseg-pswbt = it_bseg-pswbt * -1.
ENDIF.
MODIFY it_bseg.
READ TABLE it_ekbe WITH KEY ebeln = it_bseg-ebeln
ebelp = it_bseg-ebelp.
IF sy-subrc = 0.
it_bseg-budat = it_ekbe-budat.
ENDIF.
READ TABLE it_skat WITH KEY saknr = it_bseg-hkont.
IF sy-subrc = 0.
IF it_skat-txt20 IS NOT INITIAL.
it_bseg-acdes = it_skat-txt20.
ELSE.
it_bseg-acdes = it_skat-txt50.
ENDIF.
ENDIF.
MODIFY it_bseg.
CLEAR it_bseg.
ENDLOOP.
it_bseg1[] = it_bseg[].
LOOP AT it_bseg1.
IF it_bseg1-xref3 = ''.
DELETE it_bseg1.
CLEAR it_bseg1.
ENDIF.
ENDLOOP.
LOOP AT it_bseg.
READ TABLE it_bseg1 WITH KEY belnr = it_bseg-belnr.
IF sy-subrc = 0.
it_bseg-belnr1 = it_bseg1-xref3+4(10).
it_bseg-xref3 = it_bseg1-xref3.
ENDIF.
MODIFY it_bseg.
CLEAR it_bseg.
ENDLOOP.
ENDFORM. "data_retrive
*& Form DISPLAY_REPORT
text
--> p1 text
<-- p2 text
FORM display_report .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = ''
i_callback_program = g_repid
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_special_groups = gt_sp_group[]
it_sort = gt_sort[]
it_filter = gt_filter[]
i_save = g_save
is_variant = g_variant
it_events = gt_events[]
is_print = gs_print
it_alv_graphics = gt_alv_graphics[]
it_excluding = gt_excluding
TABLES
t_outtab = it_bseg.
ENDFORM. " DISPLAY_REPORT
*& Form build_layout
text
--> p1 text
<-- p2 text
FORM build_layout.
gs_layout-no_input = 'X'.
gs_layout-colwidth_optimize = 'X'.
gs_layout-totals_text = 'Totals'(201).
gs_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " BUILD_LAYOUT -
SD - Accounting document line items are generating for each item
Hi all of you,
We have done account determination for SD. Accounting documents are also generating, but with in the invoice accounting document, number of line items are generating for each item with in the sales order, standard invoice type is F2 like -
Item 001 - X Material
Item 002 - Y Material
Item 003 - Z Material
The accounting document is -
Line Item 001 - Customer Ac Dr
Line Item 002 - Discount A/c Dr
Line Item 003 - Sales revenue
Line Item 004 - Discount A/c Dr
Line Item 005 - Sales Revenue
Line Item 006 - Discount A/c Dr
Line Item 007 - Sales revenue
Line Item 008 - VAT
Even, in my experience I did not find this type of entry and the sales revenue and discount accounts are same with in the COA and is posted with in the plant.
Please give me your valuable suggestion to rectify the above issue.
Regards,
Ramki
Edited by: Ramki on Nov 5, 2009 10:06 AMDear Ramki,
This is SAP Standard. System generates Accounting document line item for each Line items in Invoice.
This is standard & also required bacuase say you have different Material types in single Invoice (e.g.Material & Service items, Trading Goods, etc). The valuation class assigned to these Material Types may be different & you might want to post revenues from these Line items in different GL Accounts.
Hope this helps. .
Thanks,
Jignesh mehta -
Accounting document during MIGO or MIRO
hi
all an accounting document is generated ,when it is generated during MIRO or MIGO ?
can we able to view these in MB51 ?
Regards
Leo Thilak.MSHi,
While posting stock posting movement in MIGO - accounting document has generated .
You can view the material document in t.code MB51 - Material document for a material
MR51- Accounting document for a material
MBAL -Archieved material document
MBSM-Cancelled Material document
MB03- Material document list
MIRO- accounting document posting
All the stock update in your plant accounting document has generated except 101K, 541, etc
FB03 - There choose List option, you can view the accounting document for the MIRO posting by select document type RE-Invoice
Fiscal year, Material etc
Thanks,
Thiru
Edited by: thiru on Jan 18, 2011 11:33 AM -
Accounting documents qestion from VF03 customer billing
Hi
I am from SD back ground. Please some one can guide us how the accouting documents are creating automatically from customer invoice -
>list of document in accouting -?
1) accouting document
2)profit center doc
3)controlling doc
4)profitability analysys doc
5)special purpose ledger doc.
i know first one accounting doc from accout determination while posting to G/L account.But some one with sales/AR back groung experts give me complete details.
Please try to answer the question only and any links or any documentation.
Thanks
KrisWhen you post any Billing document and customer invoice in SD the GL account assigned in SD for Sales and Cost of sales and Customer and Stocks are posted according to the Billing document and Sale order calculations
now as soon as a FI document ( accounting Document) is posted there are some documents known as
Controlling document , Profit center document and COPA document and Profit center accounting document
are automatically created based on the configuration done by the FI consultant
so it flows from the GL posting to Profitability and special purpose ledger posting automatically once a billing document and invoice is posted
Regards -
ACCOUNT DOCUMENT NOT GENARATED
WHILE CREATING BILLING DOCUMENT ACCOUNT DOCUMENT NOT GENARATED
hi,
in vf02 click on teh green flag to release to accnting. if there is an erro the system will tell. altenatively click the icn nxt to the green flag it will show u which cond was posted and how and which was not and why not. maintin the data in vkoa, ob40.
saurabh
Maybe you are looking for
-
Workflow, How to make the attached SAP shortcut linked to a webgui t-code ?
How to make the attached SAP shortcut linked to the webgui ? (Instead of the SAP Gui ) When I received a "workflow msg" in my outlook inbox, I clicked on the attached shortcut. And a logon pop-up comes to me, in order that I logon to SAP in the SAPGu
-
How to retrieve DB package from JDev custom context menu
Hi everyboby, I have a question, sorry in advance if it sounds dumb . In my JDev project I declaratively added a context menu to a database package (<folder type="PACKAGE">...) . It's to say when log in to a DB and you click on a package you can see
-
[Bindable] causes compilation errors (definition not found) ?
I'm trying to build a simple actionscript project, where an embedded gif is moving around the screen. Without the [Bindable] tag it works fine, with [Bindable] it throws: 1172: Definition mx.binding:BindingManager could not be found. hello2.as hello2
-
Point to point wireless connectivity
Can I use Cisco AP 1240 for a point to point connectivity of 2 sites having a distance of approx 2 km
-
Doubled entries after transport
Hi, We decided to make some modification in DEV (delete and recreate new KPIs, delete and recreate new metrics sets). After Transport to QUAL, Some entries are doubled (twice the same KPIs linked to a objective, metric sets doubled...). We checked in