How to use Javamail for accessing additional mailboxes -IMAP, Exchange 2010
hi,
I want to access a shared mailbox (NOT FOLDER) via Javamail API (1.4.5) using IMAP(s) with plain logon. The mailserver is a Exchange Server 2010.
User: user1 ([email protected])
pwd: xxxx
shared mailbox: [email protected]
Properties:
mail.imaps.socketFactory.port = 993
mail.imaps.starttls.enable = true
mail.imaps.socketFactory.class = javax.net.ssl.SSLSocketFactory
mail.imaps.socketFactory.fallback = false
username = [email protected]
password = xxxx
I´ve managed to get access to the user1 - mailbox:
Session session = Session.getInstance(properties, new ExchangeAuthenticator(username, password));
session.setDebug(true);
Store store = session.getStore("imaps");
store.connect(imapHost, username, password);
--> this works just fine! But now i want to access the additional mailbox by changing the login-String:
[email protected]/shared_MB (user@domain/additional_MB)
--> unfortunately I´m getting an "NO AUTHENTICATE" message:
DEBUG: setDebug: JavaMail version 1.4.5
DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: mail.imap.statuscachetimeout: 1000
DEBUG: mail.imap.appendbuffersize: -1
DEBUG: mail.imap.minidletime: 10
DEBUG: trying to connect to host "host.domain.com", port 993, isSSL true
* OK The Microsoft Exchange IMAP4 service is ready.
A0 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM AUTH=GSSAPI AUTH=PLAIN UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+
A0 OK CAPABILITY completed.
DEBUG IMAP: AUTH: NTLM
DEBUG IMAP: AUTH: GSSAPI
DEBUG IMAP: AUTH: PLAIN
DEBUG: protocolConnect login, host=host.domain.com, [email protected]/shared_MB, password=<non-null>
DEBUG IMAP: AUTHENTICATE PLAIN command trace suppressed
DEBUG IMAP: AUTHENTICATE PLAIN command result: A1 NO AUTHENTICATE failed.
javax.mail.AuthenticationFailedException: AUTHENTICATE failed.
I was able to get access with Thunderbird and also with the Exchange OWA-Client, so I think there is something missing in my code...
or is it just impossible to get access to a different mailbox using javamail and plain-auth?
Thank you in advance.
Thanks bshannon, that was a great idea!
I haven´t found an solution yet, but I have maybe identified the real problem:
Here is some interessting Thunderbird - Logging stuff:
744[7161040]: try to log in
744[7161040]: IMAP auth: server caps 0x1187235, pref 0x1006, failed 0x0, avail caps 0x1004
744[7161040]: (GSSAPI = 0x1000000, CRAM = 0x20000, NTLM = 0x100000, MSN = 0x200000, PLAIN = 0x1000, LOGIN = 0x2, old-style IMAP login = 0x4)auth external IMAP login = 0x20000000
744[7161040]: trying auth method 0x1000
744[7161040]: got new password
744[7161040]: IMAP: trying auth method 0x1000
744[7161040]: PLAIN auth
744[7161040]: 7082000:xmail.domain.com:NA:SendData: 2 authenticate plain
744[7161040]: ReadNextLine [stream=7ec9e88 nb=3 needmore=0]
744[7161040]: 7082000:xmail.domain.com:NA:CreateNewLineFromSocket: +
744[7161040]: 7082000:xmail.domain.com:NA:SendData: Logging suppressed for this command (it probably contained authentication information)
744[7161040]: ReadNextLine [stream=7ec9e88 nb=27 needmore=0]
744[7161040]: 7082000:xmail.domain.com:NA:CreateNewLineFromSocket: 2 NO AUTHENTICATE failed.
744[7161040]: authlogin failed
744[7161040]: marking auth method 0x1000 failed
---> okay, so PLAIN AUTH is failing.....
744[7161040]: IMAP auth: server caps 0x1187235, pref 0x1006, failed 0x1000, avail caps 0x4
744[7161040]: (GSSAPI = 0x1000000, CRAM = 0x20000, NTLM = 0x100000, MSN = 0x200000, PLAIN = 0x1000, LOGIN = 0x2, old-style IMAP login = 0x4)auth external IMAP login = 0x20000000
744[7161040]: trying auth method 0x4
744[7161040]: got new password
744[7161040]: IMAP: trying auth method 0x4
744[7161040]: old-style auth
744[7161040]: 7082000:xmail.xmail.domain.com:NA:SendData: Logging suppressed for this command (it probably contained authentication information)
744[7161040]: ReadNextLine [stream=7ec9e88 nb=23 needmore=0]
744[7161040]: 7082000:xmail.domain.com:NA:CreateNewLineFromSocket: 4 OK LOGIN completed.
744[7161040]: login succeeded
--> okay, so Thunderbird is using "old-style IMAP login" and is successful.
Unfortunately I have no idea what that actually means or how to use it in Javamail (is it even supported?). Any suggestions?
Similar Messages
-
How to use ejbs for accessing Function Module.
Hi,
I want to call ABAP function module using ejb(Since I want to expose them as web service on different server). I know how to do that using Models, but dont know how to go ahead using ejbs.
Could you please guide me on this?
Regards,
Abhijeet.Hi,
In another thread with a similar question I found these references:
/people/kathirvel.balakrishnan2/blog/2005/07/26/remote-enable-your-rfchosttoip-to-return-host-ip-to-jco
Re: interfacing SAP with an existing java applications
And this code example:
HashMap result = new HashMap();
Object ret = new Object();
JCO.Client mConnection = null;
mConnection = getConnection();
JCO.Repository mRepository;
mRepository = new JCO.Repository("R3", mConnection);
JCO.Function function =
createFunction("Z_ISA_GET_ORDER_ITEM_INFO", mRepository);
function.getImportParameterList().setValue(orderNum, "ORDER");
if (function != null) {
mConnection.execute(function);
JCO.Table codes = function.getTableParameterList().getTable("INFO");
for (int i = 0; i < codes.getNumRows(); i++) {
codes.setRow(i);
int tmp = new Integer(codes.getString("POSNN")).intValue();
String tmpStr = new String(Integer.toString(tmp));
ret = result.put(tmpStr, codes.getString("VBELN"));
} else {
System.out.print("Fxn call failed for Z_ISA_GET_ORDER_ITEM_INFO");
JCO.releaseClient(mConnection);
Good luck,
Roelof -
How to use Powershell to set delegate for user mailbox in Exchange 2010 and Office 365
Hello,
Can you please tell me if I can set delegate for user mailbox in Exchange 2010 or Office 365 using Powershell?
If I can, then how can I do that? (which Powershell commands for setting the delegate?)
Many thanks, and have a good day!Hi,
If you wanted to add a delegate to possiblly a large number of users or you do this during mailbox provisioning. So the following script will use
impersonation to access another users mailbox and add a delegate.
$mbtoDelegate = "[email protected]"
$delegatetoAdd = "[email protected]"
$dllpath = "C:\Program Files\Microsoft\Exchange\Web Services\1.0\Microsoft.Exchange.WebServices.dll"
[void][Reflection.Assembly]::LoadFile($dllpath)
$service = new-object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2007_SP1)
$windowsIdentity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
$sidbind = "LDAP://<SID=" + $windowsIdentity.user.Value.ToString() + ">"
$aceuser = [ADSI]$sidbind
$service.AutodiscoverUrl($aceuser.mail.ToString())
$service.ImpersonatedUserId = new-object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress,
$mbtoDelegate);
$mbMailbox = new-object Microsoft.Exchange.WebServices.Data.Mailbox($mbtoDelegate)
$dgUser = new-object Microsoft.Exchange.WebServices.Data.DelegateUser($delegatetoAdd)
$dgUser.ViewPrivateItems = $false
$dgUser.ReceiveCopiesOfMeetingMessages = $false
$dgUser.Permissions.CalendarFolderPermissionLevel = [Microsoft.Exchange.WebServices.Data.DelegateFolderPermissionLevel]::Editor
$dgUser.Permissions.InboxFolderPermissionLevel = [Microsoft.Exchange.WebServices.Data.DelegateFolderPermissionLevel]::Reviewer
$dgArray = new-object Microsoft.Exchange.WebServices.Data.DelegateUser[] 1
$dgArray[0] = $dgUser
$service.AddDelegates($mbMailbox, [Microsoft.Exchange.WebServices.Data.MeetingRequestsDeliveryScope]::DelegatesAndMe, $dgArray);
Hope this helps. -
Hi,
I am planning to develop an application to use EWS managed API streaming notification for listening the new email event of a shared mailbox. Will it will work or not? I knew it works for a personal mailbox, where the authentication of EWS can be performed
with the associated Active directory account. For the shared mailbox in Exchange Server, is there such an Active Directory account associated?
Thanks,
Richard>> Are you saying that if an Active Directory account has the access to a shared mailbox, and then this account can be used for creating the Streaming subscription for that mailbox
Yes that's correct (try it yourself with the EWSEditor)
>> In other words, the way how Exchange Server works is that the new messages like new emails are automatically sending to all of the AD accounts which have the access to a mailbox.
Not sure what you mean by this ? A Shared a Mailbox is just like any other Exchange Mailbox if you have rights to the Folder then you can create a subscription against it. There is no automation involved.
Cheers
Glen -
Hi all,
I'd like to know if it's possible and how to use JavaMail 1.4 with Oracle Application Server 10g (9.0.4.0.0), Windows version.
With the following code, I can see that the mail.jar used by the server is the one included in the jdk installation :
// I'm testing InternetAddress.class because I want to use commons-email-1.2.jar that requires mail.jar 1.4 (or higher) and activation.jar 1.1 (or higher)
// and I know that inside the commons-email-1.2.jar file, I need to call the InternetAddress.validate() method that throws a java.lang.NoSuchMethodError: javax.mail.internet.InternetAddress.validate()V if it is used with mail.jar 1.2.
Class cls = javax.mail.internet.InternetAddress.class;
java.security.ProtectionDomain pDomain = cls.getProtectionDomain();
java.security.CodeSource cSource = pDomain.getCodeSource();
java.net.URL location = cSource.getLocation();
System.out.println(location.toString());
This code returns : file:/C:/oracle/app/jdk/jre/lib/ext/mail.jar and this mail.jar file has an implementation version number: 1.2
- I've tried to include my own mail.jar (1.4.2) and activation.jar (1.1.1) files in the war file that I deploy, but it doesn't work (the server still uses the same mail.jar 1.2)
- I've tried to put the mail.jar (1.4.2) and activation.jar (1.1.1) files in the applib directory of my OC4J instance, but it doesn't work (the server still uses the same mail.jar 1.2)
- I know that a patch exists : I've read the following document: How to Make Libraries such as mail.jar and activation.jar Swappable ? [ID 552432.1]
This article talks about the Patch 6514136, but this patch only applies to : Oracle Containers for J2EE - Version: 10.1.3.3.0
Can you please help me ?
Thanks in advance for your answers,
LaurentI strongly suggest to upgrade to AS 10.1.3 to get this.
Think of future support of AS 9.0.4. You will get not critical patch updates anymore.
--olaf -
How to use JAPI to Access Essbase 6.5
Do anyone knows How to use JAPI to Access Essbase 6.5?
I was told to install Enterprise Services 7.3.1.10.
But when I test eds samples, I can connect Essbase but can not get data from Essbase.
Need to change another Enterprise Services(I was told 7.3.1.10 is the latest version), or do some config in 7.3.1.10.
Thanks a lot in advanceGee is correct. You will need to use EAS 7.x to add an analytic server. You will also have to do a few other tasks such as synch'ing security, etc.
Further, as you are not accessing the exact same version of Essbase as your version of EDS, there is a property setting you will have to change to be successful. In eds\7.1.3\bin, open essbase.properties and modify the server.olap.direct setting to set it to false. What this setting does is forces EDS to use it's own private set of C API files and to use them for all calls to Essbase. Otherwise, EDS will attempt to use pure Java calls to the server. Unfortunately, the pure Java calls were implemented in an 'evolutionary' manner so every Essbase version got more calls until sometime in the System 9 timeframe. By the time 9.3 shipped (and maybe before, I would have to check), all calls the server are pure Java and that property setting is no longer available.
Tim Tow
Oracle ACE
Applied OLAP, Inc -
How to use JavaMail to receive incomming email?
Hello,
I am a year 3 student and doing a final year project about web hosting.
I want to know how to use JavaMail to receive and treat the incomming email. It means that the incoming email how to process and store the "message" in the recipient "folder" in the "store" class.
If you have any optinions or examples or suggestion, please contact me.
Thank you for your attention....First, it would be better to post questions about JavaMail in the JavaMail forum and not in the JSP forum.
Second, the JavaMail download comes with a set of examples, including some that cover exactly what you ask. -
Who has full access on all mailboxes in Exchange 2010 using Powershell ?
Greetings,
Could you please tell me how can i know Who has full access on all mailboxes in Exchange 2010 using Powershell ?
Thanks.
Redouane SARRAThis is going to depend greatly on WHICH inherited permissions you plan to delete - there are some that you can never delete if you want the system to function properly. Now, that being said, let's look at some example permissions. First, here
are some permissions on a standard mailbox:
Identity User AccessRights
IsInherited Deny
users.corp.... USERS\btwatcher {FullAccess}
False False
users.corp.... USERS\svcactAdmin {FullAccess}
True False
users.corp.... CORP\Domain Ad... {FullAccess}
True True
users.corp.... CORP\Enterpris... {FullAccess}
True True
users.corp.... CORP\Organizat... {FullAccess}
True True
users.corp.... CORP\adminact {FullAccess}
True True
users.corp.... CORP\esswin {FullAccess}
True True
users.corp.... USERS\svcactEncase {FullAccess}
True False
users.corp.... CORP\Exchange ... {FullAccess}
True False
users.corp.... NT AUTHORITY\SYSTEM {FullAccess}
True False
As you can see, the first is not inherited. All others are, and two are from service accounts (svcact...). Also, some are Exchange system permissions, some are denies, and some are just administrative accounts. Once you determine which
you wish to remove, the SIMPLEST way to set the permissions you want is to open the account properties in ADSIEdit, and go to the Security tab. Here, click the Advanced button and find the inherited permission you wish to remove. ADSIEdit will
show where the permission is inherited from - you will need to go to that container to remove the inherited permission. You can also grant inherited denies at the same level(s).
Now, something you will need to understand is that if you hope to remove permissions granted to domain administrators, the system will replace them - these permissions are required by the system and can't be modified permanently. -
How to Use 'uid' for AD Users Without Domain Name For User Log in OAM
How to Use 'uid' for synchronized Active Directory (AD) Users into Oracle Internet Directory (OID) Without Domain Name For User Logins in OIDDAS and OAM
We successfully integrated OAM 11g with EBS R12.1.3 Now all the AD user id's stored in fnd_users table as [email protected]
How can we remove @abc.com
We are using OID 11g and OAM 11g
Found the similar note for OID 10G: How to Use 'uid' for AD Users Without Domain Name For User Logins in OIDDAS and SSO [ID 580480.1]
We are in OID 11g.
Any help on this greatly appreciated.I couldn't find any reference that could be helpful -- Please log a SR and see if this is supported and if the steps are available.
Thanks,
Hussein -
How to use webcam for Yahoo Messenger on MacBook Pro, How to use webcam for Yahoo Messenger on MacBook Pro because it's not working =(
The cheap & easy way is to just drag the app to the Trash.
If you want to get all of the associated files use an app deleting app like the free AppCleaner;
http://www.freemacsoft.net/appcleaner/
Just drag an app and drop it on the AppCleaner icon in the Dock and it will find and present to you all the files it thinks are associated with the app. You can uncheck any that you want to keep and then let AppCleaner Trash the rest. -
How to use i for if condition in a for i in loop?
Hi friends,
I have a question on how to use i for IF condition in a loop, in order to get an efficient programming and results. Here is outlined SQL:
cursor is
select c1,c2,c3 from table1; -- 100 rows returned.
open cursor
loop
fetch c1,c2,c3 into v1,v2,v3;
for i in 1..3 loop
if 'v'||i between 90 and 100 then
v_grade := 'Excellent';
elsif 'v'||i between 80 and 89 then
elsif 'v'||i between 50 and 59 then
end if;
end loop;
close cursor;
This way, I don't need to use a lot of if..then for hard code v1,v2,v3,.... actually I have more v..
But Oracle gave an error of this usage of 'if 'v'||i' or 'v'||to_char(i).
Thanks for any advice in advance!user508774 wrote:
Thanks for comments and advices. But I didn't get your inputs clearly. Are you saying I don't need to use PL/SQL to achieve this?Correct. Ronel and John showed you the basic approaches. SQL is not a mere I/O language for making read and write calls. It is a very capable, flexible and powerful language. One can solve a problem with a few lines of SQL code, that will take 100's of lines of PL/SQL or Java code.
So do not underestimate what can be done in SQL.
v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
EXECUTE IMMEDIATE v_cmd;This code is also wrong. Besides the fact that there is no need for dynamic SQL, this approach creates a brand new SQL statement each loop iteration.
SQL is source code. It needs to be parsed (compiled). The end result is an executable program that is called a cursor. This cursor needs to be stored in server memory (the SQL Shared Pool in the SGA).
The problem with your code is that it is slow and expensive - it generates lots of unique SQL statements that need CPU for parsing and server memory for storage.
These add up to a very significant performance overhead. That is the wrong approach. The correct approach is the same one that you would use in any other programming language.
Let's say you need to use Java to process a bunch of CSV files - exact same CSV layout used by each file. A file needs to be read, processed, and a log file created.
Will you write a Java program that loops through the files, for each file found, write a Java program for processing that file, compile it, then execute it?
Or would you write a Java program that takes the name of the file as input, and then process that file and writes the log file?
The 2nd approach provides a program that can process any of those CSV files - one simply needs to pass the filename as an input parameter.
Your code and approach use the 1st method. Not the 2nd. And that is why it is wrong.
To create a SQL program with parameters is done by using bind variables. Instead of
v_cmd := 'UPDATE parts_categ_counts SET w1='||v1||', w2='||v2||...||v9||' WHERE seq='||vseq||';
The following SQL source code should be created:
v_cmd := 'UPDATE parts_categ_counts SET w1=:v1, w2=:v2 ..., w9=:v9 WHERE seq= :vseq';
The tokens with the colon prefix (such as :v1), are bind variables. Think of these as the parameters to the SQL cursor.
The server parses this SQL into a cursor. You can now execute the same cursor over and over again, using different bind variables. (just like the 2nd approach above that one would use in Java)
In PL/SQL, this is made even easier as you can code native SQL code with PL/SQL code and use PL/SQL variables in it. The PL/SQL compiler is clever enough to do the SQL parsing, variable binding, and cursor execution for you. So in PL/SQL, you would use:
UPDATE parts_categ_counts SET w1=v1, w2=v2 ..., w9=v9 WHERE seq= vseq;
Where v1 and the others are PL/SQL variables.
That all said - PL/SQL is only used for data crunching, when the processing of data is too complex for the SQL language to deal with. And this is very seldom the case.
The main reason for using PL/SQL it to provide processing flow control, conditional processing and error handling, for SQL code. As the SQL language does not have these features. -
Install Sun ONE Directory Server 5,2 & how to use it for authenticate user
Good afternoon, Excuse, are newbie in the scope I am learning and putting desire to him, this in my situation I am trying to install Sun ONE Directory Server 5,2 since I understand that this it is application LDAP for Solaris, ok I want to install it to authenticate user against the system, that is to say, to be able to acces the server entering with a created user from the data base of LDAP and make think user that his created in the system. But the documentation that I finds indicates the installation of Sun ONE Directory Server 5,2 but it not clearly about how to use it for authentication. Some one have any manual step by step of Sun ONE Directory Server 5,2 installation and how to make it for authentication systems users.
I read the forum seeking for anwser and i get confuse
Thanks for the help and sorry for any inconvenient
Message was edited by:
Aku_28
Message was edited by:
Aku_28I think that I found the Sun endorsed book locations for using LDAP accounts that don't use authentication besides "crypt". I now can use an account with a "ssha" password. It can be more than 8 characters long.
Chapter 14 System Administration Guide: Naming and Directory Services
Read page 201 which is the pam.conf file pam_ldap setups. I edited my "/etc/pam.conf" file to reflect this
Chapter 7 Directory Server 5.2 2005Q4 - Administration Guide
Read page 316-318 which has a graphical technique to specify password syntax. I set it up and then tried the password by running "su - brahms". It now requires a longer password than 8 characters and it is set up to use "ssha" for that UID entry "brahms". -
How to use parathesis for OR and AND OPERATOR...
oracle 10g
Hi
Guys please help how to use parathesis for this below query its giving same output values for all my similar queries
select count(balance) from balanace_tb
where kk_code in(111,112,113)
or
kk_code in(111,1124,115,116) and sec_id in(50,51,52,53)
or
kk_code in(100,164,215,161) and sec_id in(53,51,52,59)
or
kk_code not in(100,164,215,162,134) and sec_id in(53,51,52,59)
or
kk_code in(100,164,215,16) and sec_id in(53,51,52,59)
and
open_date=20130331I assume you're looking for something like this?
select count(balance) from balanace_tb
where ( kk_code in(111,112,113)
or (kk_code in(111,1124,115,116) and sec_id in(50,51,52,53))
or (kk_code in(100,164,215,161) and sec_id in(53,51,52,59))
or (kk_code not in(100,164,215,162,134) and sec_id in(53,51,52,59))
or (kk_code in(100,164,215,16) and sec_id in(53,51,52,59))
and open_date=20130331
If not, please post some example data, the expected output from that data, and the logic you are expecting to use, as well as posting your database version.
Re: 2. How do I ask a question on the forums? -
How to Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split
Hi Experts, I have the follow delivery:
Item Material Deliv.Qty Un
10 739911 2 PQT
And I want to obtain this:
Item Material Deliv.Qty Un Batch
10 739911 0 PQT
900001 739911 1 PQT ZZ00060
900002 739911 1 PQT ZZ00061
But, after using the Bapi I obtained this:
Item Material Deliv.Qty Un Batch
10 739911 1,372 PQT
900001 739911 0,314 PQT ZZ00060
900002 739911 0,314 PQT ZZ00061
So as you can see the problem is with the "Deliv.Qty". I expected:
Item Deliv.Qty
10 0
900001 1
900002 1
But I obtained:
Item Deliv.Qty
10 1,372
900001 0,314
900002 0,314
The parameters that I am using in the Bapi are:
HEADER_DATA
DELIV_NUMB = 801174646
HEADER_CONTROL
DELIV_NUMB = 801174646
DELIVERY = 801174646
TECHN_CONTROL
UPD_IND = U
ITEM_DATA (three records):
DELIV_NUMB = 801174646
DELIV_ITEM = 000010
MATERIAL = 739911
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
DELIV_NUMB = 801174646
DELIV_ITEM = 900001
MATERIAL = 739911
BATCH = ZZ00060
HIERARITEM = 000010
USEHIERITM = 1
DLV_QTY = 1
DLV_QTY_IMUNIT = 1
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
DELIV_NUMB = 801174646
DELIV_ITEM = 900002
MATERIAL = 739911
BATCH = ZZ00061
HIERARITEM = 000010
USEHIERITM = 1
DLV_QTY = 1
DLV_QTY_IMUNIT = 1
FACT_UNIT_NOM = 1
FACT_UNIT_DENOM = 1
ITEM_CONTROL (three records):
DELIV_NUMB = 801174646
DELIV_ITEM = 000010
CHG_DELQTY = X
DELIV_NUMB = 801174646
DELIV_ITEM = 900001
CHG_DELQTY = X
DELIV_NUMB = 801174646
DELIV_ITEM = 900002
CHG_DELQTY = X
So I am missing something but I don't know what.
Can any one help me with this please?
PD: I have looked the following forums in order to use the Bapi:
How to Use BAPI_OUTB_DELIVERY_CHANGE for Batch Split
batch split using BAPI_OUTB_DELIVERY_CHANGE
Re: Help in BAPI_OUTB_DELIVERY_CHANGE(batch-split)
BAPI_OUTB_DELIVERY_CHANGE - Batch Splits don't work
Help for BAPI_OUTB_DELIVERY_CHANGEHey,
My code is for the inbound delivery but it should work the same.
Give this a try.
REPORT z_delivery_batch_split.
DATA:header_data LIKE bapiibdlvhdrchg,
header_control LIKE bapiibdlvhdrctrlchg,
delivery LIKE bapiibdlvhdrchg-deliv_numb,
ls_return LIKE bapiret2,
item_data TYPE TABLE OF bapiibdlvitemchg,
item_control TYPE TABLE OF bapiibdlvitemctrlchg,
ls_item_data LIKE bapiibdlvitemchg,
ls_item_control LIKE bapiibdlvitemctrlchg,
return TYPE TABLE OF bapiret2 WITH NON-UNIQUE KEY type.
header_data-deliv_numb = '1800005005'.
header_control-deliv_numb = '1800005005'.
delivery = '1800005005'.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900001'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 80.
ls_item_data-dlv_qty_imunit = 80.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_data-deliv_numb = '1800005005'.
ls_item_data-deliv_item = '900002'.
ls_item_data-material = '000000000020067722'.
PERFORM create_batch CHANGING ls_item_data-batch.
ls_item_data-hieraritem = '000010'.
ls_item_data-usehieritm = '1'.
ls_item_data-dlv_qty = 60.
ls_item_data-dlv_qty_imunit = 60.
ls_item_data-fact_unit_nom = '1'.
ls_item_data-fact_unit_denom = '1'.
ls_item_data-sales_unit = 'EA'.
ls_item_data-base_uom = 'EA'.
APPEND ls_item_data TO item_data.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900001'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
ls_item_control-deliv_numb = '1800005005'.
ls_item_control-deliv_item = '900002'.
ls_item_control-chg_delqty = 'X'.
APPEND ls_item_control TO item_control.
break cgavin.
CALL FUNCTION 'BAPI_INB_DELIVERY_CHANGE'
EXPORTING
header_data = header_data
header_control = header_control
delivery = delivery
* TECHN_CONTROL = TECHN_CONTROL
TABLES
* HEADER_PARTNER = HEADER_PARTNER
* HEADER_PARTNER_ADDR = HEADER_PARTNER_ADDR
* HEADER_DEADLINES = HEADER_DEADLINES
item_data = item_data
item_control = item_control
* ITEM_SERIAL_NO = ITEM_SERIAL_NO
* EXTENSION1 = EXTENSION1
* EXTENSION2 = EXTENSION2
return = return
* TOKENREFERENCE = TOKENREFERENCE
* HANDLING_UNIT_HEADER = HANDLING_UNIT_HEADER
* HANDLING_UNIT_ITEM = HANDLING_UNIT_ITEM
* PARTIAL_GR_OBJECTS = PARTIAL_GR_OBJECTS
READ TABLE return
INTO ls_return
WITH TABLE KEY type = 'E'.
IF sy-subrc = 0.
MESSAGE ID ls_return-id TYPE ls_return-type NUMBER ls_return-number WITH ls_return-message_v1 ls_return-message_v2
ls_return-message_v3 ls_return-message_v4.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
break cgavin.
*& Form CREATE_BATCH
* text
* <--P_LS_ITEM_DATA_BATCH text
FORM create_batch CHANGING p_ls_item_data_batch.
DATA: ls_bncom TYPE bncom.
ls_bncom-matnr = ls_item_data-material.
ls_bncom-werks = 'C333'.
ls_bncom-lgort = '3000'.
SELECT SINGLE mtart
FROM mara
INTO ls_bncom-mtart
WHERE matnr = ls_bncom-matnr.
CALL FUNCTION 'VB_NEXT_BATCH_NUMBER'
EXPORTING
matnr = ls_bncom-matnr
werks = ls_bncom-werks
check_batch = 'X'
check_material = ''
message_when_auto = ' '
x_bncom = ls_bncom
lock_batch = ' '
IMPORTING
new_charg = p_ls_item_data_batch
EXCEPTIONS
no_material = 1
no_plant = 2
material_not_found = 3
plant_not_found = 4
no_batch_handling = 5
batch_exist = 6
no_number = 7
illegal_batch_number = 8
interval_not_found = 9
object_not_found = 10
interval_overflow = 11
error_automatic_batch_number = 12
cancelled = 13
automatic_batch_num_not_active = 14
OTHERS = 15.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDFORM. " CREATE_BATCH -
Need documents for how to use OAM for APPS DBAs
Hi All,
Need documents/pdfs, how to use OAM for APPS DBAs.
Thanks a lot in advanceHi,
For R12 ,refer the Oracle E-Business Suite System Administrator's Guide - Configuration part no:E12893-03 (http://download.oracle.com/docs/cd/B53825_04/current/acrobat/121sacg.pdf)
For 11i version pls chk :
Oracle Applications System Administrator's Guide - Configuration (zipped) B13925-06 (http://download.oracle.com/docs/cd/B25516_18/current/acrobat/115sacg.zip)
--Rk
Maybe you are looking for
-
Hi im looking for a driver for win 7 to work on a sound blaster li've ct4670 can any help?
-
OMWB Oracle Migration Work Bench for MS Access hints
Hey folks, This is a great tool, however, there are a couple of 'gotchas' you might encounter: 1. When loading data, you may encounter this error:[Microsoft][ODBC Microsoft Access Driver] '(unknown)'. On a windows box, just update the ODBC DSN for om
-
Can not seem to load actions? Can anyone help me with this? I have pse8 elements
I need help loading actions on pse8 elements it has been done but i can not seem to find where to put it
-
Hi Guys, One simple question, can one use Heterogenious connectivity via ODBC with Oracle Database Express edition 10x Boris
-
i have tried to put it in many times and even tried to use one of my own cards for her but it is still not working.. does anyone know if there is a temp blip wrong with the card system at the moment or can anyone help? thanks!