Rename presentation layer catalog
Hi,
I have renamed the presentation layer catalog in RPD. When I am seeing the dashboard all the reports are getting displayed but when I see the individual reports I am getting :"Either you do not have permission to use the subject area X within Answers, or the subject area does not exist" on the left side of the report.Can anyone tell me how can we rename the presentation layer catalog with individual reports not showing the above statement?
Thanks and Regards,
Amrit
Option 1 :
use the rename wizard ( tols-> utility-> rename wizard) to change the name of presentation catalog
option 2 :
go to answers of that report->go to advance tab
under
Enter the name of the Subject Area : write the new subject area
Similar Messages
-
Rename columns in Presentation layer
Hi Experts,
I Have one BMM layer table with 2 groups columns like
BMM Table
Sales
Revenue
Sum
Sales_ B Group
Revenue_ B Group
Sum_ B Group
Now I want to show these columns in two tables i.e. A table and B table with same column names in presentation layer as below:
Presentation A table Presentation B table
Sales Sales
Revenue Revenue
Sum Sum
In BMM layer it should be Sales_ B Group but in presentation table it should show as Sales as vice verse for other 2 columns for B group columns
If I rename Sales_ B Group as Sales in BMM layer it won’t accept because already sales column is there my requirement is in BMM layer in should as Sales_ B Group but in presentation layer the same column it should show as Sales .
Regards,
Rafi
Edited by: Rafi.BI on Jan 31, 2013 11:28 PMHi Rafi,
Can you right click on your presenatation layer and create a new presentation table (EG: Table A) -- and then move the columns from bmm layer and rename them as per your req.
Now right click again.. create one more Pres. table (EG: Table B) -- and then move the columns from bmm simply drag and drop and rename as per your req.
Thank you. -
Copy Businss Model and Presentation Layer Objects
Hi,
We have an environment whereby there is a Development DB and a Production DB.
I have built a model around the dev. DB and created answers requests. How Do I copy the model within the same repository and rename it and copy the answers requests to a different folder and use them as "Production" Answers Requests.
The rename wizard provided by Oracle only helps to Rename the Presentation Catalog.
Thx,
rkingmduIt seems you are using one OBIEE server to host your Dev and Prod environments. That's certainly not a good idea (as Stijn says) and will not work. Answers requests are linked to a Subject Area and specific fields on that subject area. A subject area is basically a folder in your Presentation layer of the RPD. So a SA is always linked to an RPD. You are not goind to be able to achieve complete separation with a single OBIEE server. And no, it's not correct that a BI server can connect to one RPD, you can have a BI Server connecting to many RPDs. While is not supported to have multiple Presentation Services in the same server, you can have more Presentation Services on other servers that use other RPDs.
-
Issue adding a new column to OBIEE presentation layer
Hi,
I am pretty new to OBIEE so this may be a silly question. I am facing some problems trying to add a new column from a physical table the OBIEE presentation layer.
Below are the steps I followed:
Task: add a product category set to the presentation layer.
Steps:
1) First verified that the product category set is being populated in the W_PROD_CAT_DH table in the datawarehouse. this was done by running the following sql
SELECT W_PROD_CAT_DH.TOP_LVL_PRODCAT_NAME
FROM W_PROD_CAT_DH, W_INVENTORY_PRODUCT_D
WHERE W_PROD_CAT_DH.integration_id = W_INVENTORY_PRODUCT_D.INV_PROD_CAT1
This sql gave the right category value.
2) created a "Alias" of the table W_PROD_CAT_DH in the OBIEE Admin tool physical layer. (done by right clicking W_PROD_CAT_DH >>New Object>> Alias)
3) named the Alias of W_PROD_CAT_DH as "Dim_W_INV_MKT_CAT" and created a key of the alias named "integration id" on the column "integration_id"
4) opened the pre-existing alias of W_INVENTORY_PRODUCT_D the alias was called "Dim_W_INVENTORY_PRODUCT_D" and added a key called "MKT_CAT" on the column "INV_PROD_CAT1" in this alias (Dim_W_INVENTORY_PRODUCT_D of the table W_INVENTORY_PRODUCT_D)
5) in the alias of the "W_INVENTORY_PRODUCT_D" called "Dim_W_INVENTORY_PRODUCT_D" added a "Foreign Keys" the expression of the key is following: ("Oracle Data Warehouse"."Catalog"."dbo"."Dim_W_INV_MKT_CAT"."INTEGRATION_ID" = "Oracle Data Warehouse"."Catalog"."dbo"."Dim_W_INVENTORY_PRODUCT_D"."INV_PROD_CAT1")
Logical layer
6) Opened the existing logical folder called "Dim - Inventory Product" and clicked on "Sources" tab then double clicked the source "Dim_W_INVENTORY_PRODUCT_D" and added a new mapping under "Map to these tables" under "General" tab. The column that was added was the physical alias "Dim_W_INV_MKT_CAT"
7) added a new column mapping to the same logical table source (Dim_W_Inventory_PRODUCT_D) this new mapping was a column from the alias "Dim_W_INV_MKT_CAT" (column name "TOP_LVL_PRODCAT_NAME")
Presentation Layer
8) dragged the newly added column (TOP_LVL_PRODCAT_NAME) from the logical layer "Dim - Inventory Product" to the presentation layer "Product" folder.
ISSUE
after adding everything and checking global consistency and save and checking-in my work when i login from the front end presentation services. I see the newly added column is showing under the "Product" folder. on dragging the column by itself to the Ad-Hoc analysis I can see the different values of the category. On adding a second column from the same logical folder (Dim - Inventory Product in logical layer) i still see the right product name and corresponding category. BUT when I drag any other column from any other folder (such as "Day" from "Time" or any fact values) the result does not fetch any data (message: The specified criteria didn't result in any data.)
I am not sure if I am missing any step but I know I am mapping the new table alias to the inventory_product_d since i see right results on creating analysis of columns in those two folders. but no other folders give me any data.
I also know that the logical folder "Dim - Inventory Product" is joined with other tables as I can see results when i do not add the newly added catagory column but other folder and other columns of "Dim - Inventory Product"
I would really appreciate any insight to this very much. we are using OBIEE 11.1.1.6 with the Oracle 11.5.10 Adaptor (SDE_ORA11510_Adopter)
I will try to upload some screenshots if needed but presently not sure if its something really simple.Hi Prassu,
thanks for the responce. and Apologies for the delay in getting back to you.
1) 1.First of all set the logging level to 3 in the admin tool save it.
You can get the SQL query from here
settings(Answers right top)-->Administration-->manage sessions-->view log
When I try to do this I get the following message. and no log files.
Error
Log Could Not Be Retrieved
Odbc driver returned an error (SQLExecDirectW).
Error Details
Error Codes: OPR4ONWY:U9IM8TAC
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <3790667783>: Syntax error [nQSError: 26012] . (HY000) -
Unable to drop BMM Dimension to Presentation Layer
The BMM Dimension is based on Location_D. At first level I have country (1attribute of location_d) and is made as a key for first level. At second level I have state (also as key & 2 attribute of location_d) The preferred drill down path at first level is pointed to second level.
When I try to drop dimension to Presentation layer, it doesnt allow. I do not get any errors during consistency check.
I am using OBIEE10g on a Windows XP system.
Is there anything that is wrong?
Regards,
Prem.If you are creating a Presentation catalog based on BMM then, mouse right click on Presentation layer and create manually and drag and drop from BMM.
If your case is adding column to existing Presentation catalog's Presentation table; See the related BMM to that Presentation catalog, you may use mouse right click and Related to.
If these are not helping send me rpd with details to my email I do it for you.
Mark if helps -
Presentation Layer column name change effects on existing reports ?
Hello Gurus,
I have one requirement where user are not sure about the column names in Presentation Layer.
so they want us to create the reports and once the reports are delivered they will give us the column name as per their requirement.
now i read couple of blogs related to this, that does it affects the exiting reports?
in couple of blogs they says that i won't. becaus BI server creates the alias for the old name and will reflects it wherever it's used in reports..
So can anyone tell me where this alias name has been stored in OBIEE?
and is there any precaution that needs to be done while doing this beacuse we are expecting to create around 40-50 reports and changing the column name after changing the presentation layer name change will increase lots of work..
Thanking You..I've confirmed it on a 10g environment that when you rename the column in the RPD the existing reports reflect the change.
What I was referring to in the statement you highlight is that a column name can be changed when being used as the definition of a report. If somebody specifies an abbreviation of the current name to fit it in a table or chart then it will not be updated from a name change in the RPD.
So long as you build reports using the name provided by the RPD and none of the developers take the liberty of renaming it in the column properties of the request/analyses the single rename should take effect through all the reports you build.
You can also manage the column name by renaming it in a report and using the save as system wide default. But the way you intend to do it would be the best method.
Edited by: James - Projected on 25-May-2012 14:07 -
Reordering the presentation layer in BI Server repository
Is there a way to re-order the presentation layer in the BI server repository? Currently if I add something new to a table in a subject area - it is always placed at the bottom. Also, if I add a whole new table - it is also placed at the bottom. I then have to remove everything below where I want it - and add it back. It seems like there must be an easier way! Any help is most appreciated.
I figured there is something, and I know it sounds dumb, but i've looked everywhere - and no up or down buttons. On right click I have rename... I am in the Administrator tool for the repository.
-
hi,
i m renaming exiting columns in presentation ie in repository
i would like to know
if they are present in any of reports it will definitely effect it so how to find out and resolve itHi,
i will explain it further
1)If you rename columns in RPD, then it will create an alias for that presentation column.If you double clcik the column you have renamed in presentation layer,you will see alias tab.Under this you will see the alias being created.This wll help in avoiding existing reports to function properly
2)If you go to Answers and look for the column that you have renames it will show the new name that you have given.
Now my question is are users have access to RPF because they will be able to see that alias only in RPD.If you want to change the heading of column you can chang it manually.
Thanks
Sandeep -
Hi Experts
I want to know about aliases in presentation layer ..and how to use them..
Regards
fHi,
Aliases at the presentaiton layer simply mean that a table or columns can be referenced by more than one name. In the past I have mainly used them when I have changed the name of a presentaiton table or column and wanted old reports which referenced the old column name to continue working without changes.
So for example.
Logical table: "Table1"
Logical column: "Column1
Due to a change the column is renamed to "Column2". If you then include an alias for this column called "Column1" then any reports built which reference "Column1" will still work even though the column name has been changed, because the alias still references it.
Regards,
Matt -
Accessing the presentation layer
Does anybody know how to access the presentation layer using a tool other than the OBIEE front end? What if I wanted to query the presentation layer from Excel or SQL Developer. Does anyone know how to do that?
You need to use the ODBC connection. OBI Presentation Dashboard use it and Excel also.
Here an example how to access the presentation catalog from Excel :
http://gerardnico.com/wiki/dat/obiee/import_data_from_obiee_to_excel
And here how to set up the ODBC :
http://gerardnico.com/wiki/dat/obiee/obiee_client_tools#setting_up_odbc -
I am trying to use java file as Model layer and jsf as presentation layer
I am trying to use java file as Model layer and jsf as presentation layer and need some help
I successfully get the value of h:outputText from java file by doing simple binding operation but I am facing problems when I am trying to fill h:dataTable
I create java file
package oracle.model;
import java.sql.;*
import java.util.;*
*public class TableBean {*
Connection con ;
Statement ps;
ResultSet rs;
private List perInfoAll = new ArrayList();
*public List getperInfoAll() {*
perInfoAll.add(0,new perInfo("name","username","blablabla"));
return perInfoAll;
*public class perInfo {*
String uname;
String firstName;
String lastName;
*public perInfo(String firstName,String lastName,String uname) {*
this.uname = uname;
this.firstName = firstName;
this.lastName = lastName;
*public String getUname() {*
return uname;
*public String getFirstName() {*
return firstName;
*public String getLastName() {*
return lastName;
right click on the file and choose 'create data control'
then i wrote the jsf file:
*<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
*<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
*<f:view>*
*<h:dataTable id="dt1" value="#{bindings.perInfoAll}"*
var="item" bgcolor="#F1F1F1" border="10"
cellpadding="5" cellspacing="3" rows="4" width="50%"
dir="LTR" frame="hsides" rules="all"
*>*
*<f:facet name="header">*
*<h:outputText value="This is 'dataTable' demo" id="ot6"/>*
*</f:facet>*
*<h:column id="c2">*
*<f:facet name="header">*
*<h:outputText value="First Name" id="ot1"/>*
*</f:facet>*
*<h:outputText style="" value="#{item.firstName}"*
id="ot2"/>
*</h:column>*
*<h:column id="c4">*
*<f:facet name="header">*
*<h:outputText value="Last Name" id="ot9"/>*
*</f:facet>*
*<h:outputText value="#{item.lastName}" id="ot8"/>*
*</h:column>*
*<h:column id="c3">*
*<f:facet name="header">*
*<h:outputText value="Username" id="ot7"/>*
*</f:facet>*
*<h:outputText value="#{item.uname}" id="ot4"/>*
*</h:column>*
*<f:facet name="footer">*
*<h:outputText value="The End" id="ot3"/>*
*</f:facet>*
*</h:dataTable>*
*</center>*
*</af:document>*
*</f:view>*
but nothing is appear in my table
I know that there is something wrong in calling the binding object
I need help pls and where can i find some help to deal with another tag types
thanksi dragged the "perInfoAll" from my "Data Controls" and choosed adf table (even I know that new table with adf tags well be generated and i want table with jsf tags)
and this code is generated
*<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"*
*"http://www.w3.org/TR/html4/loose.dtd">*
*<%@ page contentType="text/html;charset=UTF-8"%>*
*<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
*<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
*<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>*
*<f:view>*
*<af:document id="d1">*
*<af:messages id="m1"/>*
*<af:form id="f1">*
*<af:table value="#{bindings.perInfoAll1.collectionModel}" var="row"*
*rows="#{bindings.perInfoAll1.rangeSize}"*
*emptyText="#{bindings.perInfoAll1.viewable ? 'No data to display.' : 'Access Denied.'}"*
*fetchSize="#{bindings.perInfoAll1.rangeSize}"*
*rowBandingInterval="0"*
*selectionListener="#{bindings.perInfoAll1.collectionModel.makeCurrent}"*
*rowSelection="multiple" id="t1">*
*<af:column sortProperty="uname" sortable="false"*
*headerText="#{bindings.perInfoAll1.hints.uname.label}"*
*id="c1">*
*<af:inputText value="#{row.bindings.uname.inputValue}"*
*label="#{bindings.perInfoAll1.hints.uname.label}"*
*required="#{bindings.perInfoAll1.hints.uname.mandatory}"*
*columns="#{bindings.perInfoAll1.hints.uname.displayWidth}"*
*maximumLength="#{bindings.perInfoAll1.hints.uname.precision}"*
*shortDesc="#{bindings.perInfoAll1.hints.uname.tooltip}"*
*id="it3">*
*<f:validator binding="#{row.bindings.uname.validator}"/>*
*</af:inputText>*
*</af:column>*
*<af:column sortProperty="firstName" sortable="false"*
*headerText="#{bindings.perInfoAll1.hints.firstName.label}"*
*id="c2">*
*<af:inputText value="#{row.bindings.firstName.inputValue}"*
*label="#{bindings.perInfoAll1.hints.firstName.label}"*
*required="#{bindings.perInfoAll1.hints.firstName.mandatory}"*
*columns="#{bindings.perInfoAll1.hints.firstName.displayWidth}"*
*maximumLength="#{bindings.perInfoAll1.hints.firstName.precision}"*
*shortDesc="#{bindings.perInfoAll1.hints.firstName.tooltip}"*
*id="it2">*
*<f:validator binding="#{row.bindings.firstName.validator}"/>*
*</af:inputText>*
*</af:column>*
*<af:column sortProperty="lastName" sortable="false"*
*headerText="#{bindings.perInfoAll1.hints.lastName.label}"*
*id="c3">*
*<af:inputText value="#{row.bindings.lastName.inputValue}"*
*label="#{bindings.perInfoAll1.hints.lastName.label}"*
*required="#{bindings.perInfoAll1.hints.lastName.mandatory}"*
*columns="#{bindings.perInfoAll1.hints.lastName.displayWidth}"*
*maximumLength="#{bindings.perInfoAll1.hints.lastName.precision}"*
*shortDesc="#{bindings.perInfoAll1.hints.lastName.tooltip}"*
*id="it1">*
*<f:validator binding="#{row.bindings.lastName.validator}"/>*
*</af:inputText>*
*</af:column>*
*</af:table>*
*</af:form>*
*</af:document>*
*</f:view>*
but when run it i see the following errors
*Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
*Object EmpManager of type DataControl is not found.*
*java.lang.NullPointerException*
*Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
*Object EmpManager of type DataControl is not found.*
*java.lang.NullPointerException*
:( -
How can I import db column comments into the OBIEE presentation layer?
We have a very well designed data mart - it is a star schema and all the fact and dimension table columns have comments in them with their definition and use. There is virtually no change required in the physical or business layer. The only modifications done in the presentation layer was to hide the Pk/Fk columns.
Is there a way to import these column comments into the presentation layer so that the business user can see this comment in the tool tip while hovering over the presentation column in Answers?
Thanks for your help!Hi,
I assume the comments you mean are stored in user_tab_comments and user_col_comments.
When this is the case you should do the following:
Go to your subject area in your presentation layer. For now I assume the name of this subject area is "Subject Area".
Then right click on this subject area and check "Externalize Descriptions".
Then create an initialization block (session) using this query:
(select 'CD_Subject_Area_' || table_name, comments from user_tab_comments)
union all
(select 'CD_Subject_Area_' || table_name || '_' || column_name, comments from user_col_comments)
Use "Row-wise initialization" for this initialization block.
Two comments:
1) Like I said, I assume Subject Area is the name of your subject area in your presentation layer, so I guess you need to replace this with the name of your Subject Area.
But be sure that you replace each space ' ' with an underscore '_'.
2) Maybe you need to refine above querys by filtering on table_name for those table_names you are using.
Good luck.
Regards,
Stijn -
Hiding columns in Presentation Layer, but still accessible in a report.
Hi BI Devs,
I have a question on how to hide certain columns in the presenation layer but still make them available in a dashboard/report.
We have 3 sections in our Presenatation Layer...section_a, section_b, section_c. We have two groups created, group_max and group_lite. Group_max will have access to all the sections in the presentation layer but group_lite will only have access to section_a and section_b
We have a report in a dashboard (lets call it full_dashboard) that contains columns from section_a, section_b and section_c. We want all users (group_max and group_lite) to have access to the report, run the report and return data.
Our requirement is that the group_lite will not have access to the section_c in "Answers".
When we set the permissions in the RPD for the different sections, the permissions work correctly in hiding the section_c from group_lite, but when they run the report full_dashboard, the report errors out for group_lite users.
Is there a way to grant access to the group_lite users so that they can run full_dashboard but still deny them access to the columns in Answers?Here is my thinking about duplicationg the section_c
1. If i duplicate section_c, it will still be visible to group_lite in the presenation layer.
2. If i duplicate section_c, i will have to change the dashboard (a very complex one too) to point to the duplicated section. How will I be able to hide the duplicated section?
I am just not sure how to hide section_c from the group_lite users and still have the reports in the dashboard access the columns, without having to change the report.
Edited by: empyre on Mar 16, 2011 8:21 AM -
Usage of LOCALE in Localization of Presentation Layer metadata
Hi,
This is about usage of LOCALE in Localization of Presentation Layer metadata.
The value of WEBLANGUAGE variable can be directly passed to the initialization block (2nd Initialization block ) which contains the sql:
select SESSION_VARIABLE, TRANSLATION from external where LANGUAGE = ‘VALUEOF(NQ_SESSION.LOCALE)’
So that, it comes to have the below sql:
select SESSION_VARIABLE, TRANSLATION from external where LANGUAGE = ‘VALUEOF(NQ_SESSION.WEBLANGUAGE)’
This avoids the need of using extra Initialization Block for LOCALE variable.
Is there is any need to use and initialize LOCALE ?Each interactive object remains active even if it is covered by a non-interactive object.
More info about using shape buttons, either on master slide or timed for the rest of the project: http://blog.lilybiri.com/why-i-like-shape-buttons-captivate-6
Be careful: when timed for the rest of the project, to have them visible everywhere normally you put it On top. But in this case, that will mean they'll be on top of the Lightboxes. I have been presenting about lightboxes once, maybe I should write it down in a blog post.
Lilybiri -
Sending PDF file in presentation layer as a attachment to Email
Hi,
I have a PDF file in my Presentation layer, I want to send it as a attachment to Email. Is there any Function Module or sample code to it.
Regards,
Adithya M.Hi Maha,
Go through this hope u can understand. also check this link
http://abapcode.blogspot.com/2007/05/convert-spool-request-to-pdf-and-send.html.
Here is the code to send the Smartform to mail as PDF attachment.
*& Report ZTEST_NREDDY_PDF_MAIL
REPORT ZTEST_NREDDY_PDF_MAIL.
Internal Table declarations
DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
WA_OBJHEAD TYPE SOLI_TAB,
W_CTRLOP TYPE SSFCTRLOP,
W_COMPOP TYPE SSFCOMPOP,
W_RETURN TYPE SSFCRESCL,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
Variables declarations
V_FORM_NAME TYPE RS38L_FNAM,
V_LEN_IN LIKE SOOD-OBJLEN,
V_LEN_OUT LIKE SOOD-OBJLEN,
V_LEN_OUTN TYPE I,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST'
IMPORTING
FM_NAME = V_FORM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 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.
W_CTRLOP-GETOTF = 'X'.
W_CTRLOP-NO_DIALOG = 'X'.
W_COMPOP-TDNOPREV = 'X'.
CALL FUNCTION V_FORM_NAME
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
I_OTF[] = W_RETURN-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = V_LEN_IN
TABLES
OTF = I_OTF
LINES = I_TLINE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
ENDIF.
LOOP AT I_TLINE.
TRANSLATE I_TLINE USING '~'.
CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
I_RECORD = WA_BUFFER.
APPEND I_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
Create Message Body Title and Description
I_OBJTXT = 'test with pdf-Attachment!'.
APPEND I_OBJTXT.
DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
READ TABLE I_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = 'RAW'.
APPEND I_OBJPACK.
Attachment (pdf-Attachment)
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
READ TABLE I_OBJBIN INDEX V_LINES_BIN.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE = 'PDF'.
I_OBJPACK-OBJ_NAME = 'smart'.
I_OBJPACK-OBJ_DESCR = 'test'.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = '[email protected]'.
I_RECLIST-REC_TYPE = 'U'.
APPEND I_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
If you want to send some text as Body of the Mail then follow this once
when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
I_OBJPACK-TRANSF_BIN = ' '.
I_OBJPACK-HEAD_START = 000000000000001.
I_OBJPACK-HEAD_NUM = 000000000000001.
I_OBJPACK-BODY_START = 000000000000002
I_OBJPACK-BODY_NUM = 000000000000010.
I_OBJPACK-DOC_TYPE = 'RAW'.
append I_OBJPACK-.
by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8.
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program can be run in background or online and a spool request *
*& will still be created *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT [email protected],
p_sender LIKE somlreci1-receiver
DEFAULT [email protected],
p_delspl AS CHECKBOX,
p_online no-display.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA: w_recsize TYPE i,
w_spool_nr like sy-spono.
%_print LIKE pri_params.
DATA: gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE sy-sysid VALUE DEV,
c_no(1) TYPE c VALUE ,
c_device(4) TYPE c VALUE LOCL.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
WRITE Hello World.
new-page.
commit work.
new-page print off.
If p_online = X.
Processing performed when program calls itself when run online
gd_spool_nr = sy-spono.
EXPORT gd_spool_nr TO MEMORY ID SPOOLTOPDF.
EXIT.
endif.
IF sy-batch EQ X.
PERFORM get_job_details.
PERFORM obtain_spool_id.
ELSE.
gd_spool_nr = sy-spono.
If executed online, it submits a program to perform the write
statements
instructing it to create a spool request, this could be another
program
which just performs the write statements and then exports sy-spono
to memory. But in this example it calls itself passing X to parameter
p_online, which takes it down an alternative procesing path.
submit ZSPOOLTOPDF
with p_online = X
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
ENDIF.
Get spool id from program called above
IMPORT gd_spool_nr FROM MEMORY ID SPOOLTOPDF.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ X.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = INT
WITH output = X
AND RETURN.
ENDIF.
FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident 0000000000′
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
FORM get_job_details *
FORM get_job_details.
Get current job details
CALL FUNCTION GET_JOB_RUNTIME_INFO
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION CONVERT_ABAPSPOOLJOB_2_PDF
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ~.
CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
ENDLOOP.
TRANSLATE gd_buffer USING ~ .
DO.
it_mess_att = gd_buffer.
APPEND it_mess_att.
SHIFT gd_buffer LEFT BY 255 PLACES.
IF gd_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = Subject.
gd_attachment_desc = Attachname.
CONCATENATE attach_name INTO gd_attachment_name.
it_mess_bod = Message Body text, line 1′.
APPEND it_mess_bod.
it_mess_bod = Message Body text, line 2 .
APPEND it_mess_bod.
If no sender specified - default blank
IF p_sender EQ space.
gd_sender_type = space.
ELSE.
gd_sender_type = INT.
ENDIF.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_mess_bod
it_mess_att
using p_email
Example .xls documnet attachment
PDF
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl c_no.
CALL FUNCTION RSPO_R_RDELETE_SPOOLREQ
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables it_message
it_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: t_packing_list like sopcklsti1 occurs 0 with header line,
t_contents like solisti1 occurs 0 with header line,
t_receivers like somlreci1 occurs 0 with header line,
t_attachment like solisti1 occurs 0 with header line,
t_object_header like solisti1 occurs 0 with header line,
w_cnt type i,
w_sent_all(1) type c,
w_doc_data like sodocchgi1.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = SAPRPT.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = F.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = SAPRPT.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = F.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = it_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = RAW.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = X.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = U.
t_receivers-com_type = INT.
t_receivers-notif_del = X.
t_receivers-notif_ndel = X.
APPEND t_receivers.
CALL FUNCTION SO_DOCUMENT_SEND_API1′
EXPORTING
document_data = w_doc_data
put_in_outbox = X
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = X
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
Reward points if helpful
Thanks
Naveen khan
Maybe you are looking for
-
Why can't I get Pro Tools LE to create a session on my new iMac?
Summary I can't get Pro Tools LE to open a session on my brand new iMac. Detail Pro Tools launches but when I go to create a session it seizes up, the beach ball spins and I have to Force Quit and send yet another note to the Apple teacher. It does t
-
ADF NullPointerExceptions in Migrated 11g
We have a ADF web application programmed in JDeveloper 11g (11.1.2.4.0), which was migrated over from a 10g (10.1.3.5.0) project. The application will run fine for 5 minutes or so, then regardless of activity, it'll return a 500 error nullpointerexce
-
How do i tell if i have a iphone3 or 3gs model number is A1303
how do i tell if i have a iphone3 or 3gs model number is A1303
-
Need Package Name to create SAP report in SE38
Hello there, I'm in the process of working through a Unicode conversion on an ECC 6.0 system, and one of the steps is to run report TERM_DELETE_INCORRECT_CHARSET. We are on a lower Support Pack level then when this report is delivered via OSS Note 1
-
Hello All, I need to enable the Navigation Cache in the portal , On System Administration --> Navigation . Currently the Navigation cached for Roles are disabled , When I select click 'Enable', It still shows as 'Disable' , even if I log-off and log-