‎2011 Jan 13 10:19 AM
Hi,
I am running the FM SD_SALESDOCUMENT_CREATE to create sales documents.
After execution I get the following result:
SALES_HEADER_IN has been processed successfully
SALES_ITEM_IN has been processed successfully
SALES_CONDITIONS_IN has been processed successfully
Credit M.-Prod. THE 8000000633 has been saved
in export parameter SALESDOCUMENT_EX I get a value (for example 8000000633) which is a correct sales document number. But when I use transaction VA02 or VA03 and give the above number I get the message "Sales document is not available".
If I try to crete a sales documnet using VA01 the document is created successfully and takes the next sales document number (for exemple 8000000634).
Can someone help me.
Thanks in advanced.
Edited by: Odysseas Spyroglou on Jan 13, 2011 11:19 AM
‎2011 Jan 13 10:29 AM
Hi Odysseas,
Try to use the FM BAPI_TRANSACTION_COMMIT right after SD_SALESDOCUMENT_CREATE.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
* IMPORTING
* RETURN =
.
‎2011 Jan 13 10:29 AM
Hi Odysseas,
Try to use the FM BAPI_TRANSACTION_COMMIT right after SD_SALESDOCUMENT_CREATE.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
* IMPORTING
* RETURN =
.
‎2011 Jan 13 12:10 PM
I am not using SD_SALESDOCUMENT_CREATE in a ABAP program yet. I am trying to execute it manualy to see if it runs correct and then I will use it in a program.
do I have to I run the BAPI_TRANSACTION_COMMIT manualy?
Thanks
‎2011 Jan 13 12:17 PM
Dear Odysseas,
Yes. You can execute the both functions to test.
Go to TCODE SE37, Function Module / Test / Test Sequences, then put the two FM's in the lines...
SD_SALESDOCUMENT_CREATE
BAPI_TRANSACTION_COMMIT
And press ENTER.
The two FM's will be called sequentially.
Regards,
João Henrique
‎2011 Jan 13 12:33 PM
‎2011 Jan 14 8:06 AM
Hi,
Today I wrote the following ABAP program. The problem is that I dont get the sales document number in d_vbeln. It seems that is not working. Can someone help?
Thanks in advanced
DATA: ta_BAPIPARNR LIKE BAPIPARNR occurs 0 with header line. "customers
ta_bapiparnr-partn_role = 'SH'.
ta_bapiparnr-partn_numb = customercode.
APPEND ta_bapiparnr.
ta_bapiparnr-partn_role = 'SP'.
ta_bapiparnr-partn_numb = customercode.
APPEND ta_bapiparnr.
CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
SALES_HEADER_IN = st_bapisdhd1
CONVERT_PARVW_AUART = 'X'
STATUS_BUFFER_REFRESH = 'X'
IMPORTING
SALESDOCUMENT_EX = d_vbeln
SALES_HEADER_OUT =
TABLES
RETURN = ta_BAPIRET2
SALES_ITEMS_IN = ta_bapisditm
SALES_PARTNERS = ta_bapiparnr
SALES_CONDITIONS_IN = ta_bapicond
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN =
.
Edited by: Odysseas Spyroglou on Jan 14, 2011 10:07 AM
‎2011 Jan 14 9:24 AM
‎2011 Jan 13 10:30 AM
Have you called BAPI_TRANSACTION_COMMIT after the function module call ?
‎2011 Jan 13 10:31 AM
Hi,
in the Importing parameter pass or comment testrun = testrun
and call
call function 'BAPI_TRANSACTION_COMMIT'.
Prabhudas