Really urgent: regarding MM04 REPORT
hi,
i had made dis code and i am not able to display the proper out put,plzz help me for idsplaying the output of program <REMOVED BY MODERATOR>.
CODE:-
REPORT ZNEW01 no standard page heading LINE-SIZE 310.
TABLES: cdhdr,cdpos.
DATA : BEGIN OF itab OCCURS 0,
objectclas LIKE cdhdr-objectclas,
objectid LIKE cdhdr-objectid,
username LIKE cdhdr-username,
udate LIKE cdhdr-udate,
utime LIKE cdhdr-utime,
tcode LIKE cdhdr-tcode,
change_ind LIKE cdhdr-change_ind,
changenr LIKE cdhdr-changenr,
END OF itab.
DATA: BEGIN OF itab1 OCCURS 0,
OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
objectid LIKE cdpos-objectid,
changenr LIKE cdpos-changenr,
fname LIKE cdpos-fname,
chngind LIKE cdpos-chngind,
value_new LIKE cdpos-value_new,
value_old LIKE cdpos-value_old,
END OF itab1.
DATA : BEGIN OF it_final OCCURS 0,
objectclas LIKE cdhdr-objectclas,
objectid LIKE cdhdr-objectid,
username LIKE cdhdr-username,
udate LIKE cdhdr-udate,
utime LIKE cdhdr-utime,
tcode LIKE cdhdr-tcode,
change_ind LIKE cdhdr-change_ind,
changenr LIKE cdhdr-changenr,
fname LIKE cdpos-fname,
chngind LIKE cdpos-chngind,
value_new LIKE cdpos-value_new,
value_old LIKE cdpos-value_old,
end of it_final.
select-options : m_date for cdhdr-udate.
SELECT objectclas objectid username udate utime tcode change_ind changenr
FROM cdhdr
INTO TABLE itab WHERE objectclas = 'MATERIAL' AND
change_ind = 'U' AND
udate IN m_date.
IF NOT itab[] IS INITIAL.
SELECT objectclas objectid changenr fname chngind value_new value_old
FROM cdpos
INTO TABLE itab1
FOR ALL ENTRIES IN itab
WHERE changenr = itab-changenr and chngind = itab-change_ind.
ENDIF.
*corresponding fields of
LOOP AT itab1.
READ TABLE itab WITH KEY changenr = itab1-changenr.
it_final-objectid = itab-objectid.
it_final-username = itab-username.
it_final-udate = itab-udate.
it_final-tcode = itab-tcode.
* it_final-fname = itab1-fname.
it_final-chngind = itab1-chngind.
it_final-value_old = itab1-value_old.
it_final-value_new = itab1-value_new.
APPEND it_final.
CLEAR it_final.
ENDLOOP.
loop at it_final.
write : / it_final-objectid,it_final-username,it_final-udate,it_final-tcode,it_final-chngind,it_final-value_old,it_final-value_new.
endloop.
Edited by: Alvaro Tejada Galindo on Feb 14, 2008 5:15 PM
Hi ..
I think refer to table MAST--material link to BOM.
U also refer t othe following tables of MM if necessary....
MARA - Material Master: General data
MAKT - Material Master: Description
MARM - Material Master: Unit of Measure
MAPE - Material master: Export control file
MARC - Material master: Plant data
MARD - Material master: Storage location
MAST - Material link to BOM
MBEW - Material valuation
MLGN Material Master: WM Inventory
MLGT Material Master: WM Inventory type
MDIP - Material: MRP profiles (field contents)
MKOP - Consignment price segment (old versions of SAP)
EBEW - Valuation of sales order stock
QBEW - Valuation of project stock
MVER Material Master: Consumption <Plant>
DVER Material Master: Consumption <MRP Area>
MVKE Material Master: Sales <Sales Org, Distr Ch>
MLAN - Material Master: Tax indicator
MARC - Material Master: Plant data
MAPR Material Master: Forecast
MARD Material Master: Storage Location
MCH1 Material Master: X Plant Batches
MCHA Material Master: Batches
MCHB Material Master: Batch Stock
MDMA - MRP Area data
DBVM - MRP Planning File Entry: MRP Area
MOFF - Outstanding Material Master Records (Maintenance status)
MARCH - Material Master C Segment: History
MARDH - Material Master Storage Location Segment: History
MBEWH - Material Valuation: History
MCHBH - Batch Stocks: History
MKOLH - Special Stocks from Vendor: History
MSCAH - Sales Order Stock at Vendor: History
MSKAH - Sales Order Stock: History
MSKUH - Special Stocks at Customer: History
MSLBH - Special Stocks at Vendor: History
MSPRH - Project Stock: History
MSSAH - Total Sales Order Stocks: History
MSSQH - Total Project Stocks: History
thnx
Sravani
Plz reward points if helpful....
Similar Messages
-
Urgent: regarding vendor report(tables)
Hi,
I am making a report in which i have to display the status of a vendor payment is done or not. I know that there are 2 tables which are going to be used i.e. BSIK n BSAK (for open items n cleared items) . i want to know is there any necessity of other tables such as BSIS n BSAS as they are the 1nes which are on the basis of g/l account (open n clear items).
Plzz provide me guidelines for it as help will be deifnately rewarded.Hi,
Actually i have to show the status of the vendor payment is done or not. r u sure the use of BSAS n BSIS table. what is the difference b/w VENDOR LINE ITEM DISPLAY - FBL2N and G/L Line item display -FBL3N.
This thing is making me confuse that the necessity of the tables as i have to display the payment of the vendors accoring to the MIGO ( in which the vendors are mentioned. for this thing i am taking XBLNR field from MKPF as it the common field b/w BKPF and after that taking the BELNR and XBLNR from BKPF to the BSAK n BSIK table.
Plzz tell me that i am using correct relationship among the tables also.It is really urgent to me .
Edited by: abaper2008 on May 23, 2008 6:49 AM
Edited by: abaper2008 on May 23, 2008 7:08 AM -
URGENT: REGARDING ROUTING REPORT(plzz help me out)
Hi,
I am making a report in which i have to display the stock during the routing i.e. in CA03 we get to know which are the operations are implemented on a material. the requirement is if there are 50 pcs of material are in 1st operation and only 10 materials are able to reach next stage of operations ,then how many pcs of a material are left among them? i want to know which are the tables used for these qtys as i am checking that in CA03 the values are in structure and i want to know in which tables these quantities to be present.
plzz help me out as it is really urgent and help will be definitely rewarded.
Edited by: ric .s on Apr 1, 2008 7:45 AMhi,
can anybody tell me which are the tables used in the routing? -
Urgent: regarding ALV report display problem
hi,
There are 3 problems:-
1.) I had made a ALV report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as PERIOD :- _______ to _______ on alv report ..
2.)the 2nd problem is dat when i use the ' wa_fieldcat-no_zero = 'X'. It eliminates all the leading zeros which are present which is okay when i it displays material no.. but the problem is dat it also deletes the other fields where the values are to be zeros.
i had used this FM:-
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ITS1-MATNR
IMPORTING
OUTPUT = ITS1-MATNR.
so that only matnr field are to be 0's.
3.) I want to delete the rows which use to contain the values 0's as there are no calculations are performing as these are displayed .
ANYbody having solution of this problem ,plzzzz provide the soluion of it as it is most urgent to me and dat person will definately rewarded.
regards,
ric.shi kiran,
thanks for ur response. here is d code which i am using it and plzz help me to figure out where i have to make changes:-
REPORT ZTEST03.
TABLES: ISEG,MARA.
TYPE-POOLS : SLIS.
INTERNAL TABLE FOR INVENTORY STOCK *****************
DATA: BEGIN OF ITS1 OCCURS 0,
MATNR LIKE ISEG-MATNR,
MEINS LIKE ISEG-MEINS,
MENGE LIKE ISEG-MENGE,
WRTZL LIKE ISEG-WRTZL,
BUCHM LIKE ISEG-BUCHM,
WRTBM LIKE ISEG-WRTBM,
WERKS LIKE ISEG-WERKS,
BUDAT LIKE ISEG-BUDAT,
MTART LIKE MARA-MTART,
ITEMDESC LIKE MAKT-MAKTX,
DIFFQTY LIKE ISEG-BUCHM,
DIFFVALUE LIKE ISEG-WRTBM,
END OF ITS1.
data: t_heading type slis_t_listheader.
SELECTION-SCREEN BEGIN OF BLOCK PAR1 WITH FRAME TITLE TEXT-001.
*********PARAMETERS*********
PARAMETERS : PLANT LIKE ISEG-WERKS OBLIGATORY.
*********SELECTION SCREEN OPTIONS*********
SELECT-OPTIONS : R_DATE FOR ISEG-BUDAT,
M_TYPE FOR MARA-MTART,
IT_M FOR MARA-MATNR.
*********DEFINING VARIABLES*********
SELECTION-SCREEN END OF BLOCK par1.
TOP-OF-PAGE.
PERFORM PG_HEADER.
START-OF-SELECTION.
SELECT DISTINCT A~MATNR A~MEINS A~MENGE A~WRTZL A~BUCHM A~WRTBM A~WERKS A~BUDAT B~MTART
FROM ISEG AS A INNER JOIN MARA AS B ON B~MATNR = A~MATNR
INTO CORRESPONDING FIELDS OF TABLE ITS1 WHERE B~MATNR = A~MATNR AND B~MEINS = A~MEINS AND A~WERKS = PLANT AND A~BUDAT IN R_DATE AND B~MTART IN M_TYPE AND B~MATNR IN IT_M.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ITS1-MATNR
IMPORTING
OUTPUT = ITS1-MATNR.
SORT ITS1 BY MATNR.
DELETE ADJACENT DUPLICATES FROM ITS1 WHERE MENGE = 0 AND BUCHM = 0.
LOOP AT ITS1.
ITS1-DIFFQTY = ITS1-MENGE - ITS1-BUCHM.
ITS1-DIFFVALUE = ITS1-WRTZL - ITS1-WRTBM.
SELECT SINGLE MAKTX FROM MAKT INTO ITS1-ITEMDESC WHERE MATNR = ITS1-MATNR.
MODIFY ITS1.
ENDLOOP.
PERFORM PRN_SMSTOCK_ALV.
WRITING DATA FROM D TABLES**********
FORM PG_HEADER.
WRITE : 'PHYSICAL INVENTORY AUDIT REPORT PLANT : ', PLANT.
ENDFORM.
*& Form PRN_SMSTOCK_ALV
text
--> p1 text
<-- p2 text
form PRN_SMSTOCK_ALV .
data: w_title type lvc_title,
w_repid type syrepid,
w_comm type slis_formname,
w_status type slis_formname,
x_layout type slis_layout_alv,
t_event type slis_t_event,
t_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv.
refresh t_fieldcat.
refresh t_event.
refresh t_sort.
clear x_layout.
clear w_title.
perform set_fieldcat2 using:
1 'MTART' 'MTART' 'MARA' '15' space 'MATERIAL TYPE' space space space space space space space space SPACE t_fieldcat 'L' 'C',
2 'MATNR' 'MATNR' 'MARA' '13' space 'MATERIAL NO. ' space space space space space space space space SPACE t_fieldcat 'R' 'C',
3 'ITEMDESC' 'MAKTX' 'MAKT' '25' space 'MATERIAL DESCRIPTION' space space space space space space space space SPACE t_fieldcat 'L' 'C',
4 'MEINS' 'MEINS' 'MARA' '5' space 'UOM' space space space space space space space space SPACE t_fieldcat 'C' 'C',
5 'MENGE' 'MENGE' 'ISEG' '13' space 'ORG.INV.QTY' space space space space space space space space SPACE t_fieldcat 'R' 'C',
6 'WRTZL' 'WRTZL' 'ISEG' '13' space 'ORG.INV.VALUE' space space space space space space space space SPACE t_fieldcat 'R' 'C',
7 'BUCHM' 'BUCHM' 'ISEG' '13' space 'PHY.INV.QTY' space space space space space space space space SPACE t_fieldcat 'R' 'C',
8 'WRTBM' 'WRTBM' 'ISEG' '13' space 'PHY.INV.VALUE' space space space space space space space space SPACE t_fieldcat 'R' 'C',
9 'DIFFQTY' 'MENGE' 'ISEG' '13' space 'DIFF.INV.QTY' space space space space space space space space SPACE t_fieldcat 'R' 'C',
10 'DIFFVALUE' 'WRTZL' 'ISEG' '13' space 'DIFF.INV.VALUE' space space space space space space space space SPACE t_fieldcat SPACE 'P'.
x_layout-zebra = 'X'.
perform set_top_page_heading using t_heading t_event.
perform set_events using t_event.
w_status = ''.
w_repid = sy-repid.
w_comm = 'USER_COMMAND'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = w_repid
it_fieldcat = t_fieldcat
i_Callback_top_of_page = 'Top-of-page'
is_layout = x_layout
it_sort = t_sort
i_callback_pf_status_set = w_status
i_callback_user_command = w_comm
i_save = 'X'
it_events = t_event
i_grid_title = w_title
tables
t_outtab = ITS1
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.
FORM set_fieldcat2 USING
p_colpos p_fieldname p_ref_fieldname p_ref_tabname
p_outputlen p_noout
p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
p_hotspot p_showasicon p_checkbox p_edit
p_dosum
t_fieldcat TYPE slis_t_fieldcat_alv
P_JUST
P_FTYPE.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
General settings
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-no_zero = 'X'.
wa_fieldcat-col_pos = p_colpos.
wa_fieldcat-no_out = p_noout.
wa_fieldcat-hotspot = p_hotspot.
wa_fieldcat-checkbox = p_checkbox.
wa_fieldcat-icon = p_showasicon.
wa_fieldcat-do_sum = p_dosum.
Set output length.
IF NOT p_outputlen IS INITIAL.
wa_fieldcat-outputlen = p_outputlen.
ENDIF.
Set text headers.
IF NOT p_seltext_m IS INITIAL.
wa_fieldcat-seltext_m = p_seltext_m.
ENDIF.
IF NOT p_seltext_l IS INITIAL.
wa_fieldcat-seltext_l = p_seltext_l.
ENDIF.
IF NOT p_seltext_s IS INITIAL.
wa_fieldcat-seltext_s = p_seltext_s.
ENDIF.
IF NOT p_reptext_ddic IS INITIAL.
wa_fieldcat-reptext_ddic = p_reptext_ddic.
ENDIF.
IF NOT p_ddictxt IS INITIAL.
wa_fieldcat-ddictxt = p_ddictxt.
ENDIF.
IF NOT P_JUST IS INITIAL.
WA_FIELDCAT-JUST = P_JUST.
ENDIF.
Set as editable or not.
IF NOT p_edit IS INITIAL.
wa_fieldcat-input = 'X'.
wa_fieldcat-edit = 'X'.
ENDIF.
APPEND wa_fieldcat TO t_fieldcat.
ENDFORM. "set_fieldcat2
======================== Subroutines called by ALV ================
*& Form top_of_page
Called on top_of_page ALV event.
Prints the heading.
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_heading.
ENDFORM.
form set_top_page_heading using t_heading type slis_t_listheader
t_events type slis_t_event.
data: x_heading type slis_listheader,
x_event type line of slis_t_event.
Report title
clear t_heading[].
clear x_heading.
x_heading-typ = 'H'.
x_heading-info = 'PHYSICAL INVENTORY AUDIT REPORT'.
append x_heading to t_heading.
Plant Name
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'PLANT: '.
x_heading-info = its1-werks.
append x_heading to t_heading.
Posting Date
*clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'POSTING DATE: '.
x_heading-info = ITS1-BUDAT.
append x_heading to t_heading.
Control Date
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'CONTROL No: '.
x_heading-info = its1-werks.
append x_heading to t_heading.
Control date
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'CONTROL DATE: '.
x_heading-info = its1-werks.
append x_heading to t_heading.
User who is running the report
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'User: '.
x_heading-info = sy-uname.
append x_heading to t_heading.
Date of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Date: '.
write sy-datum to x_heading-info.
append x_heading to t_heading.
Time of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Time: '.
write sy-uzeit to x_heading-info.
append x_heading to t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-form = 'TOP_OF_PAGE'.
append x_event to t_events.
endform.
form set_events using t_events type slis_t_event.
data: x_event type line of slis_t_event.
endform.
plzzz help me out as it is most urgent to me.
regards,
ric.s -
URGENT: - REGARDING ALV REPORT
hi,
i had made dis report in ALV and i want to display d heading format as follows:-
NAME:- TEST PROGRAM
date: - 21.05.2007
time:- 1:30:23 am
moreover i want to see the print perview of it but it is giving runtime error.
plz help me in solving dis problem and he or she will be definately rewarded..
*& Report ZMFTEST5
REPORT ZMFTEST5 no standard page heading LINE-SIZE 310.
TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
DATA : T_HEADING TYPE slis_t_listheader.
INTERNAL TABLE FOR SALES ORDER *****************
DATA : BEGIN OF ITSO OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
BSTNK LIKE VBAK-BSTNK,
KUNNR LIKE VBAK-KUNNR,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
WMENG LIKE VBEP-WMENG,
NTGEW LIKE MARA-NTGEW,
BRGEW LIKE MARA-BRGEW,
GEWEI LIKE MARA-GEWEI,
SPART LIKE VBAK-SPART,
BMENG LIKE VBEP-BMENG,
EDATU LIKE VBEP-EDATU,
BSTKD LIKE VBKD-BSTKD,
WERKS LIKE VBAP-WERKS,
MEINS LIKE MARA-MEINS,
KWMENG LIKE VBAP-KWMENG,
KLMENG LIKE VBAP-KLMENG,
BALQTY LIKE VBAP-KLMENG,
SOGWT LIKE MARA-BRGEW,
SONWT LIKE MARA-BRGEW,
SINWT LIKE MARA-BRGEW,
BALGWT LIKE MARA-BRGEW,
BALNWT LIKE MARA-BRGEW,
DISPNWT LIKE MARA-BRGEW,
PARTYNAME LIKE KNA1-NAME1,
ITEMDESC LIKE MAKT-MAKTX,
STATUS TYPE C,
END OF ITSO.
DATA:B_QTY TYPE P LENGTH 7 DECIMALS 3.
***********PARAMETERS***************
PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.
*********SELECTION SCREEN OPTIONS*********
SELECT-OPTIONS : SO_ORD FOR VBAK-VBELN,
SO_PARTY FOR VBAK-KUNNR,
IT_M FOR MARA-MATNR,
DIV FOR VBAK-SPART,
SO_DATE FOR VBAK-ERDAT,
S_DATE FOR VBEP-EDATU.
START-OF-SELECTION.
SELECT DISTINCT A~VBELN A~ERDAT A~BSTNK A~KUNNR B~SPART B~MATNR B~POSNR B~WERKS B~KWMENG B~KBMENG C~NTGEW C~BRGEW C~GEWEI D~WMENG D~BMENG D~EDATU D~VBELN
FROM VBAK AS A INNER JOIN VBAP AS B ON B~VBELN = A~VBELN
INNER JOIN MARA AS C ON C~MATNR = B~MATNR
INNER JOIN VBEP AS D ON D~WMENG > 0 AND D~VBELN = A~VBELN AND D~POSNR = B~POSNR
INTO CORRESPONDING FIELDS OF TABLE ITSO
WHERE A~VBELN IN SO_ORD AND A~KUNNR IN SO_PARTY AND B~SPART IN DIV AND A~ERDAT IN SO_DATE AND D~EDATU IN S_DATE AND B~MATNR IN IT_M AND B~WERKS = PLANT.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
DATA : V_NETWT LIKE MARA-NTGEW,
V_GRWT LIKE MARA-NTGEW,
V_SOSTAT TYPE C.
LOOP AT ITSO.
if ITSO-bmeng = 0.
V_SOSTAT = 'A'.
ELSEIF ITSO-WMENG <> ITSO-BMENG.
V_SOSTAT = 'B'.
ELSE.
V_SOSTAT = 'C'.
ENDIF.
IF ITSO-GEWEI = 'G'.
V_NETWT = ITSO-NTGEW / 1000.
V_GRWT = ITSO-BRGEW / 1000.
ELSEIF ITSO-GEWEI = 'KG'.
V_NETWT = ITSO-NTGEW.
V_GRWT = ITSO-BRGEW.
ELSEIF ITSO-GEWEI = 'TO'.
V_NETWT = ITSO-NTGEW * 1000.
V_GRWT = ITSO-BRGEW * 1000.
ENDIF.
ITSO-STATUS = V_SOSTAT.
ITSO-SOGWT = V_GRWT * ITSO-WMENG / 1000.
ITSO-SONWT = V_NETWT * ITSO-WMENG / 1000.
ITSO-SINWT = V_GRWT * ITSO-BMENG / 1000.
ITSO-BALGWT = V_GRWT * ( ITSO-WMENG - ITSO-BMENG ) / 1000.
ITSO-BALNWT = V_NETWT * ( ITSO-WMENG - ITSO-BMENG ) / 1000.
ITSO-DISPNWT = V_NETWT * ITSO-BMENG / 1000.
ITSO-BALQTY = ITSO-WMENG - ITSO-BMENG.
SELECT SINGLE NAME1 FROM KNA1 INTO ITSO-PARTYNAME WHERE KUNNR = ITSO-KUNNR.
SELECT SINGLE MAKTX FROM MAKT INTO ITSO-ITEMDESC WHERE MATNR = ITSO-MATNR.
MODIFY ITSO.
ENDLOOP.
perform f_build_eventcat.
PERFORM LAYOUT using t_heading.
END-OF-SELECTION.
FORM LAYOUT using t_heading type slis_t_listheader.
data : t_event type slis_t_event.
PERFORM FCAT USING 'WERKS' 'ITSO' '' 'PLANT ' 'WERKS' 'VBAP' ''.
PERFORM FCAT USING 'VBELN' 'ITSO' '' 'SO NO. ' 'VBELN' 'VBAK' ''.
PERFORM FCAT USING 'ERDAT' 'ITSO' '' 'S.O.DATE' 'ERDAT' 'VBAK' ''.
PERFORM FCAT USING 'BSTNK' 'ITSO' '' 'P.O.N.O.' 'BSTNK' 'VBAK' ''.
PERFORM FCAT USING 'KUNNR' 'ITSO' '' 'PARTY ' 'KUNNR' 'VBAP' ''.
PERFORM FCAT USING 'PARTYNAME' 'ITSO' '' 'PARTY DESCRIPTION' 'PARTYNAME' '' ''.
PERFORM FCAT USING 'ITEMDESC' 'ITSO' '' 'MATERIAL DESCRIPTION' 'ITEMDESC' '' ''.
PERFORM FCAT USING 'MATNR' 'ITSO' '' 'MAT.NO. ' 'MATNR' 'MARA' ''.
PERFORM FCAT USING 'POSNR' 'ITSO' '' 'LINE.ITEM' 'POSNR' 'VBAP' ''.
PERFORM FCAT USING 'WMENG' 'ITSO' '' 'S.O.QTY' 'WMENG' 'VBEP' '' .
PERFORM FCAT USING 'EDATU' 'ITSO' '' 'SCH.DATE' 'EDATU' 'VBEP' ''.
PERFORM FCAT USING 'SONWT' 'ITSO' '' 'S.O.NWT ' 'P' '' ''.
PERFORM FCAT USING 'SOGWT' 'ITSO' '' 'S.O.GWT ' 'P' '' ''.
PERFORM FCAT USING 'SPART' 'ITSO' '' 'DIV ' 'SPART' 'VBAP' ''.
PERFORM FCAT USING 'BMENG' 'ITSO' '' 'DISP.QTY' 'BMENG' 'VBEP' ''.
PERFORM FCAT USING 'DISPNWT' 'ITSO' '' 'DISP.NT.WT ' 'P' '' ''.
PERFORM FCAT USING 'BALQTY' 'ITSO' '' 'BAL.QTY.' 'P' '' ''.
PERFORM FCAT USING 'BALNWT' 'ITSO' '' 'BAL.NT.WT ' 'P' '' ''.
PERFORM FCAT USING 'BALGWT' 'ITSO' '' 'BAL.GR.WT ' 'P' '' ''.
PERFORM FCAT USING 'STATUS' 'ITSO' '' 'STATUS' 'STATUS' '' ''.
refresh t_event.
*perform set_top_page_heading using t_heading t_event.
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = F1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITSO
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM.
*FORM F_REPORT_HEADER_ALV.
*CALL FUNCTION 'Z_HEAD_PRINT'
EXPORTING
WRITE: / TITLE1 = 'XYZ Limited'
TITLE2 = 'Sales Order Report'
TITLE3 = 'Created on '
COLOR = 'X'.
*ENDFORM.
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM.
*& Form set_top_page_heading
text
-->P_T_HEADING text
*form set_top_page_heading using t_heading
t_events type slis_t_event.
*data: x_heading type slis_listheader,
x_event type line of slis_t_event.
Report title
clear t_heading[].
clear x_heading.
x_heading-typ = 'H'.
x_heading-info = ''(001).
append x_heading to t_heading.
t_heading-info = 'TEST'.
t_heading-typ = 'H'.
Program name
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Program: '.
x_heading-info = sy-repid.
append x_heading to t_heading.
User who is running the report
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'User: '.
x_heading-info = sy-uname.
append x_heading to t_heading.
Date of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Date: '.
write sy-datum to x_heading-info.
append x_heading to t_heading.
Time of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Time: '.
write sy-uzeit to x_heading-info.
append x_heading to t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-form = 'TOP_OF_PAGE'.
append x_event to t_events.
*endform. " set_top_page_headingHi,
i had change ur code just copy this and try,i hope it will work.
REPORT ZMFTEST5 no standard page heading LINE-SIZE 310.
TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
****************CHANGES**************
DATA : FDATE TYPE STRING,
FTIME TYPE STRING,
FNAME TYPE STRING.
****************CHANGES**************
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
DATA: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
DATA : T_HEADING TYPE slis_t_listheader.
INTERNAL TABLE FOR SALES ORDER *****************
DATA : BEGIN OF ITSO OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
BSTNK LIKE VBAK-BSTNK,
KUNNR LIKE VBAK-KUNNR,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
WMENG LIKE VBEP-WMENG,
NTGEW LIKE MARA-NTGEW,
BRGEW LIKE MARA-BRGEW,
GEWEI LIKE MARA-GEWEI,
SPART LIKE VBAK-SPART,
BMENG LIKE VBEP-BMENG,
EDATU LIKE VBEP-EDATU,
BSTKD LIKE VBKD-BSTKD,
WERKS LIKE VBAP-WERKS,
MEINS LIKE MARA-MEINS,
KWMENG LIKE VBAP-KWMENG,
KLMENG LIKE VBAP-KLMENG,
BALQTY LIKE VBAP-KLMENG,
SOGWT LIKE MARA-BRGEW,
SONWT LIKE MARA-BRGEW,
SINWT LIKE MARA-BRGEW,
BALGWT LIKE MARA-BRGEW,
BALNWT LIKE MARA-BRGEW,
DISPNWT LIKE MARA-BRGEW,
PARTYNAME LIKE KNA1-NAME1,
ITEMDESC LIKE MAKT-MAKTX,
STATUS TYPE C,
END OF ITSO.
DATA:B_QTY TYPE P LENGTH 7 DECIMALS 3.
***********PARAMETERS***************
PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.
*********SELECTION SCREEN OPTIONS*********
SELECT-OPTIONS : SO_ORD FOR VBAK-VBELN,
SO_PARTY FOR VBAK-KUNNR,
IT_M FOR MARA-MATNR,
DIV FOR VBAK-SPART,
SO_DATE FOR VBAK-ERDAT,
S_DATE FOR VBEP-EDATU.
START-OF-SELECTION.
SELECT DISTINCT A~VBELN A~ERDAT A~BSTNK A~KUNNR B~SPART B~MATNR B~POSNR B~WERKS B~KWMENG B~KBMENG C~NTGEW C~BRGEW C~GEWEI D~WMENG D~BMENG D~EDATU D~VBELN
FROM VBAK AS A INNER JOIN VBAP AS B ON B~VBELN = A~VBELN
INNER JOIN MARA AS C ON C~MATNR = B~MATNR
INNER JOIN VBEP AS D ON D~WMENG > 0 AND D~VBELN = A~VBELN AND D~POSNR = B~POSNR
INTO CORRESPONDING FIELDS OF TABLE ITSO
WHERE A~VBELN IN SO_ORD AND A~KUNNR IN SO_PARTY AND B~SPART IN DIV AND A~ERDAT IN SO_DATE AND D~EDATU IN S_DATE AND B~MATNR IN IT_M AND B~WERKS = PLANT.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
DATA : V_NETWT LIKE MARA-NTGEW,
V_GRWT LIKE MARA-NTGEW,
V_SOSTAT TYPE C.
LOOP AT ITSO.
if ITSO-bmeng = 0.
V_SOSTAT = 'A'.
ELSEIF ITSO-WMENG <> ITSO-BMENG.
V_SOSTAT = 'B'.
ELSE.
V_SOSTAT = 'C'.
ENDIF.
IF ITSO-GEWEI = 'G'.
V_NETWT = ITSO-NTGEW / 1000.
V_GRWT = ITSO-BRGEW / 1000.
ELSEIF ITSO-GEWEI = 'KG'.
V_NETWT = ITSO-NTGEW.
V_GRWT = ITSO-BRGEW.
ELSEIF ITSO-GEWEI = 'TO'.
V_NETWT = ITSO-NTGEW * 1000.
V_GRWT = ITSO-BRGEW * 1000.
ENDIF.
ITSO-STATUS = V_SOSTAT.
ITSO-SOGWT = V_GRWT * ITSO-WMENG / 1000.
ITSO-SONWT = V_NETWT * ITSO-WMENG / 1000.
ITSO-SINWT = V_GRWT * ITSO-BMENG / 1000.
ITSO-BALGWT = V_GRWT * ( ITSO-WMENG - ITSO-BMENG ) / 1000.
ITSO-BALNWT = V_NETWT * ( ITSO-WMENG - ITSO-BMENG ) / 1000.
ITSO-DISPNWT = V_NETWT * ITSO-BMENG / 1000.
ITSO-BALQTY = ITSO-WMENG - ITSO-BMENG.
SELECT SINGLE NAME1 FROM KNA1 INTO ITSO-PARTYNAME WHERE KUNNR = ITSO-KUNNR.
SELECT SINGLE MAKTX FROM MAKT INTO ITSO-ITEMDESC WHERE MATNR = ITSO-MATNR.
MODIFY ITSO.
ENDLOOP.
perform f_build_eventcat.
PERFORM LAYOUT using t_heading.
END-OF-SELECTION.
FORM LAYOUT using t_heading type slis_t_listheader.
data : t_event type slis_t_event.
PERFORM FCAT USING 'WERKS' 'ITSO' '' 'PLANT ' 'WERKS' 'VBAP' ''.
PERFORM FCAT USING 'VBELN' 'ITSO' '' 'SO NO. ' 'VBELN' 'VBAK' ''.
PERFORM FCAT USING 'ERDAT' 'ITSO' '' 'S.O.DATE' 'ERDAT' 'VBAK' ''.
PERFORM FCAT USING 'BSTNK' 'ITSO' '' 'P.O.N.O.' 'BSTNK' 'VBAK' ''.
PERFORM FCAT USING 'KUNNR' 'ITSO' '' 'PARTY ' 'KUNNR' 'VBAP' ''.
PERFORM FCAT USING 'PARTYNAME' 'ITSO' '' 'PARTY DESCRIPTION' 'PARTYNAME' '' ''.
PERFORM FCAT USING 'ITEMDESC' 'ITSO' '' 'MATERIAL DESCRIPTION' 'ITEMDESC' '' ''.
PERFORM FCAT USING 'MATNR' 'ITSO' '' 'MAT.NO. ' 'MATNR' 'MARA' ''.
PERFORM FCAT USING 'POSNR' 'ITSO' '' 'LINE.ITEM' 'POSNR' 'VBAP' ''.
PERFORM FCAT USING 'WMENG' 'ITSO' '' 'S.O.QTY' 'WMENG' 'VBEP' '' .
PERFORM FCAT USING 'EDATU' 'ITSO' '' 'SCH.DATE' 'EDATU' 'VBEP' ''.
PERFORM FCAT USING 'SONWT' 'ITSO' '' 'S.O.NWT ' 'P' '' ''.
PERFORM FCAT USING 'SOGWT' 'ITSO' '' 'S.O.GWT ' 'P' '' ''.
PERFORM FCAT USING 'SPART' 'ITSO' '' 'DIV ' 'SPART' 'VBAP' ''.
PERFORM FCAT USING 'BMENG' 'ITSO' '' 'DISP.QTY' 'BMENG' 'VBEP' ''.
PERFORM FCAT USING 'DISPNWT' 'ITSO' '' 'DISP.NT.WT ' 'P' '' ''.
PERFORM FCAT USING 'BALQTY' 'ITSO' '' 'BAL.QTY.' 'P' '' ''.
PERFORM FCAT USING 'BALNWT' 'ITSO' '' 'BAL.NT.WT ' 'P' '' ''.
PERFORM FCAT USING 'BALGWT' 'ITSO' '' 'BAL.GR.WT ' 'P' '' ''.
PERFORM FCAT USING 'STATUS' 'ITSO' '' 'STATUS' 'STATUS' '' ''.
refresh t_event.
*perform set_top_page_heading using t_heading t_event.
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK
I_CALLBACK_HTML_TOP_OF_PAGE = 'TOP'
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = F1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITSO
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM.
*FORM F_REPORT_HEADER_ALV.
*CALL FUNCTION 'Z_HEAD_PRINT'
EXPORTING
WRITE: / TITLE1 = 'XYZ Limited'
TITLE2 = 'Sales Order Report'
TITLE3 = 'Created on '
COLOR = 'X'.
*ENDFORM.
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM.
FORM TOP.
DATA: WT_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER.
CONCATENATE 'DATE:-' SY-DATUM INTO FDATE.
CONCATENATE 'TIME:-' SY-UZEIT INTO FTIME.
FNAME = 'NAME:- TEST'.
WA_HEADER-TYP = HEADER.
WA_HEADER-INFO = FNAME.
APPEND WA_HEADER TO WT_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = HEADER.
WA_HEADER-INFO = FDATE.
APPEND WA_HEADER TO WT_HEADER.
CLEAR WA_HEADER.
WA_HEADER-TYP = HEADER.
WA_HEADER-INFO = FTIME.
APPEND WA_HEADER TO WT_HEADER.
CLEAR WA_HEADER.
ENDFORM.
*& Form set_top_page_heading
text
-->P_T_HEADING text
*form set_top_page_heading using t_heading
t_events type slis_t_event.
*data: x_heading type slis_listheader,
x_event type line of slis_t_event.
Report title
clear t_heading[].
clear x_heading.
x_heading-typ = 'H'.
x_heading-info = ''(001).
append x_heading to t_heading.
t_heading-info = 'TEST'.
t_heading-typ = 'H'.
Program name
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Program: '.
x_heading-info = sy-repid.
append x_heading to t_heading.
User who is running the report
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'User: '.
x_heading-info = sy-uname.
append x_heading to t_heading.
Date of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Date: '.
write sy-datum to x_heading-info.
append x_heading to t_heading.
Time of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Time: '.
write sy-uzeit to x_heading-info.
append x_heading to t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-form = 'TOP_OF_PAGE'.
append x_event to t_events.
*endform. " set_top_page_heading
*please do reward points if helpful
Thanks and Regards,
S.N.Venkatesh -
Re: URGENT: REGARDING ALV REPORT
hi,
i am making dis report :-
TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
**DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
INTERNAL TABLE FOR SALES ORDER *****************
DATA : BEGIN OF ITSO OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
BSTNK LIKE VBAK-BSTNK,
KUNNR LIKE VBAK-KUNNR,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
WMENG LIKE VBEP-WMENG,
NTGEW LIKE MARA-NTGEW,
BRGEW LIKE MARA-BRGEW,
GEWEI LIKE MARA-GEWEI,
SPART LIKE VBAK-SPART,
BMENG LIKE VBEP-BMENG,
EDATU LIKE VBEP-EDATU,
BSTKD LIKE VBKD-BSTKD,
WERKS LIKE VBAP-WERKS,
MEINS LIKE MARA-MEINS,
KWMENG LIKE VBAP-KWMENG,
KLMENG LIKE VBAP-KLMENG,
END OF ITSO.
Heading of the report.
data: t_heading type slis_t_listheader.
***********PARAMETERS***************
PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.
*********SELECTION SCREEN OPTIONS*********
SELECT-OPTIONS : SO_ORD FOR VBAK-VBELN,
SO_PARTY FOR VBAK-KUNNR,
IT_M FOR MARA-MATNR,
DIV FOR VBAK-SPART,
SO_DATE FOR VBAK-ERDAT,
S_DATE FOR VBEP-EDATU. .
START-OF-SELECTION.
SELECT DISTINCT AVBELN AERDAT ABSTNK AKUNNR BSPART BMATNR BPOSNR BWERKS BKWMENG BKBMENG CNTGEW CBRGEW CGEWEI DWMENG DBMENG DEDATU D~VBELN
FROM VBAK AS A INNER JOIN VBAP AS B ON BVBELN = AVBELN
INNER JOIN MARA AS C ON CMATNR = BMATNR
INNER JOIN VBEP AS D ON DWMENG > 0 AND DVBELN = AVBELN AND DPOSNR = B~POSNR
INTO CORRESPONDING FIELDS OF TABLE ITSO
WHERE AVBELN IN SO_ORD AND AKUNNR IN SO_PARTY AND BSPART IN DIV AND AERDAT IN SO_DATE AND DEDATU IN S_DATE AND BMATNR IN IT_M AND B~WERKS = PLANT.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
FORM LAYOUT.
PERFORM FCAT USING 'WERKS' 'ITSO' '' 'PLANT ' 'WERKS' 'VBAP' ''.
PERFORM FCAT USING 'VBELN' 'ITSO' '' 'S.O.NO. ' 'VBELN' 'VBAK' ''.
PERFORM FCAT USING 'ERDAT' 'ITSO' '' 'S.O.DATE' 'ERDAT' 'VBAK' ''.
PERFORM FCAT USING 'BSTNK' 'ITSO' '' 'P.O.N.O' 'BSTNK' 'VBAK' ''.
PERFORM FCAT USING 'KUNNR' 'ITSO' '' 'PARTY ' 'KUNNR' 'VBAP' ''.
PERFORM FCAT USING 'MATNR' 'ITSO' '' 'MAT.NO.' 'MATNR' 'MARA' ''.
PERFORM FCAT USING 'WMENG' 'ITSO' '' 'S.O.QTY' 'WMENG' 'VBEP' ''.
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = F1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITSO
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
and i want to add dis code: -
DATA: B_QTY TYPE P LENGTH 7 DECIMALS 3,
B_GR_W TYPE P LENGTH 5 DECIMALS 3,
B_NT_W TYPE P LENGTH 5 DECIMALS 3,
ITEM_NTW TYPE P LENGTH 5 DECIMALS 3,
ITEM_GRW TYPE P LENGTH 5 DECIMALS 3,
ITEM_DISP TYPE P LENGTH 5 DECIMALS 3,
CNT(5) TYPE N.
CNT = 0.
DATA : V_SOSTAT TYPE C,
V_NETWT LIKE MARA-NTGEW,
V_GRWT LIKE MARA-BRGEW,
V_DESPQTY TYPE P LENGTH 5 DECIMALS 3,
V_TSONWT TYPE P LENGTH 5 DECIMALS 3,
V_TSOGWT TYPE P LENGTH 5 DECIMALS 3,
V_TSINWT TYPE P LENGTH 5 DECIMALS 3,
V_TBALNWT TYPE P LENGTH 5 DECIMALS 3,
V_TBALGWT TYPE P LENGTH 5 DECIMALS 3.
V_TSONWT = 0.
V_TSOGWT = 0.
V_TSINWT = 0.
V_TBALNWT = 0.
V_TBALGWT = 0.
*LOOP AT ITSO.
loop at t_data.
if t_data-bmeng = 0.
V_SOSTAT = 'A'.
ELSEIF t_data-WMENG <> t_data-BMENG.
V_SOSTAT = 'B'.
ELSE.
V_SOSTAT = 'C'.
ENDIF.
if ( PEND = 'X' AND ( V_SOSTAT = 'A' OR V_SOSTAT = 'B' ) ) OR ( UNTC = 'X' AND V_SOSTAT = 'A' ) OR ( COMP = 'X' AND V_SOSTAT = 'C' ) OR ALL_E = 'X'.
CNT = CNT + 1.
IF ITSO-BMENG = 0.
if wa_data-bmeng = 0.
V_SOSTAT = 'A'.
ELSEIF ITSO-WMENG <> ITSO-BMENG.
V_SOSTAT = 'B'.
ELSE.
V_SOSTAT = 'C'.
ENDIF.
if ( PEND = 'X' AND ( V_SOSTAT = 'A' OR V_SOSTAT = 'B' ) ) OR ( UNTC = 'X' AND V_SOSTAT = 'A' ) OR ( COMP = 'X' AND V_SOSTAT = 'C' ) OR ALL_E = 'X'.
CNT = CNT + 1.
SELECT SINGLE MAKTX FROM MAKT INTO V_ITEM WHERE MATNR = ITSO-MATNR.
SELECT SINGLE NAME1 FROM KNA1 INTO V_ADDR WHERE KUNNR = ITSO-KUNNR.*
IF ITSO-GEWEI = 'G'.
V_NETWT = ITSO-NTGEW / 1000.
V_GRWT = ITSO-BRGEW / 1000.
ELSEIF ITSO-GEWEI = 'KG'.
V_NETWT = ITSO-NTGEW.
V_GRWT = ITSO-BRGEW.
ELSEIF ITSO-GEWEI = 'TO'.
V_NETWT = ITSO-NTGEW * 1000.
V_GRWT = ITSO-BRGEW * 1000.
ENDIF.
V_DESPQTY = ITSO-BMENG.
ITEM_NTW = V_NETWT * ITSO-WMENG / 1000.
ITEM_GRW = V_GRWT * ITSO-WMENG / 1000.
ITEM_DISP = V_NETWT * V_DESPQTY / 1000.
B_QTY = ITSO-WMENG - V_DESPQTY.
B_NT_W = V_NETWT * B_QTY / 1000.
B_GR_W = V_GRWT * B_QTY / 1000.
HOW CAN I DISPLAY IT is a calculation stored in d variable.
providing dis solution to dis problem will b rewarded....take a marker and write calculation....!!!!
waiting for reward point......... -
VERY URGENT:REGARDING ALV REPORT
HI,
I am making Interactive alv report in which i have to display 3 views in a single report i.e.
1.) I have to display :-
RAW MATERIAL DAYS
BOP DAYS
Here days are the difference b/w the Material Doc. Date and Requsition Approval date.
(which i have already calculated.)
2.) When i double click the raw material or bop option then material no and days are to be dislplayed.
3.) After double clicking the material then the its migo status and requsition status to be dislplayed .(this thing i had performed )
My main problem is dat i have to write it all in a single ALV but its little confusing to me as i am doing this kind of report for first time.
If anybody provide me useful or solved awnser ,he or she will be definately rewarded.
Message was edited by:
ric .shi ric.s
check this prog
*& Report ZSAMP_INTERCTIVE *
REPORT zsamp_interctive .
TABLES: mara,vbap.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE mara-matnr,
ernam LIKE mara-ernam,
END OF itab.
DATA : BEGIN OF itab1 OCCURS 0,
matnr LIKE vbap-matnr,
vbeln LIKE vbap-vbeln,
END OF itab1.
DATA: fld(20) TYPE c,val LIKE mara-matnr .
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: m FOR mara-matnr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk1.
*AT SELECTION-SCREEN ON m.
SELECT SINGLE matnr FROM mara INTO mara-matnr WHERE matnr = m.
IF sy-subrc NE 0.
MESSAGE e000(zz) WITH 'invalid ' mara-matnr 'in your ' 'selection'.
ENDIF.
START-OF-SELECTION.
SELECT matnr ernam INTO TABLE itab FROM mara WHERE matnr IN m.
SELECT matnr vbeln INTO TABLE itab1 FROM vbap FOR ALL ENTRIES IN itab
WHERE matnr = itab-matnr.
END-OF-SELECTION.
LOOP AT itab.
WRITE:/20 itab-matnr,40 itab-ernam.
hide itab-matnr.
CLEAR itab-matnr.
ENDLOOP.
AT LINE-SELECTION.
GET CURSOR FIELD fld VALUE val.
CASE fld.
WHEN 'ITAB-MATNR'.
WRITE:/ val.
ENDCASE.
CASE sy-lsind.
WHEN '1'.
SET PF-STATUS 'XX2'.
SET TITLEBAR 'XX2'.
IF itab1[] IS INITIAL.
WRITE:/ 'no data found for itab1 in first secondary list'.
ENDIF.
LOOP AT itab1.
WRITE:/30 itab1-matnr,60 itab1-vbeln.
hide itab1-matnr.
ENDLOOP.
WHEN '2'.
SET PF-STATUS 'XX2'.
SET TITLEBAR 'XX2'.
LOOP AT itab.
WRITE:/30 itab-matnr,60 itab-ernam.
ENDLOOP.
ENDCASE.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'SET'.
IF sy-lsind = 1.
WINDOW STARTING AT 5 3 ENDING AT 40 10.
WRITE 'Select line for a second window'.
ELSEIF sy-lsind = 2.
WINDOW STARTING AT 45 10 ENDING AT 60 12.
WRITE 'Last window'.
ENDIF.
WHEN 'BACK'.
sy-lsind = sy-lsind - 1.
WHEN 'ABC'.
WRITE:/ 'iam great'.
WHEN 'DOWNLOAD'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'c:\temp.txt'
filetype = 'DAT'
TABLES
data_tab = itab
FIELDNAMES =
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDCASE.
TOP-OF-PAGE DURING LINE-SELECTION.
CASE sy-lsind.
WHEN '1'.
WRITE:/ 'this is secondary list'.
ENDCASE. -
Re: URGENT: REGARDING ALV REPORT OUTLOOK
HI,
I am making alv report in which d simple format is used and its output is used to be appear to be simple and now i want to make its output more gud,can anybody tell me d solution of dis problem,reply useful will be definately rewarded....
REPORT ZMFTEST5 no standard page heading LINE-SIZE 310.
TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
**DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
INTERNAL TABLE FOR SALES ORDER *****************
DATA : BEGIN OF ITSO OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
BSTNK LIKE VBAK-BSTNK,
KUNNR LIKE VBAK-KUNNR,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
WMENG LIKE VBEP-WMENG,
NTGEW LIKE MARA-NTGEW,
BRGEW LIKE MARA-BRGEW,
GEWEI LIKE MARA-GEWEI,
SPART LIKE VBAK-SPART,
BMENG LIKE VBEP-BMENG,
EDATU LIKE VBEP-EDATU,
BSTKD LIKE VBKD-BSTKD,
WERKS LIKE VBAP-WERKS,
MEINS LIKE MARA-MEINS,
KWMENG LIKE VBAP-KWMENG,
KLMENG LIKE VBAP-KLMENG,
END OF ITSO.
Heading of the report.
data: t_heading type slis_t_listheader.
***********PARAMETERS***************
PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.
*********SELECTION SCREEN OPTIONS*********
SELECT-OPTIONS : SO_ORD FOR VBAK-VBELN,
SO_PARTY FOR VBAK-KUNNR,
IT_M FOR MARA-MATNR,
DIV FOR VBAK-SPART,
SO_DATE FOR VBAK-ERDAT,
S_DATE FOR VBEP-EDATU. .
START-OF-SELECTION.
SELECT DISTINCT AVBELN AERDAT ABSTNK AKUNNR BSPART BMATNR BPOSNR BWERKS BKWMENG BKBMENG CNTGEW CBRGEW CGEWEI DWMENG DBMENG DEDATU D~VBELN
FROM VBAK AS A INNER JOIN VBAP AS B ON BVBELN = AVBELN
INNER JOIN MARA AS C ON CMATNR = BMATNR
INNER JOIN VBEP AS D ON DWMENG > 0 AND DVBELN = AVBELN AND DPOSNR = B~POSNR
INTO CORRESPONDING FIELDS OF TABLE ITSO
WHERE AVBELN IN SO_ORD AND AKUNNR IN SO_PARTY AND BSPART IN DIV AND AERDAT IN SO_DATE AND DEDATU IN S_DATE AND BMATNR IN IT_M AND B~WERKS = PLANT.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
FORM LAYOUT.
PERFORM FCAT USING 'VBELN' 'ITSO' '' 'S.O.NO. ' 'VBELN' 'VBAK' ''.
PERFORM FCAT USING 'WERKS' 'ITSO' '' 'PLANT ' 'WERKS' 'VBAP' ''.
PERFORM FCAT USING 'ERDAT' 'ITSO' '' 'S.O.DATE' 'ERDAT' 'VBAK' ''.
PERFORM FCAT USING 'BSTNK' 'ITSO' '' 'P.O.N.O.' 'BSTNK' 'VBAK' ''.
PERFORM FCAT USING 'KUNNR' 'ITSO' '' 'PARTY ' 'KUNNR' 'VBAP' ''.
PERFORM FCAT USING 'MATNR' 'ITSO' '' 'MAT.NO. ' 'MATNR' 'MARA' ''.
PERFORM FCAT USING 'WMENG' 'ITSO' '' 'S.O.QTY' 'WMENG' 'VBEP' ''.
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = REPID
IT_FIELDCAT = F1
IT_SORT = GT_SORT
I_SAVE = 'X'
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = ITSO.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Top of page heading
perform set_top_page_heading using t_heading t_event.
Events
perform set_events using t_event.
GUI Status
w_status = ''.
w_repid = sy-repid.
Title
w_title = <<If you want to set a title for
the ALV, please, uncomment and edit this line>>.
User commands
w_comm = 'USER_COMMAND'.
ENDFORM. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
*& Form F_WRITE_SUMMARY
Write summary before exit
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM.Just check the program :
REPORT ZMFTEST5 no standard page heading LINE-SIZE 310.
TABLES : VBAK,ABAP,VBEP,VBKD,MARA,KNA1,MAKT.
*Varriable declaration.
TYPE-POOLS SLIS.
DATA : POS TYPE I.
DATA REPID LIKE SY-REPID.
DATA : F1 TYPE SLIS_T_FIELDCAT_ALV,
F2 TYPE SLIS_FIELDCAT_ALV,
L_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA L_POS TYPE I VALUE 1. "position of the column
DATA GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
**DATA GT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: GT_EVENTS TYPE SLIS_T_EVENT,
FS_EVENTCAT LIKE LINE OF GT_EVENTs.
INTERNAL TABLE FOR SALES ORDER *****************
DATA : BEGIN OF ITSO OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
BSTNK LIKE VBAK-BSTNK,
KUNNR LIKE VBAK-KUNNR,
MATNR LIKE VBAP-MATNR,
POSNR LIKE VBAP-POSNR,
WMENG LIKE VBEP-WMENG,
NTGEW LIKE MARA-NTGEW,
BRGEW LIKE MARA-BRGEW,
GEWEI LIKE MARA-GEWEI,
SPART LIKE VBAK-SPART,
BMENG LIKE VBEP-BMENG,
EDATU LIKE VBEP-EDATU,
BSTKD LIKE VBKD-BSTKD,
WERKS LIKE VBAP-WERKS,
MEINS LIKE MARA-MEINS,
KWMENG LIKE VBAP-KWMENG,
KLMENG LIKE VBAP-KLMENG,
END OF ITSO.
Heading of the report.
data: t_heading type slis_t_listheader.
***********PARAMETERS***************
PARAMETERS : PLANT LIKE VBAP-WERKS OBLIGATORY.
*********SELECTION SCREEN OPTIONS*********
SELECT-OPTIONS : SO_ORD FOR VBAK-VBELN,
SO_PARTY FOR VBAK-KUNNR,
IT_M FOR MARA-MATNR,
DIV FOR VBAK-SPART,
SO_DATE FOR VBAK-ERDAT,
S_DATE FOR VBEP-EDATU. .
START-OF-SELECTION.
SELECT DISTINCT AVBELN AERDAT ABSTNK AKUNNR BSPART BMATNR B~POSNR
BWERKS BKWMENG BKBMENG CNTGEW CBRGEW CGEWEI DWMENG DBMENG
DEDATU DVBELN
FROM VBAK AS A INNER JOIN VBAP AS B ON BVBELN = AVBELN
INNER JOIN MARA AS C ON CMATNR = BMATNR
INNER JOIN VBEP AS D ON DWMENG > 0 AND DVBELN = AVBELN AND DPOSNR =
B~POSNR
INTO CORRESPONDING FIELDS OF TABLE ITSO
WHERE AVBELN IN SO_ORD AND AKUNNR IN SO_PARTY AND B~SPART IN DIV AND
AERDAT IN SO_DATE AND DEDATU IN S_DATE AND BMATNR IN IT_M AND BWERKS
= PLANT.
IF SY-SUBRC <> 0.
MESSAGE E899(M3) WITH 'No records'.
ENDIF.
perform f_build_eventcat.
PERFORM LAYOUT.
END-OF-SELECTION.
FORM LAYOUT.
PERFORM FCAT USING 'VBELN' 'ITSO' '' 'S.O.NO. ' 'VBELN' 'VBAK' ''.
PERFORM FCAT USING 'WERKS' 'ITSO' '' 'PLANT ' 'WERKS' 'VBAP' ''.
PERFORM FCAT USING 'ERDAT' 'ITSO' '' 'S.O.DATE' 'ERDAT' 'VBAK' ''.
PERFORM FCAT USING 'BSTNK' 'ITSO' '' 'P.O.N.O.' 'BSTNK' 'VBAK' ''.
PERFORM FCAT USING 'KUNNR' 'ITSO' '' 'PARTY ' 'KUNNR' 'VBAP' ''.
PERFORM FCAT USING 'MATNR' 'ITSO' '' 'MAT.NO. ' 'MATNR' 'MARA' ''.
PERFORM FCAT USING 'WMENG' 'ITSO' '' 'S.O.QTY' 'WMENG' 'VBEP' ''.
REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = F1
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS = GT_EVENTS[]
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ITSO
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.
Top of page heading
perform set_top_page_heading using t_heading t_event.
Events
perform set_events using t_event.
GUI Status
w_status = ''.
w_repid = sy-repid.
Title
w_title = <<If you want to set a title for
the ALV, please, uncomment and edit this line>>.
User commands
w_comm = 'USER_COMMAND'.
ENDFORM. " LAYOUT
*& Form FCAT
FORM FCAT USING P_FIELD P_TABLE P_SUM P_TEXT P_RFIELD P_RTABLE P_DISP.
ADD 1 TO POS.
F2-COL_POS = POS.
F2-FIELDNAME = P_FIELD.
F2-TABNAME = P_TABLE.
F2-SELTEXT_L = P_TEXT.
F2-REF_FIELDNAME = P_RFIELD.
F2-REF_TABNAME = P_RTABLE.
F2-DO_SUM = P_SUM.
F2-NO_OUT = P_DISP.
APPEND F2 TO F1.
CLEAR F2.
ENDFORM. " FCAT
FORM F_BUILD_EVENTCAT .
CLEAR: GT_EVENTS. REFRESH: GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'TOP_OF_PAGE'.
FS_EVENTCAT-FORM = 'F_REPORT_HEADER_ALV'.
APPEND FS_EVENTCAT TO GT_EVENTS.
CLEAR: FS_EVENTCAT.
FS_EVENTCAT-NAME = 'END_OF_LIST'.
FS_EVENTCAT-FORM = 'F_WRITE_SUMMARY'.
APPEND FS_EVENTCAT TO GT_EVENTS.
ENDFORM. " F_BUILD_EVENTCAT
*& Form F_WRITE_SUMMARY
Write summary before exit
FORM F_WRITE_SUMMARY .
write:/ 'Welcome to XYZ Limited'.
write:/ 'This is a test program to display Report in ALV Format'.
ENDFORM.
Thanks
Seshu -
Urgent:L regarding MM04 mass report
hi,
I had made dis report and it is working fine and ir is displaying some material correct and some of the material is not displaying correct.
plzz help me out as help will be definately rewarded.
REPORT ZNEW01 no standard page heading LINE-SIZE 310.
TABLES: cdhdr,cdpos.
DATA : BEGIN OF itab OCCURS 0,
objectclas LIKE cdhdr-objectclas,
objectid LIKE cdhdr-objectid,
username LIKE cdhdr-username,
udate LIKE cdhdr-udate,
utime LIKE cdhdr-utime,
tcode LIKE cdhdr-tcode,
change_ind LIKE cdhdr-change_ind,
changenr LIKE cdhdr-changenr,
END OF itab.
DATA: BEGIN OF itab1 OCCURS 0,
OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
objectid LIKE cdpos-objectid,
changenr LIKE cdpos-changenr,
fname LIKE cdpos-fname,
chngind LIKE cdpos-chngind,
value_new LIKE cdpos-value_new,
value_old LIKE cdpos-value_old,
END OF itab1.
DATA : BEGIN OF it_final OCCURS 0,
objectclas LIKE cdhdr-objectclas,
objectid LIKE cdhdr-objectid,
username LIKE cdhdr-username,
udate LIKE cdhdr-udate,
utime LIKE cdhdr-utime,
tcode LIKE cdhdr-tcode,
change_ind LIKE cdhdr-change_ind,
changenr LIKE cdhdr-changenr,
fname LIKE cdpos-fname,
chngind LIKE cdpos-chngind,
value_new LIKE cdpos-value_new,
value_old LIKE cdpos-value_old,
end of it_final.
select-options : m_date for cdhdr-udate.
SELECT objectclas objectid username udate utime tcode change_ind changenr
FROM cdhdr
INTO TABLE itab WHERE objectclas = 'MATERIAL' AND
change_ind = 'U' AND
udate IN m_date.
IF NOT itab[] IS INITIAL.
SELECT objectclas objectid changenr fname chngind value_new value_old
FROM cdpos
INTO TABLE itab1
FOR ALL ENTRIES IN itab
WHERE changenr = itab-changenr and chngind = itab-change_ind.
ENDIF.
*corresponding fields of
LOOP AT itab1.
READ TABLE itab WITH KEY changenr = itab1-changenr.
it_final-objectid = itab-objectid.
it_final-username = itab-username.
it_final-udate = itab-udate.
it_final-tcode = itab-tcode.
it_final-fname = itab1-fname.
it_final-chngind = itab1-chngind.
it_final-value_old = itab1-value_old.
it_final-value_new = itab1-value_new.
APPEND it_final.
CLEAR it_final.
ENDLOOP.
loop at it_final.
write : / it_final-objectid,it_final-username,it_final-udate,it_final-tcode,it_final-chngind,it_final-value_old,it_final-value_new.
endloop.
plzz help me its really urgent.Hi
Try to modify the For All like below..
IF NOT itab[] IS INITIAL.
SELECT objectclas objectid changenr fname chngind value_new value_old
FROM cdpos
INTO TABLE itab1
FOR ALL ENTRIES IN itab
WHERE
objectclas = itab-objectclas
objectid = itab-cobjectid
changenr = itab-changenr
fname = itab-fname
chngind = itab-chngind
ENDIF.
After that Modify the Read like below///
LOOP AT itab1.
READ TABLE itab WITH KEY
objectclas = itab1-objectclas
objectid = itab1-objectid
changenr = itab1-changenr
fname = itab1-fname .
changenr = itab1-changenr.
In my opinion there can be diferent records for Change nr,,therefore..
correct Line is not Read.
Please try like this..
Hope it will help.
Thanks
Praveen -
Urgent: regarding modification in the ystock report
hi,
i am making a report in which i have to display the stock as on date 13.03.2008 ( for instance),but the table form where the field is coming from the table which is similar to the MSEG,and it is displaying the updation of stock on last day of every month.
my problem is if i am making the stock changes then it is displayed on 31.03.2008 but not on 13.03.2008 and i want to display it on todays date.
plzz help me out as it is really urgent to me.hi,
dis is d part of my code and i want to modify in it,
PARAMETERS : P_DATE LIKE ZSTOCKSUM-STLDATE OBLIGATORY DEFAULT sy-datum.
SELECT ASTLDATE AMATNR AWERKS ALGORT ASTSTOCK ASTDEBIT A~STCREDIT
CMEINS CMTART CMATKL CNTGEW C~GEWEI
FROM ZSTOCKSUM AS A
INNER JOIN MARA AS C ON AMATNR = CMATNR
INTO TABLE STIT
WHERE AWERKS = P_WERKS AND MTART IN MAT_TYPE AND AMATNR IN P_MATNR AND STLDATE <= P_DATE
AND ( MTART = 'FERT' OR MTART = 'HALB' OR MTART = 'ZBOP' OR MTART = 'ZSCR' OR MTART = 'ROH' )
AND A~LGORT IN P_STLOC.
LOOP AT STIT WHERE MATNR = ITAB-MATNR AND LGORT = ITAB-LGORT.
V_QTY = V_QTY + STIT-STDEBIT - STIT-STCREDIT.
IF P_DATE >= STIT-STLDATE.
V_QTY1 = V_QTY1 + V_QTY + ( STIT-STDEBIT - STIT-STCREDIT ).
ENDIF.
ENDLOOP. -
URGENT: REGARDING SALES ORDER REPORT
HI,
I making a report on sales order in which i have to display the sales order no,date,customer no,date,material issued to customer,date of issue,invoice no,date,quantity,amount of invoice.
can anbody tell what are the tables used for making dis report .
currnetly i am using VBAK,VBAK,VBRP.
PLZZ help me out as it is really urgent to me & help will be deifnately rewarded.
Edited by: ric .s on Feb 19, 2008 11:01 AMHello,
Go through the Diagram on the page hope it will help you.
http://www.erpgenie.com/abap/tables_sd.htm
Thanks,
Gunjan -
Report Help------------PLZ really Urgent
Hi
we are having 2 DIM in row Job Category and Cost Center,there are around 10 Job Categories and 5 Cost Centers and thesetobe selected Dynamically
now the requirement is
- After 10 Job Categories in 10 rows in 11th row Cost Center Member shoud display, generally Cost Center will come in second ROW how to bring it in first ROW just below to Job Category
forEx:
JC1
JC2
JC3
.JC10----------> JC DIM
CC1------------->Cost Center DIM
these CC and JC are selected Dynamically (@Desc or @Child.....) how can we display this???
this is really urgent please help me.....
Edited by: Kumar on Feb 10, 2011 9:03 AMHi
Wont take the Dimension as DIM to BOTTOM just select the members manually in to rows according to the user requirement this will work in WEB ANALYSIS.
selecting members manually differs from the tools -
Urgent : Making heirarchy report by fetching data froma single table
Hi,
I am making a report in which i hae to display the data like this:-
If there is a material and it contains batch and that batch furhter conatins sub-batches of it.
The problem is dat all the data which is to be displayed is from the table CHVW and i am not able to display the data in hierarchy by fetching it from a single table.
plzz guide me how to do dis as it is really urgent and points will be deinftely rewarded.
help me out.
reagrds,
ric.s
Edited by: ric .s on Apr 30, 2008 10:31 AMHi,
Check the sample Report.
REPORT z_alv_hierseq_list.
Program with FM REUSE_ALV_HIERSEQ_LIST_DISPLAY *
TYPE-POOLS: slis. " ALV Global types
CONSTANTS :
c_x VALUE 'X',
c_gt_vbap TYPE slis_tabname VALUE 'GT_VBAP',
c_gt_vbak TYPE slis_tabname VALUE 'GT_VBAK'.
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max. "#EC NEEDED
PARAMETERS p_max(02) TYPE n DEFAULT '10' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_2 FOR FIELD p_expand. "#EC NEEDED
PARAMETERS p_expand AS CHECKBOX DEFAULT c_x.
SELECTION-SCREEN END OF LINE.
TYPES :
1st Table
BEGIN OF ty_vbak,
vbeln TYPE vbak-vbeln, " Sales document
kunnr TYPE vbak-kunnr, " Sold-to party
netwr TYPE vbak-netwr, " Net Value of the Sales Order
erdat TYPE vbak-erdat, " Creation date
waerk TYPE vbak-waerk, " SD document currency
expand TYPE xfeld,
END OF ty_vbak,
2nd Table
BEGIN OF ty_vbap,
vbeln TYPE vbap-vbeln, " Sales document
posnr TYPE vbap-posnr, " Sales document
matnr TYPE vbap-matnr, " Material number
arktx TYPE vbap-arktx, " Material description
netwr TYPE vbap-netwr, " Net Value of the Sales Order
waerk TYPE vbap-waerk, " SD document currency
END OF ty_vbap.
DATA :
1st Table
gt_vbak TYPE TABLE OF ty_vbak,
2nd Table
gt_vbap TYPE TABLE OF ty_vbap.
INITIALIZATION.
v_1 = 'Maximum of records to read'.
v_2 = 'With ''EXPAND'' field'.
START-OF-SELECTION.
Read Sales Document: Header Data
SELECT vbeln kunnr netwr waerk erdat
FROM vbak
UP TO p_max ROWS
INTO CORRESPONDING FIELDS OF TABLE gt_vbak.
IF gt_vbak[] IS NOT INITIAL.
Read Sales Document: Item Data
SELECT vbeln posnr matnr arktx netwr waerk
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE gt_vbap
FOR ALL ENTRIES IN gt_vbak
WHERE vbeln = gt_vbak-vbeln.
ENDIF.
END-OF-SELECTION.
PERFORM f_display.
Form F_DISPLAY
FORM f_display.
Macro definition
DEFINE m_fieldcat.
ls_fieldcat-tabname = &1.
ls_fieldcat-fieldname = &2.
ls_fieldcat-ref_tabname = &3.
ls_fieldcat-cfieldname = &4. " Field with currency unit
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
DEFINE m_sort.
ls_sort-tabname = &1.
ls_sort-fieldname = &2.
ls_sort-up = c_x.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_layout TYPE slis_layout_alv,
ls_keyinfo TYPE slis_keyinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
lt_sort TYPE slis_t_sortinfo_alv," Sort table
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv." Field catalog
ls_layout-group_change_edit = c_x.
ls_layout-colwidth_optimize = c_x.
ls_layout-zebra = c_x.
ls_layout-detail_popup = c_x.
ls_layout-get_selinfos = c_x.
IF p_expand = c_x.
ls_layout-expand_fieldname = 'EXPAND'.
ENDIF.
Build field catalog and sort table
m_fieldcat c_gt_vbak 'VBELN' 'VBAK' ''.
m_fieldcat c_gt_vbak 'KUNNR' 'VBAK' ''.
m_fieldcat c_gt_vbak 'NETWR' 'VBAK' 'WAERK'.
m_fieldcat c_gt_vbak 'WAERK' 'VBAK' ''.
m_fieldcat c_gt_vbak 'ERDAT' 'VBAK' ''.
m_fieldcat c_gt_vbap 'POSNR' 'VBAP' ''.
m_fieldcat c_gt_vbap 'MATNR' 'VBAP' ''.
m_fieldcat c_gt_vbap 'ARKTX' 'VBAP' ''.
m_fieldcat c_gt_vbap 'NETWR' 'VBAP' 'WAERK'.
m_fieldcat c_gt_vbap 'WAERK' 'VBAP' ''.
m_sort c_gt_vbak 'KUNNR'.
m_sort c_gt_vbap 'NETWR'.
ls_keyinfo-header01 = 'VBELN'.
ls_keyinfo-item01 = 'VBELN'.
ls_keyinfo-item02 = 'POSNR'.
Dipslay Hierarchical list
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_sort = lt_sort
i_tabname_header = c_gt_vbak
i_tabname_item = c_gt_vbap
is_keyinfo = ls_keyinfo
i_save = 'A'
TABLES
t_outtab_header = gt_vbak
t_outtab_item = gt_vbap
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. " F_LIST_DISPLAY
Form USER_COMMAND *
FORM user_command USING i_ucomm TYPE sy-ucomm
is_selfield TYPE slis_selfield. "#EC CALLED
DATA ls_vbak TYPE ty_vbak.
CASE i_ucomm.
WHEN '&IC1'. " Pick
CASE is_selfield-tabname.
WHEN c_gt_vbap.
WHEN c_gt_vbak.
READ TABLE gt_vbak INDEX is_selfield-tabindex INTO ls_vbak.
IF sy-subrc EQ 0.
Sales order number
SET PARAMETER ID 'AUN' FIELD ls_vbak-vbeln.
Display Sales Order
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDCASE.
ENDFORM. " USER_COMMAND
END OF PROGRAM Z_ALV_HIERSEQ_LIST ******************
Regards,
Raj. -
Condition Surpression in HFR-----Really Really Urgent
Hi All,
we are having a requirement from our client that
If he selelcts the current year then the Scenario shud be Actual, if he selects the next year then the scenario shud be Plan can any one help me in solving this
Actual Requirement from the client
FYadmin = Current fiscal year
MONTHadmin = Current month
LASTQRUPLANadmin = Last scenario (QRU1, QUR2, QRU3, PLAN…)
Current position on the report :
FYreport = Fiscal year selected in the report
MONTHreport = March (default last month of the fiscal year at SOITEC)
Actual_QRU calculation rule:
IF ( FYreport < FYadmin ) OR ( (FYreport = FYadmin) AND (MONTHreport < MONTHadmin) )
THEN Scenario = ACTUAL
ELSE Scenario = LASTQRUPLANadmin
This a really urgent isuee
Regards
Vijay
Edited by: Kumar on Mar 8, 2011 5:16 PMIm using Condition Suppressing for columns
I have taken Year, Period and Scenario in Column
In Col A: I used User POV for Year, Actual as Scenario and User POV for Period
Condition Suppression1: Not Suppress if Member Name Year Equal to ActualYear(Sub Var for CurrYear)
Condition Suppression2: Not Suppress if Member Name Year Contains Previous Year1(Sub Var for Previous Year)
Condition Suppression3: Not Suppress if Member Name Period Equal to ActualPeriod (Sub Var for CurrPreiod)
Condition Suppression4: Not Suppress if Member Name Period Contains to PreviousPerid (Sub Var for Previous Period)
In ColB: I used Same as Col A for Year and period and Scenario will be Prompt for user.
Condition Suppression1: Suppress if Member Name Year NotEqual to ActualYear(Sub Var for CurrYear)
Condition Suppression2: Suppress if Member Name Year NotContains Previous Year1(Sub Var for Previous Year)
Condition Suppression3: Suppress if Member Name Period NotEqual to ActualPeriod (Sub Var for CurrPreiod)
Condition Suppression4: Suppress if Member Name Period NotContains to PreviousPerid (Sub Var for Previous Period)
Will this work???
Regards
Vijay
Edited by: Kumar on Mar 10, 2011 12:35 PM -
Urgent: regarding sub select statement
I making a report in which i have to display the STOCK and i want to do the sum in a select statement of the value coming from the field AFRU-GMNGA so that i can do calculation of the value of 1st field to be subtracted from the last value of the same field .
can anybody provide me example of it as i am currently using dis select statement:-
SELECT AMATNR ALGORT BGMNGA BVORNR C~MEINS FROM AFPO AS A
INNER JOIN AFRU AS B ON AAUFNR = BAUFNR
INNER JOIN MARA AS C ON AMATNR = CMATNR
INTO TABLE ITAB
WHERE MTART IN MAT_TYPE AND A~MATNR IN P_MATNR .
plzz help me out as it is really urgent to me.Hi,
Go thr the below select query.
select tvkwzwerks a350kschl a350vkorg konpkbetr
from tvkwz inner join a350 on tvkwzvkorg = a350vkorg inner join konp
on a350knumh = konpknumh into table itab where tvkwz~werks = '1003'
and a350~kschl = 'ZCPA'.
Regards,
vijay
Maybe you are looking for
-
Error message 13005 when trying to run iTunes 8
Can anyone help me. I bought my new nano today. Have previously run iTunes with no problems but but today this error message comes up. Have uninstalled and re-installed to no avail. Guy
-
How do I fix font problems in InDesign?
Fonts are not displaying correctly in InDesign . . . Exporting to PDF produces distorted fonts. I have tried with Helvetica and Helvetica Nue. I am not using third party font software . . I am on OSC Maverics running Indesign CC. Also some low res j
-
ITunes error Claiming I "Do not have write access privileges"
The other day without any upgrades (that I am aware of), iTunes stopped allowing me to import cds into iTunes. It claims that I do not have the proper "write" privileges for my music folder. I have no idea how to fix this, if this is even the real pr
-
I need help
-
I am going through a certification book, that I have found to have errors. I am not real familiar with bitwise operations, but I have come across one that I think is in error. Can someone confirm or deny whether the following is correct? 00001010 ^ 0