List Display of Blocked invoices
Hi Friends,
Is there a transaction to just display all the blocked invoices (Other than MRBR).
I mean not for "Parked". But just to display "Blocked" invoices???
Thanks in advance,
Vamsi
Ooops!!,
I found the answer from standard (any) transaction with dynamic selection!!!
Thanks,
Similar Messages
-
Message no. M8657, The list of blocked invoices is incomplete
Hi Experts,
The MRBR report is processed to list all invoices in Release block, however it is in-complete and SAP displays an information message to alert this.
This means that there are blocked invoices in SAP that users are unaware of and this could result in invoices being paid late.
Can you let me know why MRBR doesn't list all invoices in Release block and what action needs to be taken to rectify this.
We are facing this probelm in ECC 6.0
Can you please look into this and confirm why this is happening.
Many thanks
VikasHi Vikas,
You can probably have a look at OSS note: Note 777367 - MRBR: Job terminates.
Symptom
You define a background processing job in several processing steps for the report RM08RELEASE. If no list is created during the first step, the system terminates the job, even though there are still more steps to be carried out.
Kind Regards,
Prakash -
The list of blocked invoices is incomplete
Hello,
I have encountered a situation when running T-code MRBR to list all blocked invoice however get one message as below:
The list of blocked invoices is incomplete
Message no. M8 657
Kindly suggest us why So.
Regards:
Tata Reddy> The list of blocked invoices is incomplete
> Message no. M8 657
If No Invoice is Blocked Stocastically then only you will get this Message.
Please Select Proper Blocking Procedure.
You Can Select
Blocked Due to Variance
Manual Payment Block
If You Select Stocastically Block Option System will show the List if Docuemnts are Stocastically Blocked Otherwise it will throw an error. -
Block list display when report is executed in background?
Hello all,
when i execute the report program in foreground ,output is displayed as block list with two blocks say success table and failure table.
when i execute the same report program in background, i could see only a single block which is success table. Why is this?
Thanks,
Sindhu.Did you check all the pages in spool? If the report has a output which runs multiple pages, then spool might not display everything unless you change the setting to display more than certain pages. Kindly check the same.
-
I want to display cacelled verified invoice list
I want a transaction, which will display cacelled verified invoice list.
You can get a list of the cancelled documents through fb03, in the document
type enter the document type used when cancelling, if you are not sure what the
document type is just do a look up in the document type field or check in oba7
plz assign points if helpfull -
Hi Friends,
How can I add blocks dynamically depending on different vendor. please can you tell any1 how to add blocks dynamically to the list in block list.and I dont know how many blocks can be there....as it depends on vendors they give in selection screen.......................
Depending on the vendor I have to create different block.
Please revert back......
requirement is to display the debitnote report. if more vendors are given in selection screen then i have to display the blocks different for different vendors..................
Thanks in Advance...................please revert its urgent............You should do this way
DATA: SORT TYPE SLIS_SORTINFO_ALV,
IT_SORT TYPE SLIS_T_SORTINFO_ALV.
SORT-FIELDNAME = 'VBELN'.
SORT-SPOS = '1'.
SORT-GROUP = '*'.
SORT-UP = 'X'.
APPEND SORT TO IT_SORT.
if you do this way it will dynamically do block display based on the field you sepecify.
Still if you face problem you check this sample code
REPORT ZALV_LIST_SUBTOTAL .
type-pools: slis.
data: f_fldcat type slis_fieldcat_alv,
t_fldcat type slis_t_fieldcat_alv,
l_layout type slis_layout_alv,
f_event type slis_alv_event,
t_event type slis_t_event.
data: begin of itab occurs 0,
vbeln like vbap-vbeln,
posnr like vbap-posnr,
zmeng like vbap-zmeng,
text(35),
end of itab.
select vbeln posnr zmeng from vbap
into table itab up to 20 rows.
loop at itab.
itab-zmeng = sy-tabix.
modify itab index sy-TABIX.
endloop.
f_fldcat-fieldname = 'text'.
f_fldcat-col_pos = 1.
f_fldcat-outputlen = 15.
*f_fldcat-checkbox = 'X'.
*f_fldcat-edit = ''.
append f_fldcat to t_fldcat.
clear f_fldcat.
f_fldcat-fieldname = 'VBELN'.
f_fldcat-taBname = 'itab'.
f_fldcat-seltext_l = 'VBELN'.
f_fldcat-col_pos = 2.
f_fldcat-outputlen = 30.
f_fldcat-just = 'C'.
f_fldcat-edit = 'X'.
append f_fldcat to t_fldcat.
clear f_fldcat.
f_fldcat-fieldname = 'POSNR'.
f_fldcat-tabname = 'itab'.
f_fldcat-seltext_l = 'POSNR'.
f_fldcat-col_pos = 3.
f_fldcat-edit = 'X'.
append f_fldcat to t_fldcat.
clear f_fldcat.
f_fldcat-fieldname = 'ZMENG'.
f_fldcat-tabname = 'itab'.
f_fldcat-seltext_l = 'ZMENG'.
f_fldcat-col_pos = 4.
f_fldcat-edit = 'X'.
f_fldcat-do_sum = 'X'.
append f_fldcat to t_fldcat.
clear f_fldcat.
DATA: SORT TYPE SLIS_SORTINFO_ALV,
IT_SORT TYPE SLIS_T_SORTINFO_ALV.
SORT-FIELDNAME = 'VBELN'.
SORT-SPOS = '1'.
SORT-GROUP = '*'.
SORT-UP = 'X'.
SORT-SUBTOT = 'X'.
*SORT-OBLIGATORY = 'UL'.
APPEND SORT TO IT_SORT.
l_layout-TOTALS_TEXT = 'total text'.
l_layout-SUBTOTALS_TEXT = 'subtotal text'.
*l_layout-totals_only = 'X'.
data: prg type sy-repid.
prg = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = SY-REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_STRUCTURE_NAME =
IS_LAYOUT = L_LAYOUT
IT_FIELDCAT = T_FLDCAT
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT[]
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
IT_EVENTS = T_EVENT
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITAB
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
ME2N - PO List Display Items Received not Invoiced
Hello Experts
In ME2N how to display PO List items received not invoiced ?
Is that the meaning is to display PO list items received but not invoiced. if that is the case how to get this list in ME2N. I have created the variants and delivered in ME2N. But this one i didnt understand proerly. Please guide me.
Thanks in advance .. Points are awaiting for you.
Meenakshi.NIn a PO when you close all the major nodes, you would see three major nodes,
a) header
b) item overview
c) item
Open the item and look for purchase order history tab to tell you if there are any transaction posted to it. -
Displaying Average of Columns in ALV Blocked List Display
Hi,
I am using ALV Blocked List Display. For the 1st block, I need to display the average of certain columns.
I am using the following code in the field catalog of the RATE column to display the average , but it is not displayed.
wa_disptab_field-col_pos = 8.
wa_disptab_field-fieldname = 'RATE''.
wa_disptab_field-ref_tabname = 'IT_DISPTAB'.
wa_disptab_field-seltext_m = 'RS PER KL'.
wa_disptab_field-do_sum = 'C'.
wa_disptab_field-datatype = 'QUAN'.
append wa_disptab_field to it_disptab_field.
clear wa_disptab_field.
For the same column, the sum is displayed with the same code if I change this part:
wa_disptab_field-do_sum = 'C'. To wa_disptab_field-do_sum = 'X'.
Please Help..Hi Debarati,
go For function/pattern [reuse_alv_grid_display_lvc]
do the following as mentioned in the previous reply's.
And To find the Average of your requirement, pass the field names as per the requirement.
gs_sort-fieldname = 'RATE'.
gs_sort-tabname = 'T_DISPTAB' "Final Internal table
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
gs_sort-fieldname = 'RATE1'.
gs_sort-tabname = 'T_DISPTAB' "Final Internal table
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
gs_sort-fieldname = 'RATE2'.
gs_sort-tabname = 'T_DISPTAB' "Final Internal table
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
gs_sort-fieldname = 'RATE3'.
gs_sort-tabname = 'T_DISPTAB' "Final Internal table
gs_sort-subtot = 'X'.
APPEND gs_sort TO gt_sort.
CALL FUNCTION ' REUSE_ALV_GRID_DISPLAY_lvc'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = wa_disptab
it_events = gt_events
it_sort = gt_sort
i_default = 'X'
i_save = 'U'
TABLES
t_outtab = gt_final
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i think this will workout.
Thanks & Regards,
Abhisek
Edited by: Abhisek Pradhan on Sep 29, 2011 7:55 PM -
Hierarchial and blocked list displays
Hi friends,
when do we opt for hierachial list display and when do we opt for blocked list display?Hi Suresh,
Blocked ALV displays the data in blocks together in output. e.g. suppose you want to dsplay the data of header & item level. Then you candisplay the data of header records in first block & Item level data in another block on same output screen.
For hierarchical ALV check the below link
http://help.sap.com/saphelp_nw2004s/helpdata/en/6e/4e2941fa918739e10000000a1550b0/frameset.htm
& check this link also:
A new approach to ALV Programming
Hope this will help.
Regards,
Nitin. -
List of blocked invoices purchase group wise
Hi experts
Any standard reports available for blocked invoices purchase group wise ? Wht is the Tcode for that?Hi,
Check the Table RBKP_BLOCKED -
Header is not coming in alv list display- urgent
hi all,
i am sending my code below....
my requirement is in selection screen i have 4 radio buttons . if i click 1 radio button it will duiisplay data and and its header. report is working fine. my requirement id when i click r_mssng radio button(missing radio button) it is showing data correctsly. here i want to show header as 'Missing details report'.
this is not coming in my report. anybody can suggest me.
i am sending my code below....
report zvra0001ftb13 message-id zv.
Confidential and Proprietary
* Celestica Corporation
* All Rights Reserved
*ABAP Name: ZVRA0001FTB13
*Created by: Srinivasa Chakravarthi
*Created on: 26/03/2003
*SAP Version: 4.6 C
*Description: This report displays details of foreign trades
and EHS based on the deliveries made to the outside
countries.
*Input: Selection Screen Criteria includes country of
origin,Company code, Sales Organisation,
Ship-to-party, Sold-to-paarty, Goods movement date,
Invoice number, Invoice type, Material , Material
Type, Exporter ID, Province of origin.
*Output: ALV output that contains Mode of Transport, Export
HS number, Commodity Description, Quantity, UOM,
Value, Country of Destination, Goods Origin
*Dependency: Nil
*Modification Log:
*CR# Date Coded Transport Description
*====== ======== ========= ============= ===============================
*5147 26/03/2003 Srinivas ED1K922286 New Development
*8700 02/11/2004 H.Arular ED1K938380 To check if entries of Comm
Code(HS code)is less than 8
digits and give a warning
message.
*18684 25/07/2007 MAHEEDHAR Merge the logic from report
ZVRA0001FTB13_ERROR into
report ZVRA0001FTB13 and
added two radio buttons
called missing data and non
missing data, addedc logic
accoriding to the radio
buttons.
*Declaring Tables.
tables: likp, "Delivery document Header
lips, "Delivery Document Item
vbfa, "Sales document Flow
bkpf, "Accounting Document Header
eikp, "Foreign Trade:Export/Import Data
eipo, "Foreign Trade:Export/ Import
"Header data
t618t, "Forein Trade:Mode of Transport
"Description
t604t, "Foreign Trade: Commodity Code/
"Import Code number Description.
mara, "Material master data.
t005, "Countries
t001, "Company Codes
tvko, "Sales Organisations
kna1, "Customer Master
t003, "Document types
t134, "Material types
tvfk,
konv,
vbrk.
constants : c_rep like vbrk-fkart value 'YGFB',
c_for(10) value 'Foreign'.
*Decalre Type pool for ALV
type-pools: slis.
*Type declaration for LIKP.
types: begin of t_data1,
vbeln like likp-vbeln, "Delivery
kunnr like likp-kunnr,
end of t_data1.
*Type declaration for LIPS,VBFA.
types: begin of t_data2,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
vbelv like vbfa-vbelv, "Preceding SD document
posnv like vbfa-posnv, "Preceding item of SD document
matnr like lips-matnr, "Material Number
meins like lips-meins, "Base unit of measure
lfimg like lips-lfimg, "Actual Quantity Delivered
mtart like mara-mtart,
end of t_data2.
**Type declaration for BKPF.
*types: begin of t_data3,
belnr like bkpf-belnr, "Accounting Documnet number
bukrs like bkpf-bukrs, "Company Code
end of t_data3.
*Type declaration for BKPF.
types: begin of t_data3,
vbeln like vbrk-belnr, " Billing Doc
fkart like vbrk-fkart,
land1 like vbrk-land1,
end of t_data3.
*Type declaration for EIPO.
types: begin of t_data4,
vbeln like lips-vbeln, "Delivery
posnr like lips-posnr, "Delivery Item
matnr like vbrp-matnr,
fkimg like vbrp-fkimg,
meins like vbrp-meins,
verld like eipo-verld, "Country of dispatch for Foreign
"trade
herkl like eipo-herkl, "Country of origin of material
grwrt like eipo-grwrt, "Statistical value for Foreign
" trade
stawn like eipo-stawn, "Commodity code for foreign trade
expvz like eikp-expvz, "Mode of transport for foreign
"trade
end of t_data4.
*Type declaration for T618T.
types: begin of t_data5,
land1 like t618t-land1, "Country key
expvz like t618t-expvz, "Mode of Transport
bezei like t618t-bezei, "Description
end of t_data5.
*Type declaration for T604T.
types: begin of t_data6,
land1 like t604t-land1, "Country key
stawn like t604t-stawn, "Commodity Code
text1 like t604t-text1, "Description
end of t_data6.
*Type declaration for T604T.
types: begin of t_mara,
matnr like mara-matnr,
end of t_mara.
types : begin of rep_val,
vbelv like vbfa-vbelv,
posnv like vbfa-posnv,
vbeln like vbfa-vbeln,
posnn like vbfa-posnn,
uepos like vbap-uepos,
posnr like vbap-posnr,
netwr like vbap-netwr,
end of rep_val.
types : begin of t_price,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
knumv like konv-knumv,
kposn like konv-kposn,
kbetr like konv-kbetr,
kpein like konv-kpein,
end of t_price.
data : t_sord type rep_val occurs 0 with header line.
data : t_dord type rep_val occurs 0 with header line.
data : t_rord type rep_val occurs 0 with header line.
data : t_hord type rep_val occurs 0 with header line.
data : t_ford type rep_val occurs 0 with header line.
data : i_price type t_price occurs 0 with header line.
data : i_price1 type t_price occurs 0 with header line.
data : i_mara type t_mara occurs 0 with header line.
data : i_sort type slis_t_sortinfo_alv.
DATA: t_layout TYPE slis_layout_alv.
*Declaring Selection screen.
selection-screen begin of block b1 with frame title text-101.
select-options:
s_verld for eipo-verld, "Country of Dest.
s_bukrs for bkpf-bukrs, "Company code
s_vkorg for likp-vkorg, "Sales Organisation
s_kunnr for likp-kunnr, "Ship-to-Party
s_kunag for likp-kunag, "Sold-to-party
s_wadat for likp-wadat_ist, "Goods Movement date
s_belnr for vbrk-vbeln, "Invoice number
s_blart for vbrk-fkart. "Invoice type.
selection-screen end of block b1.
selection-screen begin of block b2 with frame title text-101.
select-options:
s_matnr for mara-matnr, "Material
s_mtart for mara-mtart. "Material Type
selection-screen end of block b2.
selection-screen begin of block b3 with frame title text-101.
parameters:
p_export(30) type c default '1366770724RM' obligatory , "Exporter ID
p_provi(30) type c default 'ONTARIO' obligatory ,
p_sumid(30) type c default 'SUM0704'.
"Province of Origin
selection-screen end of block b3.
selection-screen begin of block b4 with frame title text-104.
parameters:
r_summ radiobutton group zsum,
r_dets radiobutton group zsum,
r_mssng radiobutton group zsum, " maheedhar
R_NMSNG RADIOBUTTON GROUP ZSUM. " MAHEEDHAR
selection-screen skip.
parameter : p_sum as checkbox .
selection-screen end of block b4.
selection-screen begin of block b5 with frame title text-105.
select-options : s_i_kun for likp-kunnr.
selection-screen end of block b5.
*Data Declaration
data: i_fieldcat type slis_t_fieldcat_alv.
data: l_fieldcat type slis_fieldcat_alv .
data: v_lin type i.
data: v_lfstk type c value 'C'.
data: v_vbtyp type c value 'U'.
data: i_data1 type t_data1 occurs 0 with header line.
data : begin of t_T005t occurs 0.
include structure t005t.
data : end of t_t005t.
data: i_data2 type t_data2 occurs 0 with header line.
data: t_delv type t_data2 occurs 0 with header line.
data: t_bild type t_data2 occurs 0 with header line.
data: i_data3 type t_data3 occurs 0 with header line.
data: i_data4 type t_data4 occurs 0 with header line.
data: i_data5 type t_data5 occurs 0 with header line.
data: i_data6 type t_data6 occurs 0 with header line.
*Declare Internal table for ALV output.
data: begin of i_output occurs 0,
belnr like vbrk-vbeln,
posnr like vbrp-posnr,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
strlen, "ED1K938380
end of i_output.
maheedhar-start.
data : i_output1 like i_output occurs 0 with header line,
i_output2 like i_output occurs 0 with header line.
maheedhar-end
data : buff_out like i_output occurs 0 with header line.
data: begin of t_outsum occurs 0,
bezei like t618t-bezei,
stawn like eipo-stawn,
text1 like t604t-text1,
quantity type p decimals 2,
meins like lips-meins,
value type p decimals 2,
verld like t_t005t-landx,
herkl like t_t005t-landx,
end of t_outsum.
data : v_ans.
data : variante LIKE disvariant.
data : v_repid LIKE sy-repid.
data : wa_listheader TYPE slis_listheader.
data : t_listheader TYPE slis_t_listheader.
data : b_text(250).
data: evntS type slis_t_event with header line. " MAHEEDHAR
EVENT AT SELECTION-SCREEN
at selection-screen.
*For Autorisation check
perform authorisation_check.
Validation of Selection screen
perform check_entry.
EVENT START-OF-SELECTION
start-of-selection.
*Get data
perform select_data.
**For calling ALV function modules
MAHEEDHAR - START
if r_mssng eq 'X'.
DELETE I_OUTPUT WHERE BEZEI NE SPACE AND
STAWN NE SPACE AND
HERKL NE SPACE AND
VERLD NE SPACE.
DESCRIBE TABLE I_OUTPUT LINES V_LIN.
IF V_LIN > 0.
PERFORM DISPLAY_OUTPUT.
ELSE.
MESSAGE E000 WITH TEXT-130.
ENDIF.
elseif R_SUMM eq 'X' OR R_DETS EQ 'X'. "ENDIF. " MAHEEDHAR
MAHEEDHAR-END
describe table i_output lines v_lin.
if v_lin > 0.
buff_out[] = i_output[].
Begin of ED1K938380
delete buff_out where stawn ne space or "ED1K938380
verld eq space or
herkl eq space.
delete buff_out where strlen ne 'X' or
verld eq space or
herkl eq space.
End of ED1K938380
describe table buff_out lines v_lin.
Lines with no commodity code exists.
if v_lin gt 0.
concatenate text-902 text-903 into b_text.
concatenate text-906 text-907 into b_text. "ED1K938380
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = Text-901
TEXT_QUESTION = b_text
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'
DEFAULT_BUTTON = '2'
IMPORTING
ANSWER = v_ans.
if v_ans eq '1'.
perform display_output.
endif.
else.
perform display_output.
endif.
else. " MAHEEDHAR
message e000 with text-130.
endif.
MAHEEDHAR-START
*"-- If non missing details radiobutton is selected
elseif r_nmsng = 'X'.
*"-- move data from i_output to i_output1.
i_output1[] = i_output[].
sort i_output by belnr.
sort i_output1 by belnr.
*"-- to get missing data
delete i_output1 where bezei ne space and
stawn ne space and
herkl ne space and
verld ne space.
loop at i_output.
*"-- compare two int tables with respective document number
read table i_output1 with key belnr = i_output-belnr.
if sy-subrc ne 0.
move-corresponding i_output to i_output2.
append i_output2.
clear i_output2.
endif.
endloop.
describe table i_output2 lines v_lin.
if v_lin gt 0.
perform display_output.
else.
message e000 with text-130.
endif.
MAHEEDHAR-END.
ENDIF. " MAHEEDHAR
FORM SELECT_DATA *
form select_data.
Data:l_strlen type i. "ED1K938380
*Get details from LIKP.
if s_i_kun[] is initial.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' .
else.
select likpvbeln likpkunnr
into corresponding fields of table i_data1
from likp
inner join vbuk on likpvbeln = vbukvbeln
where
( ( likp~vkorg in s_vkorg and
likp~kunnr in s_kunnr and
likp~kunag in s_kunag and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' )
or
likp~kunnr in s_i_kun and
likp~wadat_ist in s_wadat and
vbuk~wbstk = 'C' ) .
endif.
if sy-subrc ne 0.
message e000 with text-200.
endif.
*Get details from table LIPS
select lips~vbeln
lips~posnr
vbfa~vbeln
vbfa~posnn
lips~matnr
lips~meins
lips~lfimg
mara~mtart
from lips
inner join vbfa on vbfavbelv = lipsvbeln
and vbfaposnv = lipsposnr
inner join mara on maramatnr = lipsmatnr
into table i_data2
for all entries in i_data1
where
lips~vbeln = i_data1-vbeln and
lips~matnr in s_matnr and
vbfa~vbeln in s_belnr and
mara~mtart in s_mtart and
vbfa~vbtyp_n = 'U'.
if sy-subrc ne 0.
message e000 with text-201.
endif.
t_delv[] = i_data2[].
t_bild[] = i_data2[].
sort t_delv by vbeln.
delete adjacent duplicates from t_delv comparing vbeln.
sort t_bild by vbeln ascending vbelv descending.
delete adjacent duplicates from t_bild comparing vbeln.
*Get details of Accounting document number
select vbeln fkart land1 from vbrk
into table i_data3
for all entries in t_bild
where vbeln = t_bild-vbelv and
bukrs in s_bukrs and
fkart in s_blart and
vkorg in s_vkorg and " MAHEEDHAR
land1 in s_verld. " MAHEEDHAR
sort i_data3.
*Get details from EIPO.
select vbrp~vbeln
vbrp~posnr
vbrp~matnr
vbrp~fkimg
vbrp~meins
eipo~verld
eipo~herkl
eipo~grwrt
eipo~stawn
eikp~expvz
from eikp
inner join vbrp on vbrp~vbeln = eikp~refnr
inner join eipo on eikp~exnum = eipo~exnum
and eipo~expos = vbrp~posnr
into table i_data4 for all entries in i_data3
where vbrp~vbeln = i_data3-vbeln.
eipo~verld in s_verld.
if sy-subrc ne 0.
message e000 with text-201.
endif.
IF R_MSSNG NE 'X' or r_nmsng = 'X'. " MAHEEDHAR
perform get_price.
ENDIF. " MAHEEDHAR
Get details from T618T.
select land1
expvz
bezei
from t618t
into table i_data5
for all entries in i_data4
where
land1 = 'CA' and " Getting for Canada only
expvz = i_data4-expvz and
spras = sy-langu.
select matnr from mara into table i_mara where matnr in s_matnr
and mtart in s_mtart.
Get details from T604T.
select land1
stawn
text1
from t604t
into table i_data6
for all entries in i_data4
where
land1 = i_data4-VERLD and
stawn = i_data4-stawn and
spras = sy-langu.
select * from T005t into table t_T005t where spras = sy-langu.
loop at i_data3.
loop at i_data4 where vbeln eq i_data3-vbeln.
clear : i_data1, i_data2.
read table i_data2 with key vbelv = i_data4-vbeln
posnv = i_data4-posnr.
read table i_data1 with key vbeln = i_data2-vbeln.
if not s_i_kun[] is initial.
check ( ( i_data1-kunnr in s_i_kun ) or
( i_data3-land1 in s_verld ) ).
else.
check i_data3-land1 in s_verld .
endif.
read table i_mara with key matnr = i_data4-matnr.
if sy-subrc eq 0.
read table i_data5 with key expvz = i_data4-expvz .
land1 = i_data3-land1.
read table i_data6 with key stawn = i_data4-stawn
land1 = i_data4-VERLD.
move i_data4-vbeln to i_output-belnr.
move i_data4-posnr to i_output-posnr.
move i_data5-bezei to i_output-bezei.
move i_data6-text1 to i_output-text1.
Begin of ED1K938380.
l_strlen = strlen( i_data4-stawn ).
if l_strlen < 8.
move 'X' to i_output-strlen.
endif.
End of ED1K938380.
move i_data4-stawn to i_output-stawn.
move i_data4-meins to i_output-meins.
read table t_T005t with key land1 = i_data3-land1.
move t_t005t-landx to i_output-verld.
if p_sum eq space.
if i_data4-herkl ne 'CA'.
i_output-herkl = c_for.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
else.
read table t_T005t with key land1 = i_data4-herkl.
move t_t005t-landx to i_output-herkl.
endif.
move i_data4-fkimg to i_output-quantity.
if i_data3-fkart eq c_rep.
read table t_dord with key vbeln = i_data4-vbeln
posnn = i_data4-posnr.
if sy-subrc eq 0.
read table t_sord with key vbeln = t_dord-vbelv
posnn = t_dord-posnv.
if sy-subrc eq 0.
read table t_hord with key vbeln = t_sord-vbelv
posnr = t_sord-posnv.
if sy-subrc eq 0.
read table t_ford with key vbeln = t_hord-vbeln
posnr = t_hord-uepos.
if sy-subrc eq 0.
read table i_price with key vbeln = t_ford-vbeln
posnr = t_ford-posnr.
if sy-subrc eq 0.
read table i_price1 with key knumv = i_price-knumv
kposn = t_ford-posnr.
if sy-subrc eq 0.
if i_price1-kpein ne 0.
i_output-value =
( i_price1-kbetr / i_price1-kpein ) *
i_data4-fkimg.
endif.
endif.
endif.
endif.
endif.
endif.
endif.
else.
move i_data4-grwrt to i_output-value.
endif.
append i_output.
clear i_output.
clear : i_data5, i_data6.
endif.
endloop.
endloop.
sort i_output by verld herkl bezei stawn.
endform.
FORM DISPLAY_OUTPUT *
This form is to create the ALV output
form display_output.
data: xevents type slis_t_event,
ls_event type slis_alv_event,
slis_ev_top_of_page type slis_formname value 'TOP_OF_PAGE',
slis_ev_end_of_list type slis_formname value 'END_OF_LIST'.
*Call Function 'REUSE_ALV_EVENTS' for top of page
call function 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = xevents
EXCEPTIONS
list_type_wrong = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
read table xevents with key name = slis_ev_top_of_page
into ls_event.
if sy-subrc = 0.
move slis_ev_top_of_page to ls_event-form.
append ls_event to xevents.
endif.
read table xevents with key name = slis_ev_end_of_list
into ls_event.
if sy-subrc = 0.
move slis_ev_end_of_list to ls_event-form.
append ls_event to xevents.
endif.
if r_dets ne space.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 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.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BELNR'.
l_fieldcat-seltext_m = text-912.
l_fieldcat-seltext_l = text-912.
l_fieldcat-reptext_ddic = text-912.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '12'..
when 'POSNR'.
l_fieldcat-seltext_m = text-913.
l_fieldcat-seltext_l = text-913.
l_fieldcat-reptext_ddic = text-913.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '6'.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
is_layout = t_layout
i_save = 'A'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = i_output
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
else. " MAHEEDHAR
ELSEIF R_SUMM EQ 'X'. " MAHEEDHAR
sort i_output by verld herkl stawn bezei.
loop at i_output.
move-corresponding i_output to t_outsum.
collect t_outsum.
endloop.
*Call Function 'REUSE_ALV_FIELD_CATALOG_MERGE' for position fixing in
*the output.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'T_OUTSUM'
i_inclname = 'ZVRA0001FTB13'
i_bypassing_buffer = 'X'
i_buffer_active = ' '
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 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.
loop at i_fieldcat into l_fieldcat.
l_fieldcat-key = ' '.
case l_fieldcat-fieldname.
when 'BEZEI'.
l_fieldcat-seltext_m = text-911.
l_fieldcat-seltext_l = text-911.
l_fieldcat-reptext_ddic = text-911.
l_fieldcat-col_pos = '1'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '15'..
when 'STAWN'.
l_fieldcat-seltext_m = text-111.
l_fieldcat-seltext_l = text-111.
l_fieldcat-reptext_ddic = text-111.
l_fieldcat-col_pos = '2'.
l_fieldcat-just = 'C'.
l_fieldcat-outputlen = '30'.
when 'TEXT1'.
l_fieldcat-seltext_m = text-112.
l_fieldcat-seltext_l = text-112.
l_fieldcat-outputlen = '40'.
l_fieldcat-col_pos = '3'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-112.
when 'QUANTITY'.
l_fieldcat-outputlen = '18'.
l_fieldcat-reptext_ddic = text-113.
l_fieldcat-seltext_m = text-113.
l_fieldcat-col_pos = '4'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-113.
when 'MEINS'.
l_fieldcat-outputlen = '8'.
l_fieldcat-reptext_ddic = text-114.
l_fieldcat-seltext_m = text-114.
l_fieldcat-col_pos = '5'.
l_fieldcat-just = 'C'.
l_fieldcat-seltext_l = text-114.
when 'VALUE'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-115.
l_fieldcat-seltext_l = text-115.
l_fieldcat-col_pos = '6'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-115.
when 'VERLD'.
l_fieldcat-outputlen = '20'.
l_fieldcat-seltext_m = text-116.
l_fieldcat-seltext_l = text-116.
l_fieldcat-col_pos = '7'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-116.
when 'HERKL'.
l_fieldcat-seltext_m = text-117.
l_fieldcat-seltext_l = text-117.
l_fieldcat-outputlen = '30'.
l_fieldcat-col_pos = '8'.
l_fieldcat-just = 'C'.
l_fieldcat-reptext_ddic = text-117.
when others.
l_fieldcat-no_out = 'X'.
endcase.
modify i_fieldcat from l_fieldcat.
endloop.
Call Function 'REUSE_ALV_LIST_DISPLAY' for dispaly of data in ALV.
call function 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZVRA0001FTB13'
it_fieldcat = i_fieldcat
it_events = xevents
i_save = 'A'
is_layout = t_layout
i_default = 'X'
is_variant = variante
i_bypassing_buffer = 'X'
i_buffer_active = ' '
TABLES
t_outtab = t_outsum
EXCEPTIONS
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
MAHEEDHAR-START.
*"-- if detail summary checkbox is selected
elseIF R_MSSNG = 'X'.
PERFORM PREPARE_HEADER.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = 'ZVRA0001FTB13'
i_internal_tabname = 'I_OUTPUT'
i_inclname = 'ZVRA0001FTB13'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = i_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2
hi,
*& Report ZALV_FIELD_GRID1
REPORT ZALV_FIELD_GRID1
NO STANDARD PAGE HEADING.
TABLES MARA.
type-pools :slis.
TYPES : BEGIN OF TMARA ,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
ERSDA LIKE MARA-ERSDA,
color(4) type c,
SEL type c,
LIGHT TYPE C,
END OF TMARA.
TYPES: BEGIN OF TMAKT,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
MAKTG LIKE MAKT-MAKTG,
SEL TYPE C,
COLOR(4),
END OF TMAKT.
DATA: ITAB TYPE TMARA OCCURS 0 WITH HEADER LINE,
ITAB1 TYPE TMAKT OCCURS 0 WITH HEADER LINE,
wa_fieldcat type slis_fieldcat_alv,
fieldcat type slis_fieldcat_alv occurs 0,
i_layout type slis_layout_alv,
WA_LISTHEADER TYPE SLIS_LISTHEADER ,
i_LISTHEADER TYPE SLIS_LISTHEADER OCCURS 0,
V_EVENTS TYPE SLIS_T_EVENT ,
WA_EVENT TYPE SLIS_ALV_EVENT,
I_TITLE_MARA TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED',
I_TITLE_MAKT TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED',
SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE,
PRINT_CONT type slis_print_alv.
SELECTION SCREE
selection-screen begin of block screen1 with frame title TEXT-001.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN COMMENT /32(35) COMM1.
SELECTION-SCREEN ULINE /27(35).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS MATNR FOR MARA-MATNR.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN ULINE.
SELECTION-SCREEN COMMENT /30(50) COMM2.
SELECTION-SCREEN ULINE /27(40).
SELECTION-SCREEN SKIP.
SELECT-OPTIONS ERSDA FOR MARA-ERSDA.
SELECTION-SCREEN SKIP.
selection-screen end of block screen1.
INITIALIZATION
INITIALIZATION.
MATNR-low = '23'.
MATNR-high = '1000'.
MATNR-option = 'BT'.
MATNR-sign = 'I'.
APPEND MATNR.
ERSDA-low = '20030124'.
ERSDA-high = '20050302' .
APPEND ERSDA.
PERFORM FILLFIELD.
PERFORM FILLLAYOUT.
PERFORM build_print_params.
PERFORM FILL_SORT.
PERFORM EVENT_CALL.
PERFORM POPULATE_EVENT.
SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
comm1 ='SELECT MATERIAL NUMBER RANGE'.
comm2 ='SELECT MATERIAL CREATION DATE'.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM READDATA.
PERFORM POPDATA.
*& Form READDATA
text
FORM READDATA .
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-LOW
IMPORTING
OUTPUT = MATNR-LOW.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = MATNR-HIGH
IMPORTING
OUTPUT = MATNR-HIGH.
SELECT MATNR
ERSDA
MEINS
FROM MARA
INTO CORRESPONDING FIELDS OF
TABLE ITAB
WHERE MATNR IN MATNR AND ERSDA IN ERSDA.
LOOP AT ITAB.
data id_color type i VALUE 1.
data id_colors(2) type c.
IF ITAB-MATNR < '000000000000000100'.
ITAB-LIGHT = '1'.
ELSEIF ITAB-MATNR < '000000000000000150' AND ITAB-MATNR >
'000000000000000100' .
ITAB-LIGHT = '2'.
ELSE.
ITAB-LIGHT = '3'.
ENDIF.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab-color.
modify itab.
CLEAR ITAB.
endloop.
ENDFORM. " READDATA
Form FILLFIELD
FORM FILLFIELD .
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
WA_FIELDCAT-outputlen = 20.
WA_FIELDCAT-HOTSPOT = 'X'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
*WA_FIELDCAT-EMPHASIZE = 'C210'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-COL_POS = '2'.
*WA_FIELDCAT-EMPHASIZE = 'C510'.
WA_FIELDCAT-outputlen = 10.
wa_fieldcat-seltext_m = 'UNIT'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'ERSDA'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-outputlen = 15.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
*WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'CREAT DATE'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. "FILLFIELD
Setup print parameters
form build_print_params.
PRINT_CONT-reserve_lines = '3'. "Lines reserved for footer
PRINT_CONT-no_coverpage = 'X'.
endform. " BUILD_PRINT_PARAMS
Form POPDATA
FORM POPDATA .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'USER-COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOPPAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = I_TITLE_MARA
I_GRID_SETTINGS =
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT = SORT[]
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = V_EVENTS
IT_EVENT_EXIT =
IS_PRINT = PRINT_CONT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " POPDATA
Form TOPPAGE
FORM TOPPAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DETAIL'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
ENDFORM. "TOPPAGE
Form FILLLAYOUT
FORM FILLLAYOUT .
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-lights_fieldname = 'LIGHT'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
I_LAYOUT-no_totalline = 'X'.
ENDFORM. "FILLLAYOUT
Form FILL_SORT
FORM FILL_SORT .
SORT-DOWN = 'X'.
SORT-SPOS = 1.
SORT-FIELDNAME = 'MATNR'.
SORT-tabname = 'MARA'.
APPEND SORT.
ENDFORM. " FILL_SORT
Form EVENT_CALL
FORM EVENT_CALL .
DATA: I_EVENT LIKE V_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = V_EVENTS.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " EVENT_CALL
Form POPULATE_EVENT
FORM POPULATE_EVENT .
READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC EQ 0.
WA_EVENT-FORM = 'USER_COMMAND'.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
READ TABLE V_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO WA_EVENT.
IF SY-SUBRC = 0.
move 'END_OF_PAGE' to WA_EVENT-FORM.
MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
WA_EVENT-NAME.
endif.
ENDIF.
ENDFORM. "POPULATE_EVENT
FORM END_OF_PAGE.
write: sy-uline(50).
skip.
write:/40 'Page:', sy-pagno .
ENDFORM.
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CASE RS_SELFIELD-FIELDNAME.
when 'MATNR'.
read table itab with key matnr = RS_SELFIELD-VALUE.
if sy-subrc = 0.
PERFORM DATA_RETRIEVAL_MAKT USING RS_SELFIELD-VALUE.
PERFORM BUILD_FIELDCATLOG_MAKT.
PERFORM FILLLAYOUT_MAKT.
PERFORM DISPLAY_ALV_MAKT.
CLEAR RS_SELFIELD.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. "user_command
Form DATA_RETRIEVAL_MAKT
FORM DATA_RETRIEVAL_MAKT USING TMATNR .
SELECT MATNR
MAKTX
MAKTG
UP TO 100 ROWS
FROM MAKT
INTO TABLE ITAB1
WHERE SPRAS = 'EN' AND MATNR = TMATNR.
LOOP AT ITAB1.
data id_color type i VALUE 1.
data id_colors(2) type c.
id_color = id_color + 1.
if id_color > 7.
id_color = 1.
endif.
id_colors = id_color.
concatenate 'C' id_colors '10' into itab1-color.
modify itab1.
CLEAR ITAB1.
ENDLOOP.
ENDFORM. "DATA_RETRIEVAL_MAKT
Form FILLLAYOUT_MAKT
FORM FILLLAYOUT_MAKT .
CLEAR I_LAYOUT.
i_layout-zebra = 'X'.
i_layout-info_fieldname = 'COLOR'.
i_layout-box_fieldname = 'SEL'.
I_LAYOUT-EDIT ='X'.
I_LAYOUT-colwidth_optimize = 'X'.
I_LAYOUT-window_titlebar = 'EXAMPLE FOR ALV GRID'.
ENDFORM. " LAYOUT_MAKT
Form BUILD_FIELDCATLOG_MAKT
FORM BUILD_FIELDCATLOG_MAKT .
REFRESH FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-KEY = 'X'.
WA_FIELDCAT-COL_POS = '1'.
*WA_FIELDCAT-EDIT_MASK = 'DD.MM.YYYY'.
WA_FIELDCAT-EMPHASIZE = 'C510'.
wa_fieldcat-seltext_m = 'MATERIAL NUMBER'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTX'.
WA_FIELDCAT-COL_POS = '2'.
WA_FIELDCAT-EMPHASIZE = 'C710'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
WA_FIELDCAT-FIELDNAME = 'MAKTG'.
WA_FIELDCAT-COL_POS = '3'.
WA_FIELDCAT-EMPHASIZE = 'C210'.
wa_fieldcat-seltext_m = 'MATERIAL DESCRIPTION'.
APPEND WA_FIELDCAT TO FIELDCAT.
clear wa_fieldcat.
ENDFORM. " BUILD_FIELDCATLOG_MAKT
Form DISPLAY_ALV_MAKT
FORM TOP-OF-PAGE.
REFRESH I_LISTHEADER.
DATA: ld_lines type i,
ld_linesc(10) type c,
I_DATE(10) TYPE C,
I_INFO LIKE WA_LISTHEADER-INFO.
WA_LISTHEADER-TYP = 'H'.
WA_LISTHEADER-INFO = 'MATERIAL DESCRIPTION FOR SELECTED NUMBER'.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
WA_LISTHEADER-TYP = 'S'.
WA_LISTHEADER-KEY = 'DATE :'.
CONCATENATE SY-DATUM+6(2) '.'
SY-DATUM+4(2) '.'
SY-DATUM(4) INTO I_DATE.
WA_LISTHEADER-INFO = I_datE.
APPEND WA_LISTHEADER TO I_LISTHEADER.
CLEAR WA_LISTHEADER.
describe table ITAB1 lines ld_lines.
ld_linesc = ld_lines.
concatenate 'TOTAL NUMBER OF RECORD SELECTED: ' ld_linesc
into I_INFO separated by space.
WA_LISTHEADER-TYP = 'A'.
WA_LISTHEADER-INFO = I_INFO.
append WA_LISTHEADER to I_LISTHEADER.
clear: WA_LISTHEADER , I_INFO.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = I_LISTHEADER
I_LOGO = 'ENJOYSAP_LOGO'.
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "TOP-OF-PAGE
*& Form DISPLAY_ALV_MAKT
text
FORM DISPLAY_ALV_MAKT .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
I_GRID_TITLE = I_TITLE_MAKT
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = fieldcat
TABLES
T_OUTTAB = ITAB1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV_MAKT
Regards
Ashok kumar -
Tables and fields for blocked invoices
hi,
what r the tables and fields which r required to develop a report that displays blocked invoices.
thanks
kishoreHi Venkat,
Please check these tables
RBKP_BLOCKED Logistics Invoice Verification: Blocked Invoices
RM08A Data for Processing Blocked Invoices
RSEG_BLOCKEDPRICES Blocked Invoice Document Items with PO Information
RSEG_BUZEI Blocked Invoice Document Items as Single-Column List
Best regards,
raam -
Dear all,
I have got a question about SAP FS-CD
I want to get a report of all blocked invoices (dunning block, payment block etc etc) by company code.
I know the locks are stored in table DFKKLOCKS but the problem there is that I don't have there the possibility to make a selection on company code and also I don't have the possibility there to make a selection on open invoices only.
My question is does anyone know how I can get a list of all outstanding invoices (not cleared) that are blocked in SAP. I need to be able to produce the list by company code.
Kind regards,
LatifaHi
I am not sure if your problem is solved or not, but here is what i think the issue can be.
Dunning is usually done in two steps.
--> Dunning Proposal Run(VPVA) : It will create a dunning proposal for the list of all the applicable dunning items. Which is usually reviewed by the clerk before carrying out the dunning activity.
During this step Print Date is not update.
--> Dunning Activity Run(VPVB) : It determines and executes the dunning activities defined in the dunning procedures and dunning level. It refers to items that were determined during dunning proposal run.
During this step the print date is update.
Now regarding the items not shown in the dunning histroy transaction (VYM10). This is because you have not executed the dunning Activity run, so the items are still not dunned. Technical they are still under review.
On the other hand if you want, you can use FPM3 which will display the list from both, the dunning proposal run and dunning activity run.
Regards
Mithlesh -
Hide delete option is not working in ALV List Display- urgent
Hi All,
In my program i am displaying the output by using alv list display. after displaying the data i am displaying my own pf status here. in this i have few pushbuttons like
selest all, deselect all, hide . first two options are working fine. when i click hide button selected records are going to be hide.but this is not happening in my program. any body cam send me the code plz.
i am sending my code below. if possible please modify and resend the code asap.
my code:
type-pools : slis.
tables : zuser_secobjects.
data : t_header1 like zuser_secobjects.
data : begin of it_secobjects occurs 0.
include structure t_header1.
*data : box,
input(1) type c,
data : checkbox type c,
flag type c,
end of it_secobjects.
data : wa_ita like line of it_secobjects.
*data : it_secobjects like zuser_secobjects occurs 0 with header line.
data : i_field type slis_t_fieldcat_alv with header line.
data : w_field like line of i_field.
data : i_sort type slis_t_sortinfo_alv.
data : w_sort like line of i_sort.
data : it_filt1 type slis_t_filter_alv with header line.
data:
i_tabname type tabname,
i_repid like sy-repid,
is_lout type slis_layout_alv.
data : it_filt type slis_t_filter_alv with header line,
it_evts type slis_t_event with header line.
DATA : is_vari type disvariant.
constants : c_default_vari value 'X',
c_save_vari value 'U',
c_checkfield type slis_fieldname value 'ACTION',
c_f2code type sy-ucomm value '&ETA'.
data : chk_box type slis_fieldname.
selection-screen: begin of block b1 with frame title text-t01.
parameters : p_appln type zuser_secobjects-appln.
parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
p_partnr type zuser_secobjects-appln_partner,
p_ptype type zuser_secobjects-partner_type default '02',
p_upostn type zuser_secobjects-user_position,
p_sdate like likp-erdat default sy-datum,
p_edate(10) default '12/31/9999',
p_revnum type zuser_secobjects-revnum,
p_cted type zuser_secobjects-created_by,
p_cdate type zuser_secobjects-creation_date,
p_ctime type zuser_secobjects-creation_time,
p_chnby type zuser_secobjects-changed_by,
p_cdate1 type zuser_secobjects-changed_date,
p_ctime1 type zuser_secobjects-changed_time.
selection-screen: end of block b1.
form user_command using p_ucomm like sy-ucomm
rs_selfield type slis_selfield.
*DATA : it_filt type slis_t_filter_alv with header line.
case p_ucomm.
when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
loop at it_secobjects into wa_ita.
wa_ita-checkbox = 'X'.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
when 'DESLCT_ALL'.
loop at it_secobjects into wa_ita.
wa_ita-checkbox = ' '.
modify it_secobjects from wa_ita.
endloop.
rs_selfield-refresh = 'X'. "<- ADD THIS
is_lout-f2code = c_f2code.
is_lout-box_fieldname = c_checkfield.
is_lout-get_selinfos = 'X'.
is_lout-detail_popup = 'X'.
is_lout-detail_initial_lines = 'X'.
when 'HIDE_DEL'.
rs_selfield-exit = 'X'.
it_filt-fieldname = 'CHECKBOX'.
it_filt-tabname = '1'.
it_filt-valuf = 'X'.
it_filt-intlen = '1'.
it_filt-inttype = 'C'.
it_filt-datatype = 'CHAR'.
it_filt-valuf_int = 'X'.
it_filt-sign0 = 'E'.
it_filt-optio = 'EQ'.
if it_filt[] is initial.
append it_filt.
else.
modify it_filt index 1.
endif.
perform display using i_object.
PERForm ALV_LIST_DISPLAY.
WHEN 'SHOW_DEL'.
rs_selfield-exit = 'X'.
free it_filt.
PERForm ALV_LIST_DISPLAY.
when 'SAVE1'.
select * from zuser_secobjects where
appln = zuser_secobjects-appln
and appln_partner = zuser_secobjects-appln_partner
and partner_type = zuser_secobjects-partner_type
and start_date = zuser_secobjects-start_date
and end_date = zuser_secobjects-end_date.
endselect.
if sy-subrc eq 0.
message e000(ZV) with 'Duplicate Entry'.
endif.
endcase.
endform.
*& Form delete
form delete.
data : begin of is_secobjects occurs 0.
include structure zuser_secobjects.
data : checkbox type c.
data : end of is_secobjects.
is_secobjects-checkbox = 'X'.
modify is_secobjects
from it_secobjects
transporting checkbox
where checkbox = 'X'.
endform.
*& Form get_data
form get_data.
select * from zuser_secobjects
into table it_secobjects.
endform. " get_data
*& Form prepare_fieldcatalog
text
--> p1 text
<-- p2 text
form prepare_fieldcatalog.
clear: w_field,i_field.
refresh:i_field.
i_field-key = 'X'.
i_field-col_pos = 1.
i_field-ddictxt = 'S'.
i_field-seltext_s = '@11@'.
i_field-checkbox = 'X'.
i_field-input = 'X'.
i_field-fieldname = 'HEADER'.
i_field-outputlen = 0.
append i_field.
clear i_field.
w_field-fieldname = 'APPLN'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-seltext_l = text-m01.
w_field-outputlen = '10'.
w_field-col_pos = 1.
append w_field to i_field.
clear w_field.
w_field-fieldname = 'APPLN_USER'.
w_field-tabname = 'IT_SECOBJECTS'.
w_field-just = 'C'.
w_field-seltext_l = text-m02.
w_field-outputlen = '7'.
w_field-col_pos = 2.
append w_field to i_field.
clear w_field.
endform. " prepare_fieldcatalog
*& Form ALV_LIST_DISPLAY
text
--> p1 text
<-- p2 text
form alv_list_display.
i_repid = sy-repid.
is_lout-box_fieldname = 'CHECKBOX'.
it_filt-fieldname = 'CHECKBOX'.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_pf_status_set = 'PF_STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout = is_lout
it_fieldcat = i_field[]
it_filter = it_filt[]
it_events = it_evts[]
i_default = c_default_vari
i_save = c_save_vari
is_variant = is_vari
tables
t_outtab = it_secobjects.
endform. " ALV_LIST_DISPLAY
*& Form display
text
-->P_I_OBJECT text
form display using object.
case object.
ENDCASE.
endform. " display
thanks,
maheedhar.tHi,
What do you mean by Hiding the records.
Deleting completely from the screen.
You can just delete the records from the internal table and pass to field catalog before displaying again.
or serach in the slis structrue for hiding the contents of the output.
reward if useful
regards,
Anji -
Issue in ALV List display
Posted: Apr 5, 2008 10:25 AM Edit E-mail this message Reply
Hi Friends,
Can any one help me out in the logic to display the output in the ALV list.
i want to get the out put as
based on the field4 i have to display fieds5, field6 and field 7 values as mentioned below.
field1 field2 field3 field4 field5 field6 field7
0L 123 456 2008 001 123.00 456.00
- - - - 002 213.00 789.00
- - - 003 0.00 0.00
- - - 004 0.00 0.00
- - - 005 0.00 0.00
- - - 006 0.00 0.00
336.00 1245.00
Thanks,
Vijayfor display you have to define fieldcatlaog and use Fm RESUE_ALV_GRID_DISPLAY,
Go through this program
*& Report Z_OPEN_CLOSE *
REPORT Z_OPEN_CLOSE MESSAGE-ID YW2 LINE-SIZE 231 LINE-COUNT 45
NO STANDARD PAGE HEADING.
Type Declaration *
TYPE-POOLS SLIS.
Tables *
TABLES: MKPF, " Material Document: Header Data
MSEG, " Material Document: Item Data
MARA,
MARD,
S031,
EKKO,
EKPO,
LIKP,
MAKT,
J_1IWRKCUS,
T001W,
WB2_V_MKPF_MSEG2,
MMIM_REP_PRINT,
YW2_STKMOVEMENTS,
YPLNT,
MARDH.
Internal Tables *
DATA: I_WERKS LIKE J_1IWRKCUS OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF I_YPLNT OCCURS 0,
PPLNT LIKE YPLNT-PPLNT,
WPLNT LIKE YPLNT-WPLNT,
END OF I_YPLNT.
DATA: BEGIN OF I_MKPF OCCURS 0,
MBLNR LIKE MKPF-MBLNR,
MJAHR LIKE MKPF-MJAHR,
BUDAT LIKE MKPF-BUDAT,
VGART LIKE MKPF-VGART,
BWART LIKE MSEG-BWART,
MATNR LIKE MSEG-MATNR,
WERKS LIKE MSEG-WERKS,
LGORT LIKE MSEG-LGORT,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
KUNNR LIKE MSEG-KUNNR,
ZEILE LIKE MSEG-ZEILE,
XAUTO LIKE MSEG-XAUTO,
SHKZG LIKE MSEG-SHKZG,
MATNR1 LIKE MSEG-MATNR,
END OF I_MKPF.
DATA: BEGIN OF I_MARDH OCCURS 0,
WERKS LIKE MARDH-WERKS,
MEINS LIKE MARA-MEINS,
MATNR LIKE MARDH-MATNR,
LGORT LIKE MARDH-LGORT,
LABST LIKE MARDH-LABST,
LFGJA LIKE MARDH-LFGJA, "Added -MB
LFMON LIKE MARDH-LFMON, "Added -MB
PERIO(6),
INSME LIKE MARDH-LABST,
EINME LIKE MARDH-LABST,
SPEME LIKE MARDH-LABST,
RETME LIKE MARDH-LABST,
O_STK LIKE MARDH-LABST, " Opening Stock
C_STK LIKE MARDH-LABST, " Closing Stock
END OF I_MARDH.
DATA: BEGIN OF I_MARD OCCURS 0,
WERKS LIKE MARD-WERKS,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT,
LABST LIKE MARD-LABST,
INSME LIKE MARD-LABST,
MEINS LIKE MARA-MEINS,
EINME LIKE MARD-LABST,
SPEME LIKE MARD-LABST,
RETME LIKE MARD-LABST,
END OF I_MARD.
DATA: I_MARD1 LIKE I_MARD OCCURS 0 WITH HEADER LINE.
DATA: I_MARDH1 LIKE I_MARDH OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF I_MKPF1 OCCURS 0,
MBLNR LIKE MKPF-MBLNR,
WERKS LIKE MSEG-WERKS,
MATNR LIKE MSEG-MATNR,
BUDAT LIKE MKPF-BUDAT,
BWART LIKE MSEG-BWART,
MJAHR LIKE MKPF-MJAHR,
VGART LIKE MKPF-VGART,
LGORT LIKE MSEG-LGORT,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
XAUTO LIKE MSEG-XAUTO,
SHKZG LIKE MSEG-SHKZG,
END OF I_MKPF1.
DATA: BEGIN OF I_MKPF2 OCCURS 0,
WERKS LIKE MSEG-WERKS,
MATNR LIKE MSEG-MATNR,
BUDAT LIKE MKPF-BUDAT,
BWART LIKE MSEG-BWART,
MJAHR LIKE MKPF-MJAHR,
VGART LIKE MKPF-VGART,
LGORT LIKE MSEG-LGORT,
MENGE LIKE MSEG-MENGE,
MEINS LIKE MSEG-MEINS,
XAUTO LIKE MSEG-XAUTO,
END OF I_MKPF2.
DATA: BEGIN OF I_FINAL5 OCCURS 0,
WERKS LIKE MSEG-WERKS, " Plant
MATNR LIKE MSEG-MATNR, " Material
LGORT LIKE MSEG-LGORT, " Storage Location
BUDAT LIKE MKPF-BUDAT, " Posting Date
MTART LIKE MARA-MTART, " Material Type
SPMON LIKE S031-SPMON, " Month
MAKTX LIKE MAKT-MAKTX, " Description
meins(3), " UOM
MEINS LIKE MSEG-MEINS,
O_STK LIKE MARDH-LABST, " opening stock
TRECEP LIKE MARDH-LABST, " total receipts
PRODU LIKE MARDH-LABST, " Net Receipts - Production
RECEP LIKE MARDH-LABST, " Net Receipts - Receipts
SAL_RET LIKE MARDH-LABST, " Net Receipts - Sales Return
TDISP LIKE MARDH-LABST, " total dispatches
CUSTMR LIKE MARDH-LABST, " Net Dispatches - Customers
OPLANT LIKE MARDH-LABST, " Net Dispatches - To Other Plant
TLOSS LIKE MARDH-LABST, " Total Loss
TRLOSS LIKE MARDH-LABST, " Transit Loss
WHLOSS LIKE MARDH-LABST, " Warehouse Loss
C_STK LIKE MARDH-LABST, " Closing Stock
TRFSTK LIKE MARDH-LABST, "Transfer stock
MENGE LIKE MSEG-MENGE,
OTHADJ LIKE MARDH-LABST,
END OF I_FINAL5.
DATA: BEGIN OF I_FINAL OCCURS 0,
WERKS LIKE MSEG-WERKS, " Plant
MATNR LIKE MSEG-MATNR, " Material
BUDAT LIKE MKPF-BUDAT, " Posting Date
MTART LIKE MARA-MTART, " Material Type
SPMON LIKE S031-SPMON, " Month
MAKTX LIKE MAKT-MAKTX, " Description
meins(3), " UOM
MEINS LIKE MSEG-MEINS,
O_STK LIKE MARDH-LABST, " opening stock
TRECEP LIKE MARDH-LABST, " total receipts
PRODU LIKE MARDH-LABST, " Net Receipts - Production
RECEP LIKE MARDH-LABST, " Net Receipts - Receipts
SAL_RET LIKE MARDH-LABST, " Net Receipts - Sales Return
TDISP LIKE MARDH-LABST, " total dispatches
CUSTMR LIKE MARDH-LABST, " Net Dispatches - Customers
OPLANT LIKE MARDH-LABST, " Net Dispatches - To Other Plant
TRFSTK LIKE MARDH-LABST, "Material Transfer stock
TRLOSS LIKE MARDH-LABST, " Transit Loss
WHLOSS LIKE MARDH-LABST, " Warehouse Loss
TLOSS LIKE MARDH-LABST, " Total Loss
C_STK LIKE MARDH-LABST, " Closing Stock
OTHADJ LIKE MARDH-LABST,
END OF I_FINAL.
DATA: I_FINAL1 LIKE I_FINAL OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF I_FINAL_TEMP OCCURS 0,
WERKS LIKE MSEG-WERKS, " Plant
MATNR LIKE MSEG-MATNR, " Material
MTART LIKE MARA-MTART, " Material Type
MAKTX LIKE MAKT-MAKTX, " Description
MEINS LIKE MSEG-MEINS,
O_STK LIKE MARDH-LABST, " opening stock
TRECEP LIKE MARDH-LABST, " total receipts
PRODU LIKE MARDH-LABST, " Net Receipts - Production
RECEP LIKE MARDH-LABST, " Net Receipts - Receipts
SAL_RET LIKE MARDH-LABST, " Net Receipts - Sales Return
TDISP LIKE MARDH-LABST, " total dispatches
CUSTMR LIKE MARDH-LABST, " Net Dispatches - Customers
OPLANT LIKE MARDH-LABST, " Net Dispatches - To Other Plant
TRFSTK LIKE MARDH-LABST, "Material Transfer stock
TRLOSS LIKE MARDH-LABST, " Transit Loss
WHLOSS LIKE MARDH-LABST, " Warehouse Loss
TLOSS LIKE MARDH-LABST, " Total Loss
C_STK LIKE MARDH-LABST, " Closing Stock
OTHADJ LIKE MARDH-LABST,
END OF I_FINAL_TEMP.
For Materials
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR TYPE MARA-MATNR,
MTART TYPE MARA-MTART,
MEINS LIKE MARA-MEINS,
LABST TYPE MARD-LABST,
MAKTX LIKE MAKT-MAKTX,
END OF I_MARA.
DATA: BEGIN OF I_STKMVMNTS OCCURS 0,
BWART LIKE MSEG-BWART,
SHKZG LIKE MSEG-SHKZG,
VZBEW LIKE YW2_STKMOVEMENTS-VZBEW,
END OF I_STKMVMNTS.
DATA: BEGIN OF I_FINALT OCCURS 0,
WERKS LIKE MSEG-WERKS, " Plant
MATNR LIKE MSEG-MATNR, " Material
BUDAT LIKE MKPF-BUDAT, " Posting Date
MTART LIKE MARA-MTART, " Material Type
SPMON LIKE S031-SPMON, " Month
MAKTX LIKE MAKT-MAKTX, " Description
meins(3), " UOM
MEINS LIKE MSEG-MEINS,
O_STK LIKE MARDH-LABST, " opening stock
TRECEP LIKE MARDH-LABST, " total receipts
PRODU LIKE MARDH-LABST, " Net Receipts - Production
RECEP LIKE MARDH-LABST, " Net Receipts - Receipts
SAL_RET LIKE MARDH-LABST, " Net Receipts - Sales Return
TDISP LIKE MARDH-LABST, " total dispatches
CUSTMR LIKE MARDH-LABST, " Net Dispatches - Customers
OPLANT LIKE MARDH-LABST, " Net Dispatches - To Other Plant
TRFSTK LIKE MARDH-LABST, "Material Transfer stock
TRLOSS LIKE MARDH-LABST, " Transit Loss
WHLOSS LIKE MARDH-LABST, " Warehouse Loss
TLOSS LIKE MARDH-LABST, " Total Loss
C_STK LIKE MARDH-LABST, " Closing Stock
OTHADJ LIKE MARDH-LABST,
MONTH(8) ,
END OF I_FINALT.
DATA: IMKPFT LIKE I_MKPF OCCURS 0 WITH HEADER LINE.
DATA: IMKPFT1 LIKE I_MKPF1 OCCURS 0 WITH HEADER LINE.
DATA: IMARDT LIKE I_MARD OCCURS 0 WITH HEADER LINE.
DATA: IMARDHT LIKE I_MARDH OCCURS 0 WITH HEADER LINE.
DATA: T_FINAL LIKE I_MKPF OCCURS 0 WITH HEADER LINE.
DATA: IMKPFT2 LIKE I_MKPF OCCURS 0 WITH HEADER LINE.
FCAT is used for the field catalog
DATA: FCAT TYPE TABLE OF SLIS_FIELDCAT_ALV WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
for excluding the ICONs from the application toolbar
FEXC TYPE TABLE OF SLIS_EXTAB WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
FS_LAYO is used for Grid Layout
FS_LAYO TYPE SLIS_LAYOUT_ALV,
FEVENTS to handle the events TOP OF PAGE & USER_COMMAND
FEVENTS TYPE TABLE OF SLIS_ALV_EVENT WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
FHEADER is used for List header
FHEADER TYPE TABLE OF SLIS_LISTHEADER WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
sort is used for sorting
FSORT TYPE TABLE OF SLIS_SORTINFO_ALV WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
FCAT1 TYPE TABLE OF SLIS_FIELDCAT_ALV WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
FS_LAYO1 TYPE SLIS_LAYOUT_ALV,
GT_LIST_TOP_OF_PAGE1 TYPE SLIS_T_LISTHEADER,
FEVENTS1 TYPE TABLE OF SLIS_ALV_EVENT WITH NON-UNIQUE DEFAULT KEY
WITH HEADER LINE INITIAL SIZE 0,
FHEADER1 TYPE TABLE OF SLIS_LISTHEADER WITH NON-UNIQUE DEFAULT
KEY WITH HEADER LINE INITIAL SIZE 0,
G_STATU_071 TYPE SLIS_FORMNAME VALUE 'Z_PFSTATUS',
ALV_VARIANT1 LIKE DISVARIANT.
Variable Declaration *
TYPES: TRFF_TYPE_DEC_6_5(6) TYPE P DECIMALS 5.
DATA: FYEAR(4),
MON(2),
FYEAR1(4),
MON1(2),
OBAL LIKE MARD-LABST,
CBAL LIKE MARD-LABST,
INDEX TYPE I,
COUNT,
COUNT1 TYPE I,
O_STK TYPE P DECIMALS 3,
C_STK TYPE P DECIMALS 3,
V_MJAHR LIKE MKPF-MJAHR,
MONTHS TYPE TRFF_TYPE_DEC_6_5,
MONTH TYPE I.
Global variables for handling ALV functionality
DATA: ALV_KEYINFO TYPE SLIS_KEYINFO_ALV,
ALV_VARIANT LIKE DISVARIANT,
ALV_LAYOUT TYPE SLIS_LAYOUT_ALV,
ALV_REPID LIKE SY-REPID,
ALV_PRINT TYPE SLIS_PRINT_ALV,
ALV_DETAIL_FUNC(30),
ALV_DEFAULT_VARIANT LIKE DISVARIANT-VARIANT,
ALV_COLOURIZE_FIELDS LIKE MMIM_REP_PRINT-COLOR.
RANGES: R_BUDAT FOR MKPF-BUDAT.
*Added by Prabhu for year on 26.4.05.
DATA: IDATE LIKE R_BUDAT OCCURS 0 WITH HEADER LINE.
Selection Screen Elements *
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_WERKS FOR MARD-WERKS OBLIGATORY NO INTERVALS.
PARAMETER: P_SPMON LIKE S031-SPMON NO-DISPLAY .
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR OBLIGATORY,
S_LGORT FOR MSEG-LGORT NO-EXTENSION NO INTERVALS,
S_MBLNR FOR MKPF-MBLNR,
S_BUDAT FOR MKPF-BUDAT OBLIGATORY .
SELECTION-SCREEN END OF BLOCK BLK.
SELECTION-SCREEN BEGIN OF BLOCK BLK3 WITH FRAME TITLE TEXT-004.
PARAMETER : MTART LIKE MARA-MTART DEFAULT 'FERT' NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK BLK3.
SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-003.
SELECTION-SCREEN END OF BLOCK BLK2.
ADDED BY PRABHU FOR DAY-WISE REPORT.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-007.
PARAMETERS: D1 RADIOBUTTON GROUP P1 DEFAULT 'X',
M1 RADIOBUTTON GROUP P1,
Y1 RADIOBUTTON GROUP P1.
SELECTION-SCREEN END OF BLOCK B3.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-006.
PARAMETERS: ALV_DEF LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF BLOCK B2.
DATA: S_BUDAT1 LIKE S_BUDAT OCCURS 0 WITH HEADER LINE."prabhu
Initialization *
INITIALIZATION.
PERFORM ALV_INIT.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR ALV_DEF.
PERFORM ALV_F4.
At Selection Screen
*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_spmon.
PERFORM monat_f4.
At Selection Screen *
AT SELECTION-SCREEN.
checking for the layout
PERFORM ALV_CHECK.
authorisation check for the Plant
PERFORM auth_check.
Validation for the Plant
PERFORM VALIDITY_CHECK.
IF MTART NE 'FERT'.
MESSAGE E041 WITH 'Material Type must be FERT Only...'.
ENDIF.
IF D1 = 'X'." On 26.4.05.
P_SPMON0(4) = S_BUDAT-LOW0(4).
P_SPMON4(2) = S_BUDAT-LOW4(2).
ELSE.
P_SPMON0(4) = S_BUDAT-LOW0(4).
P_SPMON4(2) = S_BUDAT-LOW4(2).
ENDIF.
LOOP AT S_BUDAT.
IF S_BUDAT-HIGH IS INITIAL.
S_BUDAT-HIGH = S_BUDAT-LOW.
MODIFY S_BUDAT.
ENDIF.
ENDLOOP.
IDATE-LOW = S_BUDAT-LOW.
IDATE-HIGH = S_BUDAT-HIGH.
CALL FUNCTION 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
EXPORTING
I_DATE_FROM = IDATE-LOW
I_DATE_TO = IDATE-HIGH
IMPORTING
E_DAYS =
E_MONTHS = MONTH
E_YEARS =
DATA: I(3) TYPE C.
I = S_BUDAT-LOW+4(2).
CLEAR: R_BUDAT.
REFRESH: R_BUDAT.
*added by Prabhu for Only for Oneday.on 18.5.5
IF MONTH EQ '0'.
MONTH = MONTH + 1.
ENDIF.
*added by Prabhu for Only for Oneday.on 18.5.5
DO MONTH TIMES.
R_BUDAT-LOW = S_BUDAT-LOW.
APPEND R_BUDAT.
ENDDO.
I = 0.
LOOP AT R_BUDAT.
R_BUDAT-LOW4(2) = S_BUDAT-LOW4(2) + I.
I = I + 1.
R_BUDAT-LOW+6(2) = '01'.
MODIFY R_BUDAT.
ENDLOOP.
LOOP AT R_BUDAT.
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = R_BUDAT-LOW
IMPORTING
LAST_DAY_OF_MONTH = R_BUDAT-HIGH
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2
MODIFY R_BUDAT.
ENDLOOP.
LOOP AT R_BUDAT.
IF R_BUDAT-LOW4(2) = S_BUDAT-LOW4(2).
R_BUDAT-LOW = S_BUDAT-LOW.
MODIFY R_BUDAT.
ENDIF.
IF R_BUDAT-HIGH4(2) = S_BUDAT-HIGH4(2).
R_BUDAT-HIGH = S_BUDAT-HIGH.
MODIFY R_BUDAT.
ENDIF.
For Summary on 26.4.05.
IF Y1 = 'X'.
CLEAR R_BUDAT.
REFRESH R_BUDAT.
R_BUDAT-LOW = S_BUDAT-LOW.
R_BUDAT-HIGH = S_BUDAT-HIGH.
APPEND R_BUDAT.
CLEAR R_BUDAT.
ENDIF.
ENDLOOP.
At Selection Screen *
AT SELECTION-SCREEN OUTPUT.
Start of Selection *
START-OF-SELECTION.
V_MJAHR = P_SPMON+0(4).
Get plant distinction warehouse/production
PERFORM GET_PLANT_DISTINCTION.
Collect the data from various tables
PERFORM GETDATA_FG_STOCK.
here the number of rows in the output table is found
PERFORM OUTPUT_TABLE_CHECK.
here the top of the page code is written, that is to be displayed
in the output
PERFORM Z_TOP_OF_PAGE.
here ALV layout properties are set
PERFORM Z_LAYOUT_SETTINGS.
ALV EVENTS for TOP OF PAGE and for USER COMMAND
PERFORM Z_ALV_EVENTS.
The field catalog is defined for the Primary List is defined in
the subroutine CREATE_FIELD_CATALOG include program ZPRRDOCR_FCAT
PERFORM Z_CREATE_FIELD_CATALOG.
This is for displaying the output
PERFORM Z_REUSE_ALV_GRID_DISPLAY.
*& Form getdata_fg_stock
Getting data from standard tables
FORM GETDATA_FG_STOCK.
For getting the Start date & end date of the month
PERFORM get_month_dates.
Getting the Opening Stock from MARDH table
IF MON EQ '01'.
MON1 = MON.
FYEAR1 = FYEAR.
MON = '12'.
FYEAR = FYEAR - 1.
ELSE.
MON1 = MON.
FYEAR1 = FYEAR.
MON = MON - 1.
FYEAR = FYEAR.
ENDIF.
PERFORM GET_RECORDS_FROM_DB.
*added for Month Summary on 26.4.05.
LOOP AT R_BUDAT.
S_BUDAT-LOW = R_BUDAT-LOW.
S_BUDAT-HIGH = R_BUDAT-HIGH.
*for Month
P_SPMON0(4) = S_BUDAT-LOW0(4).
P_SPMON4(2) = S_BUDAT-LOW4(2).
*for summary.
IF Y1 = 'X'.
LOOP AT S_BUDAT.
S_BUDAT1-SIGN = 'I'.
S_BUDAT1-OPTION = 'NB'.
S_BUDAT1-LOW = S_BUDAT-LOW.
S_BUDAT1-HIGH = S_BUDAT-HIGH.
APPEND S_BUDAT1.
CLEAR S_BUDAT1.
ENDLOOP.
ENDIF.
IMKPFT[] = I_MKPF[].
IMKPFT2[] = I_MKPF[].
IMARDT[] = I_MARD[].
IMARDHT[] = I_MARDH[].
PERFORM MONTH_WISE.
PERFORM PROCESS_MOVEMENTS.
PERFORM CALCULATE_OPENING_STOCK.
PERFORM UPDATE_NON_TRANSACTION_ITMS.
PERFORM DELETE_EMPTY_RECORDS.
CLEAR: IMARDHT,IMARDT,IMKPFT1,IMKPFT,I_FINAL,I_FINAL5.
REFRESH: IMARDHT,IMARDT,IMKPFT1,I_FINAL,I_FINAL5,IMKPFT.
ENDLOOP.
CLEAR: R_BUDAT.
REFRESH: R_BUDAT.
*end of changes for month.
ENDFORM. " getdata_fg_stock
FORM MONAT_F4 *
F4-Hilfe für Monat *
FORM MONAT_F4.
DATA: BEGIN OF MF_DYNPFIELDS OCCURS 1.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF MF_DYNPFIELDS.
DATA: MF_RETURNCODE LIKE SY-SUBRC,
MF_MONAT LIKE ISELLIST-MONTH,
MF_HLP_REPID LIKE SY-REPID.
FIELD-SYMBOLS: .
Wert von Dynpro lesen
GET CURSOR FIELD MF_DYNPFIELDS-FIELDNAME.
APPEND MF_DYNPFIELDS.
MF_HLP_REPID = SY-REPID.
DO 2 TIMES.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = MF_HLP_REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = MF_DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 01
INVALID_DYNPROFIELD = 02
INVALID_DYNPRONAME = 03
INVALID_DYNPRONUMMER = 04
INVALID_REQUEST = 05
NO_FIELDDESCRIPTION = 06
UNDEFIND_ERROR = 07.
IF SY-SUBRC = 3.
Aktuelles Dynpro ist Wertemengenbild
MF_HLP_REPID = 'SAPLALDB'.
ELSE.
READ TABLE MF_DYNPFIELDS INDEX 1.
Unterstriche durch Blanks ersetzen
TRANSLATE MF_DYNPFIELDS-FIELDVALUE USING '_ '.
EXIT.
ENDIF.
ENDDO.
IF SY-SUBRC = 0.
Konvertierung ins interne Format
CALL FUNCTION 'CONVERSION_EXIT_PERI_INPUT'
EXPORTING
INPUT = MF_DYNPFIELDS-FIELDVALUE
IMPORTING
OUTPUT = MF_MONAT
EXCEPTIONS
ERROR_MESSAGE = 1.
IF MF_MONAT IS INITIAL.
Monat ist initial => Vorschlagswert aus akt. Datum ableiten
MF_MONAT = SY-DATLO(6).
ENDIF.
CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
EXPORTING
ACTUAL_MONTH = MF_MONAT
IMPORTING
SELECTED_MONTH = MF_MONAT
RETURN_CODE = MF_RETURNCODE
EXCEPTIONS
FACTORY_CALENDAR_NOT_FOUND = 01
HOLIDAY_CALENDAR_NOT_FOUND = 02
MONTH_NOT_FOUND = 03.
IF SY-SUBRC = 0 AND MF_RETURNCODE = 0.
ASSIGN (MF_DYNPFIELDS-FIELDNAME) TO <MF_FELD>. " ==>> note 148804
<MF_FELD> = MF_MONAT.
CALL FUNCTION 'CONVERSION_EXIT_PERI_OUTPUT'
EXPORTING
INPUT = MF_MONAT
IMPORTING
OUTPUT = MF_DYNPFIELDS-FIELDVALUE.
COLLECT MF_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = MF_HLP_REPID
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = MF_DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 01
INVALID_DYNPROFIELD = 02
INVALID_DYNPRONAME = 03
INVALID_DYNPRONUMMER = 04
INVALID_REQUEST = 05
NO_FIELDDESCRIPTION = 06
UNDEFIND_ERROR = 07. "<<== note 148804
ENDIF.
ENDIF.
ENDFORM. "MONAT_F4
*& Form get_month_dates
Calculating the Month Start & End Date
FORM GET_MONTH_DATES.
IF M1 = 'X'.
FYEAR = P_SPMON+0(4).
MON = P_SPMON+4(2).
CONCATENATE FYEAR MON '01' INTO R_BUDAT-LOW.
R_BUDAT-SIGN = 'I'.
R_BUDAT-OPTION = 'BT'.
CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
EXPORTING
I_DATE = R_BUDAT-LOW
IMPORTING
E_DATE = R_BUDAT-HIGH.
APPEND R_BUDAT.
CLEAR S_BUDAT.
REFRESH S_BUDAT.
S_BUDAT-SIGN = 'I'.
S_BUDAT-OPTION = 'BT'.
S_BUDAT-LOW = R_BUDAT-LOW.
S_BUDAT-HIGH = R_BUDAT-HIGH.
APPEND S_BUDAT.
ELSE.
FYEAR = P_SPMON+0(4).
MON = P_SPMON+4(2).
CONCATENATE FYEAR MON '01' INTO R_BUDAT-LOW.
R_BUDAT-SIGN = 'I'.
R_BUDAT-OPTION = 'BT'.
CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
EXPORTING
I_DATE = R_BUDAT-LOW
IMPORTING
E_DATE = R_BUDAT-HIGH.
APPEND R_BUDAT.
ENDIF.
ENDFORM. " get_month_dates
*& Form output_table_Check
checking for records for output
FORM OUTPUT_TABLE_CHECK .
DESCRIBE TABLE I_FINALT LINES INDEX.
IF INDEX EQ 0.
MESSAGE I041 WITH TEXT-005.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. "OUTPUT_TABLE_CHECK
*& Form Z_TOP_OF_PAGE
for setting the details in the top of page *
has no formal paramters *
FORM Z_TOP_OF_PAGE.
DATA: V_MON(2),
V_YR(40),
V_FIN(18),
V_FIN1(48),
LOW(10),
HIGH(10).
V_MON = P_SPMON+4(2).
V_YR = P_SPMON+0(4).
FHEADER-TYP = 'H'.
FHEADER-INFO = 'Stock Register Report (FG Stock)'.
APPEND FHEADER.
CLEAR FHEADER.
*if m1 = 'X'.
CONCATENATE 'Month = ' v_mon '.' v_yr INTO v_fin.
fheader-typ = 'H'.
fheader-info = v_fin.
APPEND fheader.
CLEAR fheader.
*endif."prabhu on 18.5.5
IF D1 = 'X'.
CLEAR S_BUDAT.
LOOP AT S_BUDAT.
CONCATENATE S_BUDAT-LOW6(2) '/' S_BUDAT-LOW4(2) '/'
S_BUDAT-LOW+0(4) INTO LOW.
CONCATENATE S_BUDAT-HIGH6(2) '/' S_BUDAT-HIGH4(2) '/'
S_BUDAT-HIGH+0(4) INTO HIGH.
CONCATENATE 'Date = ' LOW ' - ' HIGH INTO V_FIN1.
FHEADER-TYP = 'H'.
FHEADER-INFO = V_FIN1.
APPEND FHEADER.
CLEAR FHEADER.
ENDLOOP.
ENDIF.
ENDFORM. " Z_TOP_OF_PAGE
*& Form Z_LAYOUT_SETTINGS
this is done for setting the properties for the layout of the *
grid *
has no formal paramters *
FORM Z_LAYOUT_SETTINGS.
FS_LAYO-ZEBRA = 'X'. " Output in Zebra pattern
FS_LAYO-DETAIL_POPUP = 'X'. " A popup window appears to give
FS_LAYO-DETAIL_TITLEBAR = TEXT-022.
FS_LAYO-COLWIDTH_OPTIMIZE = 'X'.
ENDFORM. " Z_LAYOUT_SETTINGS
*& Form Z_ALV_EVENTS
This is used for handling the events TOP OF PAGE and the USER *
COMMAND event *
has no formal paramters *
FORM Z_ALV_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = FEVENTS[].
READ TABLE FEVENTS WITH KEY NAME = 'TOP_OF_PAGE'.
IF SY-SUBRC = 0.
FEVENTS-FORM = 'Z_TOPOFPAGE'.
MODIFY FEVENTS INDEX SY-TABIX.
CLEAR FEVENTS.
ENDIF.
READ TABLE FEVENTS WITH KEY NAME = 'USER_COMMAND'.
IF SY-SUBRC = 0.
FEVENTS-FORM = 'Z_USER_COMMAND'.
MODIFY FEVENTS INDEX SY-TABIX.
CLEAR FEVENTS.
ENDIF.
ENDFORM. "Z_ALV_EVENTS
*& Form Z_CREATE_FIELD_CATALOG
here the field catalog is created for the primary list *
no formal parameters *
FORM Z_CREATE_FIELD_CATALOG.
for the Plant
FCAT-FIELDNAME = 'WERKS'.
FCAT-KEY = 'X'.
FCAT-OUTPUTLEN = '000005'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Plant'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'C'.
FCAT-DATATYPE = 'CHAR'.
APPEND FCAT.
CLEAR FCAT.
for the Material Type
FCAT-FIELDNAME = 'MTART'.
FCAT-KEY = 'X'.
FCAT-OUTPUTLEN = '000006'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'MatTyp'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'C'.
FCAT-DATATYPE = 'CHAR'.
APPEND FCAT.
CLEAR FCAT.
for the Material No.
FCAT-FIELDNAME = 'MATNR'.
FCAT-KEY = 'X'.
fcat-hotspot = 'X'.
FCAT-OUTPUTLEN = '000018'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Material'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'C'.
FCAT-DATATYPE = 'CHAR'.
APPEND FCAT.
CLEAR FCAT.
for the Material Description
FCAT-FIELDNAME = 'MAKTX'.
FCAT-KEY = ''.
FCAT-OUTPUTLEN = '000040'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Description'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'C'.
FCAT-DATATYPE = 'CHAR'.
APPEND FCAT.
CLEAR FCAT.
for the Unit of Measure
FCAT-FIELDNAME = 'MEINS'.
FCAT-KEY = ''.
FCAT-OUTPUTLEN = '03'.
FCAT-JUST = 'C'.
FCAT-SELTEXT_M = 'UOM'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'C'.
FCAT-DATATYPE = 'UNIT'.
APPEND FCAT.
CLEAR FCAT.
for the Plant
FCAT-FIELDNAME = 'MONTH'.
FCAT-KEY = 'X'.
FCAT-OUTPUTLEN = '08'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'MONTH'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'C'.
FCAT-DATATYPE = 'CHAR'.
APPEND FCAT.
CLEAR FCAT.
for the Opening Stock
FCAT-FIELDNAME = 'C_STK'.
FCAT-HOTSPOT = ' '.
FCAT-OUTPUTLEN = '000016'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Opening Stock'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'Q'.
FCAT-DATATYPE = 'QUAN'.
fcat-do_sum = 'X'.
FCAT-JUST = 'R'.
FCAT-NO_ZERO = 'X'.
APPEND FCAT.
CLEAR FCAT.
for the Total Receipts
FCAT-FIELDNAME = 'TRECEP'.
FCAT-HOTSPOT = ' '.
FCAT-OUTPUTLEN = '000016'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Total Receipts'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'Q'.
FCAT-DATATYPE = 'QUAN'.
FCAT-DO_SUM = 'X'.
FCAT-JUST = 'R'.
FCAT-NO_ZERO = 'X'.
APPEND FCAT.
CLEAR FCAT.
for the Production
FCAT-FIELDNAME = 'PRODU'.
FCAT-HOTSPOT = ' '.
FCAT-OUTPUTLEN = '000016'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Production'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'Q'.
FCAT-DATATYPE = 'QUAN'.
FCAT-DO_SUM = 'X'.
FCAT-JUST = 'R'.
FCAT-NO_ZERO = 'X'.
APPEND FCAT.
CLEAR FCAT.
for the Other Plant Receipts
FCAT-FIELDNAME = 'RECEP'.
FCAT-HOTSPOT = ' '.
FCAT-OUTPUTLEN = '000016'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Othr Plnt Recpts'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'Q'.
FCAT-DATATYPE = 'QUAN'.
FCAT-DO_SUM = 'X'.
FCAT-JUST = 'R'.
FCAT-NO_ZERO = 'X'.
APPEND FCAT.
CLEAR FCAT.
Sales Return
FCAT-FIELDNAME = 'SAL_RET'.
FCAT-HOTSPOT = ' '.
FCAT-OUTPUTLEN = '000016'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Sales Return'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'Q'.
FCAT-DATATYPE = 'QUAN'.
FCAT-DO_SUM = 'X'.
FCAT-JUST = 'R'.
FCAT-NO_ZERO = 'X'.
APPEND FCAT.
CLEAR FCAT.
Total Dispatches
FCAT-FIELDNAME = 'TDISP'.
FCAT-HOTSPOT = ' '.
FCAT-OUTPUTLEN = '000016'.
FCAT-JUST = 'L'.
FCAT-SELTEXT_M = 'Total Dispatches'.
FCAT-DDICTXT = 'M'.
FCAT-INTTYPE = 'Q'.
FCAT-DATATYPE = 'QUAN'.
FCAT-DO_SUM = 'X'.
FCAT-JUST = 'R'.
FCAT-NO_ZERO = 'X'.
APPEND FCAT.
Maybe you are looking for
-
Contact and Calendar Duplications, sync and more issues!
I have the iPhone 4S. I decided to activate the iCloud on my phone through to iCloud and to my Windows PC laptop. However, this caused all my calendar entries to duplicate and I had to manually delete the duplications on my Outlook Calendar so that
-
Problem calling a EJB Java Client from Java Activity Agent
Hi, We have a wrapper java class that calls to an EJB through a JNDI lookup. The wrapper class is called from a workflow. The problem is that the call fail with the following message error: Error : getRemoteHome Lugar: ServiceLocator NamingException
-
Hi everyone, I am new to SQL server....I am learning C# programming using visual studio 2013 . And I want to learn SQL database language to create and practice C# database project....My computer meets all the hardware requirement for SQL installation
-
Why is there not a MobileMe icon in System Preferences on my Dome?
My MacBook Pro laptop has the MobileMe icon in system preferences but the Dome does not. Both hosts contain the latest software. Will this prevent the two hosts from syncing?
-
Installing SAP IDES 4.6c with Oracle DB under Windows 2000 server
Hi everyone. As many people, i would like to learn MM module and the only way is installing SAP IDES on my computer. I have a SAP IDES 4.6 with oracle DB and i want to install under w2k server. Is there any weblog explaining how to install it? If the