Blocking a company code for all transactions.

A compnay code is having two plants assigned. No open documents in that company code.
How to block the company code for any transactions including purchase document creation?
However all the past data to be available for viewing and reference.
Thanks in advance.
Narasimharao

Dear Narasimharao ,
You can remove authorization from user profile to use this company code.
And when someone try to save any documents , error message will be send.
hope this could help you.
best regards,
Carlos Moçatto

Similar Messages

  • OTL: Timecard Audit Template require reason code for all transaction.

    We are currently using OTL with CLA template with interface time entry from external system.
    When monthly time entry interfaced into OTL each employee have to review and update their time and submit to manager, but when process to audit template they has been forced to update reason code for all transactions.
    We suppose to update the reason code only for the modified transactions. Please help me.
    Nonny.

    nondhasid,
    If you are not modifying those records which are asking for a reason field to be filled, then it should be coming from the Late setup. Check the CLA setup.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                       

  • Delete the company code for all customization

    Hi All
    is it possible to delete the company code, if yes how to delete the company code?.
    is it possible to house keep the company code?
    Please help us to provide the necessary solution.
    Regards
    K.Gunasekar

    Hi,
    It is possible to delete company code, but have you started using the company code already?
    Path to delete company code
    IMG -> Enterprise Structure -> Definition -> Financial Accounting -> Edit, Copy, Delete, Check Company Code
    Your second question is not clear to me. Could you please elaborate.
    Regards,
    Abhinav Sethi

  • Cannot change company code for functional location in PM module

    Dear Gurus,
    When I try to change the maint plant for topmost level hierarchy FL, I get error. So I cleared the data in organization tab (planning plant....) and tried to click location tab but receive warning (After changing PM planning plant, please check dependent objects) & cannot proceed. Kindly advice me on how I can change the company code for all the functional location in the plant.
    Thank you.

    Dear Gurus,
    Is there any way I can mass change the company code for all FLs?
    Thank you.

  • Set up Payment Methods Per Company code for Transaction

    Hi All,
    Can any expert please suggest whether do we need to enter only paying company codes while defining the payment methods per company code or enter all company codes.
    Ex: We have 10 company codes for which there are 3 paying company codes. After defining the payment methods in the country, while defining payment methods per company code do we need to define for only 3 paying company codes or for all 10 company codes. Because when you are paying through one company code on behalf of three company codes, how does it make sense having the payment method in company codes which are not paying. I hope my query is sensible.
    Thanks&Regards
    Srinivas

    Hi,
    You should define the payment method in all the 10 company codes regarding they are the paying or non paying company code.
    If you are not defining them they you will not have the option to select the payment for that particular company code.
    regards
    pbb

  • Hi guys please give me sample code for call transaction that handles error

    hi guys, please give me sample code for call transaction that handles error,
    please send me the sample code in which there should be all decleration part and everything, based on the sample code i will develop my code.
    please do help me as it is urgent.
    thanks and regards.
    prasadnn.

    Hi Prasad,
    Check this code.
    Source Code for BDC using Call Transaction
    *Code used to create BDC
    *& Report  ZBDC_EXAMPLE                                                *
    *& Example BDC program, which updates net price of item 00010 of a     *
    *& particular Purchase order(EBELN).                                   *
    REPORT  ZBDC_EXAMPLE  NO STANDARD PAGE HEADING
                          LINE-SIZE 132.
    Data declaration
    TABLES: ekko, ekpo.
    TYPES: BEGIN OF t_ekko,
        ebeln TYPE ekko-ebeln,
        waers TYPE ekko-waers,
        netpr TYPE ekpo-netpr,
        err_msg(73) TYPE c,
    END OF t_ekko.
    DATA: it_ekko  TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko  TYPE t_ekko,
          it_error TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_error TYPE t_ekko,
          it_success TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_success TYPE t_ekko.
    DATA: w_textout            LIKE t100-text.
    DATA: gd_update TYPE i,
          gd_lines TYPE i.
    *Used to store BDC data
    DATA: BEGIN OF bdc_tab OCCURS 0.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    *Used to stores error information from CALL TRANSACTION Function Module
    DATA: BEGIN OF messtab OCCURS 0.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: END OF messtab.
    *Screen declaration
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
                                        TITLE text-001. "Purchase order Num
    SELECT-OPTIONS: so_ebeln FOR ekko-ebeln OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK block1.
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME
                                        TITLE text-002. "New NETPR value
    PARAMETERS:  p_newpr(14)   TYPE c obligatory.  "LIKE ekpo-netpr.
    SELECTION-SCREEN END OF BLOCK block2.
    *START-OF-SELECTION
    START-OF-SELECTION.
    Retrieve data from Purchase order table(EKKO)
      SELECT ekkoebeln ekkowaers ekpo~netpr
        INTO TABLE it_ekko
        FROM ekko AS ekko INNER JOIN ekpo AS ekpo
          ON ekpoebeln EQ ekkoebeln
       WHERE ekko~ebeln IN so_ebeln AND
             ekpo~ebelp EQ '10'.
    *END-OF-SELECTION
    END-OF-SELECTION.
    Check data has been retrieved ready for processing
      DESCRIBE TABLE it_ekko LINES gd_lines.
      IF gd_lines LE 0.
      Display message if no data has been retrieved
        MESSAGE i003(zp) WITH 'No Records Found'(001).
        LEAVE TO SCREEN 0.
      ELSE.
      Update Customer master data (instalment text)
        LOOP AT it_ekko INTO wa_ekko.
          PERFORM bdc_update.
        ENDLOOP.
      Display message confirming number of records updated
        IF gd_update GT 1.
          MESSAGE i003(zp) WITH gd_update 'Records updated'(002).
        ELSE.
          MESSAGE i003(zp) WITH gd_update 'Record updated'(003).
        ENDIF.
    Display Success Report
      Check Success table
        DESCRIBE TABLE it_success LINES gd_lines.
        IF gd_lines GT 0.
        Display result report column headings
          PERFORM display_column_headings.
        Display result report
          PERFORM display_report.
        ENDIF.
    Display Error Report
      Check errors table
        DESCRIBE TABLE it_error LINES gd_lines.
      If errors exist then display errors report
        IF gd_lines GT 0.
        Display errors report
          PERFORM display_error_headings.
          PERFORM display_error_report.
        ENDIF.
      ENDIF.
    *&      Form  DISPLAY_COLUMN_HEADINGS
          Display column headings
    FORM display_column_headings.
      WRITE:2 ' Success Report '(014) COLOR COL_POSITIVE.
      SKIP.
      WRITE:2 'The following records updated successfully:'(013).
      WRITE:/ sy-uline(42).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(004), sy-vline,
              (11) 'Old Netpr'(005), sy-vline,
              (11) 'New Netpr'(006), sy-vline.
      WRITE:/ sy-uline(42).
    ENDFORM.                    " DISPLAY_COLUMN_HEADINGS
    *&      Form  BDC_UPDATE
          Populate BDC table and call transaction ME22
    FORM bdc_update.
      PERFORM dynpro USING:
          'X'   'SAPMM06E'        '0105',
          ' '   'BDC_CURSOR'      'RM06E-BSTNR',
          ' '   'RM06E-BSTNR'     wa_ekko-ebeln,
          ' '   'BDC_OKCODE'      '/00',                      "OK code
          'X'   'SAPMM06E'        '0120',
          ' '   'BDC_CURSOR'      'EKPO-NETPR(01)',
          ' '   'EKPO-NETPR(01)'  p_newpr,
          ' '   'BDC_OKCODE'      '=BU'.                      "OK code
    Call transaction to update customer instalment text
      CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
             MESSAGES INTO messtab.
    Check if update was succesful
      IF sy-subrc EQ 0.
        ADD 1 TO gd_update.
        APPEND wa_ekko TO it_success.
      ELSE.
      Retrieve error messages displayed during BDC update
        LOOP AT messtab WHERE msgtyp = 'E'.
        Builds actual message based on info returned from Call transaction
          CALL FUNCTION 'MESSAGE_TEXT_BUILD'
               EXPORTING
                    msgid               = messtab-msgid
                    msgnr               = messtab-msgnr
                    msgv1               = messtab-msgv1
                    msgv2               = messtab-msgv2
                    msgv3               = messtab-msgv3
                    msgv4               = messtab-msgv4
               IMPORTING
                    message_text_output = w_textout.
        ENDLOOP.
      Build error table ready for output
        wa_error = wa_ekko.
        wa_error-err_msg = w_textout.
        APPEND wa_error TO it_error.
        CLEAR: wa_error.
      ENDIF.
    Clear bdc date table
      CLEAR: bdc_tab.
      REFRESH: bdc_tab.
    ENDFORM.                    " BDC_UPDATE
          FORM DYNPRO                                                   *
          stores values to bdc table                                    *
    -->  DYNBEGIN                                                      *
    -->  NAME                                                          *
    -->  VALUE                                                         *
    FORM dynpro USING    dynbegin name value.
      IF dynbegin = 'X'.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-program,
               value TO bdc_tab-dynpro,
               'X'  TO bdc_tab-dynbegin.
        APPEND bdc_tab.
      ELSE.
        CLEAR bdc_tab.
        MOVE:  name TO bdc_tab-fnam,
               value TO bdc_tab-fval.
        APPEND bdc_tab.
      ENDIF.
    ENDFORM.                               " DYNPRO
    *&      Form  DISPLAY_REPORT
          Display Report
    FORM display_report.
      FORMAT COLOR COL_NORMAL.
    Loop at data table
      LOOP AT it_success INTO wa_success.
        WRITE:/      sy-vline,
                (10) wa_success-ebeln, sy-vline,
                (11) wa_success-netpr CURRENCY wa_success-waers, sy-vline,
                (11) p_newpr, sy-vline.
        CLEAR: wa_success.
      ENDLOOP.
      WRITE:/ sy-uline(42).
      REFRESH: it_success.
      FORMAT COLOR COL_BACKGROUND.
    ENDFORM.                    " DISPLAY_REPORT
    *&      Form  DISPLAY_ERROR_REPORT
          Display error report data
    FORM display_error_report.
      LOOP AT it_error INTO wa_error.
        WRITE:/      sy-vline,
                (10) wa_error-ebeln, sy-vline,
                (11) wa_error-netpr CURRENCY wa_error-waers, sy-vline,
                (73) wa_error-err_msg, sy-vline.
      ENDLOOP.
      WRITE:/ sy-uline(104).
      REFRESH: it_error.
    ENDFORM.                    " DISPLAY_ERROR_REPORT
    *&      Form  DISPLAY_ERROR_HEADINGS
          Display error report headings
    FORM display_error_headings.
      SKIP.
      WRITE:2 ' Error Report '(007) COLOR COL_NEGATIVE.
      SKIP.
      WRITE:2 'The following records failed during update:'(008).
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_HEADING.
      WRITE:/      sy-vline,
              (10) 'Purchase Order'(009), sy-vline,
              (11) 'Netpr'(010), sy-vline,
              (73) 'Error Message'(012), sy-vline.
      WRITE:/ sy-uline(104).
      FORMAT COLOR COL_NORMAL.
    ENDFORM.                    " DISPLAY_ERROR_HEADINGS
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Set Up Payment Methods per Company Code for Payment

    Hi All,
    Can any expert please suggest whether do we need to enter only paying company codes while defining the payment methods per company code or enter all company codes.
    Ex: We have 10 company codes for which there are 3 paying company codes. After defining the payment methods in the country, while defining payment methods per company code do we need to  define for only 3 paying company codes or for all 10 company codes. Because when you are paying through one company code on behalf of three company codes, how does it make sense having the payment method in company codes which are not paying. I hope my query is sensible.
    Thanks&Regards
    Srinivas

    Generally Payment method is defined for a customer at Company code level and Sales area level. Through Partner function we can control who has to make payment. In your case , if you need to define different customer as payer you can do so in KNVP table. while making sales order payment terms will pick from Payer of the Sold to patry customer.
    Not sure why do you wants to link to Company code

  • Remove Company Code with all the Employees in it from r/3?

    Hi i have a bit unusual requirement.
    i want to know how can i Remove a Company Code with all its assigned Employees completely from a system(r/3) ?
    can this be possible at all? if yes then please also mentions what can be the side effects of this action.

    Jack,
    You will have to follow reverse engineering....
    As Sikandar Guru Mentioned.....identify all the PERNRs for mass deletion....
    Secondly I believe, that you want to Delete the Company Code.....check with Finance Folks.......If they have no issues, you can delete the co. code with TCODE EC01... but this will not delete the Relationships to Personnel area...etc.
    There may be custom Features, Reports or programs functioning based on Co. Code.......
    So, in a way....its not feasible..neither wise to attempt deletion of Co. Code....
    S_PHO_48000106 is the TCode for Mass Deletion.
    Good Luck !!!
    Kumarpal Jain.
    Edited by: Kumarpal Jain on Oct 26, 2009 3:20 PM

  • Set up Company Codes for Contract Accounts Receivable and Payable

    HI,
    I need clarification on "Set up Company Codes for Contract Accounts Receivable and Payable"
    When a company code "ABCD" isn't set up for contract accounts receivable and payable (Menu path:
    SAP Insurance -> Collections/Disbursements -> Organizational Units -> Set up Company Codes for Contract Accounts Receivable and Payable), are postings on this company code "ABCD" within FS-CD not allowed and blocked ?
    Is it mandetory to specify company codes to post in Contract Accounts Receivable and Payable in SAP FS-CD.

    Yes .  It is mandatory to extend company code chart of accounts to CA/CR and FSCD.
    Srinivas

  • Error when changing a Company Code for a given Cost Center

    Hello Friends ,
                             I'm trying to modify a company code value for a given cost center in KS02 and I get the below error. The error message receommends to change the analysis period ( not sure what it is..) but when I click edit > Analysis period from tool bar I  still get the below message , is there way to get over come this issue ?
    Thanks in advance ,
    Field change Company Code is not possible (transaction data already exists)
    Message no. KS134
    Diagnosis
    To ensure the consistency of existing data, you can only change object Company Code if no transaction data exists in the change period; that is, neither plan data nor actual data has been posted.
    As transaction data already exists, it is not possible to change objects in this time period.
    Procedure
    If you still want to change the object, select a suitable change interval by choosing "Edit -> Analysis period...".

    Thank you Vishal . I have 3 cost centers with 2 having validity period ( from 01/01/1950 to 12/31/9999) and third one had 2 records 12/30/2004 to 12/26/2009 and 12/27/2009 to 12/31/9999 ) for the third one it did allow to change the validty period and I could change the comapny code for my profit center . But for first 2 somehow it doesnt allow to change the validity periods. And when I run some reports against these 2 cost centers to see if there is any activity I dont see any data .
    Could you please give your ideas ?
    Thanks alot .

  • Maintain company codes for MM

    The day we assign the plants to the company code, we have to do the settings i.e.,,
      in Maintain company codes for MM(T-code : OMSY).
    1.What's the siginificane(importance) of this?
    2.I have assigned the plants to the company code today,
       but forgot to do the settings on the same day i.e.,. maintain company codes for MM?
       Now what should i do?

    Hello Pavan,
    When you create a material master record, the control record must exist for the company code so without maintaining period in OMSY you will not be able to create the material master record.
    To Allow backposting or Disallow backposting you need to maintain indicators in this transaction.
    You can use, MMPV/MMPI if you missed out this setting.
    Hope this helps.
    Regards
    Arif Mansuri

  • Display address omitted postal code for all countries in sapscript

    Hi everyone
    Does anyone know how to omit the postal code for all countries(eg. US ) when displaying address in sapscript form?
    I want to avoid to display postal code even the country is US.
    coz my firm doesn't want to show postal code.....
    Also, how to use combination keys of PRIORITY parameter?
    For example, if i want PRIORITY '1' 'S' 'L' 'N' 'C'
    I cannot write like this as following....
    /:   ADDRESS DELIVERY PARAGRAPH AS <b>PRIORITY 1 S L N C</b> LINES 5
    /:   ADDRESSNUMBER &VBDKR-ADRNR_WE(K)&
    /:   FROMCOUNTRY &VBDKR-SLAND&
    /:   ENDADDRESS

    Hi,
    Bold text describes the usage of <b>Priority</b>.
    ADDRESS: Formatting of addresses
    The command ADDRESS - ENDADDRESS formats an address according to the postal standards of the
    destination country defined in the parameter COUNTRY. The reference fields are described in the
    structure ADRS. Both constants and symbols can be assigned to the parameters.
    Syntax:
    /: ADDRESS [DELIVERY] [PARAGRAPH a] [PRIORITY p] [LINES l]
    /: TITLE title
    /: NAME name1[,name2[,name3[,name4]]]
    /: STREET street
    /: POBOX PO box [CODE zip code]
    /: POSTCODE zip code
    /: CITY town1[,town2]
    /: REGION region
    /: COUNTRY country
    /: FROMCOUNTRY from country
    /: ENDADDRESS
    Both formatting data and address data are given as parameters. Address data is formatted for output in accordance with the parameters COUNTRY, PRIORITY and LINES. If available, the P.O. box is used instead of the street as the default.
    •&#61472;DELIVERY: Defines the street address. If this parameter is selected, the system prints the street address on the layout output instead of the P.O. box.
    •&#61472;PARAGRAPH: Defines in which paragraph format the address is output. If the parameter is not defined, the address is output in the default paragraph format.
    <b>•&#61472;PRIORITY: Defines which address lines can be omitted if necessary. You can enter a combination of the following values:
    A form of address
    P mandatory blank line 1
    Q mandatory blank line 2
    2 name2
    3 name3
    4 name4
    L name of country
    S line for the street
    O line for the city
    </b>
    •&#61472;LINES: Defines how many lines are available for formatting the address. If all the address data cannot be formatted due to an insufficient number of lines, the data entered in the parameter PRIORITY is omitted. If the LINES specification is missing and this command is in a layout set window whose type is not MAIN, the lines available for the address layout are then calculated automatically by means of the current output line item and window size.
    •&#61472;TITLE: Required form of address.
    •&#61472;NAME: Up to four separate names, separated by commas, can be defined.
    •&#61472;STREET: Street specification including address number.
    •&#61472;POBOX: Post Office box number.
    •&#61472;CODE: P.O. box Postal or ZIP code if it is different from the postal code of the city.
    •&#61472;POSTCODE: Postal or ZIP code of the city.
    •&#61472;CITY: Up to two place names can be defined.
    •&#61472;REGION: Determines the administrative area.
    •&#61472;COUNTRY: Specifies the country according to whose specific postal standards the address    is formatted.
    •&#61472;FROMCOUNTRY: Defines in which language the name of the destination country is formatted. In EC countries, only the international country identification letter is put before the postal code with a hyphen.
    Example:
    /: ADDRESS
    /: TITLE ‘Company’
    /: NAME ‘Widget Technology, Inc.’, ‘All Kind of Widgets’
    /: STREET ‘1005 Lido Lane’
    /: POBOX ‘2935’ CODE ‘94400’
    /: POSTCODE ‘94404’
    /: CITY ‘Foster City’
    /: REGION ‘CA’
    /: COUNTRY ‘USA’
    /: FROMCOUNTRY ‘USA’
    /: ENDADDRESS
    Generates the following address:
    Company
    Widget Technology, Inc.
    All Kind of Widgets
    PO box 2935
    Foster City, CA 94400
    If the supplement DELIVERY is specified for the command ADDRESS, then the street is entered instead of
    the PO box.
    Company
    Widget Technology, Inc.
    All Kind of Widgets
    1005 Lido Lane
    Foster City, CA 94404
    Regards,
    Sailaja.
    Reward points if answer helps you.

  • Is there any T-codes for all these............

    Hello all
    I came to know that there are T-codes for all these like
    Infoprovider,Infosource,PSA and etc.........
    pl let me know
    regards
    balaji

    Hi Balaji,
    the tcodes are
    rsa11   InfoProvider
    rsa12   InfoSources
    rsa15   PSA
    Have a look in Tabele TSTCT, select your language an filter for transaction RS* to get a list of most BW-related Transactions
    regards
    Robert

  • BDC code for MM01 Transaction

    Hi All,,
                 Please give Entire BDC code for MM01 Transaction.
    i will change as per my requirement.
    I think this is already done by some ABAP Consultants.
    plz dont give answers like do recording for that transaction MM01. I know recording...
    For time constraiint, I have to complete soon.....
    Thanks in Advance
    BestRegards,
    Anil

    Hi,
    The below code is using the Session Method
    report ZDS_BDC_MM01
           no standard page heading line-size 255.
    include bdcrecx1.
    *parameters: dataset(132) lower case.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record OCCURS 0,
    * data element: MATNR
            MATNR_001(018),
    * data element: MBRSH
            MBRSH_002(001),
    * data element: MTART
            MTART_003(004),
    * data element: XFELD
            KZSEL_01_004(001),
    * data element: XFELD
            KZSEL_02_005(001),
    * data element: MAKTX
            MAKTX_006(040),
    * data element: MEINS
            MEINS_007(003),
    * data element: MAKTX
            MAKTX_008(040),
          end of record.
    *** End generated data section ***
    start-of-selection.
    *perform open_dataset using dataset.
    perform open_group.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      ='C:\DHRUV.TXT'
       FILETYPE                      = 'DAT'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = RECORD
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *do.
    LOOP AT record.
    *read dataset dataset into record.
    if sy-subrc <> 0. exit. endif.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-MATNR_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-MBRSH_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-MTART_003.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(02)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  record-KZSEL_01_004.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(02)'
                                  record-KZSEL_02_005.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_006.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-MEINS_007.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_008.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    perform bdc_transaction using 'MM01'.
    *enddo.
    ENDLOOP.
    perform close_group.
    *perform close_dataset using dataset.
    *Text elements
    * E00 Error opening dataset, return code:
    * I01 Session name
    * I02 Open session
    * I03 Insert transaction
    * I04 Close Session
    * I05 Return code =
    * I06 Error session created
    * S01 Session name
    * S02 User
    * S03 Keep session
    * S04 Lock date
    * S05 Processing Mode
    * S06 Update Mode
    * S07 Generate session
    * S08 Call transaction
    * S09 Error sessn
    * S10 Nodata indicator
    * S11 Short log
    *Messages
    * Message class: MS
    *613   Please enter a session name and user name
    The Below is the coding for the Call Transaction...
    report ZDS_BDC_MM01_2
           no standard page heading line-size 255.
    *include bdcrecx1.
    *parameters: dataset(132) lower case.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    data: begin of record OCCURS 0,
    * data element: MATNR
            MATNR_001(018),
    * data element: MBRSH
            MBRSH_002(001),
    * data element: MTART
            MTART_003(004),
    * data element: XFELD
            KZSEL_01_004(001),
    * data element: MAKTX
            MAKTX_005(040),
    * data element: MEINS
            MEINS_006(003),
    * data element: MTPOS_MARA
            MTPOS_MARA_007(004),
          end of record.
    DATA: FLNAME TYPE STRING.
    *** End generated data section ***
    DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.
    *** MESSAGE******
    DATA: BEGIN OF MESSTAB OCCURS 0.
            INCLUDE STRUCTURE BDCMSGCOLL.
            DATA: MATNR TYPE MARA-MATNR,
          END OF MESSTAB.
    ****END OF MESSAGE****
    PARAMETERS: FILENAME TYPE RLGRAP-FILENAME.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME.
      CALL FUNCTION 'F4_FILENAME'
       IMPORTING
         FILE_NAME           = FILENAME.
    start-of-selection.
    *perform open_dataset using dataset.
    perform open_group.
    FLNAME = FILENAME.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = FLNAME
        FILETYPE                      = 'DAT'
    *   HAS_FIELD_SEPARATOR           = ' '
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = record
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT record.
      DATA:
        CNT TYPE I.
        CNT = CNT + 1.
        REFRESH BDCDATA.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MTART'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-MATNR_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-MBRSH_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-MTART_003.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  record-KZSEL_01_004.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-MAKTX_005.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-MEINS_006.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  record-MTPOS_MARA_007.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    *perform bdc_transaction using 'MM01'.
    CALL TRANSACTION 'MM01' USING BDCDATA
                            MODE 'N'
                            UPDATE 'A'
                            MESSAGES INTO MESSTAB.
    READ TABLE MESSTAB INTO MESSTAB INDEX CNT.
       IF MESSTAB-MSGTYP = 'E'.
         MESSTAB-MATNR = RECORD-MATNR_001.
         MODIFY MESSTAB INDEX CNT FROM MESSTAB. " TRANSPORTING MATNR.
       ENDIF.
    ENDLOOP.
    FORM OPEN_GROUP.
      CALL FUNCTION 'BDC_OPEN_GROUP'
             EXPORTING  CLIENT   = SY-MANDT
                        GROUP    = 'MM01'
                        USER     = SY-UNAME
                        KEEP     = 'X'.
    ENDFORM.
    FORM BDC_INSERT.
      CALL FUNCTION 'BDC_INSERT'
       EXPORTING
         TCODE                  = 'MM01'
    *     POST_LOCAL             = NOVBLOCAL
    *     PRINTING               = NOPRINT
    *     SIMUBATCH              = ' '
    *     CTUPARAMS              = ' '
        TABLES
          DYNPROTAB              = BDCDATA
       EXCEPTIONS
         INTERNAL_ERROR         = 1
         NOT_OPEN               = 2
         QUEUE_ERROR            = 3
         TCODE_INVALID          = 4
         PRINTING_INVALID       = 5
         POSTING_INVALID        = 6
         OTHERS                 = 7
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.
    END-OF-SELECTION.
    LOOP AT MESSTAB.
        IF MESSTAB-MSGTYP = 'E'.
          WRITE:/ 'ERROR OCCURED ON MATNR = ',MESSTAB-MATNR , 'MESSAGE : MATNR ALREADY EXISTS IN MARA!!!'.
        ENDIF.
      ENDLOOP.
    perform close_group.
    *perform close_dataset using dataset.
    *&      Form  close_group
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM close_group .
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
       NOT_OPEN          = 1
       QUEUE_ERROR       = 2
       OTHERS            = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " close_group
    *&      Form  bdc_dynpro
    *       text
    *      -->P_0270   text
    *      -->P_0271   text
    FORM bdc_dynpro  USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    *       text
    *      -->P_0275   text
    *      -->P_0276   text
    FORM bdc_field  USING  FNAM FVAL.
      IF FVAL <> ' '.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    " bdc_field
    *Text elements
    * E00 Error opening dataset, return code:
    * I01 Session name
    * I02 Open session
    * I03 Insert transaction
    * I04 Close Session
    * I05 Return code =
    * I06 Error session created
    * S01 Session name
    * S02 User
    * S03 Keep session
    * S04 Lock date
    * S05 Processing Mode
    * S06 Update Mode
    * S07 Generate session
    * S08 Call transaction
    * S09 Error sessn
    * S10 Nodata indicator
    * S11 Short log
    HTH
    Regards,
    Dhruv Shah

  • Block Logistics Company Code

    Hi,
    Could anybody tell me how to block a Company Code in logistics area?
    Thanks in advance!
    Analí

    Hi Rohit,
    I want that any transaction/movement can be done to one specific company code.
    This CC won´t work no more so we want to avoid that any movement can be done.   
    I hope this can clarify
    Thanks!!!

Maybe you are looking for