Change report standard header line
Hi Friends,
I have to change the print of standard header of all reports by using cmod exit S38MREP1. I have to print User-ID Time and system-ID on each page incl. all SAP standardreports.
thanks in advance
Harald
Hi Harald,
Are you saying about the report output or when we create a report commentted lines that we get.
Regards,
Kiran I
If you are saying about the commented lines that we get at the time of creating report then this may not work.
For that you can use table
TSE05
Inputs for this table are APP_OBJ = 'ADDM' and Keyword = 'REPORT' for report .
reward points if it solved your issue.
Message was edited by:
kiran i
Similar Messages
-
how to create a report with out the HEADER LINE concept....because I want the output as only some of the fields from the table.....
And this type of programming consumes much processing than the normal one.....
NOTE: In normal process I am facing memory problem. It's giving error like "the WORKAREA <internal table> is not enough"
Regards
SureshCheck the below example ,it has both header line and withou header line:
Internal table with header line
here i am using get time field command ,so use both program and see comparision time
report zxyz.
Internal table with header line.
DATA:BEGIN OF itab OCCURS 0,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
END OF itab.
data : f1 type i,
f2 type i,
f3 type i.
start-of-selection.
get run time field f1.
SELECT lifnr name1 FROM lfa1 INTO TABLE itab up to 200 rows.
loop at itab.
endloop.
get run time field f2.
f3 = f2 - f1 .
write :/ 'Time taken by query in Micro seconds', f3.
Internal table without header line
report zxyz1.
Internal table without header line.
types : begin of ty_itab ,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
end of ty_itab.
data itab type standard table of ty_itab.
data wa_itab like line of itab.
data : f1 type i,
f2 type i,
f3 type i.
start-of-selection.
get run time field f1.
SELECT lifnr name1 FROM lfa1 INTO TABLE itab up to 200 rows.
loop at itab into wa_itab.
endloop.
get run time field f2.
f3 = f2 - f1 .
write :/ 'Time taken by query in Micro seconds', f3.
I would suggest use always internal table without header line.
Thanks
Seshu -
Changing report painter header
Dear all,
I have developed report for balance sheet. Report execution screen fields are Period and fiscal year.
eg. If I give Period 11 FY = 2008
The header it is displaying is balance sheet for the period 11 year 2008
But My client wants to display " The Balance sheet for February 2009."
How do I get this? Can any body help me as i am in urgency
I will assign full points
b.s.raoHi,
For this Report has been created based on some Form. Choose that form by double clicking it.
Place the cursor in the text "balance sheet = " that you have already given. Click Edit in the
tool bar > Click Element > Click Change Text. Enter the Text you want short, medium & long.
Finally save the form.
Sadashivan -
Re: Report output header text longuage change
Hi Dear's,
Ataually my issue is am unable to change report output header field text to user specific login longuage....
I.e. if user login to ITALY/GERMANY then report output header text should be displayed on same Longuage for this can any body give me some idea
Thanks & Advance,
srinivas.
Edited by: SRINIVAS1234 on Jul 23, 2011 11:35 AMHi SRINIVAS1234,
you can close it as answered and add your personal solution just to let people know how it can be handled. You can also close questions as unanswered but this implies that your problem is still existing.
Regards
Clemens -
How do I let the sieve rules match on non-standard header fields in iMS 5.0p3?
I am able to create a per-user rule that matches on standard header lines, but if I am using a non-standard line, such as X-Spam-Flag, the rule won't apply. Is there any way to make this work properly?
On a site running 5.2 hf 0.9, I have the following sieve rule:
mailSieveRuleSource: require "fileinto"; if header :contains "X-Spam-Status" "Yes" { fileinto "SPAM"; }
and it works fine for me -
How to add/change missing header lines in RNIF B2B?
Hi all,
We are using RNIF exchange protocol. We have sent invoice from BPEL to B2B. The message invoice reaches the trading partner but they are unable to process it or sent ack back as few header lines are missing in the RNIF envelope.
Can anyone tell me or provide some pointers abt how to add/change missing header lines in B2B?
These are the headers missing:
Delivery header:
<locationID> <Value>HostTradingPartner</Value> </locationID>
Service Header:
<messageStandard>
<FreeFormText xml:lang="EN">PIDX</FreeFormText>
</messageStandard> <standardVersion>
<VersionIdentifier>1.0</VersionIdentifier>
</standardVersion>
Can anyone provide some inputs on this?As per RNIF standard, all these header elements (locationID in Delivery Header & messageStandard and standardVersion in Service Header) are optional. As you are using RossettNet over RNIF, so Oracle B2B might not be setting these headers.
I do not have a 10g setup here so cann't test it. I would suggest you to raise a case with Oracle Support because PIDX is a non-RossettaNet standard and it's implementation in Oracle B2B will be different to RossettaNet implementation. Meanwhile, I would try the same in B2B 11g setup.
Regards,
Anuj -
Adding report header lines using expand.xsl style sheet
Hello
I would like to add a few header lines (appears only at the first page of the report) into my XML report that is based on expand.xsl style sheet.
Since I am not familiar with XML, is there any example or a modified (ready to run) expand.xsl style sheet that implements it?
Thank you
ZvikaHey Zvika,
Chek out this website: http://zone.ni.com/devzone/cda/epd/p/id/4759
NI doesn't support any changes in the xsl however so if you change it you are on your own. You can look to this website for help with that: http://www.w3.org/XML/
Regards,
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~ -
Download alv report output to excel format with out header line
Hi experts,
i want to download a alv report output into excel formatt with out the header line but it has to download including field description. as this output will fed into another transaction, the downloaded excel file should be with out header line.
fro eg:
Report : Zabc ABAP Development Page : 1
Run Date : 12/14/06 System: UD400
Run Time : 08:45:37
this header details should not be downloaded into the excel file.
could somebody help me please.
thanks
deepuhi jayanti,
thanks for your response.
i have delclared all the field types as character but still it is not downloading and it 's sy-subrc is 4... the code is as below.
*field names
lt_fieldnames-value = 'Material Number'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Plant'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Group'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Description'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'UOM'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Price Unit'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Material Type'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'X-Plant Status'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Valuation Class'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_avmng.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_avntp.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Latest PO Qty'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Latest PO Cost'.
APPEND lt_fieldnames.
lt_fieldnames-value = 'PO Creation Date'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_fcaqt.
APPEND lt_fieldnames.
lt_fieldnames-value = 'Prev. Yr. Std. Cost'.
APPEND lt_fieldnames.
lt_fieldnames-value = lw_stcst.
APPEND lt_fieldnames.
CALL FUNCTION 'MS_EXCEL_OLE_STANDARD_DAT'
EXPORTING
file_name = 'XLSHEET'
CREATE_PIVOT = 0
DATA_SHEET_NAME = ' '
PIVOT_SHEET_NAME = ' '
PASSWORD = ' '
PASSWORD_OPTION = 0
TABLES
PIVOT_FIELD_TAB =
data_tab = t_output1
fieldnames = lt_fieldnames
EXCEPTIONS
file_not_exist = 1
filename_expected = 2
communication_error = 3
ole_object_method_error = 4
ole_object_property_error = 5
invalid_pivot_fields = 6
download_problem = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE e001 WITH 'Data could not be downloaded'.
ENDIF.
ENDFORM. " z_dwn_xl
thanks
deepu -
Pb with header line in my report
hi,
I have a problem with the alignment of the header line of my table in my report
Indeed the header line is centered on the first page but not on the second one.
I attach the code and a pdf which shows the problem.
If someone can help me,please.
Best regards
Attachments:
test pb array.vi 20 KB
Document.pdf 24 KBHi,
Your VIs doesn't work on my computer. Is it really running on yours? Did you try with a word report and if so, do you have the same phenomena?
Regards
Manuel R
AE dans une autre vie -
Hello All,
Does any one have any idea how to create 2 Header lines in an ALv report
as in 1 cummulative header and under that 2nd detailed header.
Please help me out.
Cheers,
Deepthee KasalHi,
It is not possible to have 2 detailed headers in ALV reports.
Regards,
Satish -
Hard code header lines in report?
Hello All,
I am writting an abap report. The report is outputted into AL11. Two header lines are needed showing the fileds in the report, one in capitals and one not.
What would be the best way to do this?
Thanks,
Nick.Hi Venkat,
thanks for you response.
The header line has about 150 fields, therefore it is to big to fit into one variable.
If i create 150 variables for each individual field seems a bit excessive as I would have to do that twice.
Any other ideas?
Thanks,
Nick. -
How to create multiple report header line?
Dear Experts!
I am creating a report, which needs multiple lines for report header e.g. First row should have Report Name in bold. Then next line should have the month for which the report was executed and last line should have the person, who executed it.
I know that I can get the text of these values by text variable but the problem is to format it and to put the text in different report header lines.
Please help!
Thank you,
TyagiDear Tyagi,
Are you using BEx Report Designer?
You can use drag-and-drop for moving the fields. Just click on the cell and as the buttons appear, move it to your destination cell.
Regards, Karol - SAP BI Development -
Schedule Line Date Changed By Standard Code After User Exit
We've implemented USEREXIT_MOVE_FIELD_TO_VBEP to conditionally change the schedule line date (it changes VBEP-EDATU) when sales orders are being created. This functions correctly when VA01 or EDI is used. However, when the order is created using BAPI_SALESORDER_CREATEFROMDAT2, standard code executing after the user exit changes the schedule line date to an incorrect value.
The user exit correctly changes the schedule line date; then later on in the execution subroutine VBEP_FUELLEN_VBEPKOM in include FV45EFEP_VBEP_FUELLEN_VBEPKOM is executed which changes the date on line 37 using the value in US_VBEPKOM-EDATU. US_VBEPKOM-EDATU is in scope in the user exit, but earlier in subroutine VBEP_FUELLEN_VBEPKOM (line 12 to be exact) this variable is updated with the value in US_VBEPKOM1-EDATU, which is not in scope during the user exit. So, USEREXIT_MOVE_FIELD_TO_VBEP doesn't have access to US_VBEPKOM1-EDATU and can not ensure that the correct value is used later on in subroutine VBEP_FUELLEN_VBEPKOM.
I noticed at the end of subroutine VBEP_FUELLEN_VBEPKOM it calls USEREXIT_MOVE_FIELD_TO_VBEPKOM. I could update VBEP-EDATU here to correct the error whenever the order is created using the BAPI, but it would be nice to have a solution that could be implemented only in USEREXIT_MOVE_FIELD_TO_VBEP without also having to implement USEREXIT_MOVE_FIELD_TO_VBEPKOM.
So my question: is there a way to update the schedule line date in USEREXIT_MOVE_FIELD_TO_VBEP where it won't be changed later in subroutine VBEP_FUELLEN_VBEPKOM when the order is created using the BAPI?Hi Caetano,
thanks for your suggestion
Yes, we use firm zone for few of the vendors. there the system don't change the schedule lines.
Also for the stock transfer PR's there is no firm zone and the lead time is one day. in this case it changes everyday after the MRP run.
the stock transfer PR's leads to the creation of Schedule lines from the source plant. Since this PR gets changed everyday. the alerts coming out of MD07 gets changed and we really did not know if this order is delayed or not. In the source plant we use the firm zone to avoid moving the schedule line. But then the alerts are always not correct.
is there any setting which helps in not moving the PR everyday without using " start in the past"
thanks
Nagendra Kumar -
Why it returns ERROR after I changed some Standard Reports output to XML?
Our EBS is a 11.5.10 CU2 instance.
We just upgrated the XML Publisher to 5.6.1 and did all the work described in section "Post-install Steps" of "About Oracle XML Publisher 5.6.1"(Doc ID: Note:357308.1)
Now we are do the testing.
I changed the Standard Report "Journals - General (132 Char)" output type to XML, then ran it.
It returns ERROR
Logs is as flows:
General Ledger: Version : 11.5.0 - Development
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
GLGENJRN module: Journals - General(132 Char)
Current system time is 25-AUG-2006 11:39:25
+-----------------------------
| Starting concurrent program execution...
+-----------------------------
Arguments
P_SET_OF_BOOKS_ID='1001'
P_KIND='L'
P_POSTING_STATUS='U'
P_CURRENCY_CODE='CNY'
P_PERIOD_NAME='AUG-06'
P_PAGESIZE='132'
XML_REPORTS_XENVIRONMENT is :
/global/d01/applprod/oracle/prodora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
XENVIRONMENT is set to /global/d01/applprod/oracle/prodora/8.0.6/guicommon6/tk60/admin/Tk2Motif_UTF8.rgb
Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
AMERICAN_AMERICA.UTF8
REP-1401: 'beforereport': Fatal PL/SQL error occurred.
ORA-06502: PL/SQL: numeric or value error
Report Builder: Release 6.0.8.25.0 - Production on Fri Aug 25 11:39:26 2006
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Enter Username:
Start of log messages from FND_FILE
End of log messages from FND_FILE
Program exited with status 1
Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 301650.
Review your concurrent request log and/or report output file for more detailed information.
Executing request completion options...
Finished executing request completion options.
Concurrent request completed
Current system time is 25-AUG-2006 11:39:27
Anybody know why?
Thanks!Hi,
The log file says that the RDF report actually errored out
and its not a problem in XML Publisher.
REP-1401: 'beforereport': Fatal PL/SQL error occurred.
ORA-06502: PL/SQL: numeric or value error
what you can do to debug is change the output type to text and run the report.
See, if the report runs successfully. I guess, there might be some problem with the report itself.
If the text report runs fine, change the output type to xml and run it.
Hope it helps -
Sales changes report modification
Hi Gurus
I have created this report for sales document and it is working fine in ALV , I want to make this report to change from ALV to a Printable format and the Header Note and Internal note are displaying very length, I want this to be in display in readable format for the management.
Is there any way to modify this report please
Thanks in advanced
report z_order_changes no standard page heading
line-size 132.
type-pools:
slis. " ALV types
tables:
cdhdr, " Change documents: Header
cdpos, " Change documents: Items
vbak, " Sales order: Header
vbap. " Sales order: Items
types:
begin of ty_cdhdr,
objectclas like cdhdr-objectclas, " Object class
objectid like cdhdr-objectid, " Object value
changenr like cdhdr-changenr, " Document change number
username like cdhdr-username, " Changed by
udate like cdhdr-udate, " Changed on
utime like cdhdr-utime, " Changed at
tcode like cdhdr-tcode, " Transaction code
end of ty_cdhdr,
ty_it_cdhdr type ty_cdhdr occurs 0,
begin of ty_cdpos,
objectclas like cdpos-objectclas, " Object class
objectid like cdpos-objectid, " Object value
changenr like cdpos-changenr, " Document change number
tabname like cdpos-tabname, " Table name
tabkey like cdpos-tabkey, " Table key
fname like cdpos-fname, " Field name
chngind like cdpos-chngind, " Change indicator
value_new like cdpos-value_new, " New value of field
value_old like cdpos-value_old, " Old value of field
end of ty_cdpos,
ty_it_cdpos type ty_cdpos occurs 0,
begin of ty_dd03l,
tabname like dd03l-tabname,
fieldname like dd03l-fieldname,
as4local like dd03l-as4local,
as4vers like dd03l-as4vers,
rollname like dd03l-rollname,
end of ty_dd03l,
ty_it_dd03l type ty_dd03l occurs 0,
begin of ty_dd04t,
rollname like dd04t-rollname,
ddlanguage like dd04t-ddlanguage,
as4local like dd04t-as4local,
as4vers like dd04t-as4vers,
scrtext_l like dd04t-scrtext_l,
end of ty_dd04t,
ty_it_dd04t type ty_dd04t occurs 0,
begin of ty_kna1,
kunnr like kna1-kunnr, " Customer number
name1 like kna1-name1, " Customer name
end of ty_kna1,
ty_it_kna1 type ty_kna1 occurs 0,
ty_text(500) type c,
ty_lines type tline,
ty_it_lines type ty_lines occurs 0,
begin of ty_merged,
vbeln like vbak-vbeln, " Sales order number
erdat like vbak-erdat, " Created on
auart like vbak-auart, " Order type
faksk like vbak-faksk, " Billing block in SD document
netwr like vbak-netwr, " Net value
waerk like vbak-waerk, " Currency
vkorg like vbak-vkorg, " Sales organisation
vtweg like vbak-vtweg, " Distribution channel
vkbur like vbak-vkbur, " Sales office
fkara like vbak-fkara, " Proposed billing type
kunnr like vbak-kunnr, " Sold-to party
xblnr like vbak-xblnr, " Reference
fbuda like vbkd-fbuda, " Date services rendered
username like cdhdr-username, " Changed by
udate like cdhdr-udate, " Changed on
utime like cdhdr-utime, " Changed at
tcode like cdhdr-tcode, " Transaction code
tabname like cdpos-tabname, " Table name
tabkey like cdpos-tabkey, " Table key
fname like cdpos-fname, " Field name
chngind like cdpos-chngind, " Change indicator
value_new like cdpos-value_new, " New value of field
value_old like cdpos-value_old, " Old value of field
scrtext_l like dd04t-scrtext_l, " Description of field
intnote type ty_text, " Internal note
hdrnote type ty_text, " Header note
name1 like adrc-name1, " Sold-to party name
end of ty_merged,
ty_it_merged type ty_merged occurs 0,
begin of ty_vbak,
vbeln like vbak-vbeln, " Sales order number
erdat like vbak-erdat, " Created on
auart like vbak-auart, " Order type
faksk like vbak-faksk, " Billing block in SD document
netwr like vbak-netwr, " Net value
waerk like vbak-waerk, " Currency
vkorg like vbak-vkorg, " Sales organisation
vtweg like vbak-vtweg, " Distribution channel
vkbur like vbak-vkbur, " Sales office
fkara like vbak-fkara, " Proposed billing type
kunnr like vbak-kunnr, " Sold-to party
xblnr like vbak-xblnr, " Reference
objectid like cdhdr-objectid, " Change document object
end of ty_vbak,
ty_it_vbak type ty_vbak occurs 0,
begin of ty_vbkd,
vbeln like vbkd-vbeln, " Sales order number
posnr like vbkd-posnr, " Sales order item
fbuda like vbkd-fbuda, " Date services rendered
end of ty_vbkd,
ty_it_vbkd type ty_vbkd occurs 0.
Internal tables
data:
Internal table to store change document header details from CDHDR
it_cdhdr type ty_it_cdhdr,
Internal table to store change document details from CDPOS
it_cdpos type ty_it_cdpos,
Internal table to store field catalog for report function
it_fieldcat type slis_t_fieldcat_alv,
Internal table to store customer details from KNA1
it_kna1 type ty_it_kna1,
Internal table to store merged data for report output
it_merged type ty_it_merged,
Internal table to store sales order header details from VBAK
it_vbak type ty_it_vbak,
Internal table to store sales order business data from VBKD
it_vbkd type ty_it_vbkd.
Work areas
data:
wa_vbak type ty_vbak.
Structures
data:
Display variant structures
st_tvariant like disvariant,
st_variant like disvariant.
Constants
constants:
co_as4local_a like dd03l-as4local " Active version
value 'A',
co_objectclas_verkbeleg like cdhdr-objectclas
value 'VERKBELEG',
co_posnr_initial like vbkd-posnr " Initial item number
value is initial,
co_save_u type c " User display variant
value 'U', " saving allowed.
co_trvog_0 like vbak-trvog " Sales order
value '0'.
Variables
data:
va_exit type c, " ALV display
va_tabix like sy-tabix.
Selection screen definition
selection-screen: begin of block b1 with frame title text-001.
select-options:
s_vbeln for vbak-vbeln, " Sales order number
s_erdat for vbak-erdat, " Created on
s_auart for vbak-auart, " Order type
s_vkorg for vbak-vkorg, " Sales organisation
s_vtweg for vbak-vtweg, " Distribution channel
s_vkbur for vbak-vkbur, " Sales office
s_kunnr for vbak-kunnr, " Sold-to party
s_usrnme for cdhdr-username, " Changed by
s_udate for cdhdr-udate. " Changed on
selection-screen: end of block b1,
begin of block b2 with frame title text-002.
parameters:
p_varint like disvariant-variant. " Display variant.
selection-screen: end of block b2.
Initialization
initialization.
Load display variant.
if not p_varint is initial.
move st_variant to st_tvariant.
move p_varint to st_tvariant-variant.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = co_save_u
changing
cs_variant = st_tvariant.
st_variant = st_tvariant.
else.
clear st_variant.
st_variant-report = sy-repid.
endif.
at selection-screen on value-request for p_varint.
Provide display variant list for this program.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = st_variant
i_save = co_save_u
importing
e_exit = va_exit
es_variant = st_tvariant
exceptions
not_found = 2.
if sy-subrc eq 2.
message id sy-msgid type 'S'
number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
if va_exit eq space.
st_variant = st_tvariant.
p_varint = st_tvariant-variant.
endif.
endif.
At selection screen
at selection-screen.
Load display variant.
if not p_varint is initial.
move st_variant to st_tvariant.
move p_varint to st_tvariant-variant.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = co_save_u
changing
cs_variant = st_tvariant.
st_variant = st_tvariant.
else.
clear st_variant.
st_variant-report = sy-repid.
endif.
Start of selection
start-of-selection.
Extract order details from VBAK
select vbeln erdat auart faksk netwr waerk vkorg vtweg vkbur fkara
kunnr xblnr
from vbak
into table it_vbak
where vbeln in s_vbeln
and erdat in s_erdat
and auart in s_auart
and vkorg in s_vkorg
and vtweg in s_vtweg
and vkbur in s_vkbur
and kunnr in s_kunnr
and trvog eq co_trvog_0.
if sy-subrc ne 0.
No data found for selection
message s001(zgen).
exit.
endif.
loop at it_vbak into wa_vbak.
va_tabix = sy-tabix.
wa_vbak-objectid = wa_vbak-vbeln.
modify it_vbak from wa_vbak
index va_tabix
transporting objectid.
endloop.
Extract change document header details from CDHDR
select objectclas objectid changenr username udate utime tcode
from cdhdr
into table it_cdhdr
for all entries in it_vbak
where objectclas eq co_objectclas_verkbeleg
and objectid eq it_vbak-objectid
and username in s_usrnme
and udate in s_udate.
if sy-subrc eq 0.
Extract change document details from CDPOS
select objectclas objectid changenr tabname tabkey fname chngind
value_new value_old
from cdpos
into table it_cdpos
for all entries in it_cdhdr
where objectclas eq it_cdhdr-objectclas
and objectid eq it_cdhdr-objectid
and changenr eq it_cdhdr-changenr.
endif.
Extract sales order business data from VBKD
select vbeln posnr fbuda
from vbkd
into table it_vbkd
for all entries in it_vbak
where vbeln eq it_vbak-vbeln
and posnr eq co_posnr_initial.
Extract customer details from KNA1
select kunnr name1
from kna1
into table it_kna1
for all entries in it_vbak
where kunnr eq it_vbak-kunnr.
Merge data for report output
perform merge_data tables it_cdhdr
it_cdpos
it_kna1
it_merged
it_vbak
it_vbkd.
if it_merged[] is initial.
No data found for selection
message s001(zgen).
exit.
endif.
Release memory no longer required.
free: it_cdhdr,
it_cdpos,
it_kna1,
it_vbak,
it_vbkd.
Build field catalog for call to report function
perform build_field_catalog tables it_fieldcat.
Output report.
perform output_report tables it_fieldcat
it_merged.
*& Form merge_data
text
form merge_data tables pa_it_cdhdr type ty_it_cdhdr
pa_it_cdpos type ty_it_cdpos
pa_it_kna1 type ty_it_kna1
pa_it_merged type ty_it_merged
pa_it_vbak type ty_it_vbak
pa_it_vbkd type ty_it_vbkd.
Local internal tables
data:
lit_dd03l type ty_it_dd03l,
lit_dd04t type ty_it_dd04t.
Local work areas
data:
lwa_cdhdr type ty_cdhdr,
lwa_cdpos type ty_cdpos,
lwa_dd03l type ty_dd03l,
lwa_dd04t type ty_dd04t,
lwa_kna1 type ty_kna1,
lwa_merged type ty_merged,
lwa_vbak type ty_vbak,
lwa_vbkd type ty_vbkd.
Local variables
data:
lva_dd03l_tabix like sy-tabix,
lva_dd04t_tabix like sy-tabix.
sort pa_it_cdhdr by objectid changenr.
sort pa_it_cdpos by objectid changenr tabname tabkey fname.
sort pa_it_kna1 by kunnr.
sort pa_it_vbak by vbeln.
sort pa_it_vbkd by vbeln.
loop at pa_it_vbak into lwa_vbak.
clear lwa_merged.
Assign sales order fields to reporting work area
lwa_merged-vbeln = lwa_vbak-vbeln.
lwa_merged-erdat = lwa_vbak-erdat.
lwa_merged-auart = lwa_vbak-auart.
lwa_merged-faksk = lwa_vbak-faksk.
lwa_merged-netwr = lwa_vbak-netwr.
lwa_merged-waerk = lwa_vbak-waerk.
lwa_merged-vkorg = lwa_vbak-vkorg.
lwa_merged-vtweg = lwa_vbak-vtweg.
lwa_merged-vkbur = lwa_vbak-vkbur.
lwa_merged-fkara = lwa_vbak-fkara.
lwa_merged-kunnr = lwa_vbak-kunnr.
lwa_merged-xblnr = lwa_vbak-xblnr.
Get name of sold-to party from PA_IT_KNA1
clear lwa_kna1.
read table pa_it_kna1 into lwa_kna1
with key kunnr = lwa_vbak-kunnr
binary search.
lwa_merged-name1 = lwa_kna1-name1.
Get business data from PA_IT_VBKD.
clear lwa_vbkd.
read table pa_it_vbkd into lwa_vbkd
with key vbeln = lwa_vbak-vbeln
binary search.
lwa_merged-fbuda = lwa_vbkd-fbuda.
Get internal note text for sales order
perform read_text using '0002'
'1'
lwa_merged-vbeln
'VBBK'
lwa_merged-intnote.
Get header note 1 text for sales order
perform read_text using 'Z002'
'1'
lwa_merged-vbeln
'VBBK'
lwa_merged-hdrnote.
Determine if change documents exist for sales order.
clear lwa_cdhdr.
read table pa_it_cdhdr into lwa_cdhdr
with key objectid = lwa_vbak-objectid.
if sy-subrc ne 0.
continue.
endif.
loop at pa_it_cdhdr into lwa_cdhdr
from sy-tabix.
lwa_merged-username = lwa_cdhdr-username.
lwa_merged-udate = lwa_cdhdr-udate.
lwa_merged-utime = lwa_cdhdr-utime.
lwa_merged-tcode = lwa_cdhdr-tcode.
clear lwa_cdpos.
read table pa_it_cdpos into lwa_cdpos
with key objectid = lwa_cdhdr-objectid
changenr = lwa_cdhdr-changenr
binary search.
loop at pa_it_cdpos into lwa_cdpos
from sy-tabix.
lwa_merged-tabname = lwa_cdpos-tabname.
lwa_merged-tabkey = lwa_cdpos-tabkey.
lwa_merged-fname = lwa_cdpos-fname.
lwa_merged-chngind = lwa_cdpos-chngind.
lwa_merged-value_new = lwa_cdpos-value_new.
lwa_merged-value_old = lwa_cdpos-value_old.
Get description for field - determine date element
clear lwa_dd03l.
read table lit_dd03l into lwa_dd03l
with key tabname = lwa_cdpos-tabname
fieldname = lwa_cdpos-fname
binary search.
lva_dd03l_tabix = sy-tabix.
if sy-subrc ne 0.
select single tabname fieldname as4local as4vers rollname
from dd03l
into lwa_dd03l
where tabname eq lwa_cdpos-tabname
and fieldname eq lwa_cdpos-fname
and as4local eq co_as4local_a.
if sy-subrc eq 0.
insert lwa_dd03l into lit_dd03l
index lva_dd03l_tabix.
endif.
endif.
If data element was found, get description
if not lwa_dd03l is initial.
clear lwa_dd04t.
read table lit_dd04t into lwa_dd04t
with key rollname = lwa_dd03l-rollname
ddlanguage = sy-langu
binary search.
lva_dd04t_tabix = sy-tabix.
if sy-subrc ne 0.
select single rollname ddlanguage as4local as4vers scrtext_l
from dd04t
into lwa_dd04t
where rollname eq lwa_dd03l-rollname
and ddlanguage eq sy-langu.
if sy-subrc eq 0.
insert lwa_dd04t into lit_dd04t
index lva_dd04t_tabix.
else.
lwa_dd04t-scrtext_l = 'Description for field not found'.
endif.
endif.
endif.
lwa_merged-scrtext_l = lwa_dd04t-scrtext_l.
append lwa_merged to pa_it_merged.
at end of changenr.
Only process field changes for this change document.
exit.
endat.
endloop.
at end of objectid.
Initialise work area so we know change document for order has
been processed.
clear lwa_merged.
Only process change documents for this sales order.
exit.
endat.
endloop.
endloop.
endform. " merge_data
*& Form build_field_catalog
text
form build_field_catalog tables pa_it_fieldcat type slis_t_fieldcat_alv.
data:
Local variable
lva_col_pos type slis_fieldcat_alv-col_pos,
Local structure
st_fieldcat type slis_fieldcat_alv.
lva_col_pos = 0.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VBELN'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'VBELN'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'ERDAT'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'ERDAT'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos..
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'AUART'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'AUART'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'FAKSK'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'FAKSK'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'NETWR'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'NETWR'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'WAERK'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'WAERK'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos..
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VKORG'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'VKORG'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VTWEG'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'VTWEG'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VKBUR'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'VKBUR'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'FKARA'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'FKARA'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'KUNNR'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'KUNNR'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'XBLNR'.
st_fieldcat-ref_tabname = 'VBAK'.
st_fieldcat-ref_fieldname = 'XBLNR'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'FBUDA'.
st_fieldcat-ref_tabname = 'VBKD'.
st_fieldcat-ref_fieldname = 'FBUDA'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'USERNAME'.
st_fieldcat-ref_tabname = 'CDHDR'.
st_fieldcat-ref_fieldname = 'USERNAME'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'UDATE'.
st_fieldcat-ref_tabname = 'CDHDR'.
st_fieldcat-ref_fieldname = 'UDATE'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'UTIME'.
st_fieldcat-ref_tabname = 'CDHDR'.
st_fieldcat-ref_fieldname = 'UTIME'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'TCODE'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'TCODE'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'TABNAME'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'TABNAME'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'TABKEY'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'TABKEY'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'FNAME'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'FNAME'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'CHNGIND'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'CHNGIND'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VALUE_NEW'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'VALUE_NEW'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'VALUE_OLD'.
st_fieldcat-ref_tabname = 'CDPOS'.
st_fieldcat-ref_fieldname = 'VALUE_OLD'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'SCRTEXT_L'.
st_fieldcat-ref_tabname = 'DD04T'.
st_fieldcat-ref_fieldname = 'SCRTEXT_L'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'INTNOTE'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
st_fieldcat-seltext_s = 'Int Note'.
st_fieldcat-seltext_m = 'Internal Note'.
st_fieldcat-seltext_l = 'Internal Note'.
st_fieldcat-ddictxt = 'L'.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'HDRNOTE'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
st_fieldcat-seltext_s = 'Hdr Note'.
st_fieldcat-seltext_m = 'Header Note'.
st_fieldcat-seltext_l = 'Header Note'.
st_fieldcat-ddictxt = 'L'.
append st_fieldcat to pa_it_fieldcat.
clear st_fieldcat.
add 1 to lva_col_pos.
st_fieldcat-tabname = 'PA_IT_MERGED'.
st_fieldcat-fieldname = 'NAME1'.
st_fieldcat-ref_tabname = 'KNA1'.
st_fieldcat-ref_fieldname = 'NAME1'.
st_fieldcat-row_pos = '1'.
st_fieldcat-col_pos = lva_col_pos.
append st_fieldcat to pa_it_fieldcat.
endform. " build_field_catalog
*& Form output_report
text
form output_report tables pa_it_fieldcat type slis_t_fieldcat_alv
pa_it_merged type ty_it_merged.
Local variables
data:
lva_formname type slis_formname,
lva_repid like sy-repid.
lva_repid = sy-repid.
lva_formname = 'ALV_USER_COMMAND'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = lva_repid
i_callback_user_command = lva_formname
i_save = 'A'
is_variant = st_variant
it_fieldcat = pa_it_fieldcat[]
tables
t_outtab = pa_it_merged
exceptions
program_error = 1
others = 2.
endform. " output_report
*& Form alv_user_command
text
form alv_user_command using pa_ucomm like sy-ucomm
pa_selfield type slis_selfield.
Local work areas
data:
lwa_merged type ty_merged.
clear lwa_merged.
read table it_merged into lwa_merged
index pa_selfield-tabindex.
case pa_selfield-fieldname.
when 'VBELN'.
Sales order number
set parameter id 'AUN' field lwa_merged-vbeln.
call transaction 'VA03' and skip first screen.
when 'KUNNR'.
Customer number
set parameter id 'KUN' field lwa_merged-kunnr.
set parameter id 'VKO' field space.
set parameter id 'VTW' field space.
set parameter id 'SPA' field space.
call transaction 'XD03' and skip first screen.
endcase.
endform. " alv_user_command
*& Form read_text
text
form read_text using pa_id
pa_inline_count
pa_name
pa_object
pa_text.
Local internal tables
data:
lit_inlines type ty_it_lines,
lit_lines type ty_it_lines.
Local work areas
data:
lwa_lines type ty_lines.
Local variables
data:
lva_tdname like thead-tdname.
refresh: lit_inlines,
lit_lines.
lva_tdname = pa_name.
call function 'READ_TEXT_INLINE'
exporting
id = pa_id
inline_count = pa_inline_count
language = sy-langu
name = lva_tdname
object = pa_object
tables
inlines = lit_inlines
lines = lit_lines
exceptions
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
others = 7.
loop at lit_lines into lwa_lines.
concatenate pa_text
lwa_lines-tdline
into pa_text separated by space.
endloop.
endform. " read_textHi George!
In general this question is very complex. In Retail it's a whole module and handled by a program with more than 20 000 lines of coding - not just selecting some conditions with a starting date range.
Do you have conditions on several levels? E.g. customer specific and on sales organization - what should happen, if a customer specific condition ends?
Regards,
Christian
Maybe you are looking for
-
To determine the number of rows selected in a table view (BSP)
Hi, My requirement is: I would be selecting 1 row from a table view ( which is made multiselect for another requirement) , and press a button. The functionality of button is to open a popup window based on the row selected. I want to display an error
-
Can't receive email form outside accounts
Hi everyone, I am trying to set up a mail server on [nuke dot mgh dot harvard dot edu]. I can send emails anywhere, I can receive email from the accounts created on this server, but I can't receive anything from any outside account. I know there are
-
I want to set a tray on my printer to be the default for just adobe reader without setting the default for windows. When i set page setup settings it reverts to the defaults when i open new PDFs and i want this seetin to save. Thanks
-
Translation to unsupported language
Hi. We have a suite of Apex applications all written in the primary language of English. We have the requirement to translate some of them into Welsh, which is not a language supported by Oracle. As an experiment I decided to create a translated appl
-
I am running 10.5.8. New to mac. Cannot find iCal in apps. folder. Seems to have disappeared. Any suggestions on how to get it back?