Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI_SALESORDER_CHANGE HOW TO WORK ON IT

HEY ALL .

i have a specifiacation to change the sales order (not to delete sales order)

with REASON OF REJECTION = 'Z2'.

so i found out a value in ORDER_ITEM_IN to pass REASON_REJ and pass it in it...

now here is my code but i dont know why its not working...

giving me that red screen....

tell me if i am missing somethin ...

HERE IS THE ERROR....::::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

IN the function module interface u can specify only fields of aspecific type and lenght under

"ORDER_HEADER_IN".

Although the currently specified field "ORDER_HEADER_IN" is the correct type,its lengt is incorrect.

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

HERE IS THE CODE::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

ad = '10'.

loop at itab into wa.

ORDER_ITEMS_IN_wa-ITM_NUMBER = ad .

ORDER_ITEMS_IN_wa-material = wa-article.

ORDER_ITEMS_IN_wa-PLANT = WA-PLANT.

order_items_in_wa-STORE_LOC = WA-ST_LOC.

order_items_in_wa-TARGET_QTY = wa-ORDERQUAN.

order_items_in_wa-REASON_REJ = 'Z2'.

append order_items_in_wa to order_items_in.

wa_order_items_inx-UPDATEFLAG = 'U'.

WA_order_items_inx-itm_number = ad.

WA_order_items_inx-material = 'X'.

wa_ORDER_ITEMS_INx-PLANT = 'x'.

WA_order_items_inx-STORE_LOC = 'X'.

WA_order_items_inx-target_qty = 'X'.

WA_order_items_inX-REASON_REJ = 'X'.

APPEND WA_order_items_inx TO order_items_inx.

ad = ad + 10.

endloop.

ORDER_HEADER_IN-DOC_TYPE = 'ZEVT'.

ORDER_HEADER_IN-SALES_ORG = '1000'.

ORDER_HEADER_IN-DISTR_CHAN = '04'.

order_header_in-division = '01'.

order_header_inx-division = 'X'.

ORDER_HEADER_INx-DOC_TYPE = 'X'.

order_header_inx-sales_org = 'X'.

order_header_inx-distr_chan = 'X'.

order_header_inx-UPDATEFLAG = 'U'.

loop at itab into wa.

order_partners_wa-partn_role = 'AG'.

ORDER_PARTNERS_wa-PARTN_NUMB = wa-cust_no.

APPEND ORDER_PARTNERS_wa to ORDER_PARTNERS.

endloop.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

SALESDOCUMENT = VBAP_SALES_DOC_NO

ORDER_HEADER_IN = ORDER_HEADER_IN

ORDER_HEADER_INX = order_header_inx

TABLES

RETURN = IT_RETURN

ORDER_ITEM_IN = order_items_inx

ORDER_ITEM_INX = order_items_inx

PARTNERS = ORDER_PARTNERS.

.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

what lenght is it taking about....?

Edited by: shashank jaiswal on Mar 19, 2008 7:18 AM

Former Member
Not what you were looking for? View more on this topic or Ask a question