How to do BDC in mm02 ?

How to do BDC in mm02 ? as different materials have different view.

hi,
refer to the threads.
mm01/mm02 different views, bdc
BDC on MM02 with user view
regards,
srelakshmi

Similar Messages

  • BDC on MM02 with user view

    Hi all,
    I am performing BDC on MM02 to change MRP2 data.
    I have used SELECTION_VIEWS_FIND to get the correct view. It works fine on my screen as i have access to all the views in MM02.
    But when the user runs, it errors out as the user is restricted to only MRP view.
    How do i get my BDC working based on user view?
    Points will rewarded for helpful ans

    Hi Ramesh babu, user has mrp view and my program also uses mrp view.
    But the problem is my program when uses the FM  SELECTION_VIEWS_FIND, it considers almost all view and the MRP 2 view is at 12 position say, but since user has only mrp view MRP 2 is at position 2 and hence mismatch. Now how do i get the current position of view in my program based on the user view?

  • How to insert sales text (MM02) into a single record of a Ztable.

    Hi,
    I'm extracting data from different data base tables and populating a Ztable which has Matnr as primary key and sales text as a field.
    I have already used READ_TEXT to display the text and it is displayed in multiple records which in turn leads to duplication of Material numbers.
    Now I want to avoid duplication of records (Matnr) as this being a primary record, and display the sales text of a particular material number into one single record.
    Can anyone tell me how to insert sales text (MM02) transaction into one single record.
    Thanks,
    Govind

    sorry i am not enough clear about your requirement...
    as i can understand i am explaining to you.
    suppose your itab contains repaeating matnr.
    matnr
    1
    1
    2
    2
    2
    3
    3
    like this.
    data : text(200),
             matnr like mara-matnr.
    loop at itab.
    call READ_TEXT fnmodule.
    loop at tline.
    concatenate text tline-tdline into text.
    endloop.
    matnr = itab-matnr.
    at end of matnr.
    itab1-matnr = matnr.
    itab1-text = text.
    append itab1.
    clear text.
    endat.
    endloop.
    NB change the code as per your requirement
    regards
    shiba dutta

  • Please  Help me How write the BDC program for the MIGO inbound Delivery

    Please help me how to write bdc program for the MIGO Inbound Delivery in 4.7EE Version. Please help me.
    Not in LSMW.  Required call transaction or Session Method. Please help me.
    Mohan

    Run transaction BAPI . Select Logistics Execution/Shipping/InboundDelivery/SaveReplica.. You can use function module BAPI_INB_DELIVERY_SAVEREPLICA in your ABAP program.

  • HR ABAP How to Write BDC For Infotype 0586

    Hi Experts
    Can Any One tell me how to write BDC for Infotype 0586  and also 585.
    If we enter into the maintaining Screen, the lines in the Screen will dynamically changing depending on the values.
    When I am doing recording , If I press page down after entering values in top lines, the lines are changing and the records are not updating Correctly.
    I need to write BDC to Create Change.
    Can any one please help me in this regard?
    Thanks in Advance.
    Regards
    Avinash.

    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    http://www.google.co.in/search?hl=en&q=SAPBDCtable+control&meta=
    http://www.sap-basis-abap.com/abap/handling-table-control-in-bdc.htm
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm

  • How to handle bdc for more than one transaction?

    how to handle bdc for more than one transaction?

    Hi srk,
    I am providing you with some references below. Hope this prove to be helpful to you.
    Method 1:
    Use one BDC_OPEN_GROUP
    Multiple BDC_INSERT 
    One BDC_CLOSE_GROUP.
    Call function BDC_OPENGROUP.
    Build BDC data and call lBDC_INSERT for transaction 1
    Build BDC data and call lBDC_INSERT for transaction 2
    Build BDC data and call lBDC_INSERT for transaction 3
    paas the tcodes to bdc_insert.
    call function BDC_CLOSE_GROUP.
    Also check this out:
    Here we need to record 2 transactions (shdb).
    Once completion of the recording. Populate the data into input internal table .
    Loop the internal table and process the 2 transactions
    like
    1. BDC_OPEN_GROUP
    2. LOOP AT ITAB
    a. Populate first transaction recording data
    and pass transaction to the BDC_INSERT_GROUP.
    BDC_INSERT_GROUP.
    b. Populate second transaction recording data
    and pass transaction to the BDC_INSERT_GROUP.
    BDC_INSERT_GROUP.
    ENDLOOP.
    3. BDC_CLOSE_GROUP
    the above info can be found at : How to use 2 transactions in BDC?
    Also check this out:
    Suppose u have created recordings for transactions 'MM01' 'XK01' and 'VA01'.
    Then do this:
    bdc_open_group.
    after this we have to fill the bdcdata structure for one transaction.here 'MM01'.
    bdc_insert.
    refresh bdcdata.
    after this we have to fill the bdcdata structure for one transaction.here 'xk01'.
    bdc_insert .
    refresh bdcdata.
    after this we have to fill the bdcdata structure for one transaction.here 'va01'.
    bdc_insert.
    bdc_close_group.
    Hope these are useful to you.
    Please reward if any of the above are useful.
    Regards,
    Kalyan

  • BDC FOR MM02

    Hi Friends,
    i want to write a BDC FOR MM02 T.CODE AT PLANT LEVEL AND METERIAL LEVEL.
    I WANT UPLOAD THE BELOW FEILDS DATA :
    THE FIELDS THAT I WANT UPLOAD IS EISBE(SAFETY STOCK) , MAABC(ABC INDICATOR)
    AND WZEIT(LEAD TIME).....AT PLANT LEVEL AND METERIAL LEVEL.
    PLS HELP ME.... IT IS AN URGENT.
    REGARDS,

    because with LSMW , you can standard program RMDATIND (direct input ==> faster than batch input.
    In step 1 : you select standard program (OBject 0020 method 0000)
    In step 2 you define source structure ZSRC_MARA
    In step 3 you list the fields : MATNR, WERKS, MAABC, MINBE
    In step 4 you make the link of your source struture to BGR00, BMM00, BMMH1
    In step 5 you map your fields + BMM00-XEID1 ( you have to flag the views you consider).
    Finished from developpement side
    DAvid

  • How  to debug BDC , Dialog program and Script

    Hi all,
    Please let me know, how to  debug BDC , Dialog program and Script
    Thanks&Regards
    Devi

    <b>SCRIPT DEBUGGING</b>
    When we want to debug the SAPSCRIPT, we need to first activate the debugger, we have 2 ways to activate the Debugger.
    1) Execute the program RSTXDBUG
    2) Go to SE71, from the initial screen enter the form name and press Utilities --> Activate Debugger
    When we are in the Debug screen,
    3.1) F5 will be debug filed by field, that means if a single line is having 5 fields, if we press the F5 this will do field by field,
    3.2) F6 will be line by line, that means when we press the F6, it will debug the line and it will go to the next line. F7 also do the same way
    3.3) F8 will be very useful when we have any include statement in the SCRIPT, if any include is there and we press the F5 or F6 then this will go that Include (normally SO10 or any transaction text), then if we want line by line debugging then we can press the F5 or F6, or if you want to execute that in a single shot then press the F8, then the debugger will be executed that include and come back to the Script debugging.
    Some times in the script, we may right lengthy lines, if we want to debug that whole line, we have an option called Left/Right, this we will find the Debug screen of the script, there is a Push button, we can make use this button to debug.
    We can put the breakpoints in the SCRIPT DEBUGGER also, just press the BREAKPOINT Pushbutton from the debugging screen or press EDIT --> Breakpoint
    If we want to debug the print program from the SCRIPT DEBUGGER, just press SHIFT+F7 or EDIT --> ABAP Debugging
    If we want to see the Windows which are defined in the forms, just press the Go to --> Form --> Windows .if we want to see the pages go to --> Form --> pages. Here we have an option to see the page wise window also go to --> Form --> page Windows
    If we want to see the paragraphs which are defined in that script, press go to --> Styles --> paragraphs. 
    If we want to see the Character formats which are defined in that script, press go to --> Styles --> Character Strings. 
    If we want to see the Page formats which are defined in that script, press go to --> OTF --> Page.
    If we want to see the Elements which are used in the Script, then press go to --> Text Elements --> Form Elements.
    If we want to see the commands which are used in the script, press go to --> Commands --> List
    Finally, if we want to exit from the SCRIPT DEBUGING, simply press Debugger --> Exit
    <b>DEBUG BDC</b>
    ust go into debugging mode and do the BDC step by step, when it comes to the Call Transaction line, check the mode which will be 'N'....Now, overwrite this with 'A' and execute the BDC...It will run in All Screens Mode....
    As suggested above the MODE 'A' will do the trick as it takes you to all screens.
    Normally MODE N will be defaulted as it will be used for background processing,
    Here is a simple tip,
    This will be the call transaction part of the program,
    CALL TRANSACTION 'IW32' USING BDCDATA MODE 'N'
    MESSAGES INTO MESSTAB.
    I would suggest you to make it like this,
    DATA: V_MODE TYPE C VALUE 'N'.
    *<In debug mode set V_MODE = 'A' for debugging>
    CALL TRANSACTION 'IW32' USING BDCDATA MODE V_MODE
    MESSAGES INTO MESSTAB.
    This will be very useful because you just need to change the value of the V_MODE at runtime as A for debugging besides it has N which is the default to be used. (i.e. you need not change the code again and again).
    This will be very useful when you have to debug some program in QA or PRD servers.
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • How to schedule BDC program in background when we use GUI_UPLOAD

    Hi,
    I need to run the BDC program in the back ground. But my flat file is in presentation server and i am using GUI_UPLOAD F.M to upload data into I.T. How to schedule BDC program in background.
    Will anybody help me in this regards.
    Thanks in advance,
    Mythily

    You will either have to put your data file on the application server or make the directory of the presentation server available as part of the file system so that the background job will have access to it via OPEN DATASET... TRANSFER... CLOSE DATASET.

  • How to Make BDC for transcation KKS1

    Hi dear,
    can any one tell me that how to make BDC for KKS1.
    because i have recorded the BDC and converted into the program logic than it is showing the first window but not showing the window with ALV and futher more. So what coding i have to apply.
    Please help.
    Siddarth Jain

    Hi,
    U can record the flow in using SHDB transaction recorder.
    U can record and it will generate the program, u can copy and paste the part of the code that is generated, in ur ALV report. this will call the transaction.
    Do as follows:
    <b>SHDB > New Recording > Specify Recording Name YTEST > Transaction code KKS1 > STRAT RECORDING BUTTON></b>
    then speciy the vales u want to give to run the transaction. U can save and come back as soon as u reach the screen when u want to stop it.
    EG:
    Declare a messtab
    DATA: i_bdcdata TYPE STANDARD TABLE OF bdcdata,
    * Internal table to hold BDC messages
    i_messtab TYPE STANDARD TABLE OF bdcmsgcoll
    * Work area to hold bdcdata value
    DATA: w_bdcdata TYPE bdcdata,
    * Work area to hold BDC messages
    w_messtab TYPE bdcmsgcoll.
    CONSTANTS : c_e type bdcmsgcoll-msgtyp value 'E', "E
    c_a type bdcmsgcoll-msgtyp value 'A', "A
    nodata type c value '/'. "/
    perform f1000_bdc_mm03 using lv_matnr lv_werks.
    FORM f1000_bdc_mm03 USING P_LV_MATNR
    P_LV_WERKS.
    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'
    p_lv_matnr.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(15)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(15)'
    'X'.
    perform bdc_dynpro using 'SAPLMGMM' '0080'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-WERKS'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'RMMG1-WERKS'
    p_lv_werks.
    perform bdc_dynpro using 'SAPLMGMM' '4000'.
    perform bdc_field using 'BDC_OKCODE'
    '=ZU01'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_dynpro using 'SAPLMGMM' '4300'.
    perform bdc_field using 'BDC_OKCODE'
    '=ZU08'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_dynpro using 'SAPLMGMM' '4110'.
    perform bdc_field using 'BDC_OKCODE'
    '=GESV'.
    *perform bdc_field using 'BDC_CURSOR'
    * 'RMMG1-MATNR'.
    call transaction c_transaction_call_MM03 using i_bdcdata MODE 'N'MESSAGES INTO i_messtab.
    <b>Kindly close the previous threads opened by u.</b>
    Message was edited by: Judith Jessie Selvi

  • How to create bdc with table control

    hi all.
    please some body tell me how to create bdc with table control
    or suggest any www with screen shots
    thanks in advance ,
    aparna

    Hi AParna,
    Its very Simple.
    ALl you have to do is set up a counter based on the number of lines in the tabke. when the counter reaches the number of lines in the table hit the next page button which is at the top of every screen in SAP.
    Please refer to the following BDC program I had developed using Table control,
    this is for ME01 transaction.
      LOOP AT T_EORD_HED.
        SELECT SINGLE * FROM MARA WHERE MATNR = T_EORD_HED-MATNR.
        IF SY-SUBRC = 0.
          PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0200'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EORD-MATNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM BDC_FIELD       USING 'EORD-MATNR'
                                        T_EORD_HED-MATNR.       "'58335'.
          PERFORM BDC_FIELD       USING 'EORD-WERKS'
                                        T_EORD_HED-WERKS.       "'0253'.
          L_COUNT = 1.
          LOOP AT T_EORD WHERE MATNR = T_EORD_HED-MATNR
                           AND WERKS = T_EORD_HED-WERKS.
            SELECT SINGLE * FROM LFA1 WHERE LIFNR = T_EORD-LIFNR.
            IF SY-SUBRC = 0.
    * Look into the if condition below
              IF L_COUNT = 010.
                L_COUNT = 1.
                PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0205'.
                PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'EORD-MATNR'.
                PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=NS'.
                L_COUNT = L_COUNT + 1.
              ENDIF.
              PERFORM BDC_DYNPRO      USING 'SAPLMEOR' '0205'.
              PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                            'EORD-AUTET(01)'.
              PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                            '/00'.
              CONCATENATE 'EORD-VDATU' '(' L_COUNT ')' INTO OPR_FIELD.
              WRITE SY-DATUM TO T_EORD-VDATU.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-VDATU.
              CONCATENATE 'EORD-BDATU' '(' L_COUNT ')' INTO OPR_FIELD.
              WRITE T_EORD-BDATU TO V_BDATU.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            V_BDATU.
              CONCATENATE 'EORD-LIFNR' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-LIFNR.
              CONCATENATE 'EORD-EKORG' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            '0001'.
              CONCATENATE 'EORD-RESWK' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-RESWK.
              WRITE T_EORD-MEINS TO V_MEINS.
              CONCATENATE 'EORD-MEINS' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            V_MEINS.
    *          CONCATENATE 'EORD-EBELN' '(' L_COUNT ')' INTO OPR_FIELD.
    *          PERFORM BDC_FIELD       USING 'OPR_FIELD'
    *                                        T_EORD-EBELN.
              CONCATENATE 'EORD-EBELP' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-EBELP.
              IF T_EORD-FLIFN NE SPACE OR T_EORD-FRESW NE SPACE OR
                 T_EORD-FEBEL NE SPACE.
                CONCATENATE 'RM06W-FESKZ' '(' L_COUNT ')' INTO OPR1_FIELD.
                PERFORM BDC_FIELD       USING OPR1_FIELD
                                              'X'.
              ENDIF.
              IF T_EORD-NOTKZ <> ''.
                CONCATENATE 'EORD-NOTKZ' '(' L_COUNT ')' INTO OPR_FIELD.
                PERFORM BDC_FIELD       USING OPR_FIELD
                                              'X'.
              ENDIF.
              CONCATENATE 'EORD-AUTET' '(' L_COUNT ')' INTO OPR_FIELD.
              PERFORM BDC_FIELD       USING OPR_FIELD
                                            T_EORD-AUTET.
              L_COUNT = L_COUNT + 1.
            ENDIF.
          ENDLOOP.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'EORD-MATNR'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=BU'.
          CALL TRANSACTION 'ME01' USING I_BDCDATA
                        MODE UP_MODE
    *                     optIONS  FROM l_opt
                        MESSAGES INTO I_BDCMSGCOLL.
          PERFORM FORMAT_OUTPUT.
        ENDIF.
      ENDLOOP.

  • How to write BDC for tcode F-32

    Hi Experts,
    How to write BDC for tcode F-32 .
    is it possible i recorded in SHDB BUT IF I AM DOING IT'S COMING WRONG .
    plz guide me sir.
    regars,
    Hari
    Edited by: hari311 on Oct 27, 2009 9:22 AM

    There might be that when u provide the data in the selction screen of F-32 and press process open items some custom program might be attached to it and gets executed...
    chek it out..
    if so..
    pass the bdcdata of the second screen into a memory id
    export t_bdcdata into v_memid.
    in that custoom report jus import this..
    then fill the t_bdcdata with the header information and call the transcation f-32..
    Edited by: imran khan on Oct 27, 2009 9:35 AM

  • How to write BDC for KP06

    Hi,
    How to write BDC, for Tcode KP06, How to handle the table control in that Tcode.
    or any other way to upload data for this Tcode.
    Regards
    Manohar

    Hi,
    check the sample code for transaction ME51 and ME21.
    PARAMETERS:
      p_fname TYPE ibipparms-path.
    *" Data declarations...................................................
    Work variables                                                      *
    DATA:
      fs_bdc TYPE bdcdata,
      fs_msg TYPE bdcmsgcoll.
    Internal table to hold bdc data                                     *
    DATA:
         t_bdc LIKE
      STANDARD TABLE
            OF fs_bdc.
    Internal table to hold bdcmessage data                              *
    DATA:
         t_msg LIKE
      STANDARD TABLE
            OF fs_msg.
    DATA:
      w_string(50)  TYPE c,
      w_string1(19) TYPE c,
      w_message(72) TYPE c,
      w_num         TYPE i VALUE 1,
      w_num1        TYPE i.
    *" Type declarations...................................................
    Type declaration of the structure to hold  header data              *
    DATA:
      BEGIN OF t_header  OCCURS 0,
        ftype      TYPE c,
        doctype(10) TYPE c,
        acctcat(4) TYPE c,
        date(10)    TYPE c,
        plant(4)   TYPE n,
        text(10)   TYPE c,
        qty(5)     TYPE n,
        units(5)   TYPE c,
        pgrp(3)    TYPE n,
        mgrp(3)    TYPE n,
        price(2)   TYPE n,
       gacct(6)   TYPE n,
        cost(4)    TYPE n,
      END OF t_header.
                          START-OF-SELECTION EVENT                      *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = syst-cprog
      DYNPRO_NUMBER       = SYST-DYNNR
      FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_fname
    START-OF-SELECTION.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = 'c:\temp\item2.txt'
      FILETYPE                      = 'ASC'
         has_field_separator           = 'X'
        TABLES
          data_tab                      = t_header
       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.                                 " IF SY-SUBRC <> 0
      LOOP AT t_header WHERE ftype = 'H'..
        CLEAR fs_msg.
        IF t_header-ftype = 'H'.
          PERFORM bdc_program USING 'SAPMM06B' '0100'.
          PERFORM bdc_field   USING 'eban-BSART' t_header-doctype.
          PERFORM bdc_field   USING 'eban-KNTTP' t_header-acctcat.
          PERFORM bdc_field   USING 'RM06B-EEIND' t_header-date.
          PERFORM bdc_field   USING 'eban-WERKS' t_header-plant.
          PERFORM bdc_field   USING 'BDC_OKCODE' 'AB'.
        ENDIF.
       IF t_header-ftype = 'I'.
        LOOP AT t_header WHERE ftype = 'I'.
          PERFORM bdc_program USING 'SAPMM06B' '0106'.
          w_string = 'EBAN-TXZ01(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-text.
          w_string = 'EBAN-MENGE(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-qty.
          w_string = 'EBAN-MEINS(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-units.
          w_string = 'EBAN-EKGRP(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-pgrp.
          w_string = 'EBAN-MATKL(01)'.
          w_string+12(1) = w_num.
          PERFORM bdc_field   USING w_string t_header-mgrp.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=KN'.
          w_num = w_num + 1.
          PERFORM bdc_program USING 'SAPMM06B' '0102'.
          PERFORM bdc_field   USING 'EBAN-preis' t_header-price.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=KN'.
          PERFORM bdc_program USING 'SAPMM06B' '0505'.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=KWE'.
          PERFORM bdc_program USING 'SAPlkacb' '0002'.
       PERFORM bdc_field   USING 'EBAN-sakto' t_header-gacct.
          PERFORM bdc_field   USING 'cobl-kostl' t_header-cost.
          PERFORM bdc_field   USING 'BDC_OKCODE' '=ENTE'.
         PERFORM bdc_program USING 'SAPMM06B' '0102'.
         PERFORM bdc_field   USING 'BDC_OKCODE' '/00'.
             ENDIF.
        ENDLOOP.
      ENDLOOP.
      PERFORM bdc_program USING 'SAPMM06B' '0106'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BU'.
         PERFORM BDC_PROGRAM USING 'SAPMM06E' '100'.
    *PERFORM BDC_FIELD USING 'BDC_OKCODE' 'BACK'.
      CALL TRANSACTION 'ME51' USING t_bdc MODE 'N' MESSAGES INTO t_msg.
      LOOP AT t_msg INTO fs_msg.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_msg-msgid
            lang      = sy-langu
            no        = fs_msg-msgnr
            v1        = fs_msg-msgv1
            v2        = fs_msg-msgv2
            v3        = fs_msg-msgv3
            v4        = fs_msg-msgv4
          IMPORTING
            msg       = w_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
           WRITE:
             / w_message.
      ENDLOOP.
      CLEAR t_bdc[].
      PERFORM bdc_program USING 'SAPMM06E' '0100'.
      PERFORM bdc_field   USING 'EKKO-LIFNR' '1000'.
      PERFORM bdc_field   USING 'EKKO-EKORG' '1000'.
      PERFORM bdc_field   USING 'EKKO-EKGRP' '100'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BS'.
      PERFORM bdc_program USING 'SAPMM06E' '0501'.
      PERFORM bdc_field   USING 'EKET-BANFN' fs_msg-msgv1.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=KOPF'.
      PERFORM bdc_program USING 'SAPMM06E' '0125'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'MALL'.
      PERFORM bdc_program USING 'SAPMM06E' '0125'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'REFH'.
      PERFORM bdc_program USING 'SAPMM06E' '0504'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=ENTE'.
      PERFORM bdc_program USING 'SAPMM06E' '0111'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=NEXP'.
    *perform bdc_program using 'SAPLSPO1' '0300'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' 'YES'.
      PERFORM bdc_program USING 'SAPMM06E' '0504'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=ENTE'.
      PERFORM bdc_program USING 'SAPMM06E' '0111'.
      PERFORM bdc_field   USING 'BDC_OKCODE' '=NEXP'.
    *perform bdc_program using 'SAPMM06E' '0504'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=ENTE'.
    *perform bdc_program using 'SAPMM06E' '0111'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=NEXP'.
    perform bdc_program using 'SAPMM06E' '0504'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=ENTE'.
    perform bdc_program using 'SAPMM06E' '0504'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=ENTE'.
    *perform bdc_program using 'SAPMM06E' '0111'.
    *PERFORM BDC_FIELD   USING 'BDC_OKCODE' '=NEXP'.
      PERFORM bdc_program USING 'SAPMM06E' '0120'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BU'.
      CALL TRANSACTION 'ME21' USING t_bdc MODE 'N' MESSAGES INTO t_msg
      LOOP AT t_msg INTO fs_msg.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_msg-msgid
            lang      = sy-langu
            no        = fs_msg-msgnr
            v1        = fs_msg-msgv1
            v2        = fs_msg-msgv2
            v3        = fs_msg-msgv3
            v4        = fs_msg-msgv4
          IMPORTING
            msg       = w_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
           WRITE:
             / W_message.
      ENDLOOP.                             " LOOP T_MSG
      CLEAR t_bdc[].
      PERFORM bdc_program USING 'SAPMM06E' '0105'.
      PERFORM bdc_field   USING 'RM06E-BSTNR' fs_msg-msgv2.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'AB'.
      w_num1 = w_num - 1.
      DO w_num1 TIMES.
        w_string1 = 'RM06E-TCSELFLAG(00)'.
        w_string1+17(1) = w_num1.
        PERFORM bdc_program USING 'SAPMM06E' '0120'.
        PERFORM bdc_field   USING w_string1 'X'.
        PERFORM bdc_field   USING 'BDC_OKCODE' 'DL'.
        w_num1 = w_num1 - 1.
      ENDDO.                               " DO W_NUM1
      PERFORM bdc_program USING 'SAPMM06E' '0120'.
      PERFORM bdc_field   USING 'BDC_OKCODE' 'BU'.
      CALL TRANSACTION 'ME22' USING t_bdc MODE 'A' MESSAGES INTO t_msg.
      LOOP AT t_msg INTO fs_msg.
        CALL FUNCTION 'FORMAT_MESSAGE'
          EXPORTING
            id        = fs_msg-msgid
            lang      = sy-langu
            no        = fs_msg-msgnr
            v1        = fs_msg-msgv1
            v2        = fs_msg-msgv2
            v3        = fs_msg-msgv3
            v4        = fs_msg-msgv4
          IMPORTING
            msg       = w_message
          EXCEPTIONS
            not_found = 1
            OTHERS    = 2.
        WRITE:
          / w_message.
      ENDLOOP.                             " LOOP T_MSG
    *&      Form  bdc_program
    This subroutine gives screenname and screen number                 *
    There are no interface parameters to be passed to this subroutine. *
    FORM bdc_program  USING    value(p_screen)
                               value(p_num).
      CLEAR fs_bdc.
      fs_bdc-program = p_screen.
      fs_bdc-dynpro = p_num.
      fs_bdc-dynbegin = 'X'.
      APPEND fs_bdc TO t_bdc.
    ENDFORM.                               " FORM BDC_PROGRAM
    *&      Form  BDC_FIELD
    This subroutine gives the field name and field value               *
    There are no interface parameters to be passed to this subroutine. *
    FORM bdc_field  USING    value(p_name)
                             value(p_value).
      CLEAR fs_bdc.
      fs_bdc-fnam = p_name.
      fs_bdc-fval = p_value.
      APPEND fs_bdc TO t_bdc.
    ENDFORM.                               " FORM BDC_FIELD
    Regards,
    jaya

  • BDC for MM02 Internal comments - Not working

    I have created a BDC that inputs internal comments using MM02.  It moves the data in okay in the BDC.  The data is there the way it was formated.  Several lines of comments added.  But after it saves the data - it takes all of the lines and appends them into one and fills up the lines.  For example - enter: line 1, then enter line: 2.  Instead of having 2 lines showing 1 on the first and 2 on the second - I get 1 lines howing both: 2.
    Any ideas?

    Check this.  I think you may like it.  This program excepts the material number and changes the internal comment text.   I am forcing two lines, when I check after executing this program, the text is there in two lines.  Please see if you can use the BAPI instead of BDC.
    report zrich_0003 .
    data: headdata type bapimathead.
    data: clientdata type bapi_mara.
    data: clientdatax type bapi_marax.
    data: matlongtext type table of bapi_mltx with header line.
    data: return type  bapiret2 .
    data: returnm type table of bapi_matreturn2 with header line.
    data: xmara type mara.
    parameters: p_matnr type mara-matnr.
    select single * from mara into xmara
              where matnr = p_matnr.
    headdata-material        = xmara-matnr.
    headdata-ind_sector      = xmara-mbrsh.
    headdata-matl_type       = xmara-mtart.
    <b>matlongtext-applobject = 'MATERIAL'.
    matlongtext-text_name  = p_matnr.
    matlongtext-text_id    = 'IVER'.
    matlongtext-langu      = sy-langu.
    matlongtext-text_line = 'This is line 1'.
    append matlongtext.
    matlongtext-applobject = 'MATERIAL'.
    matlongtext-text_name  = p_matnr.
    matlongtext-text_id    = 'IVER'.
    matlongtext-langu      = sy-langu.
    matlongtext-text_line = 'This is line 2'.
    append matlongtext.</b>
    call function 'BAPI_MATERIAL_SAVEDATA'
         exporting
              headdata         = headdata
              clientdata       = clientdata
              clientdatax      = clientdatax
         importing
              return           = return
         tables
    <b>          materiallongtext = matlongtext</b>
              returnmessages   = returnm.
    Regards,
    Rich Heilman
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • How to handle Views in MM02 for corresponding materials

    Hi,
      I got an requirment in MM02, here view is changing depending on the materials, how can i handel this.
    Reply fast plz. i have to finish today.
    Sample codings also
    Regards
    Justin Jayaraj

    1) u  make  the condition type  based  on material type.
    using select query.
    2)do the recording for  all view.
    3)now  for perticular material type.
    make x for view field come  in recording for perticular material type.
    suppose one material type required 3 view.u can write cond like
    if mat_type = 'RAW'.
    bdc code....
    make  x to the view  which are required...
    othervise better option is   lsmw .

Maybe you are looking for

  • How to hook up a Linksys WRT54G to Motorola NVG589. PLEASE HELP!

    Hello,  I have recently switched over to AT&T Uverse and I am loving it. One thing I miss is having extra ethernet ports to plug in my desktop computer and my Xbox 360. When the Uverse technician came in, he installed a Motorola NVG589 modem that als

  • Import standard Purchase Order process and interface tables

    Hi all, We are populating three PO interface tables from our custom developed application. PO_HEADERS_INTERFACE, PO_LINES_INTERFACE and PO_DISTRIBUTIONS_INTERFACE. We are using 11.5.10.2 version of Oracle Apps. Initially we did not manage to populate

  • How to use flash file in webdynpro

    Dear all mentors, I am developing a project for travel management, and wanted that header of webdnypro page will have flash file like wise we develope project in PHP where header of website is of flash flie, same thing i wanted in webdynpro, i am big

  • When offered is it better to use WiFi? than 3 G?

    I will be offered to join a network for wifi (at work etc) is this a better idea? Does it work faster or not matter. Most of the time I am offered this option, I have no idea what wifi this is or the password so I don't join. At work I can use it and

  • Clock in Clock out RPTCORAPP

    Hi All,     I have a requirement for Clock in Clock out approval. Program RPTCORAPP is used to approve bulk clock in and clock out. But this program will not support for Substitutions. Can any one please provide details for handling substitutions by