Bapi BAPI_PROJECT_MAINTAIN

Hi SDN,
             I am creating a Activity for a Network through the BAPI -BAPI_PROJECT_MAINTAIN in PS module. For Ext Processing Activity ( External Activity ), i am not able to create the external activity with Activity Quantity field. can any one suggest me the field for the activity quantity in the bapi for the structure BAPI_NETWORK_ACTIVITY.
orelse is there is any other bapi to update the activity quantity for external Activities? The T-code for network is CN23. F7 for viewing the activities.

Example - Creating a WBS element for the project definition. Creating three WBS elements TRAINING, TRAINING.1 and TRAINING.2 for project definition PD-TRAINING
IMethodProject
OBJECTTYPE = WBS-Element
METHOD = Create
OBJECTKEY = TRAINING
REFNUMBER = 000001
OBJECTTYPE = WBS-Element
METHOD = Create
OBJECTKEY = TRAINING.1
REFNUMBER = 000002
OBJECTTYPE = WBS element
METHOD = Create
OBJECTKEY = TRAINING.2
REFNUMBER = 000003
OBJECTTYPE =
METHOD = Save
OBJECTKEY =
REFNUMBER =
IProjectDefinition
PROJECT_DEFINITION = PD-TRAINING
IWbsElementTable
Index = 1
WBS_ELEMENT = TRAINING
PROJECT_DEFINITION = PD-TRAINING
DESCRIPTION = Whole project
Index = 2
WBS_ELEMENT = TRAINING.1
PROJECT_DEFINITION = PD-TRAINING
DESCRIPTION = Preparation
Index = 3
WBS_ELEMENT = TRAINING.2
PROJECT_DEFINITION = PD-TRAINING
DESCRIPTION = Execution

Similar Messages

  • Issue with BAPI 'BAPI_PROJECT_MAINTAIN'

    Hi All,
    I am changing some dates of wbs elements in CJ20N.
    I am using the BAPI 'BAPI_PROJECT_MAINTAIN'
    when I use the BAPi
    it gives an error:
    The method table is not consistent with the data tables
    I am using the code
    data posid like prhi-posnr.
    CALL FUNCTION 'CONVERSION_EXIT_ABPSP_INPUT'
      EXPORTING
        input         = i_prps-posid
    IMPORTING
       OUTPUT        = posid          .
    select * from prhi INTO table i_wbs WHERE
      posnr = posid.
      move : 'E42527' to i_prjdef-project_definition.
      clear : i_prjupd.
      move : 'X' to i_prjupd-project_definition.
      clear : i_prjmtd.
      move : 'WBS-ELEMENT' to i_prjmtd-objecttype,
             'UPDATE' to i_prjmtd-method,
             '000001' to i_prjmtd-refnumber,
             'E425270111801' to i_prjmtd-objectkey.
      append i_prjmtd.
      clear : i_prjmtd.
    CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
      EXPORTING
        i_project_definition               = i_prjdef
        i_project_definition_upd           = i_prjupd
    IMPORTING
       RETURN                             =  i_return
      tables
        i_method_project                   = i_prjmtd
       I_WBS_HIERARCHIE_TABLE             = i_wbs
    I am not sure why the eror happens.I suppose the issue is with the  i_prjmtd table update method.Please let me know if anything need to be changed for me to update date values.
    Thank You in advance.
    Regards,
    KS

    Solved it by self.

  • BAPI   for   change budget in project   -   TCODE   CJ30

    Hello   everyone  ,
      I  want to change budget for A project   in tcode   CJ30  ,
    bdc  IS not suitble ,     the spec is to change one  WBS ' s  BUDGET money ,
    I  can't find the way to do it  in BAPI    BAPI_PROJECT_MAINTAIN 
    WHO  CAN HELP ME ?

    Hi,
    I have tried that option already. But I could not find any.
    Any update????
    Thanx,
    Sivagami.R

  • How to use BAPI_PROJECT_MAINTAIN?

    Hi,
    Please let me know how to use the BAPI, BAPI_PROJECT_MAINTAIN for maintaining project details in Project Systems(PS) module.
    Especially, I am not getting how to populate the table I_METHOD_PROJECT in the tables parameter.
    It will be more useful if you can explain with code.

    Thank you,
    Can you please explain me how to give the field values in that table?

  • Error in BAPI_PROJECT_MAINTAIN

    There is a program ZI000206 which substitutes Plant in Projects from CC Master data. We are trying to substitute Plants in almost 5000 projects.
    The problem is whenever we run the program it ends up with Error:
    Fill in All Required Fields
    though Substitution and Validations are carried out.
    While debugging the program we found it is calling standard BAPI : BAPI_PROJECT_MAINTAIN.
    The reason is that an OSS Note 1311030 which adds a call function CJWB_CHECK_BEFORE_COMMIT in from GENERAL_OBJECTS_MAINTAIN. This is causing a problem when it calls for the field PRPS-IZWEK(Investment Reason). Even though the field is hidden for projects it is calling as mandatory and throwing this error.
    I checked in customizing of screen layouts for WBS wherein this field is maintained as an input field.
    Will this change of field from input to hidden help in getting over this problem?
    Additionally I also tried CNMASS functionality for PS which also throws the same error " Fill in All Required Fields".
    input is highly appreciated.

    HI Shubhan .
    I solve my problem and in my case was the profirt cost center (profit_cctr), i write to sap and they tell me that this field is mandatory, so i use a profit  cost center "DUMMY" and i send it by default in the code, so that was my solution, i hope this help you with your problem.
    Regards.
    Alejandro

  • BAPI for Resource Allocation in Process System?

    hi,
          In an XI integrated scenario, I have created Project definition,WBS elements, Networks and Network Activities in SAP R/3 Project System by calling BAPI BAPI_PROJECT_MAINTAIN.
          Now I want to allocate resources to these network activities. Kindly suggest the BAPI name which will do that.
    Thanks.

    Hi,
    have you tried looking at ifr?:
    http://ifr.sap.com/catalog/query.asp?namespace=urn:sap-com:ifr:CFM:470X200&type=bobj&name=Network
    Regards,
    michal

  • Creating the WBS using bapis

    i am creating the WBS using thses bapis
    1. BAPI_PS_INITIALIZATION
    2. BAPI_BUS2001_CREATE
    3. BAPI_PS_PRECOMMIT
    4. BAPI_TRANSACTION_COMMIT/BAPI_TRANSACTION_ROLLBACK
    but i am getting the error
    Field COMPANY_CODE/Company code: Changing the contents of the field is not permitted
    Field BUSINESS_AREA/Business area: Changing the contents of the field is not permitted 
    Field WBS_ACCOUNT_ASSIGNMENT_ELEMENT/Acct asst elem.: Changing the contents of the field is not permitted         
    Field OBJECTCLASS/Object Class: Changing the contents of the field is not permitted     
    Please help to resolve this
    kanishak

    Hi,
    have you tried to look for corresponding OSS notes? I've never had any problems with this BAPI and according to BAPI documentation all fields from input structure can be used. It looks more like error. Or don't you have any validation for projects definitions? If you can find the reason you can still debug that code and see why it's failing.
    BTW your BAPI is for Project definition creation, not WBS element. You can maintain WBS elements form any project using BAPI BAPI_PROJECT_MAINTAIN.
    Cheers

  • BAPI to upload Person Assignment data under network activity

    Hello All!
    Can anybody tell me the appropriate BAPI that can upload the data of Person Assignment tab under network activity of Project System(TCode:cj20n)? I.E. data like Split Person Date Time Work Un and others data.
    Thanks in advance.
    Regards.
    Sarbajit

    Hi Majumdar,
    you can find it by running transaction ST05 against CJ20N.
    try bapi-
    BAPI_PROJECT_MAINTAIN
    Regards,
    NaPPy

  • HEIRARCHY IN BAPI_PROJECT_MAINTAIN

    HELLO experts,
    i am using this BAPI BAPI_PROJECT_MAINTAIN for maintaining the herirachy for the WBS but whenver i am creating the wbse its not maintained in the proper level as i am using I_WBS_HIERARCHIE_TABLE for maintaining the heirarchy but its not working properly, kindly hepl me out in solving this problem ASAP
    thanks

    Take a look at Threa WBS hierarchy not working in BAPI_PROJECT_MAINTAIN
    Regards

  • Need a BAPI to Change the WBS in CJ20n

    Hi All,
    Can anyone provied me a BAPI to change a WBS in CJ20n. Actually there a check box named "Account assignment" in the WBS screen of CJ20N, the checkbox is Tickmarked. I need to Untcik this checkbox.
    A quick response will be appreciated.
    Regards
    Abhii

    Hello,
    Check the BAPI - BAPI_PROJECT_MAINTAIN, in the tables parameter there is a component I_WBS_ELEMENT_TABLE which has a structure BAPI_WBS_ELEMENT. It has a component WBS_ACCOUNT_ASSIGNMENT_ELEMENT which represents Indicator: Account assignment element. Setting and resetting this may help in solving your issue.
    P.S. Check the documentation of this BAPI for further assistance.
    Thanks and Regards,
    Sachin

  • Bapi for Project closure -urgent

    hi all ,
    please tell me bapi or FM for closing a project/networks.
    Thanks,
    sridhar

    hi
    Check the BAPI BAPI_PROJECT_MAINTAIN
    This is for editing projects including networks.
    Hope this will help you.
    Regards.
    Lavanya.

  • Error while doing multiple object updation from EP ! object lock error

    HI all,
    I am doing multiple  object updation using a standard RFC(BAPI_PROJECT_MAINTAIN). The RFC i am calling from Enterprise portal. I am sending data to RFC one by one. But the error i am getting is object is locked by user so data can't be save.
    Though i am using Lock and unlock method before and after calling RFC the project lock error comes up.
    What might be the reason
    regards
    sandeep

    Hi Sandeep,
    Is the RFC you use for locking in the same model as the bapi BAPI_PROJECT_MAINTAIN? If it is not then you are using two connections for communication with the sap R/3 backend.
    You can do 2 things.
    1. You could add the RFCs for locking in the same model as the BAPI_PROJECT_MAINTAIN
    2. Instead of adding the RFCs in one model synchronize the connections the models use as follows:
    IWDDynamicRFCModel model1 = (IWDDynamicRFCModel) WDModelFactory.getModelInstance(Model1.class);
    IWDDynamicRFCModel model2 = (IWDDynamicRFCModel) WDModelFactory.getModelInstance(Model2.class);
    model1.setConnectionProvider(model2);
    You can do this in the wdDoInit. This will make sure both models use the same connection but closing a connection will close both at the same time.
    The same problem applies to commit/rollback functionality.
    Regards,
    Jeschael

  • Activity Change in PS

    Hi All,
    I am using BAPI BAPI_PROJECT_MAINTAIN to change my WBS element.It is working fine.I want to change duration field for the activity of the WBS elements. I am using Activity & Activity update tables of the BAPI but it is not updating the fields for the activity.
    I am passing WBS Element,duration to be changed,activity & the network.
    Network I am passing the AUFNR,
    Activity -VORNR
    WBS Element-PROJN
    duration-calculated one.
    It is not updating.Can anyone give some idea where am I missing?
    Thank You.
    Regards,
    K.S.
    Moderator message - Moved to the correct forum
    Edited by: Rob Burbank on Nov 4, 2010 11:58 AM
    Edited by: Kandaswamy S on Nov 10, 2010 8:35 PM
    Resolved

    Resolved

  • WBS Elements upload with settlement rule& classification

    I have created project profile & WBS elements with a BAPI bapi_project_maintain.
    Now i need to apply characterstic values and settlement rules to those WBS elements.
    I have been searching for a FM since long time.
    I tried with LSMW also,it did not work.
    Only way left to me is to write a BDC programs to full fill this.
    If anybody has got some solution for this let me know.
    regards
    KTSS

    Sreenivas,
    I´m afraid that none of the 3 options is available via standard tools
    I´m so sorry.
    Rgds
    Martina

  • BDC for CJ20N

    Hi Sapgurus,
    I written one bdc program for CJ20N. My requirement is to create project defination by using existing project defination.
    In recording iam clicking network overview buttton but
    that ok-code is not capturing what might be the reason.
    Iam also atta ching the code please have look and let me know the changes required.
    Thanks & regards
    Rahul
    ==========================================
    report ZTESTPS4
           no standard page heading line-size 255.
    include ymm_bdcrecx1.
    start-of-selection.
    DATA : BEGIN OF IT_DATA OCCURS 0,
             VSPSPID1(24),              "Project Defination
             POST1(40)  ,               "PS Short Description
             PLFAZ(10),                 "Project planned Start Date
             PLSEZ(10),                 "Project Planned finish Date
             VORLAGE(24),               "Reference Project Defination
             SUCHEN(24),                "Character String to be Searched
             ERSETZEN(24),              "character String to be Inserted
             AUFNR1(12),                "NetWork Number
             AUFNR2(12),                "NetWork Number
             POST2(40),                 "PS Short Description
          END OF IT_DATA.
    start-of-selection.
    Internal Table T_BDCDATA to store BDC data
           Batchinputdata of single transaction
    DATA:  T_BDCDATA LIKE BDCDATA  OCCURS 0 WITH HEADER LINE.
    Internal Table T_BDC_MSG to store BDC messages
    DATA:  T_BDC_MSG LIKE STANDARD TABLE OF BDCMSGCOLL INITIAL
           SIZE 0 WITH HEADER LINE.
    DATA:  V_FILE LIKE RLGRAP-FILENAME ,
           V_COUNT(5) TYPE C,
           V_MESSAGE_CNT(5) TYPE C .
    START-OF-SELECTION.
         PERFORM OPEN_GROUP.
         PERFORM DATA_UPLOAD.
         PERFORM CALL_TRANSACTION.
         PERFORM CLOSE_GROUP.
         PERFORM WRITE_ERROR.
    *&      Form  DATA_UPLOAD
          text
    -->  p1        text
    <--  p2        text
    FORM DATA_UPLOAD.
    *call function ws_upload to retrieve data from a flat file in the
    *presentation server into an internal table
      CALL FUNCTION 'UPLOAD'
           EXPORTING
                FILENAME                = V_FILE
                FILETYPE                = 'DAT'
           TABLES
                DATA_TAB                = IT_DATA
           EXCEPTIONS
                CONVERSION_ERROR        = 1
                INVALID_TABLE_WIDTH     = 2
                INVALID_TYPE            = 3
                NO_BATCH                = 4
                UNKNOWN_ERROR           = 5
                GUI_REFUSE_FILETRANSFER = 6
                OTHERS                  = 7.
    if ws_upload fails then display appropriate message
      IF SY-SUBRC <> 0.
       MESSAGE E000  WITH 'Data not Uploaded into internal table'.
      ENDIF.
    ENDFORM.                    " DATA_UPLOAD
    *&      Form  CALL_TRANSACTION
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_TRANSACTION.
      DATA : V_IVDAT(10) TYPE C,
             V_AKTIV(10) TYPE  C,
             V_MESSAGE(404) TYPE C.
      REFRESH T_BDCDATA.
      CLEAR T_BDCDATA.
      V_COUNT = 0.
      V_MESSAGE_CNT = 0.
      LOOP AT IT_DATA .
        V_COUNT = V_COUNT + 1.
    perform bdc_dynpro      using 'SAPLCNPB_M' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=COPY_PRJ'.
    perform bdc_dynpro      using 'SAPLCJWB' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RCWKP-VORLAGE'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=LETC'.
    perform bdc_field       using 'RCWKP-VSPSPID'
                                  IT_DATA-VSPSPID1.
    perform bdc_field       using '*PROJ-POST1'
                                  IT_DATA-POST1.
    perform bdc_field       using '*PROJ-PLFAZ'
                                  IT_DATA-PLFAZ.
    perform bdc_field       using '*PROJ-PLSEZ'
                                  IT_DATA-PLSEZ.
    perform bdc_field       using 'RCWBS-PROFL'
    perform bdc_field       using 'RCWKP-VORLAGE'
                                  IT_DATA-VORLAGE.
    perform bdc_field       using 'RCWBT-INCLA'
                                  'X'.
    perform bdc_field       using 'RC62C-COPY_MAT'
                                  'X'.
    perform bdc_field       using 'RC62C-COPY_AOB'
                                  'X'.
    perform bdc_field       using 'RC62C-COPY_PST'
                                  'X'.
    perform bdc_field       using 'RC62C-COPY_MLS'
                                  'X'.
    perform bdc_field       using 'RC62C-COPY_DOCL'
                                  'X'.
    perform bdc_dynpro      using 'SAPLCJWB' '0900'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'PROJ-PSPID'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=NUM2'.
    perform bdc_dynpro      using 'SAPLCJWB' '0560'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RCWKP-ERSETZEN'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=NUM2'.
    perform bdc_field       using 'RCWKP-SUCHEN'
                                  IT_DATA-SUCHEN.
    perform bdc_field       using 'RCWKP-ERSETZEN'
                                  IT_DATA-ERSETZEN.
    perform bdc_dynpro      using 'SAPLCJWB' '0900'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/ENEB'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'PROJ-PSPID'.
    perform bdc_field       using 'PROJ-POST1'
                                  'Unit Testing'.
    perform bdc_dynpro      using 'SAPLSPO3' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SPOP-VARVALUE1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PICK'.
    perform bdc_field       using 'SPOP-VARVALUE1'
                                  IT_DATA-AUFNR1.
    perform bdc_dynpro      using 'SAPLSPO3' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SPOP-VARVALUE1'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=PICK'.
    perform bdc_field       using 'SPOP-VARVALUE1'
                                  IT_DATA-AUFNR2.
    perform bdc_dynpro      using 'SAPLCNPB_M' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=LTCT'.
    *perform bdc_field       using 'BDC_CURSOR'
                                 'PROJ-PSPID'.
    *perform bdc_field       using 'PROJ-PSPID'
                                 'TESTESTSANG8'.
    *perform bdc_field       using 'PROJ-POST1'
                                 'Unit Testing'.
    *perform bdc_field       using 'PROJ-VERNR'
                                 '762001'.
    *perform bdc_field       using 'PROJ-VBUKR'
                                 '7620'.
    *perform bdc_field       using 'PROJ-WERKS'
                                 'SPI'.
    *perform bdc_field       using 'PROJ-PLFAZ'
                                 '01.01.2008'.
    *perform bdc_field       using 'PROJ-PLSEZ'
                                 '31.10.2008'.
    *perform bdc_field       using 'PROJ-FUNC_AREA'
                                 '600'.
    *perform bdc_field       using 'PROJ-PRCTR'
                                 '76201-CH'.
    *perform bdc_field       using 'PROJ-SPROG'
                                 '01.01.2008'.
    *perform bdc_field       using 'PROJ-EPROG'
                                 '31.01.2008'.
    perform bdc_dynpro      using 'SAPLCNPB_M' '1000'.
    perform bdc_field       using 'PROJ-PSPID'
                                  IT_DATA-VSPSPID1.
    perform bdc_field       using 'PROJ-POST1'
                                  IT_DATA-POST2.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    perform bdc_transaction using 'CJ20N'.
    perform close_group.
    perform close_group.
    LOOP AT T_MESSTAB WHERE REC_NO IS INITIAL.
        AT FIRST.
          V_MESSAGE_CNT = V_MESSAGE_CNT + 1.
          T_MESSTAB-REC_NO = V_COUNT.
        ENDAT.
          MODIFY T_MESSTAB TRANSPORTING REC_NO.
        ENDLOOP.
        REFRESH T_BDCDATA.
        CLEAR T_BDCDATA.
    ENDLOOP.
      SKIP.
      WRITE : /10 'Record Number ', 30 'Error Message'.
      SKIP.
    endform.
    *&      Form  WRITE_ERROR
          text
    -->  p1        text
    <--  p2        text
    FORM WRITE_ERROR.
      LOOP AT T_MESSTAB.
        WRITE : /10 T_MESSTAB-REC_NO , 30 T_MESSTAB-MESSAGE.
      ENDLOOP.
      ULINE /10(100).
      WRITE : /10 'No of Records : ' , V_COUNT.
      WRITE : /10 'No of Erroneous Records : ' , V_MESSAGE_CNT.
      ULINE /10(100).
    ENDFORM.                    " WRITE_ERROR
    *&      Form  CHECK_BDC
          text
    -->  p1        text
    <--  p2        text
    FORM CHECK_BDC.
    DATA: L_CHECK LIKE YMMT_CHECK_BDC-YCHECK.
      SELECT SINGLE YCHECK INTO L_CHECK FROM YMMT_CHECK_BDC
                                         WHERE PROGRAMM EQ SY-REPID
                                           AND YCHECK EQ 'X'.
      IF SY-SUBRC NE 0.
        MESSAGE S000(YM) WITH 'Execution not possible'.
        STOP.
      ENDIF.
    ENDFORM.                    " CHECK_BDC
    =================================
    Include Program
      INCLUDE YMM01_BDCRECX1                                             *
    ***INCLUDE BDCRECX1.
    for programs doing a data transfer by creating a batch-input session
    and
    for programs doing a data transfer by CALL TRANSACTION USING
    SELECTION-SCREEN BEGIN OF LINE.
      PARAMETERS SESSION RADIOBUTTON GROUP CTU.  "create session
      SELECTION-SCREEN COMMENT 3(20) TEXT-S07 FOR FIELD SESSION.
      selection-screen position 45.
      PARAMETERS CTU RADIOBUTTON GROUP  CTU default 'X'.    "call
    "transaction
      SELECTION-SCREEN COMMENT 48(20) TEXT-S08 FOR FIELD CTU.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S01 FOR FIELD GROUP.
      selection-screen position 25.
      PARAMETERS GROUP(12).                      "group name of session
      SELECTION-SCREEN COMMENT 48(20) TEXT-S05 FOR FIELD CTUMODE.
      selection-screen position 70.
      PARAMETERS CTUMODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.
                                          "A: show all dynpros
                                          "E: show dynpro on error only
                                          "N: do not display dynpro
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S02 FOR FIELD USER.
      selection-screen position 25.
      PARAMETERS: USER(12) DEFAULT SY-UNAME.     "user for session in batch
      SELECTION-SCREEN COMMENT 48(20) TEXT-S06 FOR FIELD CUPDATE.
      selection-screen position 70.
      PARAMETERS CUPDATE LIKE CTU_PARAMS-UPDMODE DEFAULT 'L'.
                                          "S: synchronously
                                          "A: asynchronously
                                          "L: local
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S03 FOR FIELD KEEP.
      selection-screen position 25.
      PARAMETERS: KEEP AS CHECKBOX.       "' ' = delete session if finished
                                          "'X' = keep   session if finished
      SELECTION-SCREEN COMMENT 48(20) TEXT-S09 FOR FIELD E_GROUP.
      selection-screen position 70.
      parameters E_GROUP(12).             "group name of error-session
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 3(20) TEXT-S04 FOR FIELD HOLDDATE.
      selection-screen position 25.
      PARAMETERS: HOLDDATE LIKE SY-DATUM.
      SELECTION-SCREEN COMMENT 51(17) TEXT-S02 FOR FIELD E_USER.
      selection-screen position 70.
      PARAMETERS: E_USER(12) DEFAULT SY-UNAME.    "user for error-session
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 51(17) TEXT-S03 FOR FIELD E_KEEP.
      selection-screen position 70.
      PARAMETERS: E_KEEP AS CHECKBOX.     "' ' = delete session if finished
                                          "'X' = keep   session if finished
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 51(17) TEXT-S04 FOR FIELD E_HDATE.
      selection-screen position 70.
      PARAMETERS: E_HDATE LIKE SY-DATUM.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 1(33) TEXT-S10 FOR FIELD NODATA.
      PARAMETERS: NODATA DEFAULT '/' LOWER CASE.          "nodata
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
      SELECTION-SCREEN COMMENT 1(33) FOR FIELD SMALLLOG.
      PARAMETERS: SMALLLOG as checkbox.  "' ' = log all transactions
                                         "'X' = no transaction logging
    SELECTION-SCREEN END OF LINE.
      data definition
          Batchinputdata of single transaction
    DATA:  BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF T_MESSTAB OCCURS 0,
            REC_NO(5) TYPE C,
            MESSAGE(250) TYPE C,
            END OF T_MESSTAB.
          messages of call transaction
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
          error session opened (' ' or 'X')
    DATA:   E_GROUP_OPENED.
          message texts
    TABLES: T100.
      at selection screen                                                *
    AT SELECTION-SCREEN.
    group and user must be filled for create session
      IF SESSION = 'X' AND
         GROUP = SPACE OR USER = SPACE.
        MESSAGE E613(MS).
      ENDIF.
      open dataset                                                       *
    FORM OPEN_DATASET USING P_DATASET.
      OPEN DATASET P_DATASET IN TEXT MODE.
      IF SY-SUBRC <> 0.
        WRITE: / TEXT-E00, SY-SUBRC.
        STOP.
      ENDIF.
    ENDFORM.
      close dataset                                                      *
    FORM CLOSE_DATASET USING P_DATASET.
      CLOSE DATASET P_DATASET.
    ENDFORM.
      create batchinput session                                          *
      (not for call transaction using...)                                *
    FORM OPEN_GROUP.
      IF SESSION = 'X'.
        SKIP.
        WRITE: /(20) 'Create group'(I01), GROUP.
        SKIP.
      open batchinput group
        CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = GROUP
                        USER     = USER
                        KEEP     = KEEP
                        HOLDDATE = HOLDDATE.
        WRITE: /(30) 'BDC_OPEN_GROUP'(I02),
                (12) 'returncode:'(I05),
                     SY-SUBRC.
      ENDIF.
    ENDFORM.
      end batchinput session                                             *
      (call transaction using...: error session)                         *
    FORM CLOSE_GROUP.
      IF SESSION = 'X'.
      close batchinput group
        CALL FUNCTION 'BDC_CLOSE_GROUP'.
        WRITE: /(30) 'BDC_CLOSE_GROUP'(I04),
                (12) 'returncode:'(I05),
                     SY-SUBRC.
      ELSE.
        IF E_GROUP_OPENED = 'X'.
          CALL FUNCTION 'BDC_CLOSE_GROUP'.
          WRITE: /.
          WRITE: /(30) 'Fehlermappe wurde erzeugt'(I06).
        ENDIF.
      ENDIF.
    ENDFORM.
           Start new transaction according to parameters                 *
    FORM BDC_TRANSACTION USING TCODE.
      DATA: L_MSTRING(480).
      DATA: L_SUBRC LIKE SY-SUBRC.
    batch input session
      IF SESSION = 'X'.
        CALL FUNCTION 'BDC_INSERT'
             EXPORTING TCODE     = TCODE
             TABLES    DYNPROTAB = BDCDATA.
        IF SMALLLOG <> 'X'.
          WRITE: / 'BDC_INSERT'(I03),
                   TCODE,
                   'returncode:'(I05),
                   SY-SUBRC,
                   'RECORD:',
                   SY-INDEX.
        ENDIF.
    call transaction using
      ELSE.
        REFRESH MESSTAB.
        CALL TRANSACTION TCODE USING BDCDATA
                         MODE   CTUMODE
                         UPDATE CUPDATE
                         MESSAGES INTO MESSTAB.
        L_SUBRC = SY-SUBRC.
        IF SMALLLOG <> 'X'.
          WRITE: / 'CALL_TRANSACTION',
                   TCODE,
                   'returncode:'(I05),
                   L_SUBRC,
                   'RECORD:',
                   SY-INDEX.
          LOOP AT MESSTAB WHERE MSGTYP = 'E'.
            SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                      AND   ARBGB = MESSTAB-MSGID
                                      AND   MSGNR = MESSTAB-MSGNR.
            IF SY-SUBRC = 0.
              L_MSTRING = T100-TEXT.
              IF L_MSTRING CS '&1'.
                REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ELSE.
                REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
                REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
              ENDIF.
              CONDENSE L_MSTRING.
              T_MESSTAB-MESSAGE = L_MSTRING(250) .
              APPEND T_MESSTAB.
             ELSE.
           ENDIF.
          ENDLOOP.
          SKIP.
        ENDIF.
    Erzeugen fehlermappe ************************************************
        IF L_SUBRC <> 0 AND E_GROUP <> SPACE.
          IF E_GROUP_OPENED = ' '.
            CALL FUNCTION 'BDC_OPEN_GROUP'
                 EXPORTING  CLIENT   = SY-MANDT
                            GROUP    = E_GROUP
                            USER     = E_USER
                            KEEP     = E_KEEP
                            HOLDDATE = E_HDATE.
             E_GROUP_OPENED = 'X'.
          ENDIF.
          CALL FUNCTION 'BDC_INSERT'
               EXPORTING TCODE     = TCODE
               TABLES    DYNPROTAB = BDCDATA.
        ENDIF.
      ENDIF.
      REFRESH BDCDATA.
    ENDFORM.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> ' '.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.
    ==========================================

    Hi,
    As Tx. CJ20N is an Enjoy SAP Transaction, it is not possible to use this effectively in BDCs. So i suggest that you use following methods:
    BAPI: BAPI_PROJECT_MAINTAIN to create & maintain a Project. check the BAPI documentation for the details.
    Else use Tx. CJ20 in the BDC.
    Best Regards, Murugesh

Maybe you are looking for

  • E200 series computer not responding

    How do I use my 4 recovery disk for my E200 series laptop. I made them when I first got my computer. The system powers on , but nothing happens. Blank screen.

  • VBR/CBR File Size

    I am running into a perplexing issue regarding file sizes of VBR vs CBR encoding... I have a my entire library of songs ripped from CDs that were encoded at AAC 256Kbs 44.1KHz. In the name of saving space (and after doing some reading), I re-ripped a

  • 0CML_DELTA : Change pointers are not active

    Hi All, I have successfully did the delta init without data transfer for datasource 0CML_DELTA and 0CML_DELTA_CAP. Now, While trying to load delta, I am getting an error "Change pointers are not active" for both the datasource 0CML_DELTA and 0CML_DEL

  • ORA-00932 on 11g + sdo_anyinteract + GROUP BY

    select pco.pointclass_id, count(pco.rid) anzahl from pointcloud_output pco ,pointcloud_blk_25833 blk where 1=1 and blk.blk_id = pco.ptn_id and blk.obj_id = (SELECT pc.pc.pc_id FROM pointcloud_25833 pc WHERE prin_id = 1) and MDSYS.SDO_RELATE blk.blk_e

  • Actiontec GT704GS how do I configure QoS???

    I just got a new Actiontrec GT704GS router/modem from Verizon and the documentation has virtually zero beginner information about how to configure QoS. I use a Skype enabled phone with a static IP so it souldn't be too hard to set up. The manual says