Error while calling a function.
Hi,
below is my callable statement through which am calling a function which returns the service years of a person with personid as parameter.
But dont know why am getting an error which is returning the serviceyrs as 0.
when i try to debug, the problem is in this statement
System.out.println("the output1 is "+cs.getInt(1));
is there any problem with my code.
please look the code below
thanks
kumar
OADBTransaction txn=getOADBTransaction();
OracleCallableStatement cs = (OracleCallableStatement) txn.createCallableStatement("begin :1:=LMIG_UTILITY_PKG.GET_TOTAL_SERVICE(p_person_id => :2); end;",1);
try
cs.registerOutParameter(1,Types.INTEGER);
cs.setInt(2,Integer.parseInt(pid));
System.out.println("person id is "+pid);
System.out.println("the output1 is "+cs.getInt(1));
cs.execute();
serviceyrs= cs.getInt(1);
cs.close();
catch(SQLException sqle)
System.out.println("ERROR"+sqle.toString());
System.out.println("Service years are "+serviceyrs);
Hi, Guess u are missing the connection to the JDBC call.
Try the following...it worked for me..
Connection conn = this.getOADBTransaction().getJdbcConnection();
OracleCallableStatement ocs = null;
String param = null;
try {
String stmt = "BEGIN :1 := <PkgName>.<FunctionName>(:2); end;";
ocs = (OracleCallableStatement)conn.prepareCall(stmt);
ocs.registerOutParameter(1, OracleTypes.CHAR);
ocs.setString(2, <param>);
ocs.execute();
param = ocs.getString(1);
} catch(SQLException se)
{ throw OAException.wrapperException(se);
finally
try {
ocs.close();
return(param);
} catch(Exception e)
throw OAException.wrapperException(e);
}
Similar Messages
-
Invalid column type error while calling db function.
We are getting an exception while calling the database function which returns a Varray of objects. We are using jpub to generate the wrapper method, ran sqlj to generate the JDBC code. The environment is weblogic 5.1 EJB container with ORacle 8.1.6.0.0 database. The JDBC driver is 8.1.7 thin, sqlj version is 8.1.7. I am giving below the exception.
When the sqlj option profile=false is not set, the error is Classcast exception. Appraently the weblogic connection object can not be used to do oracle specific calls. If somebody has done similar things(creating a bean which calls the stored function with weblogic which returns the oracle object types) or know what the issue is, please let me know.
Thanks,
Vijay.
stackTrace:
java.sql.SQLException: Invalid column type
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at java.sql.SQLException.<init>(SQLException.java:43)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
at weblogic.jdbcbase.pool.Statement.registerOutParameter(Statement.java:438)
at sqlj.runtime.profile.ref.RTStatementJDBCCallable.registerOutParameter(RTStatementJDBCCallable.java:135)
at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.registerParameters(Compiled Code)
at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.getStatement(ParamRegProfile.java:101)
at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getStatement(CachedStatementProfileWrapper.java:134)
at sqlj.runtime.ExecutionContext$StatementStack.setStatement(ExecutionContext.java:995)
at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:523)
at com.xpede.calculator.processor.jdbc.NewPrdGroupPkg.maincalculator(NewPrdGroupPkg.java:341)
----------------------Weblogic essentially wrappers the Oracle JDBC driver - as you can see from the stack trace, it does not just wrapper the connection object, but also the statement object.
The SQLJ runtime does not recognize the JDBC layer anymore as an Oracle JDBC driver.
What is happening at runtime may be the following:
(1) The invalid column type likely results from SQLJ attempting to register the type as Types.OTHER (code 1111). This typecode is not supported by Oracle JDBC.
(2) The class cast exception when using Oracle objects may result from a getObject() call which returns the value in default format (such as oracle.sql.ARRAY) rather than the JPublisher-generated wrapper object.
Are you using JDK 1.2 / runtime12.zip?
In that case you can try the standard (java.sql.)SQLData interface (in JPub: -usertypes=jdbc). However, this interface will not support wrappers for VARRAYs. -
Error while calling the function which returns SQL Query!!!
Hi,
I have a Function which returns SQL query. I am calling this function in my APEX report region source.
The query is dynamic SQL and its size varies based on the dynamic "where clause" condition.
But I am not able to execute this function.It gives me the following error in APEX region source.
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Even in SQL* Plus or SQL developer also same error .
The length of my query is more than 4000. I tried changing the variable size which holds my query in the function.
Earlier it was
l_query varchar2(4000)
Now I changed to
l_query varchar2(32767).
Still it is throwing the same error.
Can anybody help me to resolve this.???
Thanks
AlakaHi Varad,
I am already using 32k of varchar2. Then also it is not working.
It is giving the same error. I think there is something to do with buffer size.
My query size is not more than 4200. Even if i give 32k of varchar2 also buffer is able to hold only 3997 size of the query only.
Error is
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Tried CLOB also. It is not working.
Any other solution for this.
Thanks
Alaka -
Error while calling FM : Function parameter "PE_LFA1" is unknown
Dear Experts,
I am trying to call a FM in my code, but somehow I am getting the following error .Please help !
My code is :
DATA : VENDOR_NO TYPE WSRS_SHVDST_RES-VENDOR_NO,
PE_LFA2 TYPE LFA1,
PE_ADDR2 TYPE BAPIADDR1,
PE_ADRPRT2 TYPE WISO_ADRPRT,
PE_RETURN2 TYPE WSRS_RETURN,
PE_LFM2 TYPE LFM1,
PE_LFB2 TYPE LFB1.
DATA:
node_vendor TYPE REF TO if_wd_context_node,
elem_vendor TYPE REF TO if_wd_context_element,
stru_vendor TYPE if_vendor_view=>element_vendor ,
item_vendorinp LIKE stru_vendor-vendorinp.
navigate from <CONTEXT> to <VENDOR> via lead selection
node_vendor = wd_context->get_child_node( name = if_vendor_view=>wdctx_vendor ).
get element via lead selection
elem_vendor = node_vendor->get_element( ).
get single attribute
elem_vendor->get_attribute(
EXPORTING
name = `VENDORINP`
IMPORTING
value = item_vendorinp ).
VENDOR_NO = item_vendorinp.
CALL FUNCTION 'WSRS_O_VENDOR_GET_DETAIL'
EXPORTING
PE_LFA1 = PE_LFA2
PE_ADDR1 = PE_ADDR2
PE_ADRPRT = PE_ADRPRT2
PE_RETURN =PE_RETURN2
PE_LFM1 = PE_LFM2
PE_LFB1 = PE_LFB2
IMPORTING
PI_VENDOR_NO = VENDOR_NO.
My Error is :
Note
The following error text was processed in the system HE6 : Function parameter "PE_LFA1" is unknown.
The error occurred on the application server hsdnt24s11_HE6_00 and in the work process 5 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: ONACTIONFETCH_VENDOR_DETAILS of program /1BCWDY/A8XPPCRFM5I0CTSGLFDT==CP
Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/A8XPPCRFM5I0CTSGLFDT==CP
Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW_PHASE_MODEL=====CP
Method: PROCESS_REQUEST of program CL_WDR_WINDOW=================CP
Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
Please help.Hi,
I will ask this way, from where did you get list of parameters for this FM? Try using pattern to call this FM, than you will be proposed with correct interface.
EDIT:
After checking it in system you should switch IMPORTING and EXPORTING
CALL FUNCTION 'WSRS_O_VENDOR_GET_DETAIL'
EXPORTING
PI_VENDOR_NO = '99'
* PI_ACCEPT_NOTFOUND =
* PI_PURCH_ORG =
* PI_COMP_CODE =
IMPORTING
PE_LFA1 = lv
* PE_ADDR1 =
* PE_ADRPRT =
* PE_RETURN =
* PE_LFM1 =
* PE_LFB1 =
Best regards
Marcin Cholewczuk
Edited by: Marcin Cholewczuk on Apr 12, 2011 1:20 PM -
Getting Error while calling Flex function from JavaScript
Hi,
I have an aspx page, which shows charts as per dropdown selection,
I am using flex charts for flex.In aspx page, i am calling an mxml function using javascript.below is the code for javascript in aspx.
Javascript code in aspx page:
<script type="text/javascript">
function callApp(formid) {
try {
var objectChart = document.getElementById("statisticsChart");
alert(objectChart.id);
objectChart.myFlexFunction(formid,get('<%=HiddenDashboardWS.ClientID %>').value);
catch (e) {
alert(e.message);
function getDropDownListvalue() {
var IndexValue = $get('<%=FormDropDownList.ClientID %>').selectedIndex;
var SelectedVal = $get('<%=FormDropDownList.ClientID %>').options[IndexValue].value;
// alert(SelectedVal);
callApp(SelectedVal);
</script>
Html code where dropdown control is placed
<asp:DropDownList CssClass="combo" ID="FormDropDownList" runat="server" AutoPostBack="false"></asp:DropDownList>
<object id="statisticsChart" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
height="220" width="680">
<param name="src" value="../swf/DashboardStatisticChart.swf" />
<param name="flashVars" value="" />
<embed name="statisticsChart" src="../swf/DashboardStatisticChart.swf" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="220" width="680" flashvars=""></embed>
</object>
Mxml code:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="white" creationComplete="initApp();" >
<mx:script>
public function initApp():void {
ExternalInterface.addCallback("myFlexFunction",myFunc);
public function myFunc(s:String,wsurl:String):void {
Formid.text = s;
webService.wsdl = wsurl;
Alert.show("webservice");
//Getdata calls webservice and gets xml data
GetData();
//showchart() will draw chart
ShowChart();
</mx:script>
</mx:Application>
Above code works perfect in ie, but in firefox, it gives An error saying “chartObject.MyFlexFunction is not a function”.
I am getting the object in javascript in all the browsers, but not the functions!
Does anyone has worked with this?
Any help will be highly appreciated.
Regards,
Nirav PatelFound the solution from here... http://74.125.153.132/search?q=cache:4BC9BY04B5EJ:livedocs.adobe.com/flash/8/main/00002201 .html+externalinterface.addcallback+not+working&cd=1&hl=en&ct=clnk&gl=in
Hope it will help others...
Regards, -
Error while calling XQuery Function with xs:date type as Argument
Hi,
I have follwing function in my DataService .
declare function tns:getXXXDetail($effectiveDate as xs:date,
$cancelDate as xs:date) as element(ns26:XXXAccount)* {
implCode
declare function tns:testGetXXXDetail($searchCriteria as element(ns15:locateMemberXXXDetail))
as element(ns26:XXXAccount)* {
for $Account in tns:getXXXDetail($searchCriteria/ns16:accountTypeDates/ns18:effectiveDate,
$searchCriteria/ns16:accountTypeDates/ns18:cancelDate)
return $Account
I am trying to test the getXXXDetail() function from testGetXXXDetail .
The searchCriteria is a complex type with date elements effectiveDate and cancelDate, both are optional
When i test with effectiveDate,cancelDate elements present in $searchCriteria its working fine.
When i remove these dates element i am getting follwing error
"expected exactly one item, got 0 items" error
Any Clue ?When i remove these dates element i am getting follwing error"expected exactly one item, got 0 items" error
Sounds like your schema for these items indicates minOccurs="1" (or relies on that as the default).
Edit the schema and change the definitions to be...
<xs:element name="effectiveDate" minOccurs="0" ... /> -
Error while calling the Mapping function module for BW Extraction
Hi
iam getting runtime error while calling the BW mapping function
The error description is as shown below.
Runtime Errors CALL_FUNCTION_UC_STRUCT
Except. CX_SY_DYN_CALL_ILLEGAL_TYPE
<b>Short text</b>
Type conflict during structure parameter transfer at CALL FUNCTION.
<b>What happened?</b>
Error in the ABAP Application Program
The current ABAP program "GP466CV1Y7W2VML1PJ3VB80KDOP" had to be terminated
because it has
come across a statement that unfortunately cannot be executed.
<b>Error analysis</b>
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "CALL_MAPPING_FUNCTION" "(FORM)", nor was it propagated by a RAISING
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
In the function "CMS_CB_BW_MAP", the STRUCTURE parameter "EXTRACT_DATA" is
typed in such a way
that only actual parameters are allowed, which are compatible in Unicode
with respect to the fragment view. However, the specified actual
parameter " " has an incompatible fragment view.
I am passing the EXTRACT_DATA parameter as specification LIKE with the associated type - corresponding structure
Please let me know how can i resolve this issue
Regards
LeonDear benarji ,
I'm having the same problem help me to correct . I have mentioned below as what error i got.
Runtime Errors CALL_FUNCTION_UC_STRUCT
Except. CX_SY_DYN_CALL_ILLEGAL_TYPE
Short text
Type conflict during structure parameter transfer at CALL FUNCTION.
What happened?
Error in the ABAP Application Program
The current ABAP program "ZDLROUTSTANDING_COPY" had to be terminated because it
has
come across a statement that unfortunately cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
not caught in
procedure "PDF" "(FORM)", nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
In the function "/1BCDWB/SF00000080", the STRUCTURE parameter "IT_WORKS_SF" is
typed in such a way
that only actual parameters are allowed, which are compatible in Unicode
with respect to the fragment view. However, the specified actual
parameter "SFTWORKS" has an incompatible fragment view.
Missing RAISING Clause in Interface
Program ZDLROUTSTANDING_COPY
Include ZDLROUTSTANDING_COPY
Row 876
Module type (FORM)
Module Name PDF
Trigger Location of Exception
Program ZDLROUTSTANDING_COPY
Include ZDLROUTSTANDING_COPY
Row 894
Module type (FORM)
Module Name PDF
Source Code Extract
Line SourceCde
864 ** i_logo = 'ENJOYSAP_LOGO'
865 * IT_LIST_COMMENTARY = I_LIST_COMMENTS1.
866
867 ENDFORM. "alv_top_of_page1
868 *&---------------------------------------------------------------------*
869 *& Form PDF
870 *&---------------------------------------------------------------------*
871 * text
872 *----------------------------------------------------------------------*
873 * --> p1 text
874 * <-- p2 text
875 *----------------------------------------------------------------------*
876 FORM pdf .
877
878 * *** Smartforms & PDF ***
879
880 ssfctrlop-no_dialog = 'X'.
881 ssfctrlop-preview = 'X'.
882 ssfctrlop-getotf = 'X'.
883 ssfcompop-tddest = 'ERP7'.
884 DATA : mcheck LIKE sy-subrc.
885 CLEAR : fm_name.
886
887 "Get Function module name for given smartform
888 CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
889 EXPORTING
890 formname = 'ZSFDLOS1'
891 IMPORTING
892 fm_name = fm_name.
893
>>>> CALL FUNCTION fm_name
895 EXPORTING
896 control_parameters = ssfctrlop
897 output_options = ssfcompop
898 mrefno = mrefno
899 * P_TITLE = MTITLE
900 IMPORTING
901 document_output_info = st_document_output_info
902 job_output_info = st_job_output_info " IT_OTF_DATA
903 job_output_options = st_job_output_options
904 TABLES
905 it_works_sf = sftworks
906 EXCEPTIONS
907 formatting_error = 1
908 internal_error = 2
909 send_error = 3
910 user_canceled = 4
911 OTHERS = 5.
912
913 IF sy-subrc NE 0.
Advance Thanks -
Type error while calling function module with in FOX formula
Hi,
I am getting following error while calling function module from FOX Formula:
"Types of parameter DAY_IN () and variable J_CALDAY(D) are inconsistent"
Following is the code:
DATA I_CALDAY TYPE 0CALDAY.
DATA N_CALDAY TYPE 0CALDAY.
DATA KYF TYPE KEYFIGURE_NAME.
FOREACH I_CALDAY, KYF.
CALL FUNCTION SLS_MISC_GET_LAST_DAY_OF_MONTH
EXPORTING
DAY_IN = I_CALDAY
IMPORTING
LAST_DAY_OF_MONTH = N_CALDAY.
{KYF, N_CALDAY} = {KYF, L_CALDAY}.
ENDFOR.
Import parameter DAY_IN is of type sy-datum (that inturn is data element SYDATUM of data type DATS - same as 0CALDAY). Not sure why error is being thrown. Any idea? Thanks.
Edited by: SAP_BOY on Dec 4, 2009 5:26 PMHi,
I think It will not identify ,though you have (data element SYDATUM of data type DATS - same as 0CALDAY).Check it out by assigning it through a variable of type D.
Data I_CALDAY TYPE D.
Hope it may work out.
Regards,
Indu -
FOTY0001 Error while calling ref:populateXRefRow function in BPEL
I am getting folowing error while invoking populateXRefRow function in BPEL.
Expression is : ref:populateXRefRow("CustomerTable","SAP","SAP001","EBS","EBS_001","ADD")
TableName - CustomerTable
Column Names- SAP,EBS
Already ran xreftables.sql script and bounced the server too but still getting the error.
Any solution?
Thanks in AdvanceHI
Usage of variables in populateXref statements in BPEL assign activities as follows :
For example, the following is not supported:
xref:populateXRefRow("apps_intg","common","common-12345",bpws:getVariableData('Receive_Read_InputVariable','Root-Element','/ns3:Root-Element/ns3:Root-Element/ns3:appname'),bpws:getVariableData('Receive_Read_InputVariable','Root-Element','/ns3:Root-Element/ns3:Root-Element/ns3:id'),"ADD")
The following is supported:
xref:populateXRefRow("apps_intg","common","common-12345",string(bpws:getVariableData('Receive_Read_InputVariable','Root-Element','/ns3:Root-Element/ns3:Root
-Element/ns3:appname')),string(bpws:getVariableData('Receive_Read_InputVariable','Root-Element','/ns3:Root-Element/ns3:Root-Element/ns3:id')),"ADD")
Please enclose the bpws:getVariableData() with string() function as populateXRefRow() expects strings as its arguments.
Hope this resolves and answers your question.
Cheers
Anirudh Pucha -
Error while activating the function module
hi,
am getting error while activating the function module i.e. program or report statement is missing.
thank you in advance
karthikhii vinu,
hi there....
make sure that the Processing type in Attributes tab is 'Normal function module'. Also chk the general data, it must be having some name in the Program Name and include name column.try checking the program names in se38, if the program is of type include or not. you can also chk by writting a program call the function module and test it
I hope this will solve the query. in my case, SAPLZ123 is the program name and LZ123U28 is the include name.
or
Its common prob with Function module.
Goto SE80->Give Function group name->Right click on it->Activate.
regards,
Shweta -
Error while calling RFC when using BSP Web Interface
Hi,
we have a problem with the Authorization when we use an Web Interface for BSP. We have assigned all roles to the user which were mentioned in the SAP standard documentation:
R_AREA
R_METHOD
R_PACKAGE
R_PARAM
R_PLEVEL
R_PM_NAME
R_PROFILE
R_STS_PT
R_STS_SUP
R_WEBITF
S_RS_ADMWB
S_RS_AUTH
S_RS_COMP
S_RS_COMP1
S_RS_DAS
S_RS_ICUBE
but we still get the error message: "Error while calling RFC".
When using a user with SAP_ALL, it works.
What can we do?
Thx for your time.
JoergActually that's surprising - because BSP (Business Server Pages) and RFC (Remote Function Call) are not related; they use totally different transport protocols (http vs. RFC). Even if an BSP application is calling a function module remotely (acting as RFC client) no authorizations for S_RFC are required - in the calling system (but in the called system, i.e. the RFC server).
Since assigning SAP_ALL seems to "cure" the problem, it seems to be an authorization issue, indeed. In that case it makes sense to use the authorization trace (ST01 - notice: that's specific to one single ABAP application server; you might have to activate the trace on multiple instances) to find out which authorizations are checked / demanded. -
Hi GuRuS,
I am working on BI 7.0. When I open the BPS workbench using Transaction bps0 and select the planning area 4TPM9000, and click on either "Variables" tab or "Master Data" tab or when I click on "Adhoc Package", I get this error " You have selected a function, to execute this the system must set up an RFC connection to another SAP System. However, setting up this connection was not successful. The following internal error message was generated: Error while calling up RFC. "
FYI I have done RFC connections between my CRM 2007 system and BI 7.0 system using Tr.SM59 and checked the connections from both the ends and it is working fine. So, pls show me the way out.
Thanks in advance,
RaghuHi...
The roles SAP_ALL and SAP_NEW are assigned for the RFCUser.
Regards,
Raghu -
Error while calling PERFORM in SAPSCRIPT
Hi all,
I am encoutering a error while calling a perform in sapscript.
Does anyone know what is the main cause?
The shortdump description is:
Short text
Missing parameter with PERFORM.
I do not know what is missing here.
/: PERFORM GET_SPRAS IN PROGRAM ZPFI_F150_DUNN
/: USING &MHNK-KUNNR&
/: CHANGING &GV_SPRAS&
/: CHANGING &GV_LAND1&
/: ENDPERFORM
*& Form GET_SPRAS
FORM GET_SPRAS TABLES intable STRUCTURE itcsy
outtable STRUCTURE itcsy
outtable2 STRUCTURE itcsy.
DATA: lv_kunnr LIKE kna1-kunnr.
CLEAR: GV_SPRAS.
lv_kunnr = intable-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_kunnr
IMPORTING
output = lv_kunnr.
SELECT SINGLE LAND1 SPRAS INTO (gv_land1, gv_spras) FROM KNA1
WHERE KUNNR = lv_kunnr.
IF sy-subrc = 0.
READ TABLE outtable INDEX 1.
outtable-value = gv_spras.
MODIFY outtable INDEX 1.
READ TABLE outtable2 INDEX 1.
outtable2-value = gv_land1.
MODIFY outtable INDEX 1.
ENDIF.
IF gv_land1 EQ 'DE'.
CLEAR: GV_LAND1,
GV_SPRAS.
ENDIF.
ENDFORM.Hi,
Though there are a lot of importing parameters, you should give only one structure for outtable, and read as index 1 and index 2.
FORM GET_SPRAS TABLES intable STRUCTURE itcsy
outtable STRUCTURE itcsy.
DATA: lv_kunnr LIKE kna1-kunnr.
CLEAR: GV_SPRAS.
lv_kunnr = intable-value.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_kunnr
IMPORTING
output = lv_kunnr.
SELECT SINGLE LAND1 SPRAS INTO (gv_land1, gv_spras) FROM KNA1
WHERE KUNNR = lv_kunnr.
IF sy-subrc = 0.
READ TABLE outtable INDEX 1.
outtable-value = gv_spras.
MODIFY outtable INDEX 1.
READ TABLE outtable INDEX 2.
outtable-value = gv_land1.
MODIFY outtable INDEX 2.
ENDIF.
IF gv_land1 EQ 'DE'.
CLEAR: GV_LAND1,
GV_SPRAS.
ENDIF.
ENDFORM.
Edited by: Srinivas Kalluri on Mar 30, 2009 5:00 AM
Edited by: Srinivas Kalluri on Mar 30, 2009 5:10 AM -
Error while calling BAPI_PARTNEREMPLOYEE_CREATE
Hi All,
I am trying to call BAPI_PARTNEREMPLOYEE_CREATE BAPI in my java application using JCO But internally this BAPI calls VAP1 screen so currently i am getting error while calling this BAPI.
please suggest to overcome this error
Thanks in advance,
AratiHi,
The issue has to be resolved by ABAPers. The process they have to follow is
a) Record screens for transaction VAP1 - BDC(If I am not wrong)
b) Create Custom BAPI(fucntion modle)- Embed the code of screen recording and include functionality of BAPI_PARTNEREMPLOYEE_CREATE in this
The above option I used. There can be possibility of alternatives to this.
regards,
ganga -
Getting error while calling this BAPI:Field MATNR has been transferred inco
Hi,
I have a rquirement to upload material master data into sap for Plant 1251.(For plant 1251 we need to upload both Basi veiw and Extended View).
I am getting the following error while calling this BAPI.Field MATNR has been transferred inconsistently or is blank
the errror is :Field MATNR has been transferred inconsistently or is blank.
I have written the below logic in the program to upload material master data into SAP.
Please help me out to resolve this issue.
Thanks in advance.
Program logic which i have wriiten in the program is
LOOP AT it_rpt.
CLEAR lwa_return.
v_tabix = sy-tabix.
IF ( it_rpt-werks EQ p_werks AND
it_rpt-matnr IS INITIAL ).
retrieve internal number
PERFORM get_internal_number USING lc_mtart
lc_mbrsh
CHANGING it_rpt-matnr.
ENDIF.
IF NOT it_rpt-matnr IS INITIAL.
PERFORM convert_field_input CHANGING it_rpt-matnr.
ENDIF.
Header data
CLEAR lwa_headdata.
lwa_headdata-material = it_rpt-matnr.
lwa_headdata-ind_sector = lc_mbrsh.
lwa_headdata-matl_type = lc_mtart.
lwa_headdata-basic_view = 'X'.
IF NOT it_rpt-vkorg IS INITIAL.
lwa_headdata-sales_view = 'X'.
ENDIF.
lwa_headdata-purchase_view = 'X'.
lwa_headdata-mrp_view = 'X'.
lwa_headdata-storage_view = 'X'.
lwa_headdata-forecast_view = 'X'.
lwa_headdata-work_sched_view = 'X'.
lwa_headdata-account_view = 'X'.
lwa_headdata-cost_view = 'X'.
*Client data
CLEAR: lwa_clientdata, lwa_clientdatax.
IF it_rpt-werks EQ c_1251.
lwa_clientdata-matl_group = it_rpt-matkl.
lwa_clientdata-old_mat_no = it_rpt-bismt.
lwa_clientdata-base_uom = it_rpt-meins.
lwa_clientdata-manu_mat = it_rpt-mfrpn.
lwa_clientdata-mfr_no = it_rpt-mfrnr.
ENDIF.
lwa_clientdata-division = it_rpt-spart.
lwa_clientdata-unit_of_wt = lc_gewei.
lwa_clientdata-trans_grp = lc_tragr.
IF it_rpt-werks EQ c_1251.
lwa_clientdatax-matl_group = 'X'.
lwa_clientdatax-old_mat_no = 'X'.
lwa_clientdatax-base_uom = 'X'.
lwa_clientdatax-manu_mat = 'X'.
lwa_clientdatax-mfr_no = 'X'.
ENDIF.
lwa_clientdatax-unit_of_wt = 'X'.
lwa_clientdatax-trans_grp = 'X'.
lwa_clientdatax-division = 'X'.
Material Description
IF it_rpt-werks EQ c_1251.
lt_matdesc-langu = sy-langu.
lt_matdesc-matl_desc = it_rpt-maktx.
APPEND lt_matdesc.
ENDIF.
*Plant data
CLEAR lwa_plantdata.
lwa_plantdata-plant = it_rpt-werks.
lwa_plantdata-availcheck = lc_mtvfp.
lwa_plantdata-mrp_type = lc_dismm.
lwa_plantdata-mrp_group = lc_disgr.
lwa_plantdata-auto_p_ord = 'X'.
lwa_plantdata-proc_type = 'F'.
IF it_rpt-werks EQ c_1251.
it_rpt-prctr = lc_prctr. "1252
ELSEIF it_rpt-werks EQ c_1261.
it_rpt-prctr = lc_prctr1. "1262
ENDIF.
lwa_plantdata-profit_ctr = it_rpt-prctr.
lwa_plantdata-period_ind = lc_perkz.
lwa_plantdata-max_stock = it_rpt-stawn.
lwa_plantdata-countryori = it_rpt-herkl.
lwa_plantdata-sloc_exprc = it_rpt-lgfsb.
CLEAR lwa_plantdatax.
lwa_plantdatax-plant = it_rpt-werks.
lwa_plantdatax-availcheck = 'X'.
lwa_plantdatax-mrp_type = 'X'.
lwa_plantdatax-mrp_group = 'X'.
lwa_plantdatax-auto_p_ord = 'X'.
lwa_plantdatax-proc_type = 'X'.
lwa_plantdatax-profit_ctr = 'X'.
lwa_plantdata-period_ind = 'X'.
lwa_plantdatax-max_stock = 'X'.
lwa_plantdatax-countryori = 'X'.
lwa_plantdatax-sloc_exprc = 'X'.
*Valuation data
CLEAR lwa_valuationdata.
lwa_valuationdata-val_area = it_rpt-werks.
lwa_valuationdata-price_ctrl = lc_vprsv.
lwa_valuationdata-price_unit = lc_peinh.
lwa_valuationdata-val_class = it_rpt-bklas.
CLEAR lwa_valuationdatax.
lwa_valuationdatax-val_area = it_rpt-werks.
lwa_valuationdatax-price_ctrl = 'X'.
lwa_valuationdatax-price_unit = 'X'.
lwa_valuationdatax-val_class = 'X'.
*Storage location
CLEAR lwa_storagelocation.
lwa_storagelocation-plant = it_rpt-werks.
lwa_storagelocation-stge_loc = it_rpt-lgort.
CLEAR lwa_storagelocationx.
lwa_storagelocationx-plant = it_rpt-werks.
lwa_storagelocationx-stge_loc = it_rpt-lgort.
*Tax Classifications
IF it_rpt-werks EQ c_1251.
it_rpt-tatyp = lc_tatyp. "u2018MWSTu2019
ELSEIF it_rpt-werks EQ c_1261.
it_rpt-tatyp = lc_tatyp1. "u2018UTXJu2019
ENDIF.
lt_taxclass-tax_type_1 = it_rpt-tatyp.
lt_taxclass-taxclass_1 = lc_taxkm.
lt_taxclass-tax_ind = lc_taxim.
APPEND lt_taxclass.
*Sales data
CLEAR: lwa_salesdata, lwa_salesdatax.
IF it_rpt-werks EQ c_1251.
it_rpt-vkorg = lc_vkorg.
ELSEIF it_rpt-werks EQ c_1261.
it_rpt-vkorg = lc_vkorg1.
ENDIF.
lwa_salesdata-sales_org = it_rpt-vkorg.
lwa_salesdata-distr_chan = lc_vtweg.
lwa_salesdata-cash_disc = lc_sktof.
lwa_salesdata-item_cat = lc_mtpos.
lwa_salesdatax-sales_org = it_rpt-vkorg.
lwa_salesdatax-distr_chan = lc_vtweg.
lwa_salesdatax-cash_disc = 'X'.
lwa_salesdatax-item_cat = 'X'.
*Forecast parameters
CLEAR: lwa_forecast, lwa_forecastx.
lwa_forecast-plant = it_rpt-werks.
lwa_forecast-fore_model = lc_prmod.
lwa_forecast-fore_pds = lc_anzpr.
lwa_forecast-hist_vals = lc_peran.
lwa_forecastx-plant = it_rpt-werks.
lwa_forecastx-fore_model = 'X'.
lwa_forecastx-fore_pds = 'X'.
lwa_forecastx-hist_vals = 'X'.
Purchasing long text
IF it_rpt-werks EQ c_1251.
IF it_rpt-tdline1 <> ' '.
lv_tdobject = 'MATERIAL'.
lv_tdid = 'BEST'.
lv_tdname = it_rpt-matnr.
PERFORM fill_longtext TABLES lt_longtext
USING lv_tdobject
lv_tdname
lv_tdid
sy-langu
it_rpt-tdline1.
ENDIF.
Basic long text
IF it_rpt-tdline2 <> ' '.
lv_tdobject = 'MATERIAL'.
lv_tdid = 'GRUN'.
lv_tdname = it_rpt-matnr.
PERFORM fill_longtext TABLES lt_longtext
USING lv_tdobject
lv_tdname
lv_tdid
sy-langu
it_rpt-tdline2.
ENDIF.
*Units of measure
CLEAR : lt_uom,lt_uomx.
lt_uom-alt_unit = it_rpt-meins.
lt_uom-alt_unit_iso = it_rpt-meins.
lt_uom-unit_of_wt = it_rpt-gewei.
APPEND lt_uom.
lt_uomx-alt_unit = it_rpt-meins.
lt_uomx-alt_unit_iso = it_rpt-meins.
lt_uomx-unit_of_wt = 'X'.
APPEND lt_uomx.
ENDIF.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = lwa_headdata
clientdata = lwa_clientdata
clientdatax = lwa_clientdatax
plantdata = lwa_plantdata
plantdatax = lwa_plantdatax
forecastparameters = lwa_forecast
forecastparametersx = lwa_forecastx
storagelocationdata = lwa_storagelocation
storagelocationdatax = lwa_storagelocationx
valuationdata = lwa_valuationdata
valuationdatax = lwa_valuationdatax
salesdata = lwa_salesdata
salesdatax = lwa_salesdatax
IMPORTING
return = lwa_return
TABLES
materialdescription = lt_matdesc
unitsofmeasure = lt_uom
unitsofmeasurex = lt_uomx
materiallongtext = lt_longtext
taxclassifications = lt_taxclass
returnmessages = it_messages.
Regards,
ReddyCan you check with below code .
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = it_rpt-matnr
IMPORTING
OUTPUT = it_rpt-matnr
EXCEPTIONS
LENGTH_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.
Move it_rpt-matnr to lwa_headdata-material .
Regard's
Smruti
Maybe you are looking for
-
Newly installed GB 11 - LOOPS ARE GONE and won't download updates
i just installed GB 11 and tried to open files. virtually all my loops are grayed out. "The software instrument or loop is not currently installed on your computer - would you like to install the complete set of loops on your computer?" i click "Down
-
How to get only custom fields from a SharePoint 2010 list?
I am working with the Client Side Object Model. In a console application I am retrieving all fields from a custom list. The problem is the Clientcontext fetches me a bunch of internal fields I do not want to be included. Also this causes some of the
-
Save and make file name change
When I save as, I want the image to be the name of the file I type so that all subsequent changes can be saved only by clicking "save" and not having to browse to and rename the file EVERY TIME. Sometimes this works properly, sometimes it doesn't. It
-
Question mark in right had corner of windows
I just had my first crash of a 1 year old macbook. after a hard reboot, i noticed that there is a question mark to the right of the search in the right hand corner of the HD window, or any other folder window. when i click on the question mark, i get
-
Multiple Guide Sets in Photoshop
I've been able to find very little documentation (mostly just user requests) about having multiple guide sets in Photoshop. I really think this would be a useful tool. Has anyone heard anything about this feature (maybe in upcoming versions - can it