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

Multiple Sales order creation

Former Member
0 Likes
817

Hi,

I just want to know is there any method to create multiple sales order from single order.

i.e. suppose we created one order using va01 and we get the sales order number and now we want to create 100 more sales order. is there any way to make the process faster?

Plz Reply.

Thanks in advance

Hi,

I just want to know is there any method to create multiple sales order from single order.

i.e. suppose we created one order using va01 and we get the sales order number and now we want to create 100 more sales order. is there any way to make the process faster?

Plz Reply.

Thanks in advance

4 REPLIES 4
Read only

ThangaPrakash
Active Contributor
0 Likes
769

Hello Shubham,

As I understand you want to create multiple sales order for the same material and same partners.

i.e., multiple orders should be created similar to the original sales order.

Is my understanding correct ?

Regards,

TP

Read only

0 Likes
769

In that case use function module "BAPI_SALESDOCUMENT_COPY" to copy the existing sales order to create another.

Regards,

TP

Read only

Former Member
0 Likes
769

Thanks for the reply TP, u understand correct. but can u explain in detail how it works as I am new to SAP and don't know the coding part my main functionality is through GUI. So if u can help it will be more helpful.

Thanks

Read only

0 Likes
769

Create a Z* program and call the function module "BAPI_SALESDOCUMENT_COPY" inside the program like below, so based on the number those many sales orders will be created.


PARAMETERS: order LIKE vbak-vbeln,

            type LIKE vbak-auart,

            no TYPE i.

DATA:       c_lv_vbeln TYPE bapivbeln-vbeln,

            itab_lt_return TYPE TABLE OF bapiret2,

            str_ls_return TYPE bapiret2.

DO no TIMES.

  CALL FUNCTION 'BAPI_SALESDOCUMENT_COPY'

    EXPORTING

      salesdocument   = order

      documenttype    = type

      testrun         = ' '

    IMPORTING

      salesdocument_ex = c_lv_vbeln

    TABLES

      return          = itab_lt_return.

  READ TABLE itab_lt_return INTO str_ls_return WITH KEY type = 'E'.

  IF sy-subrc EQ 0.

    WRITE:/ 'Sales document creation failed'.

  ELSE.

    WRITE:/ 'Sales document', c_lv_vbeln, 'cretaed'.

  ENDIF.

ENDDO.

Regards,

TP