Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sd_salesdocument_create

xt_inergo
Participant
0 Likes
2,719

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,486

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        =
                  .

8 REPLIES 8
Read only

Former Member
0 Likes
2,487

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        =
                  .

Read only

0 Likes
2,486

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

Read only

0 Likes
2,486

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

Read only

0 Likes
2,486

that was the answer.

Thanks.

Read only

0 Likes
2,486

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

Read only

0 Likes
2,486

ok I found it . It was the date format.

Read only

Former Member
0 Likes
2,486

Have you called BAPI_TRANSACTION_COMMIT after the function module call ?

Read only

Former Member
0 Likes
2,486

Hi,

in the Importing parameter pass or comment testrun = testrun

and call

call function 'BAPI_TRANSACTION_COMMIT'.

Prabhudas