2006 Jun 09 1:04 PM
Hi abapers,
I m trying to create a sales document using.....but i m able getting error report....could u suggest me how to correct the program
report zr_bapi_sales_order.
DATA : T_HEADER LIKE BAPISDHEAD OCCURS 0 WITH HEADER LINE,
T_ITEM LIKE BAPIITEMIN OCCURS 0 WITH HEADER LINE,
T_PARTNER LIKE BAPIPARTNR OCCURS 0 WITH HEADER LINE,
RETURN TYPE BAPIRETURN1 OCCURS 0 WITH HEADER LINE,
SALES_DOC LIKE BAPIVBELN-VBELN,
SOLD_TO_PARTY LIKE BAPISOLDTO-SOLD_TO,
SHIP_TO_PARTY LIKE BAPISHIPTO-SHIP_TO,
PAYER LIKE BAPIPAYER-PAYER.
*PARAMETER : SALES_DOC(10) TYPE C.
T_HEADER-DOC_NUMBER = '90000876'.
T_HEADER-DOC_TYPE = 'TA'.
T_HEADER-SALES_ORG = 'OG01'.
T_HEADER-DISTR_CHAN = 'DS'.
T_HEADER-DIVISION = '10'.
APPEND T_HEADER.
T_ITEM-MATERIAL = 'SIDDI'.
T_ITEM-REQ_QTY = '9000'.
APPEND T_ITEM.
T_PARTNER-PARTN_ROLE = 'PARTNER'.
T_PARTNER-PARTN_NUMB = '10009'.
APPEND T_PARTNER.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
EXPORTING
ORDER_HEADER_IN = T_HEADER
WITHOUT_COMMIT = ' '
CONVERT_PARVW_AUART = ' '
IMPORTING
SALESDOCUMENT = SALES_DOC
SOLD_TO_PARTY = '000100111'
SHIP_TO_PARTY = '76854'
BILLING_PARTY =
RETURN = RETURN
TABLES
ORDER_ITEMS_IN = T_ITEM
ORDER_PARTNERS = T_PARTNER
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CCARD =
ORDER_CFGS_BLOB =
ORDER_SCHEDULE_EX =
. ..
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
IF RETURN-TYPE = 'S'.
WRITE 😕 'SALES ORDER', SALES_DOC , 'CREATED SUCCESSFULLY'.
ENDIF.
2006 Jun 09 1:16 PM
2006 Jun 09 1:05 PM
2006 Jun 09 1:13 PM
Hi,
Check the declaration
<b>T_HEADER LIKE BAPISDHEAD OCCURS 0 WITH HEADER LINE.
change it to
DATA : T_HEADER type BAPISDHEAD .</b>
T_HEADER-DOC_NUMBER = '90000876'.
T_HEADER-DOC_TYPE = 'TA'.
T_HEADER-SALES_ORG = 'OG01'.
T_HEADER-DISTR_CHAN = 'DS'.
T_HEADER-DIVISION = '10'.
<b>* APPEND T_HEADER. " Remove this statement</b>
Please Confirm The same & Reward Point
MARK Helpful Answers
regards
Message was edited by: Manoj Gupta
2006 Jun 09 1:13 PM
Yes ....Im not able to find where is the error in this program.....
2006 Jun 09 1:18 PM
Hi,
Please check my above post ; i think it will solve ur problem.
2006 Jun 09 2:45 PM
2006 Jun 09 1:16 PM
2006 Jun 09 2:44 PM
Hi Rich Heilman
Actually in starting i got some runtime errors but after some modifications its not coming.......While executing the program i got error message sales document not created .......Till now i didnt did any programs in bapi this is going to be my first program in bapi.....Thats y im not able recognise to problem in the program....