We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-abap] Runtime Error Using BAPI_SALESORDER_CHANGE

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from gkgoh on Dec 20 at 10:00 PM
Thanks Ben. Yes, you are right that the type of "l_hx" structure should be "BAPISDHD1X". The structure type that i used initially was "BAPISDHEAD1X". I thought it was correct as I found it from the function module details (SE37) for "BAPI_SALESORDER_CHANGE". If you checked the import parameters of FM "BAPI_SALESORDER_CHANGE" using SE37, you will find that the associated type for "ORDER_HEADER_INX" is "BAPISDHEAD1X".

---------------Original Message---------------
From: gk goh
Sent: Tuesday, December 20, 2011 4:27 AM
Subject: Runtime Error Using BAPI_SALESORDER_CHANGE

Hi,

I was trying to use the BAPI_SALESORDER_CHANGE to change 'Material Group 1' field. When executing the program, it kept on failing with this runtime error 'CALL_FUNCTION_CONFLICT_LENG'. Below is my codes and also the error analysis found in ST22.

Kindly please let me know my program errors.

Thanks much.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODES :-

DATA: l_vbeln TYPE bapivbeln-vbeln,
l_hx LIKE bapisdhead1x,
l_r TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE,
l_i TYPE STANDARD TABLE OF bapisditem WITH HEADER LINE,
l_ix TYPE STANDARD TABLE OF bapisditemx WITH HEADER LINE,
l_success(1) TYPE c VALUE 'Y'.

l_vbeln = '0000707671'.

l_hx-updateflag = 'U'.

l_i-itm_number = '000010'.
l_i-prc_group1 = 'Y'.
APPEND l_i.

l_ix-itm_number = '000010'.
l_ix-updateflag = 'U'.
l_ix-prc_group1 = 'X'.
APPEND l_ix.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = l_vbeln
* ORDER_HEADER_IN =
order_header_inx = l_hx
* SIMULATION =
* BEHAVE_WHEN_ERROR = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* LOGIC_SWITCH =
* NO_STATUS_BUF_INIT = ' '
TABLES
return = l_r
order_item_in = l_i
order_item_inx = l_ix
* PARTNERS =
* PARTNERCHANGES =
* PARTNERADDRESSES =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CFGS_BLOB =
* ORDER_CFGS_VK =
* ORDER_CFGS_REFINST =
* SCHEDULE_LINES =
* SCHEDULE_LINESX =
* ORDER_TEXT =
* ORDER_KEYS =
* CONDITIONS_IN =
* CONDITIONS_INX =
* EXTENSIONIN =
* NFMETALLITMS =
.

LOOP AT l_r.
IF l_r-type <> 'S'.
l_success = 'N'.
EXIT.
ENDIF.
CLEAR l_r.
ENDLOOP.

IF l_success = 'Y'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
WRITE: / 'Update successful'.
ELSE.
WRITE: / 'Update fail'.
ENDIF.



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 and
therefore caused a runtime error.
The reason for the exception is:
The call to the function module "BAPI_SALESORDER_CHANGE" is incorrect:

In the function module interface, you can specify only
fields of a specific type and length under "ORDER_HEADER_INX".
Although the currently specified field
"L_HX" is the correct type, its length is incorrect.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2011 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
gkgoh  
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Have you explored the Toolbox.com Marketplace? Learn more and access a free course now.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language