Problem in database fields creation using default class of B1DE Wizard
Hi Experts
In an AddOn I am creating database fields in default class "Project_DB'. It does not give any message weather it creates fields or not. My code for database creation is given below
Namespace FormARE
Public Class FormARE_Db
Inherits B1Db
Public Sub New()
MyBase.New
B1Connections.theAppl.StatusBar.SetText("Please wait. AddOn is updating database", BoMessageTime.bmt_Long, BoStatusBarMessageType.smt_None)
Columns = New B1DbColumn() {New B1DbColumn("OCRD", "BondNo", "Bond No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OCRD", "BFrDate", "Bond From Date", BoFieldTypes.db_Date, BoFldSubTypes.st_None, 10, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OCRD", "BTDate", "Bond To Date", BoFieldTypes.db_Date, BoFldSubTypes.st_None, 10, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "Cntner_no", "Container No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "Cntnr_Seal", "Container Seal No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "Cust_Seal", "Custom Seal No.", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1), New B1DbColumn("OINV", "ctryOrgn", "Country of Origin", BoFieldTypes.db_Alpha, BoFldSubTypes.st_None, 20, New B1WizardBase.B1DbValidValue(-1) {}, -1)}
GC.Collect()
B1Connections.theAppl.StatusBar.SetText("Successfully updated database", BoMessageTime.bmt_Short, BoStatusBarMessageType.smt_Success)
End Sub
End Class
End Namespace
It does not give first message. and second message come properly and immediately when I start the AddOn. I checked it makes all fields accuratly. But when I open the related form it gives error message "Data Source not found". I checked fields name are same as used in form and database .What can the reason? Should I use a simple function for creation of database fields which will run when a button is pressed? Is it fine to using default class for database fields creation?
Thanks
Best Regards
Jitender
I solved the problem.
Procedure I followed :
UNINSTALL ORACLE WRAEHOUSE BUILDER SOFTAWARE.
'GLOBAL_NAMES = FALSE' in init.ora file.
RESTARTED MY MACHINE.
INSTALL THE ORACLE WRAEHOUSE BUILDER SOFTAWARE.
Similar Messages
-
RE: What's database field are used in crystal report file?
Hi all
Please help me a C# code that using Crystall Report API (Crystal Report XI- Develop license) to get the list of database fieldname that using in crystal Report file. (What's database field using in header section ,group section , detail section of report.....)
We looking forward to hearing from you
Thanks
SonHello Son,
please use this code below to get a list of used database fields in a report :
//File Name: CS_Get_report_data_out_inproc.sln
//Created: April 11, 2008
//Author ID: FLI
//Purpose: This C# .NET sample Windows application demonstrates
// how to retrieve report data and put the into a XML file
// using unmanaged RAS.
// Note this is available without a dedicated RAS with SP2 for XI R2
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.ReportAppServer.ClientDoc;
using CrystalDecisions.ReportAppServer.Controllers;
using CrystalDecisions.ReportAppServer.DataDefModel;
namespace CS_Get_report_data_out_inproc
public partial class Form1 : Form
// CR Declarations
ReportDocument boReportDocument;
ISCDReportClientDocument boReportClientDocument;
public Form1()
InitializeComponent();
//Create a new ReportDocument
boReportDocument = new ReportDocument();
// load the RPT file
boReportDocument.Load("..
ReportData.rpt");
// show in reportviewer
crystalReportViewer1.ReportSource = boReportDocument;
private void button1_Click(object sender, EventArgs e)
//Access the ReportClientDocument in the ReportDocument (EROM bridge)
boReportClientDocument = boReportDocument.ReportClientDocument;
// Retrieve the Rowset Controller
RowsetController boRowsetController = boReportClientDocument.RowsetController;
// Retrieve the metadata (column headers) - this allows you to only retrieve the data that is on the report.
RowsetMetaData boRowsetMetaData = new RowsetMetaData();
Fields boFields = boReportClientDocument.DataDefinition.ResultFields;
boRowsetMetaData.DataFields = boFields;
// Now print out the data in XML file
//(Note: This will print out the results of formulas too)
StreamWriter sw = new StreamWriter("C:
ReportData.xml", false);
sw.WriteLine("<?xml version='1.0' encoding='utf-8'?>");
sw.WriteLine("<ReportData>");
sw.WriteLine("<Reportheader>");
// Print out the titles
for (int i = 0; i < boFields.Count; i++)
String boFieldName = boFields<i>.Name;
sw.WriteLine("<ReportheaderDetail>" + boFieldName + "</ReportheaderDetail>");
sw.WriteLine("</Reportheader>");
//Create the cursor which lets us loop through the data
RowsetCursor boRowsetCursor = boRowsetController.CreateCursor(null, boRowsetMetaData, 1);
Record boRecord;
while (boRowsetCursor.IsEOF == false)
sw.WriteLine("<Customer>");
boRecord = boRowsetCursor.CurrentRecord;
for (int j = 0; j < boFields.Count; j++)
try
sw.WriteLine("<Detail>" + (String)boRecord[j].ToString() + "</Detail>");
catch (Exception err)
sw.WriteLine("<Error>" + err.Message + "</Error>");
sw.WriteLine("</Customer>");
boRowsetCursor.MoveNext();
sw.WriteLine("</ReportData>");
// CLose the file
sw.Close();
MessageBox.Show("XML File 'ReportData.xml' successfully created on C:"); -
CR Database Fields doesn't display classes from a referenced project
Hi,
I created a website and a class library project. The website have a reference to a class library.
I added a new Crystal Report item to the website (CrystalReport.rpt), and on the Database Expert screen, in the Database Fields section I need to select fields that are members of classes in the class library (referenced project). Only the website classes appear in the list.
Is there a way to do this?
Thanks.if i understand correctly you added data to the dataset the report is using?
you need to verify the database to pull in the new fields
database
verify database
you should then see the fields in the db expert -
Please Help: Problem - Combining database fields in a text object
Hello
Thank you for viewing my thread and any helpful feedback you may provide. I am having trouble with the "Combining database fields in a text object" tutorial in the Help under: Quick Start\Quick Start for new users\Combining database fields in a text object.
After following the steps and previewing, I see the last name, first name stacked on top of each other in preview and design view. I don't know why this is happening. Can anyone point me in the right direction so the text is displayed the same way as it is in the Help?
Thanks
MHi,
I don't think the field is actually in the text object but just stacked on top of it.
When you double-click on the text object, you the cursor should be inside it now. Is the database field in there? If not, then you can drag and drop it into the text object where you want it to go.
You will know if it's going in because the edit cursor will show you where in the text object it will drop.
The other way to do it is to drop the database field on the report somewhere and copy it to the clipboard and paste it into the text object.
Good luck,
Brian -
Problem with Multiple record creation using BAPI BAPI_PRICES_CONDITION
Hi,
I am working on IS Media Sales And Distribution wherein i am using BAPI BAPI_PRICES_CONDITION for condition record creation in TCODE JC9B. I am able to create one record using this BAPI for one sales promotion but having problem while creation of multiple records for the same sales promotion wherein my internal table have multiple records. It gives me error that data in BAPICONDIT is missing.
I am aatching followig code for reference
BAPI have field of varkey which i am filling as combination of sales org. + distn channel + sales promotion + delivery type
In this varkey delivery type is changing for sales promotion Can be said that one sales promotion can have multiple delivery type .
Am i giving the correct varkey for each itration of internal table ?
I am attaching code for reference.
Here loop it_cond contain one promotion and multiple delivery type.
sales org distn ch promotion delivery
0100 01 zsalesprom 03
0100 01 zsalesprom z3
LOOP AT it_cond INTO wa_cond.
Get next condition number
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = 'KONH'
QUANTITY = '1'
SUBOBJECT = ' '
TOYEAR = '0000'
IGNORE_BUFFER = ' '
IMPORTING
number = number
QUANTITY =
RETURNCODE =
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
BUFFER_OVERFLOW = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Here i am concacating varkey for each new delivery
CLEAR : l_min,l_length,l_var.
CONCATENATE wa_cond-vkorg wa_cond-vtweg wa_cond-wrbakt INTO l_var.
l_length = STRLEN( l_var ).
IF l_var+14(2) IS INITIAL.
WRITE wa_cond-lifart TO L_VAR+14.
l_length = STRLEN( l_var ).
ENDIF.
W_LINE = W_LINE + 1.
*First table in BAPI
wa_bapicondct-operation = '009'.
wa_bapicondct-cond_usage = 'A'.
wa_bapicondct-table_no = '506'.
wa_bapicondct-applicatio = 'J0'.
wa_bapicondct-cond_type = 'RATE'.
wa_bapicondct-varkey = l_var.
wa_bapicondct-valid_to = wa_cond-datbi.
wa_bapicondct-valid_from = wa_cond-datab.
wa_bapicondct-cond_no = number. "
APPEND wa_bapicondct TO it_bapicondct.
*Second table in BAPI
wa_bapicondhd-operation = '009'.
wa_bapicondhd-cond_no = number.
wa_bapicondhd-cond_usage = 'A'.
wa_bapicondhd-table_no = '506'.
wa_bapicondhd-created_by = sy-uname.
wa_bapicondhd-creat_date = sy-datum.
wa_bapicondhd-applicatio = 'J0'.
wa_bapicondhd-cond_type = 'RATE'.
wa_bapicondhd-varkey = l_var.
wa_bapicondhd-valid_from = wa_cond-datab.
wa_bapicondhd-valid_to = wa_cond-datbi.
APPEND wa_bapicondhd TO it_bapicondhd.
*Third table in BAPI
wa_bapicondit-operation = '009'.
wa_bapicondit-cond_no = number.
wa_bapicondit-cond_count = wa_cond-cond_count.
wa_bapicondit-applicatio = 'J0'.
wa_bapicondit-cond_type = 'RATE'.
wa_bapicondit-calctypcon = 'C'.
wa_bapicondit-scaletype = 'A'.
wa_bapicondit-cond_value = wa_cond-kbetr.
wa_bapicondit-condcurr = wa_cond-konwa.
wa_bapicondit-promotion = wa_cond-wrbakt.
APPEND wa_bapicondit TO it_bapicondit.
*Fourth table in BAPI
wa_bapicondqs-operation = '009'.
wa_bapicondqs-cond_no = number.
wa_bapicondqs-cond_count = wa_cond-cond_count.
wa_bapicondqs-currency = wa_cond-kbetr.
wa_bapicondqs-condcurr = wa_cond-konwa.
wa_bapicondqs-cond_unit = 'EA'.
wa_bapicondqs-LINE_NO = W_LINE."'0001'.
APPEND wa_bapicondqs TO it_bapicondqs.
*Fifth table in BAPI
wa_bapicondvs-operation = '009'.
wa_bapicondvs-cond_no = number.
wa_bapicondvs-cond_count = wa_cond-cond_count.
wa_bapicondvs-currenckey = wa_cond-konwa.
wa_bapicondvs-currenciso = wa_cond-konwa.
wa_bapicondvs-currency = wa_cond-kbetr.
wa_bapicondvs-condcurr = wa_cond-konwa.
wa_bapicondvs-curren_iso = wa_cond-konwa.
wa_bapicondvs-LINE_NO = W_LINE."'0001'.
APPEND wa_bapicondvs TO it_bapicondvs.
CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
EXPORTING
PI_INITIALMODE = ' '
PI_BLOCKNUMBER =
TABLES
ti_bapicondct = it_bapicondct
ti_bapicondhd = it_bapicondhd
ti_bapicondit = it_bapicondit
ti_bapicondqs = it_bapicondqs
ti_bapicondvs = it_bapicondvs
to_bapiret2 = it_bapiret2
to_bapiknumhs = it_bapiknumhs
to_mem_initial = it_cnd_mem_initial
EXCEPTIONS
update_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
RETURN =
CLEAR : wa_bapicondct,wa_bapicondhd,wa_bapicondvs,wa_bapicondqs.
CLEAR : wa_bapicondit.
ENDLOOP.
ENDIF.
ENDIF.
Kindly Suggest.
Thanks
ParagSolved By myself
There is problem while passing data to internal table for item level -
Problem in customer master creation using BAPI_CUSTOMER_CREATEFROMDATA1
Hi Guru's...
i am unable to go forward...
can you please help me out in this customer master creation....
what are the fileds i am using while creating in XD01 (account group,name,country)then i am able create and the customer number is autogenerated.
using same field values i am trying to test the BAPI initially but i am unable to execute the BAPI BAPI_CUSTOMER_CREATEFORMDATA1.
in this one draw back is when compare to the XD01 peocess is account group.
account group is mandataory in XD01 process and in BAPI test there i sno field for giving this account group field value.....may be this is one reason....(if it is mandatory where i have to provide in BAPI test..)
and i tried in BAPI test using customer reference ID also....
please guide me....
please let me know if my question is not clear...
Thanks in advance
Srinivas...thanks rajani ur valuble reply..
but i am looking for creating at a time 'n' number of customer's using BAPI (the coustomers data will be in flat file in presentation server....)
please advise me ..
let me know if my question is not clear...
thanks in advance
srinivas.... -
Hi Experts,
I am facing a strange problem in SAP. I have a scenario where I am integrating a .Net application with SAP R/3 via SAP XI.
The .Net application is calling XI web service via SOAP adapter. The XI then sends the data to the SAP R/3 system via RFC adapter.
XI calls the BAPI u201CBAPI_INTERNALORDER_CREATEu201D to create a new internal order in the R/3 system.
This scenario works perfectly fine when tested via XIu2019s runtime workbench or any SOAP or web service testing tool. New internal order gets created in the R/3 system without any issue. But when I test the same via the .Net application I found that the order is getting created properly but some fields like currency and cost center are disabled or grayed out in change mode. Have you encountered this problem earlier? Any clue what could be the root cause?
Please help!
thanks
GopalHi Sampanth,
I think you did not understood my scenario. In real time or production situation I have to use .Net application to send data to XI. The XI will then send the same to R/3 system to create the internal order.
The .Net code is calling the XI's webservice using C# code and sends the data as a SOAP request.
How can .Net code grayout some fields in SAP R/3 system? Can you elaborate on what are you trying to explain?
Thanks
Gopal -
Problem in Database View Creation
Hi,
I was creating a view on few base tables and need to build a datasource on that view to extract the current(Today's) data using a Remote cube onto a report. The selection to be used in the view is SY-DATUM. I could not give this value in the database view but when i am using the Maintanence view it says the cardinality is not established ie there is a problem with joins,i could not have all the required joins with base tables. But while creating database view i could get relations to all necessary base tables but only problem is using of SY-DATUM in selection condition of view.
Could any one of you suggest some solution to overcome this.
Thanks,
RajuSiva,
While creating the view, you mentiond the tables, right?
Instead of mentioning the table name, mention the view name.
Regards,
Ravi
Note : Please reward the posts that help you. -
Problem in XML Message creation using ABAP Proxy
Hi,
I am trying to send the data from ECC to CRM when post goods issue is done for a delivery from ECC side using ABP Proxy. I called my proxy method in BADI : DELIVERY_PUBLISH.
And after calling the method, I used commit work also.
But the problem is, some times it is working fine. and some times the XML messages are not getting created. When I go in debug, looks everything is fine.
I am unable to understand why this inconsistency.
Could you please help me out, do I need to take any more precautions.
Thanks,
SandeepHi,
There is no problem in the proxy. Some small problem in the database update.
It is solved.
cheers
san -
Problem with Database Initialization when using Configuration Manager (ubuntu-jboss-mysql)
Hello,
When I try to initialize the database using Configuration Manager, the following error occurs:
ALC-TTN-002-001: JDBC datasource lookup failed for resource reference [java:comp/env/jdbc/
IdpDs]. The most likely cause is that a datasource having a JNDI
name of [IDP_DS] does not exist or is misconfigured. Check the application
server's configuration.
I DO have an IDP_DS datasource configured in jboss. I carefully followed the Jboss configuration instructions, so I don't really understand which is the issue here.
Anyone encountered a similar problem? Any help?
Many thanks in advance,
ArturData source files have to end with ds.xml and should be copied to the /deploy folder of your JBoss configuration (all) for them to be picked up by JBoss.
If the file was edited in Windows, make sure it does not contain DOS characters. Ubuntu Linux is not a supported LiveCycle OS platform currently. Only Red Hat Enterprise and SUSE Enterprise are. -
Custom field creation using ajax in SP 2010
Hi,
If anybody create custom field using ajax toolkit, kindly share me the link or steps.
Thanks,
Senthilyes. I have created custom field using Ajax toolkit which one available by default in VS 2010 under Ajax controls menu. do we need any other details on this, let me know.
I just drag and drop the Ajax update panel in aspx page that used in custom field solution. then i just run the code and see the result on the new form in the custom list. so i dont think, we need to do more work on this.
Thanks,
Senthil -
Problems debugging Database Java remotely using JDeveloper 9i (9.04)
I am currently working on a project where we are configuring a COTS product built onto a Oracle 9i database. The product has up versioned and changed its architecture considerably to support Java on the database as well as PL/SQL in the form of an API set. My team are writing custom code to meet the clients requirements and are all proficient PL/SQL developers and have experience with Java but we are having real trouble developing and testing our code in the same way we used to in PL/SQL using tools such as TOAD and PL/SQL Developer. I have invested some time in working out how to remote debug our Java code and have had some success with JDeveloper but have run into the following issues:
1. I am unable to add Java objects or variables to the Watch but can view PL/SQL variables.
2. The reported execution of the code seems inaccurate, i.e. often when I step into the Java code, I receive an exception that prevents me for continuing but suggests little about what has gone wrong.
3. In general, debugging is a very hit or miss affair and does not appear to be a worthwhile tool in fixing code.
Has anyone managed to set up Jdeveloper so that it is as proficient as TOAD or the like in debugging Java and can suggest how to resolve these issues?
Peter
3.Topic closed. Problem was with with database generated by DBCA. Resolved by TARs on Metalink
-
Problem creating database in RHEL3 using dbca
I have installed oracle 9iR2 on RHEL3 and applied the patch 3006854
but while installing installing Net Configuration Assistant was not installed it gave an error.
now I am trying to create database using dbca but getting an error as
ORA-12546:TNS:Permission denined.
plz guide me in solving this problemAt which step/stage in DBCA you get this error?
You can try to dump out the creation scripts and run them manually see if you can get through. -
Missing Search Field when using 3.1 Create App Wizard ?
Hi
2 points which look like bugs to me;
1 - In all previous versions whenever I used the create app wizard to build up a list of pages, reports always included the 'search across any varchar field' funtionality. This seems to have disappeared when using the Classic form of reports. It is obviously there if you use an Interactive report.
2 - Again when using the Create App wizard, if I use the Classic form (in order to be able to also 'Generate Analysis Pages') these do get built, but not linked in any way (tab, list region, button etc) to any other pages. I can link them myself, but I am demonstrating APEX here and it doesn't look so good....
Can someone just quickly confirm I am not going mad here ?
JulesHi Jules,
You're not going mad! I've reviewed the behaviour of the Search field and the Analysis Pages link using releases 3.0.1 and 3.1.1, and there is a difference in behaviour between the two versions.
Classic Reports generated via the Create Application Wizard in 3.1.1 should have a Search text field above the report region, however this field is missing. I've logged bug 7185486 for this issue. Classic Report&Forms generated via the Create Application Wizard, with the "Include Analysis Pages" option selected, are missing a link to the Analysis pages in 3.1.1. I've logged bug 7185486 for this issue. I've updated both bugs with a workaround. A fix for these issues will be available in a future release. Thanks for bringing these two issues to our attention.
Regards,
Hilary -
BAPI - Problem in Sales order creation
Hi Friends,
I have problem in Sales order creation using BAPI ,I am getting a messsage - Error in creating document ,I have sent the code along with this mail ,can you help it out.
Code:
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
PARAMETERS: p_auart TYPE auart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Sales organization
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Distribution channel
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Division.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
PARAMETERS: p_spart TYPE spart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Sold-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Ship-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Material
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Quantity.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Plant
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Data declarations.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead1.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
Initialization.
INITIALIZATION.
v_text = 'Order type'.
v_text1 = 'Sales Org'.
v_text2 = 'Distribution channel'.
v_text3 = 'Division'.
v_text4 = 'Sold-to'.
v_text5 = 'Ship-to'.
v_text6 = 'Material'.
v_text7 = 'Quantity'.
v_text9 = 'Plant'.
Start-of-selection.
START-OF-SELECTION.
Header data
Sales document type
header-doc_type = p_auart.
headerx-doc_type = 'X'.
Sales organization
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
Distribution channel
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
Division
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
Partner data
Sold to
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
Ship to
partner-partn_role = 'WE'.
partner-partn_numb = p_ship.
APPEND partner.
ITEM DATA
itemx-updateflag = 'I'.
Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
Material
item-material = p_matnr.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
Call the BAPI to create the sales order.
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
Check the return table.
LOOP AT return WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error in creating document'.
ELSE.
Commit the work.
COMMIT WORK AND WAIT.
WRITE: / 'Document ', v_vbeln, ' created'.
ENDIF.
Regards,
Dineshwhat messages u are gettting in RETURN ? Please check the RETURN tables data.
[code]CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
Regards
Prabhu
Maybe you are looking for
-
Restrict PO creation from PR.
Hi all, I have created a RFQ with reference to a PR.Can i restrict the creation of further documents (Like PO,contract scheduling agreement) from this PR. Thanks, Tess
-
XSLT 2.0 supported in Oracle BPEL ?
Hi, is XSLT 2.0 (schema-aware) supported or is there any way to change the built-in XSLT parser to Saxon or another one? Thanks.
-
Problem In moving 1 image from 1 panel to next and maintain size of original image?
Why is it when i drag one image from the bottom panel over to another picture(solid color) i will only get 50% of the image and not the full image. Same thing when i copy and paste that image over the gray solid colored image also i will get only 50%
-
Track changes of a object in Jswing Application
Hi Folks, I have a jswing application which loads a object(*xml decoder*) when it gets opened. I may make changes to this object(*xml decoder*). Finally when terminating the application i need to check if any changes made to object(*xml decoder*) if
-
On Adobe TV I found a vid for embedding movies into a Livecycle form (http://tv.adobe.com/watch/working-with-adobe-livecycle-es2/embed-video-in-a-form/#) but when I try the same steps with a Flash swf file, I fail. I see the text from my flat PDF is