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

BAPI_SALES_DEL_SCHEDULE_CREATE

Former Member
0 Likes
4,035

Hi,

BAPI_SALES_DEL_SCHEDULE_CREATE. We are using above mentioned BAPI to insert new schedule in Scheduling Agreement ( SD-va31)

I need to enter the following details

  • Customer numberof the sold-to party
  • Customer purchaseorder number
  • Material numbers
  • Order quantities for the materials

But i am not able to find  these parameter in bapi?pls give an example ?

.

1 ACCEPTED SOLUTION
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,328

ORDER_HEADER_IN has customer purchase order

PARTNERS-> You can pass sold to party detail etc

SCHEDULE_LINES-> Pass item number which will automatically pick up the material from the document

Nabheet

Hi,

BAPI_SALES_DEL_SCHEDULE_CREATE. We are using above mentioned BAPI to insert new schedule in Scheduling Agreement ( SD-va31)

I need to enter the following details

  • Customer numberof the sold-to party
  • Customer purchaseorder number
  • Material numbers
  • Order quantities for the materials

But i am not able to find  these parameter in bapi?pls give an example ?

.

18 REPLIES 18
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,329

ORDER_HEADER_IN has customer purchase order

PARTNERS-> You can pass sold to party detail etc

SCHEDULE_LINES-> Pass item number which will automatically pick up the material from the document

Nabheet

Read only

0 Likes
3,328

Hi,

Thanks for u r reply nabheet.

can i pass this value to bapi (BAPI_SALES_DEL_SCHEDULE_CREATEBAPI_SALES_DEL_SCHEDULE_CREATE)

  • sales organization,
  • distribution channel
  • division
Read only

0 Likes
3,328

I belivee it will pick up it up from the sales document which is alredy created

Read only

0 Likes
3,328

Hi,

can i pass the scheduling agreement type in bapi (

BAPI_SALES_DEL_SCHEDULE_CREATEBAPI_SALES_DEL_SCHEDULE_CREATE)

)

Read only

0 Likes
3,328

Please check field -BAPISCHDL_DEL_SCHEDREL_TYPE

Read only

0 Likes
3,328

Hi,

Srry i didnt found the field BAPISCHDL_DEL_SCHEDREL_TYPE in the bapi.

Read only

0 Likes
3,328

SCHEDULE_LINES-REL_TYPE if it helps

Read only

Former Member
0 Likes
3,328

Hi Nabheet,

I got error like this when  i execute the  bapi( in Return -table)

Field header_inx-updateflag is not an input field

regards,

kiran

Read only

0 Likes
3,328

Please share your sample code.

Read only

Former Member
0 Likes
3,328

Hi,

--------------------------Internal table declaration------------------

  DATA: lt_schedule_lines   TYPE STANDARD TABLE OF  bapischdl_del_sched,

        lt_del_schedule_in  TYPE STANDARD TABLE OF  bapisddelschd_in_del_sched,

        lt_partner          TYPE STANDARD TABLE OF  bapiparnr_del_sched,

        lt_del_schedule_inx  TYPE STANDARD TABLE OF   bapisddelschd_inx_del_sched,

        lt_return           TYPE  STANDARD TABLE OF bapiret2.

*-----------------------------------------------------------------------

*----------------------Work area declaration----------------------------

  DATA: lx_order_header_inx  TYPE bapisdh1x_del_sched,

        lx_i_schedule_lines  TYPE zaplx_s100t_creat_schdlng_line,

        lx_schedule_lines    TYPE bapischdl_del_sched,

        lx_i_partner         TYPE zaplx_s100t_creat_schdlng_part,

        lx_partner           TYPE bapiparnr_del_sched

        .

*-----------------------------------------------------------------------

*----------------------Constant Declaration-----------------------------

*  CONSTANTS:.



*-----------------------------------------------------------------------



*  lx_order_header_inx-updateflag = ' '.

  lx_order_header_inx-purch_no_c  = 'X'.





  LOOP AT i_schedule_lines INTO lx_i_schedule_lines.



    lx_schedule_lines-itm_number   = lx_i_schedule_lines-posnr.

    lx_schedule_lines-sched_line   = lx_i_schedule_lines-etenr.

    lx_schedule_lines-req_date     = lx_i_schedule_lines-edatu.

    lx_schedule_lines-date_type    = lx_i_schedule_lines-prgrs.

    lx_schedule_lines-req_qty      = lx_i_schedule_lines-wmeng.

    lx_schedule_lines-REL_TYPE     = '5'.

    APPEND lx_schedule_lines TO lt_schedule_lines.

    CLEAR lx_schedule_lines.



  ENDLOOP.



  LOOP AT i_partner INTO lx_i_partner.



lx_partner-PARTN_ROLE = lx_i_partner-PARTN_ROLE.

lx_partner-PARTN_NUMB = lx_i_partner-PARTN_NUMB.

lx_partner-ITM_NUMBER = lx_i_partner-ITM_NUMBER.

append lx_partner to lt_partner.

CLEAR lx_partner.



  ENDLOOP.







  CALL FUNCTION 'BAPI_SALES_DEL_SCHEDULE_CREATE'

    EXPORTING

      salesdocument     = i_vbeln

      ORDER_HEADER_IN   = ORDER_HEADER_IN

      order_header_inx  = lx_order_header_inx

*     SIMULATION        =

*     BEHAVE_WHEN_ERROR = ' '

*     LOGIC_SWITCH      =

    TABLES

*     ORDER_ITEM_IN     =

*     ORDER_ITEM_INX    =

      schedule_lines    = lt_schedule_lines

*     SCHEDULE_LINESX   =

*     ORDER_TEXT        =

      del_schedule_in   = lt_del_schedule_in

      del_schedule_inx  = lt_del_schedule_inx

*     CORR_CUM_QTY_IN   =

*     CORR_CUM_QTY_INX  =

      partners          = lt_partner

*     SCHEDULE_EX       =

*     DEL_SCHEDULE_EX   =

*     CORR_CUM_QTY_EX   =

*     EXTENSIONEX       =

      return            = lt_return.



Read only

0 Likes
3,328

Try passing

lx_order_header_inx-updateflag = ' U' or 'I'

Read only

Former Member
0 Likes
3,328

Hi,

thanks for u r reply,

Is there is any other bapi used for creating scheduling agreement in sd(va31 transaction)

Read only

0 Likes
3,328

I think you can use 'SD_SALESDOCUMENT_CREATE with proper document type

Read only

0 Likes
3,328

Hi nabheet,

How can i check the scheduling agreement is created or not?

Read only

0 Likes
3,328

go to VA32 and check.. If fm/bapi does not return any error

Read only

0 Likes
3,328

Hi,

I would like to know the  table get updated when we create scheduling agreement?

Read only

0 Likes
3,328

VBAK

Read only

0 Likes
3,328

Hi,

You can check the VBEP table for schedule Line data.

Thanks,

Kiran