SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Error using BAPI_SALESORDER_CHANGE



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
skolev
Участник
Участник



Joined: 27 Mar 2009
Posts: 5

PostPosted: Mon Jun 22, 2009 4:15 pm    Post subject: Error using BAPI_SALESORDER_CHANGE Reply with quote

Hi,
I'm trying to change qty in the item of the document via VA02 using BAPI_SALESORDER_CHANGE.
I'm passing the required data, but in the return table I am receiving an error message "Enter document number".
Below is my code. Did I miss something ?

Code:
DATA: s_order_header_in LIKE bapisdh1.
DATA: s_order_header_inx LIKE bapisdh1x.

DATA: BEGIN OF i_order_item_in OCCURS 0.
INCLUDE STRUCTURE bapisditm.
DATA: END OF i_order_item_in.
DATA: BEGIN OF i_order_item_inx OCCURS 0.
INCLUDE STRUCTURE bapisditmx.
DATA: END OF i_order_item_inx.
DATA: BEGIN OF it_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA: END OF it_return.

DATA: BEGIN OF i_sched OCCURS 10.
INCLUDE STRUCTURE bapischdl.
DATA: END OF i_sched.

DATA: BEGIN OF i_schedx OCCURS 10.
INCLUDE STRUCTURE bapischdlx.
DATA: END OF i_schedx.
s_order_header_inx-updateflag = 'U'.

i_order_item_in-itm_number = vbap-posnr.
i_order_item_in-TARGET_QTY = rv45a-zzqty.
i_order_item_inx-updateflag = 'U'.
i_order_item_inx-itm_number = vbap-posnr.
i_order_item_inx-TARGET_QTY = 'X'.
APPEND: i_order_item_in, i_order_item_inx.

i_sched-itm_number = vbap-posnr.
i_sched-sched_line = '0002'.
i_sched-req_qty = rv45a-zzqty.
APPEND i_sched.
i_schedx-itm_number = vbap-posnr.
i_schedx-sched_line = '0002'.
i_schedx-updateflag = 'U'.
i_schedx-req_qty = 'X'.
APPEND i_schedx.

IF sy-subrc = 0.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = xvbap-vbeln
order_header_in = s_order_header_in
order_header_inx = s_order_header_inx
behave_when_error = 'P'
TABLES
return = it_return
order_item_in = i_order_item_in
order_item_inx = i_order_item_inx
schedule_lines = i_sched
schedule_linesx = i_schedx.

ENDIF.
Back to top
View user's profile Send private message
ghost
Специалист
Специалист


Age: 37
Joined: 18 Jan 2008
Posts: 71
Location: Tashkent-Astana-Moscow

PostPosted: Tue Jun 23, 2009 8:57 am    Post subject: Reply with quote

Are u sure that xvap-vbeln has any value ? Have u check it ? And it may well be that another problem is passing as parameter empty structure s_order_header_in .


BAPI_SALESORDER_CHANGE - Sales order: Change Sales Order

_________________
Пользователь не знает, чего он хочет, пока не увидит то, что он получил. (Э. Йодан)
Back to top
View user's profile Send private message Send e-mail Blog
skolev
Участник
Участник



Joined: 27 Mar 2009
Posts: 5

PostPosted: Wed Jun 24, 2009 1:54 pm    Post subject: About BAPI_SALESORDER_CHANGE Reply with quote

Yes I'm sure xvbap-vbeln has a value. Please help me which parameters I should pass to s_order_header_in in order to have working BAPI.

Thanks

Stefan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.