UDF with valid Field
Hi there,
where is the description saved for a udf with vaild fields? i need to display the description in a query. it only displays the value.
regards
Hi,
Try to check in the UFD1 table
Rgds,
Similar Messages
-
Hi,
the subject says it all. I have downloaded the trail version to see if its possible to create a editable pdf with validation(required field) using Adobe Acrobat pro version?
Basically, I will have to create a pdf form where users fill it and send it back to me. there will be required fields (the textbox and check box) that user need to fill before saving the editable pdf?
Is it possible. if so, can someone kind enough to point to me right directions?
Thanks in advance.Thanks for reply. What I am trying to achieve is to give an option for the user to download the pdf form and once the user tries to save the pdf, it validates with the required field. I managed to create the editable pdf with required fields option. I just need that validation to be done when user click on save file. How can I achieve this? thanks so much for your help.
-
Using LOV with Validation on the Numeric Fields results in Error
Dear JHeadstart Team,
During my work with lov I encountered another problem. I defined a lov and attached the lov to a numeric field and check the LOV for validation. Now when I use LOV using the LOV button it works fine but when I enter some numbers and then press tab the LOV was not shown correctly and resulted in the following errors and the worst thing is that you can not navigate to any other pages and all try to navigate to other pages results in errors too. When we put the same LOV on a string field (which is not desirable for us) it worked fine.
It seems to me like a bug. Am I right? Is ther any solution or workaround for this problem?
Thanks in advance,
Navid
16:31:29 DEBUG (LovItemBean) -Cleared value of item HrTrainingCourseSchedulesTitle
16:31:29 DEBUG (LovItemBean) -Cleared value binding #{bindings.HrTrainingCourseSchedulesTitle.inputValue} of item HrTrainingCourseSchedulesTitle
16:31:29 ERROR (ApplyRequestValuesPhase) -java.lang.ClassCastException: java.lang.Long
javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.Long
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:130)
at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1079)
at oracle.adf.view.faces.component.UIXEditableValue.broadcast(UIXEditableValue.java:247)
at oracle.adf.view.faces.component.UIXSelectInput.broadcast(UIXSelectInput.java:215)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:249)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at com.pooya.controller.jsf.PooyaAuthenticationFilter.doFilter(PooyaAuthenticationFilter.java:256)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:332)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:367)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:336)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:196)
at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:87)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:627)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: java.lang.Long
at oracle.jheadstart.controller.jsf.bean.LovItemBean.validateWithLov(LovItemBean.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
... 31 moreHi Navid,
We ran into the same bug and have the next workaround for it:
We extended the JHeadstart class 'LovItemBean' and we have overridden the method 'validateWithLov(...)' with:
public void validateWithLov(ValueChangeEvent valueChangeEvent)
Object newValue = valueChangeEvent.getNewValue();
if(newValue != null && !(newValue instanceof String))
newValue = newValue.toString();
ValueChangeEvent newEvent = new ValueChangeEvent(valueChangeEvent.getComponent(), valueChangeEvent.getOldValue(), newValue);
newEvent.setPhaseId(valueChangeEvent.getPhaseId());
super.validateWithLov(newEvent);
else
super.validateWithLov(valueChangeEvent);
}Next step is to use a custom template in your JHeaedstart Application Structure file for 'LOV_ITEM_BEAN'. In this custom template you should use your own class as 'managed-bean-class' instead of the default JHeadstart one.
Now you can safely generate LOV with validation of number fields.
Maybe something the JHeadstart can pcik up in the next release of JHeadstart :-)
Hope this helps.
Pascal -
Problem with Validation in Struts
Dear All,
I am facing a proble with validation in struts.
I have got this code in my action class
//Initial Code...
ArrayList branches=new ArrayList();
branches.add("B01", "Main Branch");
branches.add("B02", "Second Branch");
branches.add("B03", "Third Branch");
DynaValidatorForm memberForm=(DynaValidatorForm)form;
memberForm.set(branches);
//Finalizing code.....This form is getting validated in validation.xml.
This action is being forwarded to folllowing JSP.
//Initial Code...
<tr>
<td align="right"><strong>Branch Name </strong></td>
<td> </td>
<td align="left">
<html:select property="branid">
<html:optionsCollection name="memberForm" property="branches" value="key" label="value"/>
</html:select>
</td>
</tr>
//Later code...I have action mapping as..
<action path="/member/save" input="member.page" name="memberForm" validate="true"
scope="request" type="com.mlm.action.MemberAction" parameter="action">
<forward name="success" path="/show.do?action=member" redirect="true"/>
</action>Now, the problem is that when the form doesn't pass the validation then it gives an exception that..
Can't find collection 'branches' in beansauanu wrote:
Ok, now I am giving full code of my module...
Form-bean
<form-beans>
<form-bean name="memberForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="id" type="java.lang.String"/>
<form-property name="membname" type="java.lang.String"/>
<form-property name="address" type="java.lang.String"/>
<form-property name="branid" type="java.lang.String"/>
<form-property name="branches" type="java.util.ArrayList"/>
</form-bean>
</form-beans>Validation is being done for all fileds except "branches". Validation type is "requried"
My Jsp....
<html:form action="/member/save?action=save">
<html:hidden property="id"/>
<tr>
<td align="right"><strong>Member Name </strong></td>
<td> </td>
<td align="left">
<html:text property="membname"/>
</td>
</tr>
<tr>
<td align="right"><strong>Address</strong></td>
<td> </td>
<td align="left">
<html:text property="address"/>
</td>
</tr>
<tr>
<td align="right"><strong>Branch Name </strong></td>
<td> </td>
<td align="left">
<html:select property="branid">
<html:optionsCollection name="memberForm" property="branches" />
</html:select>
</td>
</tr>
<tr>
<td align="right">
<html:submit/>
</td>
<b><td> </td></b>
<td>
<html:button value="Cancel" onclick="javascript:history.go(-1)" property="cancel"/>
</td>
</tr>
</html:form>This is the code..
I tried to find out the problem and I found that.. when the form does not pass the validation its input page gets displayed..
Now, when the input is getting displayed.. "branches" field of the form contains null???Why?
Edited by: sauanu on ?? ??????, ???? ??:?? ?????????Forget,about Validations.
Who is forwarding the control to this JSP page or view ??
Is it Action method code which metioned earlier doing it ??
Or some other Action is involved if it is some other action please intialize Values of branches component in the respective action.
Also,
Also,
ArrayList branches=new ArrayList();
branches.add("B01", "Main Branch");
branches.add("B02", "Second Branch");
branches.add("B03", "Third Branch"); I believe you need to get a good understanding of Java Collection classes aswell.
You can add things as entities in the above case lets create a simple java bean named Option.
public class Option implements Serializable{
private String label;
private String value;
public void setValue(String value){this.value = value;};
public String getValue(){return this.value;}
public void setLabel(String label){this.label = label;}
public String getLabel(){return this.label;}
} and inside the action which is forwarding to the respective view
ArrayList branches=new ArrayList();
Option option = new Option();
option.setValue("B01");
option.setLabel("Main Branch");
branches.add(option);
option = new Option();
option.setValue("B02");
option.setLabel("Second Branch");
branches.add(option);
option = new Option();
option.setValue("B03");
option.setLabel("Third Branch");
branches.add(option);
<html:select property="branid">
<html:options name="memberForm" collection="branches" value="value" label="label" />
</html:select>and one more thing is is that after the validation if it is not validated it'd be sent back to input page which destorys the request therefore try making scope of "memberForm" to session in your action mappings and check.
Hope this might help :)
REGARDS,
RaHuL -
Maintenance View with Subset Fields
Hi All,
I have created a maintenance view based on a single DB table. Two key fields are defined to be as subset fields. No selection conditions are added to the view. I have used table maintenance genrator to define the screen (one step) along with the events.
In SM30, i get the popup to fill the subset fields.
I have created an event for AA (to replace default read). I am filling total attribute here.
a) Is there some other attribute that i need to fill apart from total?
I receive following dump
" Exception condition "NO_VALUE_FOR_SUBSET_IDENT" is raised"
When i set <status>-sbsid_rcvd = 'R' in read routine along with total, then the above exception doesn't appear.
But filtering based on the subset values doesn't happen automatically.
b) I also need have to have routines to perform insert, copy and validation.
c) Would the contents displayed be automatically filtered based on the subset values or we need to process this in user routines for read and so on?
As i find very limited documentation available for maintenance views with subset fields, could you suggest me some example to do the above?
Thanks in Advance,
Regards,
RekhaHello Rekha,
Yes I've same idea, documentation for maintenance screens is inadequate.
But there is way to find examples for all events,
table TVIMF is storing the Table name - Event - Form name columns.
For example when u want to do something about "creating a new entry"
Just go se11 > Table maintenance generator and find related event : 05
- Then go to TVIMF and display a record for event = 05
- than go to function group of maintenance screen of the TABLE in that record
- find the subroutine form ( TVIMF-FORMNAME) in that function group
This is a working example for that event, try or copy & use.
I hope it helps you for the coding for all the events.
Bulent
Edited by: Bulent Balci on Aug 5, 2010 11:28 PM
Edited by: Bulent Balci on Aug 5, 2010 11:29 PM -
How to activate Approval in Sales Order for the UDF with condition
Dear Expert,
I have created the UDF field Rebate(type amount) in Sales Order.I want to activate the approval procedure for this UDF with condition where Rebate is greater then Zero.I had applied the query and Activate it in approval procedure.--
SELECT (Case When IsNull(count(T0.[DocEntry]),0) <>0 Then 'True' Else 'False' End) AS TF
FROM Ordr T0 where DocType='I' AND t0.U_rebate >0 and convert(Varchar(20),T0.[CreateDate],103) =(select convert(Varchar(20),Getdate(),103))
But I found that the approval procedure activate every time inspite the Rebate field is Zero.
Plaese suggest some soloution for it.
regards,
PankajKHi Pankaj......
Try this.......
Select Distinct 'True' From ORDR T0 Where T0.U_Rebate>0 and T0.DocType='I' And T0.DocNum=$[ORDR.DocNum.0]
Hope this will help you.......
Regards,
Rahul -
Performance problem in Mapping Designer using UDF with external imports
Hello,
we do have a big performance problem in developing (not in execution) graphical Mappings as far as we use "user defined functions" (UDF) with include-entries referencing to jar files which are imported as "imported archives".
For example the execution of invice mapping with a little bit bigger test file in the Mapping designer:
- after opening, not in change mod: 6 seconds
- after switching to change mod: 37 seconds (that's clear, now everything is compiled first)
- after adding "com.seeburger.functions.permstore.CounterFactory;" into the "import" field of one UDF, no other change: 227 seconds
- after saving and submiting the changlist (no longer in change mode): 6 seconds
- after switching to change mode: 227 seconds
So execution speed of testing (and also when watching queues) only increases in changemod more then three minutes when using UDF with imports, referencing to external JAR files. It doesn't depend on Seeburger functions (we are using XI also for EDIFACT, so we also use some Seeburger functions), I can reproduce it with any other JAR file which is used from a UDF.
Using java included functions like "java.text.NumberFormat;" in "Import" doesn't slow down the testing.
Can anybody reproduce this? We are using XI 3.0 SP19 on a AIX machine, so we also have to use the Java version from IBM.
cu
ManfredProblem was fixed by a upgrad of the JDK.
-
How to deal with validation errors from DAO layer.
I have been pondering on how to deal with validation errors from DAO layer.
Lets say you have a DAO that can save a car object. A car has a year, make, model, vin and so on. During the save operation of this DAO, it validates the car attributes to see if they pass some business rules. If it does not it throws some validation exception that contains all the validation errors. These validation errors know nothing about jsf or my components it just knows what attributes on the object are invalid and why.
If I just want to show those errors at the top of the page that would be no problem I could just create some FacesMessage objects and add them to the FacesContext messages. But if the DAO layer is telling me that the make attribute is invalid it would be nice to map it to the make field on the screen. I am wondering if any of you have tackled this problem or have some ideas on how to tackle it?
BrianLet it throw an exception with a self explaining message, then catch it and embed that message in a FacesMessage.
Or let it throw more specific exception types (InvalidCarMakeException extends CarDAOException and so on) and let JSF handle it with own FacesMessage message. -
Hi,
I am creating a Service PO
with Document type :NB standard
Item category service
where can i enter the validity periods.
[like for Document type : FO (Frame work Order) we wil get validity period from and to ].Please suggest me , i need to update my client
Regards
venuHi,
the field Validity period for NB is suppress check transaction OMF4 -> select NBF(Purchase order) ->Selection group Administrative data validity field.you can change it but it will activate for all item category.better way create Service PO using document type FO framework order.
reward if helpful.
Regards,
Chetan. -
Understanding logminer results -- inserting row into table with CLOB field
In using log miner I have noticed that inserts into rows that contain a CLOB (I assume this applies to other LOB type fields as well, have only tested with CLOB so far) field are actually recorded as two DML entries.
--the first entry is the insert operation that inserts all values with an EMPTY_CLOB() for the CLOB field
--the second entry is the update that sets the actual CLOB value (+this is true even if the value of the CLOB field is not being set explicitly+)
This separation makes sense as there may be separate locations that the values are being stored etc.
However, what I am tripping over is the fact the first entry, the Insert, has a RowId value of 'AAAAAAAAAAAAAAAAAA' which is invalid if I attempt to use it in a flashback query such as:
SELECT * FROM PERSON AS OF SCN #####' where RowId = 'AAAAAAAAAAAAAAAAAA'The second operation, the Update of the CLOB field, has the valid RowId.
Now, again, this makes sense if the insert of the new row is not really considered "+done+" until the two steps are done. However, is there some way to group these operations together when analyzing the log contents to know that these two operations are a "+matched set+"?
Not a total deal breaker, but would be nice to know what is happening under the hood here so I don't act on any false assumptions.
Thanks for any input.
To replicate:
Create a table with CLOB field:
CREATE TABLE DEVUSER.TESTTABLE
ID NUMBER
, FULLNAME VARCHAR2(50)
, AGE NUMBER
, DESCRIPTION CLOB
);Capture the before SCN:
SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Insert a new row in the test table:
INSERT INTO TESTTABLE(ID,FULLNAME,AGE) VALUES(1,'Robert BUILDER',35);
COMMIT;Capture the after SCN:
SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;Start logminer session with the bracketing scn values and options etc:
EXECUTE DBMS_LOGMNR.START_LOGMNR(STARTSCN=>2619174, ENDSCN=>2619191, -
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.CONTINUOUS_MINE + -
DBMS_LOGMNR.COMMITTED_DATA_ONLY + DBMS_LOGMNR.NO_ROWID_IN_STMT + DBMS_LOGMNR.NO_SQL_DELIMITER)Query the logs for the changes in that range:
SELECT
commit_scn, xid,operation,table_name,row_id
,sql_redo,sql_undo, rs_id,ssn
FROM V$LOGMNR_CONTENTS
ORDER BY xid asc,sequence# ascResults:
2619178 0C00070028000000 START AAAAAAAAAAAAAAAAAA set transaction read write
2619178 0C00070028000000 INSERT TESTTABLE AAAAAAAAAAAAAAAAAA insert into "DEVUSER"."TESTTABLE" ...
2619178 0C00070028000000 UPDATE TESTTABLE AAAFEXAABAAALEJAAB update "DEVUSER"."TESTTABLE" set "DESCRIPTION" = NULL ...
2619178 0C00070028000000 COMMIT AAAAAAAAAAAAAAAAAA commitEdited by: 958701 on Sep 12, 2012 9:05 AM
Edited by: 958701 on Sep 12, 2012 9:07 AMScott,
Thanks for the reply.
I am inserting into the table over a database link.
I am using the new version of HTML Db (2.0)
HTML Db is connected to an Oracle 10 database I think, however the table I am trying to insert data into (via the database link) is in an Oracle 8 database - this is why we created a link to it as we couldn't have the HTML Db interacting with the Oracle 8 database directly due to compatibility problems (or so I've been told)
Simon -
Working with Validation of Data
Hi. VC Experts.
I am currently working with VC 6.0. Where I am working with Validation of Data.
we have fields like Emp, Earea, Joining date (month & Year), Ending date((month & Year) etc.,
Here we have one push button 'select'.
Here what my client asks is unless and until, user fills all details then only
the submit but should be enabled. Otherwise submit button should be in disable mode.
I could be able to write formula for 'submit' button's properties( Disable) like this.
BOOL(IF(LEN(@Emp_code)<>0 AND LEN(@Earea)<>0 AND LEN(@Edept)<>0 AND DSUB(DVAL(@Joining_date), DVAL(@Ending_date),'D')<0 ,false,true))
Here condition is always make sure that 'Joining date' should be greater than 'Ending date' . where it is working fine for all fields except Calender Year month(Joining date & Ending date).
the calender year month format is Example : """" May 2007""""
But it is considering only month But not year.
Can you kindly provide your inputs.
Thanks & RegardsHi Vijay,
sorry
please rewrite the formula for the button disable as::
NOTE:: in the formula i have used '<''>' which nothing but a lessthan symbol and greater than symbol without single quotes (i.e. not equal to)
BOOL(IF(LEN(@Emp_code) '<''>'0 AND LEN(@Earea)'<''>'0 AND LEN(@Edept)'<''>'0 AND DSUB(DVAL(@Joining_date), DVAL(@Ending_date),'D')<0 ,false,true))
and make sure you have placed the date picker UI controls for your date functionality.
this will not work for calender UI control on the form.
and othe important point is the joining date should be less than ending date then only the button will be enable..
if you want your joining date should be greater than ending date then write the formaula like this::
BOOL(IF(LEN(@Emp_code)<>0 AND LEN(@Earea)'<''>'0 AND LEN(@Edept)'<''>'0 AND DSUB(DVAL(@Joining_date), DVAL(@Ending_date),'D')>0 ,false,true))
i tried this
its working for me
Regards
Srinivas -
X-distr.chain status in combination with valid from date
Hello I am using MM02 X-distr.chain status in combination with valid from date, to give materials a certain status in the sales order depending on the delivery date of the orderline.
How can I enter multiple statuses with future validation dates?
example following status with validation dates where entered in MM02 for a material
- material should have status A valid from January
- material should have status B valid form April
- material should have status C valid from July
- material should have status D valid from September
When I enter a sales order with delivery date in January system replies with status C.
When I enter a sales order with delivery date in April system replies with status C .
When I enter a sales order with delivery date in July system replies with status C .
When I enter a sales order with delivery date in September system replies with status D.
So only the current ( or previous status when current is not valid yet) is retained by the system.
How could multiple statuses be used?
Thanks in advance
JoosHello Jalo,
Thanks for your reply,
My customer sell season relevant materials so they want to control order entry and delivery creation based on predefined dates.
Status A = material is blocked for order entry and delivery creation
Status B = material is allowed for order entry, delivery creation is blocked
Status C = material is allowed for order entry and delivery creation.
Status D = material is blocked for order entry, delivery creation is allowed.
I had hoped to use standard functionality with this status field, it meets most of my customers requirements but at this moment the only alternative is to create a new table where this data can defined and create some abap logic in the user exit to set the status base on the table information.
Regards
Joos -
I have created a UDF (Units & Totals type) for Good Receipt PO rows that must display a USD amount. I have tried Price, Rate and Amount with no luck. Not only will the UDF not display a currency indicator, it will not hold the decimal places as entered in the Display tab of General Settings once the field is no longer in focus. Any numeric value entered defaults to 0 decimal places.
Any help would be appreciated.Suda,
Sorry to keep at this, but I want to make sure I understand and am not just making a rookie mistake. If I add a UDF with a structure of Price, I should NOT expect to see that field displayed as a price (i.e. currency), but it will be maintained in the db as a price? And further, if I add this UDF to a printed form, even then it will NOT display as a price, only as a numeric field?
(If I could give you more than the alloted 10 points, I would. You've been very patient and helpful!)
Mimi -
Problems sending an email with a field attached.
Hi everyone,
Im having problems with sending an e-mail (with a field attached) to an external e-mail address.
Im using the followings functions:
<b>'SO_DOCUMENT_INSERT'
'SO_OBJECT_UPLOAD'
'SO_ATTACHMENT_INSERT'
'SO_OBJECT_SEND'</b>
Everything goes well (the functions are executed well), but the message stacks and it isnt be sent.
I can see it with the transaction SBWP, it is in the folder Exit/Documents with status: Waiting communication service .
Then I can send it from there clicking at the button send. And then it is sent.
Have anyone any clue about what Ive missed to do.
I really appreciate your help; I need to solve this problem as soon as possible.
Kind regards.Hai
report zemail no standard page heading line-size 220.
data: message_content like soli occurs 10 with header line,
receiver_list like soos1 occurs 5 with header line,
w_object_hd_change like sood1.
start-of-selection.
Receivers
receiver_list-recextnam = '[email protected]'.
receiver_list-recesc = 'E'.
receiver_list-sndart = 'INT'
receiver_list-sndpri = '1'.
append receiver_list.
General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
w_object_hd_change-file_ext = 'HTM'. "<--this is important
Mail subject
w_object_hd_change-objdes = 'HTML from SAP/ABAP'.
Mail body
append 'Message content' to message_content.
append '<b>How''s this for sending HTML E-mail from SAP?</b>' to
message_content.
append '<p>New paragraph</p>' to message_content.
append '<p>Apostrophe’s</p>' to message_content.
Call function to send email - SAPConnect needs to be configured
call function 'SO_OBJECT_SEND'
exporting
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
tables
objcont = message_content
receivers = receiver_list.
2)
ABAP CODE
Email ITAB structure
DATA: BEGIN OF EMAIL_ITAB OCCURS 10.
INCLUDE STRUCTURE SOLI.
DATA: END OF EMAIL_ITAB.
DATA: T_EMAIL LIKE SOOS1-RECEXTNAM. "EMail distribution list
CONSTANTS: C_EMAIL_DISTRIBUTION LIKE SOOS1-RECEXTNAM VALUE
[email protected],[email protected].
Initialization
REFRESH EMAIL_ITAB.
Populate data
EMAIL_ITAB-LINE = Email body text 1.
APPEND EMAIL_ITAB.
EMAIL_ITAB-LINE = Email body text 2.
APPEND EMAIL_ITAB.
T_EMAIL = C_EMAIL_DISTRIBUTION.
--- EMAIL FUNCTION ---------------------------------------------------
REQUIRMENTS:
1) The user running the program needs a valid email address in their
address portion of tx SU01 under external comms -> SMTP -> internet
address.
2) A job called SAP_EMAIL is running with the following parameters:
Program: RSCONN01 Variant: INT User: XXX
This program moves mail from the outbox to the mail server using
RFC destination: SAP_INTERNET_GATEWAY_SERVER
INTERFACE:
1) APPLICATION: Anything
2) EMAILTITLE: EMail subject
3) RECEXTNAM: EMail distribution lists separated by commas
4) TEXTTAB: Internal table for lines of the email message
EXCEPTIONS:
Send OK = 0 otherwise there was a problem with the send.
CALL FUNCTION 'Z_SEND_EMAIL_ITAB'
EXPORTING
APPLICATION = 'EMAIL'
EMAILTITLE = 'Email Subject'
RECEXTNAM = T_EMAIL
TABLES
TEXTTAB = EMAIL_ITAB
EXCEPTIONS
OTHERS = 1.
Function Z_SEND_EMAIL_ITAB
""Local interface:
*" IMPORTING
*" VALUE(APPLICATION) LIKE SOOD1-OBJNAM
*" VALUE(EMAILTITLE) LIKE SOOD1-OBJDES
*" VALUE(RECEXTNAM) LIKE SOOS1-RECEXTNAM
*" TABLES
*" TEXTTAB STRUCTURE SOLI
*- local data declaration
DATA: OHD LIKE SOOD1,
OID LIKE SOODK,
TO_ALL LIKE SONV-FLAG,
OKEY LIKE SWOTOBJID-OBJKEY.
DATA: BEGIN OF RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF RECEIVERS.
*- fill odh
CLEAR OHD.
OHD-OBJLA = SY-LANGU.
OHD-OBJNAM = APPLICATION.
OHD-OBJDES = EMAILTITLE.
OHD-OBJPRI = 3.
OHD-OBJSNS = 'F'.
OHD-OWNNAM = SY-UNAME.
*- send Email
CONDENSE RECEXTNAM NO-GAPS.
CHECK RECEXTNAM <> SPACE AND RECEXTNAM CS '@'.
*- for every individual recipient send an Email
(see OSS message 0120050409/0000362105/1999)
WHILE RECEXTNAM CS ','.
PERFORM INIT_REC TABLES RECEIVERS.
READ TABLE RECEIVERS INDEX 1.
RECEIVERS-RECEXTNAM = RECEXTNAM+0(SY-FDPOS).
ADD 1 TO SY-FDPOS.
SHIFT RECEXTNAM LEFT BY SY-FDPOS PLACES.
MODIFY RECEIVERS INDEX 1.
PERFORM SO_OBJECT_SEND_REC
TABLES TEXTTAB RECEIVERS
USING OHD.
ENDWHILE.
*- check last recipient in recipient list
IF RECEXTNAM <> SPACE.
PERFORM INIT_REC TABLES RECEIVERS.
READ TABLE RECEIVERS INDEX 1.
RECEIVERS-RECEXTNAM = RECEXTNAM.
MODIFY RECEIVERS INDEX 1.
PERFORM SO_OBJECT_SEND_REC
TABLES TEXTTAB RECEIVERS
USING OHD.
ENDIF.
ENDFUNCTION.
FORM SO_OBJECT_SEND_REC *
FORM SO_OBJECT_SEND_REC
TABLES OBJCONT STRUCTURE SOLI
RECEIVERS STRUCTURE SOOS1
USING OBJECT_HD STRUCTURE SOOD1.
DATA: OID LIKE SOODK,
TO_ALL LIKE SONV-FLAG,
OKEY LIKE SWOTOBJID-OBJKEY.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
EXTERN_ADDRESS = 'X'
OBJECT_HD_CHANGE = OBJECT_HD
OBJECT_TYPE = 'RAW'
OUTBOX_FLAG = 'X'
SENDER = SY-UNAME
IMPORTING
OBJECT_ID_NEW = OID
SENT_TO_ALL = TO_ALL
OFFICE_OBJECT_KEY = OKEY
TABLES
OBJCONT = OBJCONT
RECEIVERS = RECEIVERS
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
FOLDER_NOT_EXIST = 4
FOLDER_NO_AUTHORIZATION = 5
FORWARDER_NOT_EXIST = 6
NOTE_NOT_EXIST = 7
OBJECT_NOT_EXIST = 8
OBJECT_NOT_SENT = 9
OBJECT_NO_AUTHORIZATION = 10
OBJECT_TYPE_NOT_EXIST = 11
OPERATION_NO_AUTHORIZATION = 12
OWNER_NOT_EXIST = 13
PARAMETER_ERROR = 14
SUBSTITUTE_NOT_ACTIVE = 15
SUBSTITUTE_NOT_DEFINED = 16
SYSTEM_FAILURE = 17
TOO_MUCH_RECEIVERS = 18
USER_NOT_EXIST = 19
X_ERROR = 20
OTHERS = 21.
IF SY-SUBRC <> 0.
RAISE OTHERS.
ENDIF.
ENDFORM.
FORM INIT_REC *
FORM INIT_REC TABLES RECEIVERS STRUCTURE SOOS1.
CLEAR RECEIVERS.
REFRESH RECEIVERS.
MOVE SY-DATUM TO RECEIVERS-RCDAT .
MOVE SY-UZEIT TO RECEIVERS-RCTIM.
MOVE '1' TO RECEIVERS-SNDPRI.
MOVE 'X' TO RECEIVERS-SNDEX.
MOVE 'U-' TO RECEIVERS-RECNAM.
MOVE 'U' TO RECEIVERS-RECESC.
MOVE 'INT' TO RECEIVERS-SNDART.
MOVE '5' TO RECEIVERS-SORTCLASS.
APPEND RECEIVERS.
ENDFORM.
3)
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
DATA L_NUM(3).
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Delivered Mail'.
Mail Contents
OBJTXT = 'Object text'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
LOOP AT ITAB_DATA.
CONCATENATE ITAB_DATA-PRODUCTOR
ITAB_DATA-VBELN
ITAB_DATA-POSNR
ITAB_DATA-MATNR INTO OBJBIN.
APPEND OBJBIN.
ENDLOOP.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'ORDERS'.
APPEND OBJHEAD.
Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'TXT'.
OBJPACK-OBJ_NAME = 'WEBSITE'.
OBJPACK-OBJ_DESCR = 'ORDERS.TXT'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
Completing the recipient list
target recipent
clear RECLIST.
RECLIST-RECEIVER = '[email protected]'.
RECLIST-EXPRESS = 'X'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
copy recipents
clear RECLIST.
RECLIST-RECEIVER = '[email protected]'.
RECLIST-EXPRESS = 'X'.
RECLIST-REC_TYPE = 'U'.
RECLIST-COPY = 'X'.
APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
ENDFORM. " SEND_MAIL
Thanks & Regards
Sreeni -
Hi,
In Item Master Data we have a UDF which is a LIST directly made when creating the UDF
In SAP when we add a new item and let this field empty we don't know how SAP handle this but
by SDK when we try to save an empty string or a DBNull.Value it isn't accepted.
What do we have to put in this UDF when creating an item by SDK ?
if I do nothing it's ok but this isn't not always practible.
Is there anything in the SDK to set a UDF as nothing ?Finally I see that we just have to let it go and not try to set it if there's no default for it.
I now check if the interface have nothing, don't do anything with the field. SAP will handle it itself
if the interface have something then and only then I set what was selected on the interface into the field and it seems to work ok that way.
Of course in case someone have set Mandatory, I presume he'll need to set this field mandatory in his interface as well.
Thank you anyway
Maybe you are looking for
-
MacBook Pro 2009 Model Identifier: MacBookPro5,1 Processor 2.4 GHz Intel Core 2 Duo Memory 4 GB 1067 MHz DDR3 Software OS X 10.8.5 (12F45) Iphoto '11 Iphoto on my macbook pro has stopped working. It comes up with a message saying that the library
-
Retrieving latest record of an employee for a same scholar ID from pa9048
Hi Experties...! i want to retrieve the latest record from the pa9048 table where the scholar ID (sname) is same for an employee.........can anyone tell me how i do that..........! latest record in means of date.......! Thanx in advance..............
-
How to find out data source for a datawindow?
I have a datawindow and I want to identify it's datasource. I open this datawindow in pb. then in design menu, Data Source is disabled. It means not direct sql Then I go to Column Specific(small window), and right click on any space, in the popup men
-
I just got a MacBook Pro today and I was not sure how to authorize my mac for iTunes
.
-
Translation table for Program name/screen number for ECC 6.0
Hello Experts, Do you know if there is a translation table and/or document that would list the Program Name / Screen Number for the transactions in SAP 5.0 and the equivalent Program Name / Screen Number for those same transactions in SAP 6.0? The re