on 05-02-2007 10:50 AM
Hi,
we're actually investigation the possibility to print out sales representative data
from ECC to Adobe Forms. This works realy fine. The Idea is to send the pdf's to
the sales representative which will fill out the forms offline and upload the pdf's via
Webdynpro to the ECC-System back again.
The question is now, that we do not get the pdf data back in the webdynpro. I was
using a howto from sdn to get the upload of the pdf done and the pdf is shown to
the user for review and then click on the send button. so far so good - the data will
be send, but i don't know how to handle the data then.
Has anyone of you an idea??
Thanks for every hint,
Mike
PS: ECC 6.0
Hi Mike,
Well, there's some WD Java to develop: when your data are mapped in the context of your application, you have to send them to an SAP system. For this, use the RFC model, explained in the https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c8780... [original link is broken] [original link is broken].
Regards,
Francois
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
answered by my own.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ll,
sorry, i forgot to mention the solution.
The problem exactly was that I didn't know exactly the structure of the adobe
document and had to update the data in the ECC-System, but I found the
following sdn thread and and could have a look at the adobe structure
and did some xml-processing to get the data.
The process goes on as follows:
1. a new contact is being created in transaction VC01N
2. a adobe interactive form is being send to the sales representative
3. the sales p. filles out the form and uploads it to a webdynpro app
4. the wd-app updates the contact in VC01n
here is the code (maybe not the smatest code, but it works g😞
public void onActionFormSubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionFormSubmit(ServerEvent)
String xmlData = null;
try{
byte[] filebytearray = wdContext.currentContextElement().getPDFObject();
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtil.write(new ByteArrayInputStream(filebytearray), out);
IWDPDFObject pdfObject = WDPDFObjectFactory.getPDFObject();
pdfObject.setPDF(out);
InputStream in = pdfObject.getData();
if (in == null) {
xmlData = "<empty>";
}
else{
java.io.DataInputStream din = new java.io.DataInputStream(in);
StringBuffer sb = new StringBuffer();
String line = null;
while((line=din.readLine()) != null){
sb.append(line+"n");
}
xmlData = sb.toString();
//for debugging only (to see the xml structure before): wdContext.currentVBKAVBElement().setINCLUDETEXT(xmlData);
}
}
catch( Exception ex ){}
try{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = factory.newDocumentBuilder();
Document doc = documentBuilder.parse(new InputSource(new StringReader(xmlData)));
NodeList tmpNodeList = doc.getElementsByTagName("VBELN");
Node tmpTextNode = tmpNodeList.item(0);
Text tmpText = (Text) tmpTextNode.getFirstChild();
wdContext.currentVBKAVBElement().setVBELN(tmpText.getNodeValue());
NodeList tmpNodeList2 = doc.getElementsByTagName("KTABG");
Node tmpTextNode2 = tmpNodeList2.item(0);
Text tmpText2 = (Text) tmpTextNode2.getFirstChild();
wdContext.currentVBKAVBElement().setKTABG(tmpText2.getNodeValue());
tmpNodeList = doc.getElementsByTagName("KTAEN");
tmpTextNode = tmpNodeList.item(0);
tmpText = (Text) tmpTextNode.getFirstChild();
wdContext.currentVBKAVBElement().setKTAEN(tmpText.getNodeValue());
tmpNodeList = doc.getElementsByTagName("KTABT");
tmpTextNode = tmpNodeList.item(0);
tmpText = (Text) tmpTextNode.getFirstChild();
wdContext.currentVBKAVBElement().setKTABT(tmpText.getNodeValue());
tmpNodeList = doc.getElementsByTagName("KTAET");
tmpTextNode = tmpNodeList.item(0);
tmpText = (Text) tmpTextNode.getFirstChild();
wdContext.currentVBKAVBElement().setKTAET(tmpText.getNodeValue());
tmpNodeList = doc.getElementsByTagName("KTEXT");
tmpTextNode = tmpNodeList.item(0);
tmpText = (Text) tmpTextNode.getFirstChild();
wdContext.currentVBKAVBElement().setKTEXT(tmpText.getNodeValue());
tmpNodeList = doc.getElementsByTagName("KUNNR");
tmpTextNode = tmpNodeList.item(0);
tmpText = (Text) tmpTextNode.getFirstChild();
wdContext.currentVBKAVBElement().setKUNNR(tmpText.getNodeValue());
} catch( Exception ex2){}
}
Mike
Message was edited by: Mike
Mike Fröhlich
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.