Skip to Content
author's profile photo Former Member
Former Member

Planned order creation: BAPI

Hi

I trying to create planned orders using BAPI_PLANNEDORDER_CREATE but are unsuccessful.

I only filled/completed the header data. Do i have to fill the component and capacity data to successfully create the planned order?

 CALL FUNCTION 'BAPI_PLANNEDORDER_CREATE'                  
   EXPORTING                                               
     headerdata                       = l_headerdata            
   IMPORTING                                               
     return                               = l_return                
     plannedorder                     = l_plannedorder          
     createdheaderdata             = l_createdheaderdata     
     capacityheaderdata1          = l_capacityheaderdata1
   TABLES                                                  
     componentsdata                = i_componentsdata        
     createdcomponentsdata     = i_createdcomponentsdata 
     capacitydata1                    = i_capacitydata1.        
                                                           
 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'                   
  EXPORTING                                                
     WAIT          =  'X'.                                 

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 11:35 AM

    Hi,

    You can take a look at this program:

    &----


    ************************************************************************

    • PROGRAM....... YRCCPLAF

    • TITLE......... Planned Orders Outbound Interface

    • AUTHOR........ Aveek Ghose

    • DATE WRITTEN.. 15/09/2006

    • R/3 RELEASE... 4.6C

    • =====================================================================*

    • COPIED FROM... N/A

    • DESCRIPTION...

    *& Creation of planned order IDOCs to a given selection *

    *& This program selects to an input given via the selection screen the *

    *& corresponding planned orders from the database. Then the function *

    *& module for creation of planned order idocs is called. *

    *& In general this report is called from the report RCCLTRAN, but it *

    *& can also be used for its own. *

    • =====================================================================*

    • PROGRAM TYPE.. Outbound Interface

    • DEV. CLASS.... ZPLN

    • LOGICAL DB.... N/A

    • =====================================================================*

    • SCREENS....... N/A

    • GUI TITLE..... N/A

    • GUI STATUS.... N/A

    • TRANSACTIONS.. N/A

    • USER EXITS.... N/A

    • =====================================================================*

    • CHANGE HISTORY *

    • Date By Correction Number & Brief Description Release

    ----


    • Tables / Structures

    ----


    REPORT YRCCPLAF

    NO STANDARD PAGE HEADING

    MESSAGE-ID ZTRV

    LINE-COUNT 65(0)

    LINE-SIZE 255.

    .

    include YRCCL_CONSTANTS.

    DATA : CREATED_MASTERIDOCS_PLO LIKE SY-TABIX.

    ................ Definition of local data ..........................

    • parallel >>>>>>>>>>>>>>>>

    DATA: T_PLAFKEYPACK LIKE PLAF OCCURS 0 WITH HEADER LINE,

    H_COUNTER TYPE I,

    H_PARALLEL LIKE BDFIELDS-PARALLEL.

    • parallel <<<<<<<<<<<<<<<<

    DATA : F_COUNTER TYPE I. "DS001 Counter for IDocs

    *>> Global data declaration

    INCLUDE PLODATA.

    INCLUDE RCPLOTOP.

    *INCLUDE ZRCORDTOP2.

    *SELECTION-SCREEN SKIP 1.

    **>> Logical system comes from Report RCCLTRANS

    *SELECTION-SCREEN BEGIN OF LINE.

    *SELECTION-SCREEN COMMENT 3(20) TEXT-001.

    *SELECTION-SCREEN POSITION 35.

    *PARAMETERS OPT_SYS LIKE TBDLST-LOGSYS.

    *SELECTION-SCREEN END OF LINE.

    *

    **>> Messagetype comes from Report RCCLTRANS

    *SELECTION-SCREEN BEGIN OF LINE.

    *SELECTION-SCREEN COMMENT 3(20) TEXT-002.

    *SELECTION-SCREEN POSITION 35.

    *PARAMETERS MESTYP LIKE TBDME-MESTYP.

    *SELECTION-SCREEN END OF LINE.

    *

    *SELECTION-SCREEN SKIP 1.

    *

    **>> Global selection parameters

    *SELECTION-SCREEN BEGIN OF BLOCK GLOB WITH FRAME TITLE TEXT-003.

    *SELECTION-SCREEN BEGIN OF LINE.

    *SELECTION-SCREEN COMMENT 1(15) TEXT-009.

    *SELECTION-SCREEN POSITION 33.

    *PARAMETERS: DATE_FR LIKE SY-DATUM OBLIGATORY.

    *SELECTION-SCREEN COMMENT 52(3) TEXT-010.

    *SELECTION-SCREEN POSITION 58.

    *PARAMETERS: DATE_TO LIKE SY-DATUM OBLIGATORY.

    *SELECTION-SCREEN END OF LINE.

    *SELECT-OPTIONS: DISPO_GL FOR MARC-DISPO,

    • MATNR_GL FOR MARA-MATNR MATCHCODE OBJECT MAT1,

    • ARBPL_GL FOR CRHD-ARBPL MATCHCODE OBJECT CRAM,

    • WERKS_GL FOR MARC-WERKS.

    • Planning scenario not a ranges table, changed by Biegler 27.06.96

    *PARAMETERS: PLSCN LIKE PLSC-PLSCN.

    *

      • do not select from MARC, but use ranges tables directly.

      • matnr_gl and werks_gl must have the same length.

      *PARAMETERS: NO_SEL TYPE C DEFAULT ' ' NO-DISPLAY.

      *SELECTION-SCREEN END OF BLOCK GLOB.

      *

      *SELECTION-SCREEN SKIP 1.

      *

      **>> Selection for planned orders

      *SELECTION-SCREEN BEGIN OF BLOCK PLORD WITH FRAME TITLE TEXT-005.

      *SELECT-OPTIONS: DISPO_PL FOR MARC-DISPO,

      • MATNR_PL FOR MARA-MATNR MATCHCODE OBJECT MAT1,

      • ARBPL_PL FOR CRHD-ARBPL MATCHCODE OBJECT CRAM,

      • WERKS_PL FOR MARC-WERKS.

      *SELECTION-SCREEN END OF BLOCK PLORD.

      *

      *

        • Parallel >>>>>>>>>>>>>>>>

        *SELECTION-SCREEN: SKIP 1,

        • BEGIN OF BLOCK PARALLEL_PROCESSING

        • WITH FRAME TITLE TEXT-011,

        • BEGIN OF LINE,

        • COMMENT 1(30) TEXT-012 FOR FIELD RFCGR,

        • POSITION 33.

        *PARAMETERS: RFCGR LIKE BDFIELDS-RFCGR.

        *SELECTION-SCREEN: END OF LINE,

        • BEGIN OF LINE,

        • COMMENT 1(30) TEXT-013 FOR FIELD PSIZE,

        • POSITION 33.

        *PARAMETERS: PSIZE LIKE BDFIELDS-PSIZE DEFAULT 20.

        *SELECTION-SCREEN: END OF LINE,

        • END OF BLOCK PARALLEL_PROCESSING.

        • Parallel <<<<<<<<<<<<<<<<

        SELECTION-SCREEN SKIP 1.

        *>> Logical system comes from Report RCCLTRANS

        SELECTION-SCREEN BEGIN OF LINE.

        SELECTION-SCREEN COMMENT 3(20) TEXT-001.

        SELECTION-SCREEN POSITION 35.

        PARAMETERS OPT_SYS LIKE TBDLST-LOGSYS.

        SELECTION-SCREEN END OF LINE.

        *>> Messagetype comes from Report RCCLTRANS

        SELECTION-SCREEN BEGIN OF LINE.

        SELECTION-SCREEN COMMENT 3(20) TEXT-002.

        SELECTION-SCREEN POSITION 35.

        PARAMETERS MESTYP LIKE TBDME-MESTYP.

        SELECTION-SCREEN END OF LINE.

        SELECTION-SCREEN SKIP 1.

        *>> Global selection parameters

        SELECTION-SCREEN BEGIN OF BLOCK GLOB WITH FRAME TITLE TEXT-003.

        SELECTION-SCREEN BEGIN OF LINE.

        SELECTION-SCREEN COMMENT 1(15) TEXT-009.

        SELECTION-SCREEN POSITION 33.

        PARAMETERS: DATE_FR LIKE SY-DATUM. " OBLIGATORY.

        SELECTION-SCREEN COMMENT 52(3) TEXT-010.

        SELECTION-SCREEN POSITION 58.

        PARAMETERS: DATE_TO LIKE SY-DATUM. " OBLIGATORY.

        SELECTION-SCREEN END OF LINE.

        SELECT-OPTIONS: DISPO_GL FOR MARC-DISPO,

        MATNR_GL FOR MARA-MATNR MATCHCODE OBJECT MAT1,

        *MOD-002

        MATNR_EU FOR MARA-MATNR MATCHCODE OBJECT MAT1,

        *MOD-002

        ARBPL_GL FOR CRHD-ARBPL MATCHCODE OBJECT CRAM,

        WERKS_GL FOR MARC-WERKS.

        • Planning scenario not a ranges table, changed by Biegler 27.06.96

        PARAMETERS: PLSCN LIKE PLSC-PLSCN.

        • do not select from MARC, but use ranges tables directly.

        • matnr_gl and werks_gl must have the same length.

        PARAMETERS: NO_SEL TYPE C DEFAULT ' ' NO-DISPLAY.

        SELECTION-SCREEN END OF BLOCK GLOB.

        SELECTION-SCREEN SKIP 1.

        *>> Selection for planned orders

        *SELECTION-SCREEN BEGIN OF BLOCK PLORD WITH FRAME TITLE TEXT-005.

        SELECT-OPTIONS: DISPO_PL FOR MARC-DISPO,

        MATNR_PL FOR MARA-MATNR MATCHCODE OBJECT MAT1,

        ARBPL_PL FOR CRHD-ARBPL MATCHCODE OBJECT CRAM,

        WERKS_PL FOR MARC-WERKS.

        *SELECTION-SCREEN END OF BLOCK PLORD.

        • Parallel >>>>>>>>>>>>>>>>

        SELECTION-SCREEN: SKIP 1,

        BEGIN OF BLOCK PARALLEL_PROCESSING

        WITH FRAME TITLE TEXT-011,

        BEGIN OF LINE,

        COMMENT 1(30) TEXT-012 FOR FIELD RFCGR,

        POSITION 33.

        PARAMETERS: RFCGR LIKE BDFIELDS-RFCGR.

        SELECTION-SCREEN: END OF LINE,

        BEGIN OF LINE,

        COMMENT 1(30) TEXT-013 FOR FIELD PSIZE,

        POSITION 33.

        PARAMETERS: PSIZE LIKE BDFIELDS-PSIZE DEFAULT 20.

        SELECTION-SCREEN: END OF LINE,

        END OF BLOCK PARALLEL_PROCESSING.

        • Parallel <<<<<<<<<<<<<<<<

        include YRCCLPLOZ.

        Add a comment
        10|10000 characters needed characters exceeded

      Before answering

      You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
      You must be Logged in to submit an answer.

      Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.