Hi all,
I am creating a ZBAPI for Sales order creation. In which i am calling BAPI_SALESORDER_CREATEFROMDAT2 bapi.
In this BAPI i want to give only madatory fields of Sales order creation in IMPORT Parameters.
Thats why i created my own structure with same variables and data elements of structure which is an import parameter in Standard BAPI.
But its giving Run time Error for incompatible type and length of structure.
CODE
Here is Structure:
TYPES: BEGIN OF ty_x_struct1,
DOC_TYPE TYPE AUART,
SALES_ORG TYPE VKORG,
DISTR_CHAN TYPE VTWEG,
DIVISION TYPE SPART,
REQ_DATE_H TYPE EDATU_VBAK,
PMNTTRMS TYPE DZTERM ,
END OF ty_x_struct1.
Here is Data Declaration:
DATA: x_struct1x type ty_x_struct1x,
x_struct1 TYPE ty_x_struct1.
Here is BAPI CALLING:
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = x_struct1
order_header_inx = x_struct1x
IMPORTING
salesdocument = vbeln
TABLES
return = it_ret
order_items_in = it_item_in
order_items_inx = it_item_inx
order_schedules_in = it_schlines
order_schedules_inx = it_schlinesx
order_partners = it_parnr.
Please Help. I will appriciate it.
Regards,
Sachin Bhatnagar.
Edited by: Alvaro Tejada Galindo on Jan 11, 2008 5:28 PM