InfoObject Creation through Code
Hi,
Is there a way to create infoobjects through a code??
Can an ABAP code be written to create Infoobjects and other objects in BW?
If so, pls. give me details...
Thanks
Hi vaishali,
Why do u want to create IO thru ABAP code. SAP makes our development simple by the presentation screens, so just do like this.
Think of craeting different tables which are created while generating IO. all the table u have to create and no whare u can link SID table with P table.
Narendra Reddy
Similar Messages
-
BCC project creation through code and update sku properties
Hi,
I want to create a BCC project through my code and want to update some sku properties.
Can someone please let me know how can it be possible?
Please help me out.
Thanks,
Gaurav AgrawalHello!
If you look at $ATG_ROOT\Publishing\base\sample-code there is a ca-import-sample-code.jar file.
This file contais .java files explaining how to create a project and auto-approve them, and .properties files for the components.
It is really simple to use and understand. -
InfoObject Creation Dynamically
Hello Experts,
I need to create thousands of custom infoobjects and trying to implement through BAPI. I am trying to create infoobject reading the infoobject structure from tab delimited tax file:
io_name io_type io_txsht io_txlng io_datatype io_length
ZEA_IO1 CHA IO Test IO Test 1 CHAR 20
ZEA_IO2 CHA IO Test IO Test 2 CHAR 20
I was able to load the text file to internal table. Now I have to work with the following function modules (please check the code):
'BAPI_IOBC_CHANGE' - To get the InfoObject Catalog so that all the infoobject will be created under InfoObject Catalog. What would be the code?
Call Function 'BAPI_IOBJ_CREATE' -
IMPORTING - Is that right?
What to write under EXPORTING to check the error validation one by one?
RETURN = BAPIRET2 ??
Call Function 'BAPI_IOBJ_ACTIVATE_MULTIPLE' - To activate all the infoobjects. What would be the code?
Here is my Code:
*& Report ZBAPI_TEST *
*& InfoObject Creation through BAPI.
*& Read the Text file, call a BAPI to create InfoObjects. *
*& Text file will hold the Info Object Structure. Text file will be *
*& located either work station or local PC.
*& Step 1. Create internal table to hold InfoObject structure *
*& Step 2. Retrieve/Load text file into Internal Table structure *
*& Step 3. Call BAPI Function to Create IO *
*& Step 4. Call BAPI Function to Activate IO *
REPORT ZBAPI_TEST .
Declaring Internal table for creating InfoObject
DATA: p_file TYPE string.
DATA: BEGIN OF itab_bapi OCCURS 0,
io_name like BAPI6108-infoobject,
io_type like BAPI6108-type,
io_txsht like BAPI6108-textshort,
io_txlng like BAPI6108-textlong,
io_datatype like BAPI6108-datatp,
io_length like BAPI6108-intlen,
END OF itab_bapi.
DATA ibapi LIKE STANDARD TABLE OF itab_bapi.
PARAMETERS: sel_file(1500) TYPE c default ' ' OBLIGATORY LOWER CASE.
PUT THE TEXT FILE PATH TO P_FILE
p_file = sel_file.
**Copy the file from the workstation to the server/ internal table**
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = p_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
DAT_MODE = SPACE
CODEPAGE = SPACE
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
READ_BY_LINE = 'X'
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = itab_bapi[]
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
MESSAGE e012(zea_spms) WITH 'Method' 'GUI_UPLOAD' sy-subrc.
&1 &2 issued return code &3
ENDIF.
loop at itab_bapi.
write: /5 itab_bapi-io_name,
20 itab_bapi-io_type,
30 itab_bapi-io_txsht,
50 itab_bapi-io_txlng,
75 itab_bapi-io_datatype,
85 itab_bapi-io_length.
endloop.
SELECT THE LOCATION FOR TEXT FILE
AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_filename = ''
def_path = 'C:\'
mask = ',Documentos de texto (*.txt), *.txt.'
mode = ''
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
find '.txt' IN p_file.
if sy-subrc <> 0.
concatenate p_file '.txt' into sel_file.
else.
sel_file = p_file.
endif.
Change InfoObject Catalog through BAPI Function
*CALL FUNCTION 'bapi_iobc_change'
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(INFOOBJCAT) LIKE BAPI6113-INFOOBJCAT
*" VALUE(DETAILS) LIKE BAPI6113 STRUCTURE BAPI6113
*" TABLES
*" INFOOBJECTS STRUCTURE BAPI6113IO
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
Create InfoObject through BAPI Function
CALL FUNCTION 'BAPI_IOBJ_CREATE'
IMPORTING
INFOOBJECT = itab_bapi-io_name
TYPE = itab_bapi-io_type
TEXTSHORT = itab_bapi-io_txsht
TEXTLONG = itab_bapi-io_txlng
DATATP = itab_bapi-io_datatype
INTLEN = itab_bapi-io_length.
*EXPORTING
INFOOBJECT = itab_bapi-io_name
RETURN = BAPIRET2.
TABLES
COMPOUNDS STRUCTURE BAPI6108CM OPTIONAL
ATTRIBUTES STRUCTURE BAPI6108AT OPTIONAL
NAVIGATIONATTRIBUTES STRUCTURE BAPI6108AN OPTIONAL
ATRNAVINFOPROVIDER STRUCTURE BAPI6108NP OPTIONAL
HIERARCHYCHARACTERISTICS STRUCTURE BAPI6108HC OPTIONAL
ELIMINATION STRUCTURE BAPI6108IE OPTIONAL
RETURNTABLE STRUCTURE BAPIRET2 OPTIONAL
Activate InfoObject through BAPI Function
*CALL FUNCTION 'BAPI_IOBJ_ACTIVATE_MULTIPLE'
*" TABLES
*" INFOOBJECTS STRUCTURE BAPI6108IO
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
*" INFOOBJECTS_ERROR STRUCTURE BAPI6108IO OPTIONAL
If anyone knows any better idea creating IO dynamically, I can look at that too. Appreciate your help.
Regards,
Mauwhat are your reference points
Is it always from current date then it that case your data will change daily.
Also is there a created date or something else associated with store id. how do you determine that -
Batch Number creation through DIAPI
Dear all,
i tried batch number creation through DIAPI.. but its shows error message [WTR1.Whscode][Line:1],'No matching Records found(ODBC-2028)' any body helpme in this regard..
thanks in advance.. here i have attached my coding..
Dim objLines As SAPbobsCOM.StockTransfer_Lines
objForm = objAddOn.objApplication.Forms.Item(FormUID)
Dim objStockTransfer As SAPbobsCOM.StockTransfer
objStockTransfer = objAddOn.objCompany.GetBusinessObjectSAPbobsCOM.BoObjectTypes.oStockTransfer)
objStockTransfer.DocDate = System.DateTime.Today
objStockTransfer.TaxDate = System.DateTime.Today
objStockTransfer.FromWarehouse = "01"
objStockTransfer.PriceList = 1
objStockTransfer.Lines.ItemCode = "B000001"
objStockTransfer.Lines.Quantity = "1"
objStockTransfer.Lines.WarehouseCode = "BAP"
objStockTransfer.Lines.BatchNumbers.BatchNumber = "B10"
objStockTransfer.Lines.BatchNumbers.Quantity = "1"
objStockTransfer.Lines.BatchNumbers.Add()
If objStockTransfer.Add <> 0 Then
objAddOn.objApplication.SetStatusBarMessage(objAddOn.objCompany.GetLastErrorDescription, SAPbouiCOM.BoMessageTime.bmt_Short, True)
objAddOn.objApplication.MessageBox(objAddOn.objCompany.GetLastErrorDescription)
Else
objAddOn.objApplication.SetStatusBarMessage("Inventory Transfered Successfully", SAPbouiCOM.BoMessageTime.bmt_Short, False)
End If
With Regards
G.shankar GaneshShankar,
your code looks fine. just ensure that the warehouse code and batch you are specifying , do exist in owhs and oibt tables respectively, with the specified quantity. ( and the best way to check it is, try stock transfer from UI with the same parameters.)
also, may be off topic, but, before specifying batch lines, you need to ensure that items are managed by batch or not )
regards,
Binita -
Exception while accessing web service through code
I have a web service developed using AXIS deployed on Weblogic 8.1
Another web application cotaining GUI deployed on Weblogic 10 tries to access this web service through code.
This piece of code to invoke the web service is written in Action Class present inside web application. (Struts is used in GUI based web app)
When the code tries to invoke web service I am getting following error.
(401)Unauthorized xxx
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:630)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:128)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:1753)
at com.ebv.app.web.action.UCS77_1ProcessOfficialChangeSaveDetailsAction.invokeAx(UCS77_1ProcessOfficialChangeSaveDetailsAction.java:243)
at com.ebv.app.web.action.UCS77_1ProcessOfficialChangeSaveDetailsAction.callUCS77_1ProcessOfficialChangeWebService(UCS77_1ProcessOfficialChangeSaveDetailsAction.java:173)
at com.ebv.app.web.action.UCS77_1ProcessOfficialChangeSaveDetailsAction.processAction(UCS77_1ProcessOfficialChangeSaveDetailsAction.java:133)
at com.ebv.framework.web.action.EBVAction.execute(EBVAction.java:106)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
The web service URL is as follows:
http://10.140.96.5:7808/services/ucs77_1/ProcessOfficialChangeSave77_1-v0001.soap
However
When I try to hit the webservice URL directly on browser login window appears where same username/password I provide which are passed in code to invoke the web service. I get the success page indicating that web service is invoked on hitting enter.
The method used in UCS77_1ProcessOfficialChangeSaveDetailsAction.java to invoke web service is as follows:
public String invokeAx
String xmlMessage,
String webServiceURL,
String webServiceOperation,
String username,
String password)
String xmlResponse = null;
Call webServiceCall = null;
InputStream input = new ByteArrayInputStream(xmlMessage.getBytes());
Service service = new Service();
try
webServiceCall = (Call) service.createCall();
SOAPEnvelope env = new SOAPEnvelope(input);
SOAPEnvelope resEnv = null;
webServiceCall.setTargetEndpointAddress(new URL(webServiceURL));
webServiceCall.setOperationName(new QName(webServiceOperation));
webServiceCall.setUsername(username);
webServiceCall.setPassword(password);
try
resEnv = webServiceCall.invoke(env);
catch (AxisFault e)
e.printStackTrace();
Message responseMessage = webServiceCall.getResponseMessage();
SOAPEnvelope soapXml = (SOAPEnvelope) responseMessage.getSOAPEnvelope();
xmlResponse = new String(soapXml.toString().getBytes(AppConstants.UTF8),AppConstants.UTF8);
if (xmlResponse == null)
xmlResponse = resEnv.toString();
catch (Exception e1)
e1.printStackTrace();
return xmlResponse;
Both the weblogic server reside on two different AIX machines.
Can anybody tell what's the problem while invoking web service through code?time to look into the gateway logs as stated by the fault ..
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xmlns:p="http://schemas.oblix.com/ws/2003/08/Faults">c</faultcode><faultstring>Step execution failed with an exception</faultstring><detail></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
looks like the cipher step might have failed -
Changing the Updatable property of a View Object Attribute through code
Hi,
Is there a way to set the "Updatable" property of an attribute in a view object through code ?
I checked the API docs for the AttributeDef class but there is no method to set this. there is a constant (UPDATEABLE_WHILE_NEW) which gives the current value.
My requirements in short - I have a ADF editable Table. Based on a flag whether it is SET or NOT, i need to make a particular column such that the inputTextBox on this column must appear for only the new rows inserted into the table. For all the existing rows users should not be allowed to edit values on this column.
I know this can be controlled with the UPDATABLE property on the attribute in the view object by setting the value as "WHILE NEW".
Now i need to control this through code at runtime.
Please let me know on ow to do this.
JDev version: 11.1.2.3
Thanks.the method you are looking for is available in the AttributeDefImpl class which you can get from the EntityImpl like
this.mDefinitionObject.getAttributeDefImpl("YOUR_ATTRIBUTE_NAME").setUpdateableFlag(AttributeDef.UPDATEABLE_WHILE_NEW);
Timo -
Creating Business Partner Through Code
Hi Everyone
I just wanted to know if any of you knew a way to create a business partner through code.
If there is a way or a sample that anyone can provide that would greatly
apreciated.
What would mandatory fields be? I know CardCode would be one mandatory field but what else would be essential?Hi Sebastiano,
If you only need to read the BP data from the 'source' company then you shouldn't need to log in to it. The RecordSet object should be capable of sending a SQL query that references the other database.
For example:
string sSQL = "select * from " + sSourceDatabase +"..OCRD where CardCode = '" + sMyBPCode +"'"
where sSourceDatabase is the Database ID for the source company and sMyBPCode is the BP you wish to copy.
Using this you should only need to log in to the company where the BP needs to be created. So the whole process should be something like this:
1) Connect to second company
2) Run the query to collect the BP data from the first company
3) Create an instance of the BP object and use the recordset object to assign the properties
4) Add the BP
Hope this makes sense
Owen
P.S. The other option is to use XML. See this post:
Copy items between databases -
Automatic Asset creation through Project settlement
Dear All,
We have one issues where in AS02 AUC Asset quantity is in display mode still we can find the quantity there.
Can any body help me about the Process of Auto Asset creation through Project settlement.
I need to know how system calculate the Quantity from the Project settlement. if such type of Process exist in SAP
Thanks
Abhijeet
Edited by: Abhijeet Patil on Oct 5, 2011 3:05 PM
Edited by: Abhijeet Patil on Oct 5, 2011 3:05 PMHi,
There is process in SAP where we can create AuC from Projects. We need to have an investement profile set up and the same needs to be used in the project. You will have the details in SAP Help documnetation for this.
Regards
Sreekanth -
Idoc Generation after Purchase Order Creation through trading contract.
Hi All,
When a Purchase Order is created via trading contract, I need to generate an Idoc and pass details of the Purchase Order created to the Partner System.
Can anyone suggest any Function module or user exit which gets called while Purchase Order creation through trading contract, so that I can fill the Idoc with necessary details of the Purchase Order and send that to the Partner System?
Thanks in advance.Hi Tejas,
I do not know about Trading Contract but what all I can say it that Check if Change pointers are getting written Once the PO has been created, If "Yes" then probably you do not have to do anything for craetion of Purchanse Order. You can use RBDMIDOC Program to create IDOCs from change pointers.
Refer [this|http://help.sap.com/saphelp_nw04/helpdata/en/12/83e03c19758e71e10000000a114084/content.htm] for more information on change pointers.
Regards
Shital -
How to create a Xfdf doc. in Acrobat Pro 10 through code?
Hi All..!!!
I wanted to know whether there is a way to create an XPdf document in Acrobat Pro 10. I know that we can create a pdf document through code using the SDK.. I wanted to know whether the same can be done for XPdf documents..
Thanks!!Writing an XFDF is not that difficult; all you need is a tool allowing you to assemble text strings.
The preferred way to get a sample on how the XFDF should look like is to export one from the form concerned, and to repeat it using your code. In this case, the document knows best how the XFDF should look like.
Hope this can help.
Max Wyss. -
How to create a XPdf doc. in Acrobat Pro 10 through code?
Hi All..!!!
I wanted to know whether there is a way to create an XPdf document in Acrobat Pro 10. I know that we can create a pdf document through code using the SDK.. I wanted to know whether the same can be done for XPdf documents..
Thanks!!You're better off asking in the SDK forum:
http://forums.adobe.com/community/acrobat/acrobat_sdk -
Getting something went wrong while trying to open workbook through code?
hi,
i am getting something went wrong while trying to open workbook through code below is m code:
ES.ExcelService client = new ES.ExcelService();
client.Credentials = System.Net.CredentialCache.DefaultCredentials;
ES.Status[] status;
string sessionId = client.OpenWorkbook("http://servername/Documents/exceles.xlsx", "en-us", "en-us", out status);
i have also added modify permission to wpg_wss group but i am still getting the same error.
any help is appreciated.
thanks,
gauravHi Gaurav,
For your issue, you need to make sure the site where your workbook is stored in is a Trusted Location in Excel Service Application:
http://technet.microsoft.com/en-in/library/ff191194(v=office.14).aspx
For more information, you can have a look at the blog:
http://blogs.msdn.com/b/cumgranosalis/archive/2006/03/24/excelserviceshelloworld.aspx
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Accessing Party EDI details through code in 2013
Hi,
We are looking at options of accessing the Party EDI details from orchestration in BTS 2013 R2. But looks like the property X12Receiver belonging to the partner object Microsoft.BizTalk.Edi.PartnerAgreementManager.Partner
has been deprecated. Although, using the property does not give a compilation error, it throws exception during runtime with the below error:
System.Data.SqlClient.SqlException (0x80131904): Could not find stored procedure 'edi_PartnerX12InterchangeSelect'.
Any pointers on how the accessing of party EDI details through code/within orchestration can be achieved? Appreciate any help on this regards. Thanks.Refer "Custom Party Resolution" sample available in the BizTalk SDK -
http://msdn.microsoft.com/en-in/library/aa559134.aspx and pay specific attention to the code in "PartyResolutionStream.cs". This has the logic for querying the BizTalk Party database tables.
You can expose you own library/helper with this code and leverage it in the orchestration.
That having said, if you use the EDI Pipelines, the party resolution is done for you and available on the received message in the orchestration as promoted property. Refer
http://msdn.microsoft.com/en-us/library/bb226500.aspx
Regards. -
Creating UDO through code with 1 Docment table & 4 Document Line Tables
Hi,
I need to create one Document table and four Document Line tables(child tables) and make them UDO through code. This process is working When I am creating UDO with one Document table and one Document Line table but if I add more than one Child table it is taking only one child.... Can anyone give me some solution or code example related to this problem this problem?
Regards,
Sudeshna.Hi,
Firstly Trinidad, unfortunately I could not open that link.
And secondly, the following is my code... Through this code I am trying to create an UDO with one document table and two document line tables.... here the UDO is being created but it is not taking two line table, its taking only one Document line table.... how can I create udo with more than one Document line tables?
Dim oUserObjectMD As SAPbobsCOM.UserObjectsMD
oUserObjectMD = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserObjectsMD)
oUserObjectMD.CanCancel = SAPbobsCOM.BoYesNoEnum.tYES
oUserObjectMD.CanClose = SAPbobsCOM.BoYesNoEnum.tYES
oUserObjectMD.CanCreateDefaultForm = SAPbobsCOM.BoYesNoEnum.tYES
oUserObjectMD.CanDelete = SAPbobsCOM.BoYesNoEnum.tYES
oUserObjectMD.CanFind = SAPbobsCOM.BoYesNoEnum.tYES
oUserObjectMD.CanLog = SAPbobsCOM.BoYesNoEnum.tNO
oUserObjectMD.CanYearTransfer = SAPbobsCOM.BoYesNoEnum.tYES
oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tYES
oUserObjectMD.ChildTables.TableName = "childSplitNew1"
oUserObjectMD.ChildTables.TableName = "childSplitNew2"
oUserObjectMD.Code = "udoSplitNew"
oUserObjectMD.ManageSeries = SAPbobsCOM.BoYesNoEnum.tNO
oUserObjectMD.Name = "udoSplitNew"
oUserObjectMD.ObjectType = SAPbobsCOM.BoUDOObjType.boud_Document
oUserObjectMD.TableName = "masterSplitNew"
lRetCode = oUserObjectMD.Add()
Regards,
Sudeshna. -
How to give acces to app to use the images in device through code
Hi,
I am writting an Iphone app, in some part of my application there is a facility to the users to upload their files , but the device is asking to give permission to the app to access files, i have to do that manually , my question is there any way to acheive that through code, In am using Xcode to create my app
Thanks.Hi Kasturi,
> not accepting the points
It worked on this and on one other thread, but this is still open: How to upload the image
> want upload the images from the client side machine
> to KM
In the thread I just referred to, I already provided information about the HTMLB upload control. With this at hand, you'll get the file from the client to the server.
At server side, get an ICollection instance where you want to store the file and create the corresponding resource. See https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/javadocs/nw04/sp12/knowledge management/com/sapportals/wcm/repository/icollection.html#createresource(java.lang.String,%20com.sapportals.wcm.repository.IPropertyMap,%20com.sapportals.wcm.util.content.IContent)
Hope it helps
Detlev
Maybe you are looking for
-
EXECUTE IMMEDIATE dynamic statement and return procedure value
Hello guys, How can i return values from procedure using EXECUTE IMMEDIATE statment? I made easy example: CREATE OR REPLACE PACKAGE pac_test IS PROCEDURE pro_calc_average( p_age_1 IN NUMBER, p_age_2 IN NUMBER, p_age_3 IN NUMBER, v_out OUT NUMBER); PR
-
I have requested to have my iphone 4 unlocked from three uk. When I receive instructions from them, do I need to connect to my own iTunes or can I connect to someone else's and/or does my contract with three still need to be active for me to unlock o
-
Connecting the iPod to a Honda or other automobile
Okay everybody - I am posting here as a warning and possible plea for help if the right people are out there. This fall, I traded my vehicle in to get a 2006 Honda Civic, enticed by many of the electronic system upgrades. The biggest and most appeali
-
I had an old version of Firefox and uninstalled it. Then I installed the 5.0 version. BUT, in the setup wizard it says "Your computer must be restarted to complete a previous uninstall of Firefox. Do you want to reboot now?" I choose "YES" and the co
-
Link to folder in a room - missing header area and navigation panel
Hello Community, I have a problem, again. While creating favorites to specific folders I got a problem while using and "publishing" them. While using the "send to..." feature the recipient gets an eMail with the link to this folder. When clicking thi