Header in greek type
I'm trying to help someone far away so I don't have every fact. Regardless she says her email header is showing as greek, nonsense type. In her email preference the font chosen is "Helsinki" which I don't even have and she claims it isn't listed in her fonts either.
When she tries to change from Helsinki to another font it switches back to Helsinki. I hesitate to have her trash the mail plist file but am at a loss.
I hesitate to have her trash the mail plist file but am at a loss.
Yes, if a POP account that could lose all her eMails.
It does sound like a Font issue, I'd open FontBook in Applications, then validate fonts, then remove Helsinki if there.
Not certain, but this can fix myriad Mail problems...
Safe Boot from the HD, (holding Shift key down at bootup), it will try to repair your Disk Directory while the spinning radian is happening, so let it go, run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, then move these folder & file to the Desktop.
Move this Folder to the Desktop...
/Users/YourUserName/Library/Caches/Mail/
Move this file to the Desktop...
/Users/YourUserName/Library/Mail/Envelope Index
Reboot.
If that doesn't do it try these & reboot...
/Users/YourUserName/Library/Mail/MessageRules.plist
/Users/YourUserName/Library/Mail/MessageRules.plist.backup
Similar Messages
-
Heading for Different Types in Query designer
We have three different types Direct, Indirect and Others. Where Indirect and Others are fixed values and Direct types are dynamic which are getting from ECC.
So they are expecting heading before each type and result according to these types.
Tried so many options but not able to achieve the desired result as expected in Query Designer.
Please find the attached document for desired output
Please provide some inputs how can we achieve at the report level.hi Naresh,
Structures are objects that you define in the BEx Query Designer. You can define reusable structures as well. they form the basic framework of a report. You can have maximum of 2 structures in a query. In such case you cannot have the same KeyFigure in both the structures.
You can also define a structure for a Characteristic.
Please check out these links.
http://help.sap.com/saphelp_nw2004s/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/b2/e50138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/4d/e2bebb41da1d42917100471b364efa/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/46/81fc706a23468ce10000000a114a6b/frameset.htm
Limitations of Structures usage
You can have maximum of two structures only ... One for kfs and one for characteristics..A characteristic can't be included in a KF structure and a KF can'be included in a characteristic structure...
We can't have 2 KF structures but we can have 2 Char Structure or 1 KF Structure and 1 Char Structure.
Regards
Lavanya. -
Hi,
I am using Microsoft ASP.NET TreeView control where I have bound embedded images. Also I have set custom header “x-content-type-options” as
“nosniff” in web.config file.
On hosting the sample containing the above mentioned things in SERVER machine, the images are not visible but its working properly while running sample in local (development) machine.
Kindly provide a solution and find the sample in the below link.
http://goo.gl/6uR2b0
Thanks,
Alagarsamy D.Hi AlagarBala,
Your issue is related to asp.net/web technology and for a better support on this please post your question to the asp.net forum below, this forum is for C# code issues in speicific:
http://forums.asp.net/
Regards,
Fouad Roumieh -
Header pricing condition types
Hi,
In a purchase order header pricing condition types are appearing twice .
Ex: JCDB 254
JCDB 20
JCV1 345
JCV1 30.
first condition type (ex: JCDB 254) is calculated on net price
second cond type (ex: JCDB 20) is calculated on handling charge.
Only for this particular PO we face this problem.
How the pricing condition types are calculating twice?
regards,
sathyaIf I am not mistaken, this is a Purchasing question.
Please post to correct forum.
Regards -
Header Discount Condition type Control data
Dear All,
I Maintained Header and Item discounts and frieght condition type and in header level the system is not calculating header discount or frieght for all items but its taking as item only.
I think i made some wrong entry in condition type control data so please suggest me what should be maintained.hi,
Might be you have maintained Caluculation Type as B Fixed amount
I think you should mainatin it as C Quantity -
Wht are functionality in salesdocument header level ( condition type)
hi friends
kindly send functionality in sales document header level , [email protected]
regards
shivajiThe functionality of sales document is as follows
Transfer of requirements and availabiltiy check
revenue account determination
text determination
pricing functions -
The Content-type: header
When I send a new message, Mail sets the Content-type header to
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
Most of the time it does the same for replies that I send. Sometimes however on a reply it instead sets
Content-Type: text/plain; charset=ISO-2022-JP; delsp=yes; format=flowed
About 2% of my replies have the second example of content-type, and I can see no common factor between them. My message format is set to plain text, and I don't "use the same format as the original message".
Does anyone know why Mail sometimes does this?
Thanks.
AKTom and I exchanged several emails on this topic. It would appear that the problem (mail setting the content-type to ISO-2022-JP) is caused when certain characters in the quoted text of a reply are encoded; mail decides it needs to specify ISO-2022-JP. Characters identified as causing the problem are smart quotes and apostrophes. If you look at the apostrophe in the raw text it appears as =1B$B!G=1B(B and the smart quotes as =1B$B!H=1B(B and =1B$B!I=1B(B
AK -
Can't Type the Letter "S" in the Header??
After upgrading from P6 V7 to P6 V8.1, changes made under Page Set up in the header do not remain once the OK button is clicked. It reverts back to the previous header. Also, the letter "S" will not be displayed when typed in the header. Oracle said "This issue is being reported as a bug, but does not have a workaround. It seems to be related to the hot key shortcut to the checkbox for "show section divider lines"." Does anyone have a work around?
At this time this a documented bug within the software please see Bug 12723553: CAN'T SAVE CHANGES MADE TO HEADER/FOOTER OR TYPE THE LETTER S
POTENTIAL WORKAROUNDS:
1. Copy the downloaded dhtmled.ocx and triedit.dll files to this directory
(It will prompt you to accept the copy)
2. Register under admin privileges (Start, Type Command, then right click on
Command Prompt and Run as Administrator)
"regsvr32 c:\program files (x86)\Oracle\Primavera P6\P6
Professional\dhtmled.ocx" -
Mails in greek are not readable
Hi,
I just have my macbook and i have inserted my email from outlook to mac mail. the problem is that i cannot read any emails that are written in greek. Can anyone help with the settings of the encoding? i have inserted greek in ecoding but do i have to do that every time with each email?
thank you in advance for your help!
Message was edited by: pg81Normally email has a header which tells Mail what encoding to use, so you should not have to use Message > Text Encoding to do it manually for each message. But it could be that your messages are missing this for some reason. You can check by doing View > Message > Raw Source on one of the messages and seeing what it says in the header called Content-Type.
-
Header in 'gui_download'
Hi All,
I use 'GUI_DOWNLOAD' to download data from internal table to excel.I am passing the heading in the header field of function module.
call FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = lv_file
FILETYPE = 'ASC'
write_field_separator = 'X'
header = lv_header
TABLES
data_tab = t_output.
header is of type XTRING in the function module.
if i declare my variable as type string it shows a runtime dump due to type mismatch.
I am not able to declare it as type xstring.can anyone advice on how to declare a variable as type xstring or any other way to solve my problem.
Thanks & Regards,
Subasreetry this
data:begin of excel_heading,
text(20) type c,
end of excel_heading.
data:it_heading like standard table of excel_heading initial size 0.
*--Generate the heading for excel data
excel_heading-text = 'A'.
append excel_heading to it_heading.
excel_heading-text = 'B'.
append excel_heading to it_heading.
excel_heading-text = 'C'.
append excel_heading to it_heading.
excel_heading-text = 'D'.
append excel_heading to it_heading.
call function 'GUI_DOWNLOAD'
exporting
filename = p_pfile
filetype = 'DAT'
write_field_separator = '#'
header = '00'
trunc_trailing_blanks = 'X'
show_transfer_status = 'X'
tables
data_tab = p_it_final[]
fieldnames = it_heading[]. -
Problem in calling a WS with complex type
Hi all...
I have to invoke a WS that has as input type a complex type defined in the wsdl...
<complexType name="LoginInfo">
- <sequence>
<element name="appCode" nillable="true" type="string" />
<element name="login" nillable="true" type="string" />
<element name="passwd" nillable="true" type="string" />
</sequence>
</complexType>the soapui request looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://com.susan/SusanWS/types">
<soapenv:Header/>
<soapenv:Body>
<typ:LoginWebService>
<LoginInfo_1>
<appCode>WEB_SERVICES</appCode>
<login>root</login>
<passwd>root</passwd>
</LoginInfo_1>
</typ:LoginWebService>
</soapenv:Body>
</soapenv:Envelope>in my java code I'm trying to call it with:
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress( new URL( wsEndpoint ) );
// call.setOperationName( wsMethod );
call.setOperationName( new QName("http://com.susan/SusanWS/types",wsMethod));
call.addParameter( "LoginInfo_1", Constants.XSD_ANYTYPE, ParameterMode.IN );
// call.addParameter( "appCode", Constants.XSD_STRING, ParameterMode.IN );
// call.addParameter( "login", Constants.XSD_STRING, ParameterMode.IN );
// call.addParameter( "passwd", Constants.XSD_STRING, ParameterMode.IN );
String[] params={appCode, login, passwd};
// call.setReturnType( Constants.XSD_INT );
// Object retval = call.invoke( new String[] {appCode, login, passwd} );
Object retval = call.invoke( new Object[] { params } );doing so..it doesn't work...the first problem I can see...is that I don't assign a parameter name to the 3 strings I pass in the param array...
anybody has a tip to give me on how to solve this problem?solved...
I imported the wsdl into Intellij idea...which created all the needed classes, interfaces,...and used service locator and endpoint binding stubs... -
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 -
Printing the header of a report and checking the join statement...
Hi All,
This report of mne is working fine but there are things that i want to include: when i print this report i want it to display heading of which is in the html_top_of_page but it does not print it, i am not familiar with smart forms so i won't be able to use smart forms.If anyone can help me out i will really appreciated and will immediately reward points......please help me guys as the due date is very close...and please check the joins on the select statement, not sure whether i've joined the tables properly!
REPORT Z_ORDER_AUDIT_NEW.
TYPE-POOLS: SLIS.
LIST OF TABLES
Tables: vbak, likp, vbrk, kna1, vbrp, nast.
DEFINITION OF FIELDS *
DATA: itb_fieldcat TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
w_fieldcat TYPE slis_fieldcat_alv.
DATA: w_cnt LIKE sy-tabix.
DATA: lv_layout TYPE slis_layout_alv,
lv_tab_group TYPE slis_t_sp_group_alv,
lv_repid LIKE sy-repid,
lv_events TYPE slis_t_event,
lv_print TYPE slis_print_alv,
lv_user TYPE slis_formname VALUE 'USER_COMMAND'.
SELECTION SCREEN *
SELECT-OPTIONS:
s_lfdat FOR likp-lfdat,
s_imwrk FOR likp-imwrk.
DEFINITION OF AN INTERNAL TABLE *
DATA: Begin of i_ordertab occurs 0,
audat LIKE vbak-audat,
vbeln LIKE vbak-vbeln,
lfdat LIKE likp-lfdat,
erdat LIKE likp-erdat,
vbeln1 LIKE likp-vbeln,
vbeln2 LIKE vbrk-vbeln,
erdat1 LIKE vbrk-erdat,
kunrg LIKE vbrk-kunrg,
name1 LIKE kna1-name1,
regio LIKE vbrk-regio,
inco1 LIKE vbrk-inco1,
vrkme LIKE vbrp-vrkme,
ntgew LIKE vbrp-ntgew,
gewei LIKE vbrp-gewei,
volum LIKE vbrp-volum,
voleh LIKE vbrp-voleh,
netwr LIKE vbrk-netwr,
End of i_ordertab.
READ THE DATA *
SELECT vbakaudat vbakvbeln likplfdat likperdat likpvbeln vbrkvbeln
vbrkerdat vbrkkunrg kna1name1 vbrkregio vbrkinco1 vbrpvrkme
vbrpntgew vbrpgewei vbrpvolum vbrpvoleh vbrk~netwr
FROM likp join kna1 on likpkunnr EQ kna1kunnr
join vbrk on kna1kunnr EQ vbrkkunrg
join vbrp on vbrkvbeln EQ vbrpvbeln
join vbak on kna1kunnr EQ vbakkunnr
INTO i_ordertab
WHERE likp~lfdat IN s_lfdat
AND likp~imwrk IN s_imwrk.
APPEND i_ordertab.
ENDSELECT.
PERFORM STATEMENTS *
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM build_event.
PERFORM build_print.
PERFORM display_alv_report.
FORM build_fieldcatalog.
w_cnt = 1.
itb_fieldcat-fieldname = 'AUDAT'.
itb_fieldcat-seltext_m = 'Document date'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
itb_fieldcat-key = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'VBELN'.
itb_fieldcat-seltext_m = 'S/O number'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'LFDAT'.
itb_fieldcat-seltext_m = 'Deliv. date'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'ERDAT'.
itb_fieldcat-seltext_m = 'Del. Crt Date'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'VBELN1'.
itb_fieldcat-seltext_m = 'Delivery No.'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'VBELN2'.
itb_fieldcat-seltext_m = 'Invoice No.'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'ERDAT1'.
itb_fieldcat-seltext_m = 'Invoice Date'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'KUNRG'.
itb_fieldcat-seltext_m = 'Payer'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'NAME1'.
itb_fieldcat-seltext_m = 'Payer-Description'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'REGIO'.
itb_fieldcat-seltext_m = 'Region'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'INCO1'.
itb_fieldcat-seltext_m = 'Incoterms'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'VRKME'.
itb_fieldcat-seltext_m = 'Billed Quantity'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'NTGEW'.
itb_fieldcat-seltext_m = 'Net weight'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'GEWEI'.
itb_fieldcat-seltext_m = 'Weight Unit'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'VOLUM'.
itb_fieldcat-seltext_m = 'Volume'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'VOLEH'.
itb_fieldcat-seltext_m = 'VOLUME UNIT'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
w_cnt = w_cnt + 1.
itb_fieldcat-fieldname = 'NETWR'.
itb_fieldcat-seltext_m = 'Net Value'.
itb_fieldcat-col_pos = w_cnt.
itb_fieldcat-emphasize = 'X'.
itb_fieldcat-ref_tabname = 'VBRK' .
itb_fieldcat-ref_fieldname = 'NETWR' .
itb_fieldcat-do_sum = 'X' .
APPEND itb_fieldcat TO itb_fieldcat.
CLEAR itb_fieldcat.
ENDFORM.
FORM build_layout.
lv_layout-no_input = 'X'.
lv_layout-colwidth_optimize = 'X'.
lv_layout-totals_text = 'Totals'(201).
lv_layout-detail_popup = 'X'.
ENDFORM.
FORM build_event.
DATA i_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = lv_events[].
READ TABLE lv_events WITH KEY name = slis_ev_user_command
INTO i_event.
if sy-subrc = 0.
MOVE lv_user TO i_event-form.
APPEND i_event TO lv_events.
endif.
ENDFORM.
FORM build_print.
lv_print-reserve_lines = '2'.
lv_print-no_coverpage = 'X'.
ENDFORM.
*& FUNCTION ALV DISPLAY
FORM display_alv_report.
lv_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = lv_repid
I_CALLBACK_USER_COMMAND = slis_ev_user_command
I_CALLBACK_HTML_TOP_OF_PAGE = 'HTML_TOP_OF_PAGE' " see FORM
I_CALLBACK_HTML_END_OF_LIST = 'END_OF_LIST_HTML' "see FORM
IS_LAYOUT = lv_layout
IT_FIELDCAT = itb_fieldcat[]
IT_SPECIAL_GROUPS = lv_tab_group
I_SAVE = 'X'
IT_EVENTS = lv_events
IS_PRINT = lv_print
TABLES
t_outtab = i_ordertab
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDFORM.
*& Form html_top_of_page
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
DATA: text TYPE sdydo_text_element.
CALL METHOD document->add_gap
EXPORTING
width = 100.
text = 'Cadbury: Daily Audit of Orders'.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'HEADING'.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
text = 'User Name : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-uname.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->add_gap
EXPORTING
width = 50.
text = 'Date : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-datum.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->add_gap
EXPORTING
width = 50.
text = 'Time : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 6.
text = sy-uzeit.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
ENDFORM.
FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
DATA: ls_text TYPE sdydo_text_element,
l_grid TYPE REF TO cl_gui_alv_grid,
f(14) TYPE c VALUE 'SET_ROW_HEIGHT',
w_lines type i,
w_lines1(9) type n.
DESCRIBE TABLE i_ordertab LINES w_lines.
w_lines1 = w_lines.
concatenate: 'TOTAL NUMBER OF RECORDS SELECTED: ' w_lines1 INTO ls_text
SEPARATED BY space.
adds test (via variable)
CALL METHOD end->add_text
EXPORTING
text = ls_text
sap_emphasis = 'strong'.
adds new line (start new line)
CALL METHOD end->new_line.
*set height of this section
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->parent->parent->(f)
EXPORTING
id = 3
height = 14.
ENDFORM. "end_of_list_html.
--END OF THE REPORT--Hi
1. first remove the ENDSELECT..use INTO table itab or INTO CORRESPONDING fields, Since you are joining the more tables this will take lot of time.
2. You are just using two fields from LIKP as selection screen fields to fetch the so much data.
see the table linkings apartfrom KUNNR between the tables
LIKP-VBELN = LIPS-VBELN
LIPS-VGBEL = VBAK-VBELN and LIPS-VGPOS = VBAP-POSNR
and
VBRP-AUBEL = VBAK-VBELN and VBRP-AUPOS = VBAP-POSNR and
VBRP-VGBEL = LIKP-VBELN and VBRP-VGPOS = LIPS-POSNR
use the above links and code again.
<b>Reward points for useful Answers</b>
Regards
Anji -
How to add 2 more field to the Header of FBL5N ALV report output
Hi All,
I have copied and made some modification to the standard transaction FBL5N and added some fields to the ALV report line Items but how to add fields to the header part i.e if you execute the transaction FBL5n, you will get the ALV report, in the header part customer no, company code then I need to add the 2 more fields. can any one tell me that which structure or where I need to add these fields to be appear in ALV output screen.
Thanks in advance.
Swapna.Hi Mohamed,
If you copied Z-FM successfully, then you have to go to subroutine TOP_OF_PAGE to add your field:
*& Form TOP_OF_PAGE
FORM top_of_page.
DATA: b_suppress LIKE boole-boole,
opfi_text LIKE eptext OCCURS 10 WITH HEADER LINE,
n_color TYPE i.
* IF NOT it_items-bukrs IS INITIAL "737295
* AND NOT it_items-konto IS INITIAL "737295
* AND NOT it_items-koart IS INITIAL. "737295
gs_items = gt_alv.
* ENDIF. "737295
* skip first call at top of page:
IF NOT gd_first_top IS INITIAL.
CLEAR gd_first_top.
EXIT.
ENDIF.
IF x_grid = c_x OR x_inet = c_x. "1012201
PERFORM grid_top_of_page.
EXIT.
ENDIF.
*... open FI: get header text.
* first fill some RFXPO fields for general info:
CLEAR: s_rfxpo, wa_kna1, wa_lfa1, wa_ska1.
s_rfxpo-bukrs = gs_items-bukrs.
s_rfxpo-kkber = gs_items-kkber.
s_rfxpo-koart = gs_items-koart.
s_rfxpo-konto = gs_items-konto.
s_rfxpo-vrbez = gs_variant-variant.
s_rfxpo-waers = gs_items-waers.
* update master record:
PERFORM fill_master_rec USING gs_items-koart
gs_items-konto
gs_items-bukrs. " note 698396
CALL FUNCTION 'OPEN_FI_PERFORM_00001640_E'
EXPORTING
i_rfxpo = s_rfxpo
i_kna1 = wa_kna1
i_lfa1 = wa_lfa1
i_ska1 = wa_ska1
IMPORTING
e_suppress_standard = b_suppress
TABLES
t_lines = opfi_text.
*... display open FI text:
IF x_konto_sort = 'X'.
LOOP AT opfi_text.
CASE opfi_text-color.
WHEN 1.
FORMAT COLOR 1.
WHEN 2.
FORMAT COLOR 2.
WHEN 3.
FORMAT COLOR 3.
WHEN 4.
FORMAT COLOR 4.
WHEN 5.
FORMAT COLOR 5.
WHEN 6.
FORMAT COLOR 6.
WHEN 7.
FORMAT COLOR 7.
ENDCASE.
WRITE: / opfi_text-text.
ENDLOOP.
FORMAT RESET.
ENDIF.
*... display other header text:
IF b_suppress NE 'X'.
PERFORM display_custom_header.
PERFORM display_ccard_lines.
ENDIF.
" Put your field somewhere...
ENDFORM. " TOP_OF_PAGE
Good luck,
Thanks, -
Change of count on the header on filtering the ALV
Hi Gurus!
I have this ALV report which gives the sales order report, in the output right on the top the report shows the count of all the distinct sales order displayed when the report is run based ona selection criteria. Is it possible to show the total count of teh sales order in the report to change and show teh number of distinct sales doc when we use filter on teh report. Suppose if we run the report based on a particular selection criteria and it gives a count of 30 . In the output if we put filter on a particular column and the report shows fewer lines , which will reduce the number of sales doc, is it possible to show this number which for eg will be say 20 , is it possible to show the number 20 after filetr on ALV instead of that 30 remainiung constant. I am wanting the report to show the change in count of distinct sales doc when I put filter on any columnh.
report zsales_orders message-id zsd no standard page heading.
* For ALV usage
type-pools: slis.
data: gs_layout type slis_layout_alv,
ta_events type slis_t_event_exit,
tp_event type slis_event_exit,
tp_print type slis_print_alv,
gt_sort type slis_t_sortinfo_alv,
gt_events type slis_t_event,
t_fieldcat type slis_t_fieldcat_alv with header line,
repid type syrepid, " ABAP Program.
gt_list_top_of_page type slis_t_listheader, " Top of page text.
gs_list_top_of_page type slis_listheader,
alv_variant type disvariant. " Customize Disp. Variant
data: w_field type slis_fieldcat_alv.
data: count type i.
data: count1 type i.
tables: vbak, vbap, vbpa, knvv.
* Definition of selection screen *
* By plant, storage location, sold-to customers, material and *
* posting date of the sales orders *
selection-screen begin of block one with frame title text-001.
parameters: p_vkorg type vkorg obligatory memory id vko,"DEVK906677
p_vtweg type vtweg obligatory default '01',
p_spart type spart obligatory default '01'.
select-options: s_vkbur for vbak-vkbur, " Sales Office "DEVK906677
s_kunnr for vbak-kunnr. " Sold-to customer number.
select-options: s_shipto for vbap-oid_ship, " Ship-to customer number.
s_billto for vbpa-kunnr, " bill-to from S.O. header.
s_load for vbpa-kunnr, " Load confirmation contact.
s_truck for vbap-oid_extbol. " Trucking ticket number.
select-options: s_werks for vbap-werks obligatory no intervals. " Plant.
select-options: s_lgort for vbap-lgort. " Storage location.
select-options: s_matnr for vbap-matnr. " Material number.
select-options: s_konda for knvv-konda. " price group
selection-screen skip 1.
select-options: s_vdatu for vbak-vdatu default sy-datum.
selection-screen end of block one.
* ALV display layout
selection-screen begin of block layout with frame title text-003.
parameters: pa_vari type slis_vari default ' '. " Display variant.
selection-screen end of block layout.
selection-screen begin of block two with frame title text-028.
selection-screen comment: /1(79) text-029.
selection-screen comment: /1(79) text-030.
selection-screen comment: /1(79) text-031.
selection-screen comment: /1(79) text-032.
selection-screen comment: /1(79) text-033.
selection-screen comment: /1(79) text-034.
selection-screen comment: /1(79) text-035.
selection-screen comment: /1(79) text-036.
selection-screen end of block two.
* Data Definitions *
* Storing Extracted Info.
types: begin of t_extract,
vbeln type vbeln_va, " Sales order number.
augru type augru, " order reason
vdatu type edatu_vbak, " Requested delivery date.
kunnr type kunag, " Sold-to customer number.
soldto_name type name1_gp, " Sold-to name.
posnr type posnr_va, " Item number.
matnr type matnr, " Material number.
vrkme type vrkme, " Sales UoM.
mseh3 type mseh3, " UoM text.
netwr type netwr_ap, " Net value of the order item.
kwmeng type p length 13 decimals 1, " Quantity.
werks type werks_d, " Plant.
lgort type lgort_d, " Storage location.
oid_extbol type oid_extbol, " External BOL or truck ticker header.
maktx type maktx, " Material description.
oid_ship type kunwe, " Ship-to customer number.
shipto_name type name1_gp, " Ship-to name.
billto type kunre, " Bill-to customer number.
billto_name type name1_gp, " Bill-to name.
load_contact type kunnr, " Load confirmation contact.
load_name type name1_gp, " Load confirmation contact name.
truck type kunnr, " Truck company number.
truck_name type name1_gp, " Truck company name.
bstkd type bstkd, " PO number.
ihrez type ihrez, " AFE number per the contract/sales order.
delivery type vbeln_vl, " Delivery number.
posnr_vl type posnr_vl, " Delivery item number.
bill_vbeln type vbeln_vf, " Invoice number.
bill_posnr type posnr_vf, " Invoice item number.
bill_netwr type netwr_fp, " Invoice net value.
statu type stats, " Document status.
auart type auart, " order type
vkorg type vkorg, " sales org.
vtweg type vtweg, " distrbtn channel
spart type spart, " division
vkbur like vbak-vkbur, " Sales Office DEVK906677
konda type konda, " price group
tdline type tdline, " text for customer account reference
count type i,
end of t_extract.
data : it_extract type table of t_extract with header line,
it_extract2 type table of t_extract with header line.
data: it_text type table of tline with header line.
data: w_index type sy-index,
w_tdname type tdobname.
constants: c_minus1 type netwr_ap value '1.00-'.
*RANGES: r_auart FOR vbak-auart.
data: r_auart type range of t_extract-auart,
r_auart_line like line of r_auart.
* initialization
initialization.
tp_event-ucomm = '&ILT'. " Filter event.
tp_event-after = 'X'.
append tp_event to ta_events.
gs_layout-colwidth_optimize = 'X'.
tp_print-no_print_listinfos = 'X'.
tp_print-no_coverpage = 'X'.
perform set_fieldcat.
perform alv_eventtab_build using:
** Event name Form to execute Event internal table
'TOP_OF_PAGE' 'TOP_OF_PAGE' gt_events[].
* changed to exclude following order types
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZEQ'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* credit memo
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZPRC'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* debit memo
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZPRD'.
clear r_auart_line-high.
append r_auart_line to r_auart.
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZDR'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* Industry sales order correction
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZSOC'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* oilfield FF correction
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZOCF'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* oilfield WP correction
r_auart_line-sign = 'I'.
r_auart_line-option = 'EQ'.
r_auart_line-low = 'ZOCW'.
clear r_auart_line-high.
append r_auart_line to r_auart.
* Dropdown list for all created ALV layouts, global or user-specific
at selection-screen on value-request for pa_vari.
perform alv_variant_f4 changing pa_vari.
* Main BODY of processing logic
start-of-selection.
perform extract_data.
end-of-selection.
if not it_extract[] is initial.
* Build headings for report.
perform build_top_of_page using gt_list_top_of_page[].
perform call_alv.
endif.
*& Form EXTRACT_KEY_DATA
* Retreive the data for the report.
form extract_data.
clear: it_extract. refresh: it_extract.
* orders
select vbak~vbeln vbak~auart vbak~augru vbak~vkorg vbak~vtweg
vbak~spart vbak~vdatu vbak~kunnr vbak~vkbur
vbap~posnr vbap~matnr vbap~vrkme vbap~netwr vbap~kwmeng
vbap~werks vbap~lgort vbap~oid_extbol vbap~oid_ship
into corresponding fields of table it_extract
from vbak inner join vbap
on vbak~mandt = vbap~mandt
and vbak~vbeln = vbap~vbeln where
vbak~auart not in r_auart and
vbak~vkorg eq p_vkorg and
vbak~vtweg eq p_vtweg and
vbak~spart eq p_spart and
vbak~vkbur in s_vkbur and "DEVK906677
vbak~vdatu in s_vdatu and
vbak~kunnr in s_kunnr and
vbap~matnr in s_matnr and
vbap~werks in s_werks and
vbap~lgort in s_lgort and
vbap~oid_extbol in s_truck and
vbap~oid_ship in s_shipto.
if sy-subrc <> 0.
message i000 with text-002 ' ' ' ' ' '.
endif.
sort it_extract by vbeln.
check sy-subrc = 0.
loop at it_extract.
* Retrieve and select by load confirmation contacts from header
select single kunnr from vbpa into it_extract-load_contact
where vbeln = it_extract-vbeln
and posnr = '000000'
and parvw = 'ZB'.
if it_extract-load_contact in s_load.
it_extract-load_name = zcl_kna1=>get_name1( it_extract-load_contact ).
else.
delete it_extract.
continue.
endif.
* Retrieve and select by sales order bill-to on header level
* as well as lookup bill-to customer name/description
select single kunnr from vbpa into it_extract-billto
where vbeln = it_extract-vbeln
and posnr = '000000'
and parvw = 'RE'.
if sy-subrc = 0.
if s_billto is initial.
it_extract-billto_name = zcl_kna1=>get_name1( it_extract-billto ).
else.
if it_extract-billto in s_billto.
it_extract-billto_name = zcl_kna1=>get_name1( it_extract-billto ).
else.
delete it_extract.
continue.
endif.
endif.
else.
* Newalta - always has bill-to, following will not occur but included
* as good programming practice.
it_extract-billto_name = it_extract-billto.
endif.
* Retrieve and select by price group of sold-to
select single konda from knvv into it_extract-konda
where kunnr = it_extract-kunnr
and vkorg = it_extract-vkorg
and vtweg = it_extract-vtweg
and spart = it_extract-spart.
if sy-subrc = 0.
if not ( it_extract-konda in s_konda ).
delete it_extract.
continue.
endif.
endif.
* Retrieve trucking company customer
select single kunnr from vbpa into it_extract-truck where
vbeln = it_extract-vbeln and
posnr = '000000' and
parvw = 'ZT'.
if sy-subrc = 0.
it_extract-truck_name = zcl_kna1=>get_name1( it_extract-truck ).
endif.
* Retrieve sold-to name
it_extract-soldto_name = zcl_kna1=>get_name1( it_extract-kunnr ).
* Retrieve ship-to name
it_extract-shipto_name = zcl_kna1=>get_name1( it_extract-oid_ship ).
* lookup P.O.
select single bstkd ihrez from vbkd into (it_extract-bstkd, it_extract-ihrez)
where vbeln = it_extract-vbeln
and posnr = '000000'.
* Retreive the material description.
it_extract-maktx = zcl_material=>get_maktx( it_extract-matnr ).
* cosmetic change of material number, donot display leading zeros.
shift it_extract-matnr left deleting leading '0'.
* translate unit of measure
it_extract-mseh3 = it_extract-vrkme.
select single mseh3 from t006a into it_extract-mseh3
where spras = sy-langu
and msehi = it_extract-vrkme.
w_tdname = it_extract-vbeln.
* read customer account reference which is under 'text'
call function 'READ_TEXT'
exporting
client = sy-mandt
id = 'Z010'
language = sy-langu
name = w_tdname
object = 'VBBK'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
tables
lines = it_text
exceptions
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
others = 8.
if sy-subrc = 0.
read table it_text index 1.
if sy-subrc = 0.
it_extract-tdline = it_text-tdline.
else.
clear it_extract-tdline.
endif.
else.
clear it_extract-tdline.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
* Get the delivery item.
call method zcl_vbap=>get_delivery
exporting
itp_vbeln = it_extract-vbeln
itp_posnr = it_extract-posnr
importing
etp_vbeln = it_extract-delivery
etp_posnr = it_extract-posnr_vl.
if it_extract-delivery is not initial.
perform process_deliveries.
else.
perform invoice_process.
endif.
it_extract-count = 1 .
move-corresponding it_extract to it_extract2.
append it_extract2.
at new vbeln.
count1 = count1 + 1.
endat.
endloop.
endform. " EXTRACT_DATA
*& Form SET_FIELDCAT
* Create the field catalogue.
form set_fieldcat .
clear w_field.
clear t_fieldcat. refresh t_fieldcat.
w_field-col_pos = 1 .
w_field-fieldname = 'VBELN'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Document.Nbr'.
w_field-emphasize = 'X'.
w_field-hotspot = 'X'.
append w_field to t_fieldcat.
clear w_field.
w_field-col_pos = 2 .
w_field-fieldname = 'POSNR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Item'(023).
append w_field to t_fieldcat.
clear w_field.
w_field-col_pos = 3 .
w_field-fieldname = 'VDATU'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Req. Del. Date'(005).
append w_field to t_fieldcat.
w_field-col_pos = 4. "DEVK909658
w_field-fieldname = 'KUNNR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Sold-to.'(038).
append w_field to t_fieldcat.
w_field-col_pos = 5 .
w_field-fieldname = 'SOLDTO_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Sold-to'(006).
append w_field to t_fieldcat.
w_field-col_pos = 6 .
w_field-fieldname = 'MATNR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Material'(007).
append w_field to t_fieldcat.
w_field-col_pos = 7 .
w_field-fieldname = 'KWMENG'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Quantity'(008).
append w_field to t_fieldcat.
w_field-col_pos = 8.
w_field-fieldname = 'MSEH3'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'UOM'(009).
append w_field to t_fieldcat.
w_field-col_pos = 9 .
w_field-fieldname = 'BILL_VBELN'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Invoice #'(010).
w_field-emphasize = 'X'.
w_field-hotspot = 'X'.
append w_field to t_fieldcat.
clear w_field.
w_field-col_pos = 10 .
w_field-fieldname = 'BILL_NETWR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Values'(011).
append w_field to t_fieldcat.
w_field-col_pos = 11.
w_field-fieldname = 'WERKS'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Plant'(012).
append w_field to t_fieldcat.
w_field-col_pos = 12.
w_field-fieldname = 'LGORT'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Storage Loc'(013).
append w_field to t_fieldcat.
w_field-col_pos = 13 .
w_field-fieldname = 'MAKTX'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Description'(014).
append w_field to t_fieldcat.
w_field-col_pos = 14. "DEVK909658
w_field-fieldname = 'OID_SHIP'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Ship-to.'(039).
append w_field to t_fieldcat.
w_field-col_pos = 15 .
w_field-fieldname = 'SHIPTO_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Ship-to'(015).
append w_field to t_fieldcat.
w_field-col_pos = 16. "DEVK909658
w_field-fieldname = 'BILLTO'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Bill-to .'(040).
append w_field to t_fieldcat.
w_field-col_pos = 17 .
w_field-fieldname = 'BILLTO_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Bill-to'(016).
append w_field to t_fieldcat.
w_field-col_pos = 18 .
w_field-fieldname = 'LOAD_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Load Contact'(017).
append w_field to t_fieldcat.
w_field-col_pos = 19 .
w_field-fieldname = 'TRUCK_NAME'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Truck Comp.'(018).
append w_field to t_fieldcat.
w_field-col_pos = 20 .
w_field-fieldname = 'BSTKD'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'P.O.'(019).
append w_field to t_fieldcat.
w_field-col_pos = 21 .
w_field-fieldname = 'IHREZ'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'AFE Nbr'(020).
append w_field to t_fieldcat.
w_field-col_pos = 22 .
w_field-fieldname = 'OID_EXTBOL'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Truck Ticket'(021).
append w_field to t_fieldcat.
w_field-col_pos = 23.
w_field-fieldname = 'STATU'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Status'(022).
append w_field to t_fieldcat.
w_field-col_pos = 24.
w_field-fieldname = 'AUGRU'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Ord.Reason'(024).
append w_field to t_fieldcat.
w_field-col_pos = 25.
w_field-fieldname = 'TDLINE'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'cstmr.acct.ref.'(027).
append w_field to t_fieldcat.
w_field-col_pos = 26 . "DEVK906678
w_field-fieldname = 'VKBUR'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Sales Office'(037).
append w_field to t_fieldcat.
w_field-col_pos = 27. "DEVK909658
w_field-fieldname = 'COUNT'.
w_field-tabname = 'IT_EXTRACT2'.
w_field-seltext_l = 'Count'(041).
w_field-do_sum = 'X'.
append w_field to t_fieldcat.
endform. " SET_FIELDCAT
*& Form CALL_ALV
* Call the ALV Grid function.
form call_alv .
sort it_extract by lgort vbeln.
* repid is necessary since the ALV F.M. does not work properly with
* sy-repid.
repid = sy-repid.
alv_variant-variant = pa_vari.
alv_variant-report = sy-repid.
alv_variant-username = sy-uname.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = repid
i_callback_user_command = 'USER_COMMAND'
is_layout = gs_layout
it_fieldcat = t_fieldcat[]
it_sort = gt_sort[]
i_default = 'X'
i_save = 'A'
is_variant = alv_variant
it_events = gt_events[]
it_event_exit = ta_events[]
is_print = tp_print
tables
t_outtab = it_extract2
exceptions
program_error = 1
others = 2.
if sy-subrc ne 0.
message w000 with text-004 ' ' ' ' ' '.
endif.
endform. " CALL_ALV
*& Form build_top_of_page
* Build heading for report. *
* -->P_GT_LIST_TOP_OF_PAGE[] Header stuff for report
form build_top_of_page using e04_lt_top_of_page type slis_t_listheader.
data: ls_line type slis_listheader. "Header table for top of page
* construct 'top of page' info. to display. In this case, one line.
data: w_selections(40) type c,
w_date_from(10) type c,
w_date_to(10) type c.
write: s_vdatu-low to w_date_from dd/mm/yyyy.
if s_vdatu-high is not initial.
write: s_vdatu-high to w_date_to dd/mm/yyyy.
clear w_selections.
concatenate 'Del.Req.Date: ' w_date_from 'To' w_date_to
into w_selections separated by space.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = w_selections.
append ls_line to e04_lt_top_of_page.
gs_list_top_of_page-typ = 'S'.
gs_list_top_of_page-info = ' Total Number of Sales Documents'.
append gs_list_top_of_page to gt_list_top_of_page.
gs_list_top_of_page-typ = 'S'.
gs_list_top_of_page-info = count1.
append gs_list_top_of_page to gt_list_top_of_page.
else.
clear w_date_to.
concatenate 'Del.Req.Date: ' w_date_from
into w_selections separated by space.
clear ls_line.
ls_line-typ = 'H'.
ls_line-info = w_selections.
append ls_line to e04_lt_top_of_page.
endif.
endform. " build_top_of_page
*& Form alv_eventtab_build
* Pass list of events to be triggered by the ALV function module
form alv_eventtab_build using u_name type slis_alv_event-name
u_form type slis_alv_event-form
alv_lt_events type slis_t_event.
data: ls_event type slis_alv_event. " structure for event handling
ls_event-name = u_name.
ls_event-form = u_form.
append ls_event to alv_lt_events.
endform. " alv_eventtab_build
* FORM TOP_OF_PAGE *
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = 'NEWALTA_LOGO'
it_list_commentary = gt_list_top_of_page.
endform. " TOP_OF_PAGE
*& Form process_deliveries
* Process the delivery related records.
form process_deliveries .
data:
ltp_date type wadat_ist, " Goods movement date.
ltp_vbtyp type vbtyp_n,
ltp_mtart type mtart, " Material type.
w_lfimg type lfimg, " Actual quantity delivered (in sales units).
w_vrkme type vrkme. " Sales unit of measure.
* Read delivery quantity and uom.
select single lfimg vrkme into (w_lfimg, w_vrkme)
from lips where
vbeln = it_extract-delivery and
posnr = it_extract-posnr_vl.
* these fields have values from vbap. override with lips values
if sy-subrc = 0.
it_extract-kwmeng = w_lfimg.
it_extract-vrkme = w_vrkme.
* translate unit of measure
it_extract-mseh3 = it_extract-vrkme.
select single mseh3 from t006a into it_extract-mseh3
where spras = sy-langu
and msehi = it_extract-vrkme.
endif.
* Determine STATUS by reading 'service confirmation', R (goods movemt)
* it is possible to have multiple 'service confirmation' records for
* one item. ie. delivery 80010390 in PRD.
* As long as there is at least one 'service confirmation' record,
* status is considered 'complete'.
* Validate the created on date of the goods movement or service confirmation.
ltp_mtart = zcl_material=>get_mtart( it_extract-matnr ).
* ltp_date = zcl_lips=>get_goods_movement_date( itp_vbeln = it_extract-delivery
* itp_posnr = it_extract-posnr_vl itp_mtart = ltp_mtart ).
call method zcl_lips=>get_goods_mvt_info
exporting
itp_vbeln = it_extract-delivery
itp_posnr = it_extract-posnr_vl
itp_mtart = ltp_mtart
importing
rtp_date = ltp_date
rtp_vbtyp = ltp_vbtyp.
* 'h' is cancel goods issue
if ltp_vbtyp = 'h'.
it_extract-statu = 'Incomplete'(025).
else.
if ltp_date is not initial.
it_extract-statu = 'COMPLETE'(026).
endif.
endif.
* Retrieve the invoice/billing document item.
call method zcl_lips=>get_invoice
exporting
itp_vbeln = it_extract-delivery
itp_posnr = it_extract-posnr_vl
importing
rtp_vbeln = it_extract-bill_vbeln
rtp_posnr = it_extract-bill_posnr.
if it_extract-bill_vbeln is not initial.
* retrieve net value from the invoice.
clear it_extract-bill_netwr.
select single netwr into it_extract-bill_netwr from vbrp
where vbeln = it_extract-bill_vbeln
and posnr = it_extract-bill_posnr.
else.
it_extract-bill_netwr = it_extract-netwr. " Use order net value.
endif.
endform. " process_deliveries
*& Form user_command
* Process the user command.
* -->R_UCOMM User command
* -->RS_SELFIELD Field selected
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
data: ltp_vbeln type vbeln. " Sales document number.
case r_ucomm.
when '&IC1'.
if ( rs_selfield-fieldname = 'VBELN'
or rs_selfield-fieldname = 'BILL_VBELN' )
and rs_selfield-value is not initial. " Display sales document.
ltp_vbeln = rs_selfield-value.
zcl_sales_doc=>display( ltp_vbeln ).
endif.
when '&ILT'.
data:
lta_filt type slis_t_filtered_entries.
break rdrury.
call function 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
importing
* es_layout = gs_layout
* et_fieldcat = t_fieldcat[]
* et_sort = gt_sort[]
* ES_LAYOUT =
* ET_FIELDCAT =
* ET_SORT =
* ET_FILTER =
* ES_LIST_SCROLL =
* ES_VARIANT =
* E_WIDTH =
* ET_MARKED_COLUMNS =
et_filtered_entries = lta_filt
* ET_FILTERED_ENTRIES_HEADER =
* ET_FILTERED_ENTRIES_ITEM = lta_filt
* TABLES
* et_outtab =
* ET_OUTTAB_HEADER =
* et_outtab_item =
* ET_COLLECT00 =
* ET_COLLECT01 =
* ET_COLLECT02 =
* ET_COLLECT03 =
* ET_COLLECT04 =
* ET_COLLECT05 =
* ET_COLLECT06 =
* ET_COLLECT07 =
* ET_COLLECT08 =
* ET_COLLECT09 =
exceptions
no_infos = 1
program_error = 2
endcase.
endform. "user_command
*& Form invoice_process
* Process for orders without deliveries. *
form invoice_process .
* Translate unit of measure.
select single mseh3 from t006a into it_extract-mseh3
where spras = sy-langu
and msehi = it_extract-vrkme.
* Retrieve the invoice/billing document item.
call method zcl_vbap=>get_invoice
exporting
itp_vbeln = it_extract-vbeln
itp_posnr = it_extract-posnr
importing
rtp_vbeln = it_extract-bill_vbeln
rtp_posnr = it_extract-bill_posnr.
if it_extract-bill_vbeln is not initial.
* retrieve net value from the invoice.
clear it_extract-bill_netwr.
select single netwr into it_extract-bill_netwr from vbrp
where vbeln = it_extract-bill_vbeln
and posnr = it_extract-bill_posnr.
else. " If no Invoice, then status becomes 'incomplete'.
it_extract-bill_netwr = it_extract-netwr. " Use order net value.
it_extract-statu = 'Incomplete'(025).
endif.
endform. " invoice_process
*& Form alv_variant_f4
* Get the display variant.
* <--CTP_VARI Variant name
form alv_variant_f4 changing ctp_vari type slis_vari.
alv_variant-report = sy-repid. " Report ID
alv_variant-username = sy-uname. " User ID
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = alv_variant
i_save = 'A'
importing
es_variant = alv_variant
exceptions
others = 1.
if sy-subrc = 0.
ctp_vari = alv_variant-variant.
endif.
endform. " alv_variant_f4I have used all the FM modules mentioned but I am not able to get the total of the sales doc on the top of the page to chnage when filtering of data is done . I just want to see this count of sales document (distict ) and to see it change as filtering is done , be it at any place in teh ALV , its not necessary that it has to be on the top of the ALV output. Could I get some inputs please. As you can see I used the below mentioned FM but on debugging I find the gt_stack is empty still.
*& Form build_top_of_page
* Build heading for report. *
* -->P_GT_LIST_TOP_OF_PAGE[] Header stuff for report
FORM build_top_of_page USING e04_lt_top_of_page TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader. "Header table for top of page
* construct 'top of page' info. to display. In this case, one line.
DATA: w_selections(40) TYPE c,
w_date_from(10) TYPE c,
w_date_to(10) TYPE c.
WRITE: s_vdatu-low TO w_date_from DD/MM/YYYY.
IF s_vdatu-high IS NOT INITIAL.
WRITE: s_vdatu-high TO w_date_to DD/MM/YYYY.
CLEAR w_selections.
CONCATENATE 'Del.Req.Date: ' w_date_from 'To' w_date_to
INTO w_selections SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = w_selections.
APPEND ls_line TO e04_lt_top_of_page.
gs_list_top_of_page-typ = 'S'.
gs_list_top_of_page-info = ' Total Number of Sales Documents'.
append gs_list_top_of_page to gt_list_top_of_page.
gs_list_top_of_page-typ = 'S'.
gs_list_top_of_page-info = count1.
append gs_list_top_of_page to gt_list_top_of_page.
ELSE.
CLEAR w_date_to.
CONCATENATE 'Del.Req.Date: ' w_date_from
INTO w_selections SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = w_selections.
APPEND ls_line TO e04_lt_top_of_page.
ENDIF.
ENDFORM. " build_top_of_page
*& Form alv_eventtab_build
* Pass list of events to be triggered by the ALV function module
FORM alv_eventtab_build USING u_name TYPE slis_alv_event-name
u_form TYPE slis_alv_event-form
alv_lt_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event. " structure for event handling
ls_event-name = u_name.
ls_event-form = u_form.
APPEND ls_event TO alv_lt_events.
ENDFORM. " alv_eventtab_build
* FORM TOP_OF_PAGE *
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
i_logo = 'NEWALTA_LOGO'
it_list_commentary = gt_list_top_of_page.
Data:lt_FILTERED_ENTRIES type SLIS_T_FILTERED_ENTRIES,
wa_filter like line of lt_FILTERED_ENTRIES.
data: count2 type i.
data: it_fieldcat type slis_t_fieldcat_alv with header line.
CALL FUNCTION 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
IMPORTING
ET_FILTERED_ENTRIES = lt_FILTERED_ENTRIES
EXCEPTIONS
NO_INFOS = 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.
MESSAGE i000 WITH count1 .
ENDIF.
loop at lt_FILTERED_ENTRIES into wa_filter.
* if sy-tabix <> 0.
if sy-subrc = 0 .
count2 = count2 + 1.
*count3 = count1 - count2 .
* write:/ 'Total number of Sales Documents =', count3 .
endif.
endloop.
ENDFORM. " TOP_OF_PAGE
I tried using it at user-command level too but it dosent help.
Thanks
Maybe you are looking for
-
Hey guys, I'm sure this has to exist elsewhere, but I couldn't come up with anything quickly. I've been trying out the Premiere Pro CC trial for a little while now, and have been mostly pleased. I've used nothing but FCP in my career and know it lik
-
Manipulation in a internal table
Hi, I have one internal table with NETWR value with other fields. now i have netwr values as 10,20,30,40. Then i should sum up NETWR value for internal table on a single hit. Can anybody have the solution. Right now i am looping at that I.Table and c
-
How to Use dyanamic table in query?
Hi, can you please tell.in query - 1] if we define a varibale and in that varibale we have to speacfy the dynamic table name can it's possible. 2] I tried but it's not working 3] Every year i have taken a backup table and from that backup table i fet
-
VBOF on rebate agreements for 2 customers in same customer hierarchy
Hello, I have 2 agreements for two customers. One customer is in the customer hierarchy of the other customer but on a higher level. When I turn VBOF, the agreement on the higher level is cancelled. Is this not possible? thanks
-
Can't acces the database with EM database control
I just did a fresh 10g R2 (only oracle home) installation on a laptop with Win XP SP2 (spanish) and everything was fine. I can connect to de database using Plus or any other development tools. But when I open the EM start page (host:1158/em) using ei