BAPI_PROJECT_MAINTAIN for CJ20N transaction

Hi
I am new in BAPI. I have a requirement like this "create a new import option to look at unique field (Work Center) for import of resource information ". Can u tell me how to add new import option in BAPI_PROJECT_MAINTAIN. The T-Code will be CJ20N.

Hi Ramya,
If you want to add a import field u need to have a acess key.
Else
you need copy the function module and needs to implement your own Z F/M which import parameter to be inserted.
After insertion go to T-code SWO1 and place bus 2054 then add ur z funtion module in BAPI: Project maintenance.
I hope this may helpfull.
Thank you,
Thanks,
AMS

Similar Messages

  • BAPI for CJ20N transaction

    I have used following step to create project/WBS:
    1.BAPI_PS_INITIALIZATION
    2.BAPI_BUS2001_CREATE
    3.BAPI_BUS2054_CREATE_MULTI
    4.BAPI_BUS2001_SET_STATUS (To set the status at project level)
    OR
    BAPI_BUS2054_SET_STATUS (To set the status at WBS element level)
    5.BAPI_PS_PRECOMMIT
    but in PS our have custom field at WBS element level, these BAPI will create a project but won't  update custom field.
    how to resolve the problem?
    thks

    Hi !
    Please have a look to the transaction BAPI .
    The Bapis of the project-system described there do have completely other nemas the you've listed... i.e.
    BAPI_PROJECTDEF_CREATE or BAPI_PROJECTDEF_UPDATE ....
    There's a very good docu for the BAPIs in the transaction BAPI .
    Regards
    Rainer
    Some points would be nive if that helped.

  • Need an user exit or BADI for CJ20n Transaction ,

    Dear Friends,
    In CJ20N ,  we have a Structure with Project definition>Top level wbs element>Network Header-->Network Activities
    For Network Activity it has main screen with one of the Tab named Necessary Fields.  It has a subscreen of Dates having Forecast Start and Forecast Finish Dates(Forecast start Date/ Forecast End date ). The dates format is DD.MM.YYYY. Now we want the Time format   00:00 to be added besides the Date format.
       Can anyone suggest if there is any user enhancement (screen exit ) or Badi can be implemented .
    Thanks & Regards
    Ramakrishna.K

    Plese check if enhancement CNEX0006 can be used for your requirement.
    Regards,
    Shyam

  • Badi ME_REQ_POSTED  For CJ20N Transaction

    Dear All,
    I am creating PR from PS using tcode: CJ20N and i need to check PR Requisitioner fields through CJ20N ,
    I am able to give error message for PR Requisitioner field through BADI ME_REQ_POSTED . My problem is as follows
    Suppose First time I enter wrong value (Ex. ABC ) in Requisitioner field , then it gives error message, then I give correct  Value (Ex. 1101_003 ) in Requisitioner Field  At that time also it is giving the error message.
    When I give correct value in Requisitioner Field the new value of Requisitioner is not coming in IM_EBAN
    I need to check every time latest value of Requisitioner Field in IM_EBAN in CJ20N.
    Following code I have written in IF_EX_ME_REQ_POSTED~POSTED
    IF SY-TCODE = 'CJ20N' .
        C_ATINN = 'PR_REQUISITIONER'.
        CALL FUNCTION 'CONVERSION_EXIT_ATINN_INPUT'
          EXPORTING
            INPUT  = C_ATINN
          IMPORTING
            OUTPUT = C_ATINN.
        LOOP AT IM_EBAN INTO L_S_EBAN WHERE LOEKZ IS INITIAL.
          CLEAR W_AFNAM.
          SELECT SINGLE ATWRT  INTO W_AFNAM
              FROM CAWN WHERE ATINN = C_ATINN
                          AND ATWRT = L_S_EBAN-AFNAM.
          IF SY-SUBRC <> 0.
            MESSAGE E499(SY) WITH  'Invalid requisitioner'
          ENDIF.
        ENDLOOP.
      ENDIF.
    Already searched on SDN.
    Please help me why the latest value which we enter in requisitioner is not coming in IM_EBAN
    Thanks in Advance
    Regard's
    Shabbir
    Any Help !!!
    Edited by: Shabbir Kureshi on Jul 15, 2010 1:01 PM
    Edited by: Shabbir Kureshi on Jul 15, 2010 2:08 PM

    Hello Shabbir
    If I understand you correctly then you want to prevent the creation of a purchase requisition in case of an invalid Requisitioner.
    In this case I would assume that BADI ME_REQ_POSTED is the wrong one because BAdI method implies that the PR will be saved. Why?
    There is no exception (not usual for BAdI methods) nor a CHANGING parameter like CH_FAILED defined.
    I assume that the correct BAdI for your purpose would be ME_PROCESS_REQ. Final checks BEFORE saving the PR are implemented in interface method IF_EX_ME_PROCESS_REQ~CHECK.
    In case of failure you set CH_FAILED = 'X'. In order to set an error message you may have a look at the following coding:
    METHOD if_ex_me_process_req~check .
      INCLUDE mm_messages_mac.
      DATA: ls_mereqitems        TYPE MMPUR_REQUISITION_ITEMS,
            ls_mereqitem         TYPE MMPUR_REQUISITION_ITEM,
            l_mereqitem          TYPE mereq_item,
            l_msgty              TYPE sy-msgty,
            l_msgno              TYPE t100c-msgnr.
    *-Get the item data
      ls_mereqitems = im_header->get_items( ).
    *-Get the configuration of the messages from T100S
      l_msgno = '173'.
    *-Check if the PR date is in the future
      LOOP at ls_mereqitems into ls_mereqitem.
        l_mereqitem = ls_mereqitem-item->get_data( ).
        CHECK     l_mereqitem-badat > sy-datlo
        AND   NOT l_msgno IS INITIAL.
        CALL FUNCTION 'READ_CUSTOMIZED_MESSAGE'
          EXPORTING
            i_arbgb = 'FICUSTOM'
            i_dtype = '-'
            i_msgnr = l_msgno
          IMPORTING
            e_msgty = l_msgty.
        IF 1 = 2.
          MESSAGE w173(ficustom). "WHEN POSTING
    *    MESSAGE w170(ficustom). "WHEN HOLDING
        ENDIF.
        IF NOT l_msgty = '-'.
          IF l_msgty = 'E'.
            ch_failed = ' '.
          ENDIF.
          sy-msgno = l_msgno.
          mmpur_message l_msgty 'FICUSTOM' sy-msgno
          l_mereqitem-bnfpo space space space.
        ENDIF.
      ENDLOOP.
    ENDMETHOD.
    Regards
      Uwe

  • User Exit for checking Purchase Requisitioner Field in CJ20N Transaction

    Hi,
    I want user Exit for checking Purchase Requisitioner field while making PR through CJ20N transaction. I have trie EXIT_SAPLEBND_001 user exit. Problem in this user exit is I am not getting Purchase Requisitioner No & Item No in I_CEBAN
    structure.
    Please suggest what to do ?
    Regard's
    Shabbir

    Hi,
    You can check with this BADI ME_PROCESS_REQ_CUST. 
    Kindly refer below mentioned link for further details:
    Badi ME_REQ_POSTED  For CJ20N Transaction
    Hope this will help you.
    Regards,
    Mudita

  • Table for user status field in CJ20n transaction project defination

    HI ALL,
    what is table for user status field in CJ20n transaction project defination creation. This field is in Basic Data tab.
    Thanks.

    Hi,
    Check following tables for Usre status:
    TJ30 - User status
    TJ30T - Texts for user status
    TJ20 - Status profile
    JEST - Object status
    JSTO- WBS status profile.
    Check this code:
    REPORT zps_get_userstatus .
    PARAMETERS: p_posid LIKE prps-posid.
    *-- Constants
    CONSTANTS: gc_yes(1)     TYPE c                 VALUE 'X',
               gc_no(1)      TYPE c                 VALUE ' '.
    *-- Variables
    DATA: l_objnr LIKE prps-objnr.
    *-- Internal tables
    DATA: BEGIN OF lit_jest OCCURS 0,
           objnr LIKE jest-objnr,
           stat  LIKE jest-stat,
         END OF lit_jest.
    DATA: BEGIN OF lit_jsto OCCURS 0,
           objnr LIKE jsto-objnr,
           stsma LIKE jsto-stsma,
          END OF lit_jsto.
    DATA: BEGIN OF lit_status OCCURS 0,       "Combination of JEST & JSTO
              objnr LIKE jest-objnr,
              stsma LIKE jsto-stsma,
              stat  LIKE jest-stat,
            END OF lit_status.
    DATA: BEGIN OF lit_usrsta OCCURS 0,       "Uer status for all wbs
             objnr LIKE jest-objnr,
             stsma LIKE jsto-stsma,
             stat  LIKE tj30t-estat,
             txt04 LIKE tj30t-txt04,
           END OF lit_usrsta.
    DATA: BEGIN OF lit_usrtxt OCCURS 0,       "User Status text - TJ30T
            stsma LIKE tj30t-stsma,
            stat  LIKE tj30t-estat,
            txt04 LIKE tj30t-txt04,
          END OF lit_usrtxt.
    * get WBS object number
    SELECT SINGLE
         objnr FROM prps
               INTO l_objnr
               WHERE posid = p_posid.
    * get WBS active status from table JEST
    SELECT
          objnr
          stat
               FROM jest INTO TABLE lit_jest
               WHERE objnr =  l_objnr AND
                     inact <> gc_yes.
    * get WBS status profile from table JSTO
    SELECT
          objnr
          stsma FROM jsto
                INTO TABLE lit_jsto
                WHERE objnr =  l_objnr.
    * combine JEST and JSTO table for user status
    LOOP AT lit_jest.
      IF lit_jest-stat CP 'E++++'.
        READ TABLE lit_jsto WITH KEY
                            objnr = l_objnr.
        IF sy-subrc = 0.
          lit_status-objnr = lit_jest-objnr.
          lit_status-stsma = lit_jsto-stsma.
          lit_status-stat  = lit_jest-stat.
          APPEND lit_status.
        ENDIF.
      ENDIF.
      CLEAR: lit_jsto, lit_status.
    ENDLOOP.
    *  get text for user status
    SELECT DISTINCT
             stsma
             estat
             txt04 FROM tj30t
                   INTO TABLE lit_usrtxt
                   FOR ALL ENTRIES IN lit_status
                   WHERE stsma = lit_status-stsma AND
                         estat = lit_status-stat  AND
                         spras = sy-langu.
    Let me know if you have any question.
    Regards,
    RS

  • BAPI for cj20 or cj20n transaction

    Hi,
    Please suggest me some BAPI's for the transaction code cj20 and cj20n to post "Structure Project defination"
    Thanks in advance,
    Sagar

    Hi Rajesh,
    Thanks for the reply. I have checked this, could you please let me know what are the Mandatory Parameters required?

  • 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

  • Bdc for CJ20N.  Selecting information button.

    Subject changed by moderator.  Please use meaningful subject in future.  Message moved to correct forum, please take care to post in the correct forum.
    Hi,
    I am trying to write a bdc for cj20n where the Status profile have to change but In the program throug recording the information button is not being selected.
    is there any way to change the Status profile ?
    debjani
    Edited by: Matt on Nov 26, 2008 8:06 AM

    Hi
    First things first, CJ20N tcode is not feasible for BDC. Dont perform BDC on enjoy transactions. Use BAPI. BAPI_PROJECT_MAINTAIN is very useful for PS.
    Vishwa.

  • Validating Profit Center in CJ20N Transaction

    Hi All,
    My requirement is to lock the Profit Center field(Make it grayed out) in the project using CJ20n transaction once it is created.
    Also when ever the user is trying to change the profit center by entering the project details, it should give an Error message saying that "the profit center value cannot be changed", when trying to save the project details with the new value.
    I have tried using almost all the userexits(CNEX0001,CNEX0002,CNEX0003,CNEX0004,CNEX0005,CNEX0006,CNEX0007,CNEX0008,CNEX0038,CNEX0033,CNEX0028,CNEX0029) for the transaction CJ20n and even searched for the BADIs, but none of them was not suitable for my requirement.
    Can any body suggest the suitable User exit or a BADI to implement for this requirement.
    Thanks

    Hello,
    Try following....
    Use BAdi BUS2054.
    In that write an implementation
    Two scenarios
    1) Creating new project. (Values in PRPS table will get updated after save.)
    2) Opening existing project  in change mode. ( Already values corresponding to that WBSE are available in PRPS table).
    Pre-Requisite:
    1) If possible make Profit center field madatory.
    Scenario 1:
    In Implementation write
    At_save
    IF PRPS-PRCTR = initial or zero. Then no error. Because he is creating Project, so no values will be available in PRPS. Once he saves PRPS will get updated and from next it will be delt as per scenario 2 below.
    Scenario 2:
    At_save
    If PRPS-PRCTR <> the value entered by the user (i.e. user trying to enter something different which is already there in PRPS table against that WBSE (PRPS-POSID)) throw an error "Profit center can not be changed".
    Please try along with ur abaper.
    Post ur findings.
    Thanks & Regards
    Saikishore.Ganga

  • How to Populate long text(item text)  from BOM CS01 to CJ20N transaction

    I have requiremnt  in which i need to Populate long text/item text  of  BOM  from CS01 to CJ20N transaction(PS network)

    Hi Naveen,
    for anylong text related work use the functions READ_TEXT and SAVE_TEXT.
    read the long text of the BOM item using the proper header and then populate the same text lines to the PS network using the new header specific to the PS network.
    Prabhas.

  • Exit for CJ20N where system status changes can be captured

    Hi Experts,
    I need exit for CJ20N where system status changes can be captured
    for both the below cases
    1) When WBS Element is having Networks inside it
    2) when WBS Element is having no networks inside it
    EXIT_SAPLCOBT_001  --->>>   ZXCO1U01  , will work for 1) , but not for 2)
    i want an exit where status change gets captured for both cases 1 and 2 and
    will do further processing according to client needs based on status change
    Need to trigger IDOC on status change of  WBS element.
    If WBS is having network inside it  , then network status changes also with WBS status change
    and IDOC should trigger for WBS also.
    I just want suitable exit  / place for coding . Rest i can do.
    if no suitable exit / BADI , then what is the best possible place where i can go for Implicit Enhancement
    Best Regards,
    Gaurav
    Edited by: TheGaurav on Oct 25, 2011 7:08 AM
    Edited by: TheGaurav on Oct 25, 2011 7:12 AM

    I am kind of stuck in a similar issue. I need to perform custom validations on standard fields which cannot be done through OPSI or OPUC transactions. 0007 or 0002 User exits seem to assist on custom field creations/validations. However, I do see people posting the following BADIs which may be useful.
    CO_SRULE_CHECK
    PROJECTDEF_UPDATE
    WORKBREAKDOWN_UPDATE (which you already tried)
    WBS_FIELDS_FOR_ASSET
    CO_SRULE_CDOC
    Let me know if any of these worked out...
    AN

  • CJ20n -transaction

    Hi In my CJ20N transaction I have check boxes which perform as per my needs like when I want to check this box and run it asks for remote sump and when I dont check and run this it asks for surface loaction. Now the problem is that this is good when it is run in change more , but it behaves the same way in the display mode too . Idont want it to ask for remote sum or the surface loaction entries when its in display mode , as it dosent allow me to go further inside the transaction without getting out again and re-enetring . I beleve there should be some kind of change in my code part here .If someone is kind enough to tell em what do I need to add on to it so that It dosent ask me for the entries in display mode.
    Pls assist.
    Thnaks
    *&      Module  check_0700_zmulti_zremsump  INPUT
          text
    MODULE check_0700_zmulti_zremsump INPUT.
      IF ( prps-zzmulti_well IS NOT INITIAL ) AND
         ( prps-posid+0(3) = 'O12' ) AND                        "DEVK907674
         ( PRPS-ZZREMSUMP IS INITIAL ).
        MESSAGE e013(zwell).  " Not a valid  Remote Sump
      ENDIF .
    ENDMODULE.                 " check_0700_zmulti_zremsump  INPUT
    *&      Module  check_0700_zmulti_zsurflocn  INPUT
    * Check that valid surface location is entered before allowing
      the display of other location.
    MODULE check_0700_zmulti_zsurflocn INPUT.
      IF ( prps-zzmulti_well IS  INITIAL ) AND
         ( prps-posid+0(3) = 'O12' ) AND                        "DEVK907674
         ( PRPS-zzsurflocn IS INITIAL ).
        MESSAGE e014(zwell).  " Not a valid surface Location
      ENDIF.
    ENDMODULE.                 " check_0700_multi_zsurflocn  INPUT

    Basically CMOD ZWBS currently has two screen exits - one for projecr definition (screen 600) and the other for WBS (screen 700).   In both of these screens a check is made to ensure that:
    - when the MultiWell checkbox is blank then the corresponding screen's Remote Sump field must be populated.
    - when the MultiWell checkbox = 'X' then the Surface Location field must be populated.Which is there in place.
    What I want is to add a check to bypass these MultiWell-Remote Sump/Surface Location checks if the object project or WBS is opened in Display mode.
    What should I do in teh above code which will bypass the check when it is in display mode.
    Thanks
    PLs help (Urgent and Important)

  • Make project profile field non mandatory in CJ20n Transaction

    Hi All,
    I want to make project profile field non mandatory in my CJ20n transaction. I tried through OPUA, OPUK, OPUC but of no use. The field over there is just an input field. I need to make it non mandatory either through configuration or through code. Please suggest.
    Regards,
    Jayant

    Hi,
    this is a required field, as far as the standard SAP code goes: everytime this field is touched the following function is executed in programme FV45EF0V_VBEP-EDATU_EINGEBEN:
        call function 'PERIOD_AND_DATE_CONVERT_INPUT'
          exporting
            external_date     = rv45a-etdat
            external_period   = rv45a-prgbz
          importing
            internal_date     = vbep-edatu
            internal_period   = vbep-prgrs
            ev_date_in_past   = lv_date_in_past
            ev_period_in_past = lv_period_in_past
          exceptions
            no_data           = 1
            period_invalid    = 2
            date_invalid      = 3.
        case sy-subrc.
          when 1.
            set cursor field 'RV45A-PRGBZ' line sy-stepl.
    * Bitte Datum eingeben
            message e394.
    The only way to avoid this is create an implicit enhancement at the beginning of this form, copy the exisitng code in there, delete the message after WHEN 1. and put RETURN at the end of the enhancement. But this would be HIGHLY UNRECOMMENDED, because I am positive you cause a lot of misery later on in the process: this field is mandatory for a reason!
    Roy

  • Doubts in CJ20N transaction

    Hi All.
    In the CJ20N transaction code, Number of TAB is there, I have to mark the Check box (for field PRPS-USR11) in the User fields TAB based on my requirements. Could you tell me how can I do it.? Any exits is there? Is it possible to do it in BADi  WBS_USER_FIELDS_F4 itself?
    Please guide me.
    Thanks.
    Jay

    In the method AT_SAVE.
    Parameter IT_WBS_ELEMENT has associated structure CJBAI_WBSELEMENT_TABLE.
    It includes structure PRPS which consists your field.
    Registered:  Mar 3, 2008 
    Total Posts:  15 
    Total Questions:  10 (9 unresolved) 
    If you dont bother about these , then you may not expect replies to your posts in future.

Maybe you are looking for

  • Why doesnt foxyspider work with 26.0 after auto update

    I was using foxyspider successfully for several months until firefox auto updated to version 26. After the update it will no longer download. All other functions work but files will not be saved. A new page will open and thumbnails are visible, but w

  • Aironet 1100 Default Username and Password not working

    I have a Cisco Aironet 1100 series access point (AP1120B) that after resetting to factory defaults the default username and password (Cisco and Cisco) aren't working in the web GUI.  I am able to telnet to the AP's IP and log in with Cisco and Cisco

  • Customs Documents for Export Declaration - Output

    Hi , i have created Billing document in R3, in GTS customs docuement generated for that billing doc. when  i am Executing the message under Communication View  giving error message "Cannot execute; message P0350 is incomplete" Could you please let me

  • Print Settings Reset

    Each time I startup from shut-down, I have to go to settings, delete one duplicate of my local USB printer and reset my network printer to be the default (local printer is selected as default). Locking the settings seems to do no good. Help!

  • Problems with MP3 audio playbacks

    I commonly have trouble with Firefox when trying to listen to an MP3 playback using Firefox. When I switch to Safari, everything works. What can be wrong? Here is an example http://www.kleinartistworks.com/recordings/Hammer%20Carl.mp3 This recording