Fill transaction fields automatically through code

Hi Gurus,
Every time we create a material we have to extend it in all plants and in all storage location of every plant.
The steps that we are using are: We first create the material to a plant and a storage location using transaction
MM01. Then we use transaction mm17 and we extend the materials in all plants automatically.
Then we use transaction MMSC to extend material to every storage location. We enter the material code, the plant code and after hitting enter we fill the fields with the storage locations of the plant where we want to extend material to. We have 9 plants and 3 storage location on every plant, so we do this procedure (mmsc) 9 x 3 = 27 times.
Is there a way to write code to fill automatically the fields in MMSC transcaction from a file so that can automate the procedure? Any Ideas how to start?
Thank you in advance

Hi!
Here's an example of this stuff, 100% working, but of course you have to change the BDC part for your code...
REFRESH: gt_bdcdata.
      PERFORM bdc_dynpro      USING 'ZMFI_AA_KTGH' '9502'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=ENTER'.
      PERFORM bdc_field       USING 'ANLZ-KOSTL' gs_change_asset-kostl.
      PERFORM bdc_field       USING 'ANLZ-ADATU' gs_change_asset-bdatu.
      PERFORM bdc_field       USING 'ANLZ-PERNR' gs_change_asset-pernr.
      PERFORM bdc_field       USING 'ANLZ-STADT' gs_change_asset-stadt.
      PERFORM bdc_field       USING 'ANLZ-XSTIL' gs_change_asset-xstil.
      PERFORM bdc_field       USING 'ANLZ-RAUMN' gs_change_asset-raumn.
      PERFORM bdc_dynpro      USING 'ZMFI_AA_KTGH' '9502'.
      PERFORM bdc_field       USING 'BDC_OKCODE' 'DUMMY_OK_CODE'.
      MOVE 'E' TO lv_mode.
      CALL TRANSACTION 'ZMFIAA_MOD' USING gt_bdcdata
                                         MODE lv_mode.
It is very important to give a 'DUMMY_OK_CODE' where you wanted to stop the processing. It is because the dummy ok code will cause a BDC error and the process will stop there and you'll get back the control.
Regards
Tamá

Similar Messages

  • Firefox freezes during various operations (scrolling, filling form fields, clicking through the options menu, etc.)

    Almost any activity in Firefox is subject to brief freezing. The freeze lasts anywhere from (approx.) 1/2 second to 3 seconds. I searched online and I came across an article stating the freezes may be due to Anti-Virus software. The work-around presented was to set browser.sessionstore.enabled to false. The idea is Firefox does not attempt to write to a file, and so my AV software doesn't waste time checking if the access is valid. The change had some positive effect. The freezes now occur less often.
    However, the freezes still occur every few seconds, still to the point of major annoyance. So what I did was run Process Monitor while Firefox was running to see if the freezes coincided with file accesses. Indeed they do.
    I would like to know if I can change a setting which will cause Firefox to not access these files (or files like these) so often:
    firefox.exe QueryOpen C:\WINDOWS\system32\msimtf.dll
    firefox.exe ReadFile C:\Documents and Settings\<username>\Local Settings\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\Cache\_CACHE_001_
    firefox.exe LockFile C:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\content-prefs.sqlite
    firefox.exe QueryOpen C:\Documents and Settings\<username>\Local Settings\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\Cache\5ACD1B8Ed01
    firefox.exe WriteFile C:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\cookies.sqlite-journal
    There are hundreds of such accesses over just tens of seconds. These files are accessed while I'm e.g. scrolling down the page. I could understand if they were accessed while loading or drawing the page, but again this is occurring while I'm merely scrolling down the page and typing in this very text box!

    Almost any activity in Firefox is subject to brief freezing. The freeze lasts anywhere from (approx.) 1/2 second to 3 seconds. I searched online and I came across an article stating the freezes may be due to Anti-Virus software. The work-around presented was to set browser.sessionstore.enabled to false. The idea is Firefox does not attempt to write to a file, and so my AV software doesn't waste time checking if the access is valid. The change had some positive effect. The freezes now occur less often.
    However, the freezes still occur every few seconds, still to the point of major annoyance. So what I did was run Process Monitor while Firefox was running to see if the freezes coincided with file accesses. Indeed they do.
    I would like to know if I can change a setting which will cause Firefox to not access these files (or files like these) so often:
    firefox.exe QueryOpen C:\WINDOWS\system32\msimtf.dll
    firefox.exe ReadFile C:\Documents and Settings\<username>\Local Settings\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\Cache\_CACHE_001_
    firefox.exe LockFile C:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\content-prefs.sqlite
    firefox.exe QueryOpen C:\Documents and Settings\<username>\Local Settings\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\Cache\5ACD1B8Ed01
    firefox.exe WriteFile C:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\Profiles\k33hi6th.default\cookies.sqlite-journal
    There are hundreds of such accesses over just tens of seconds. These files are accessed while I'm e.g. scrolling down the page. I could understand if they were accessed while loading or drawing the page, but again this is occurring while I'm merely scrolling down the page and typing in this very text box!

  • How to fill values in the system matrix through code

    hi
    All
    i want to fill the system matrix in the sales order in such a way that
    Items will be filled in system matrix in the lost focust event of the Customer Code selection in the Sales order Document
    how can i fill the system matrix through code
    one thing that first column(ItemCode)  of the system matrix column is a Icombbox type
    Now i need to fill out item code using code
    can any one suggest the answer
    thanks in advance

    madhu,
    You need to catch the Validate event, when pVal.BeforeAction = False for form items 4 (CardCode) and 54 (CardName) of the Sales Order form.
    Concerning the form's matrix, you can fill it but you cannot change it (you cannot change the ItemCode column into a ComboBox. Is is a EditText)
    Fill a System matrix's Cell with the following code:
        Dim oMatrix As SAPbouiCOM.Matrix = oForm.Items.Item("38").Specific
        oMatrix.Columns.Item("ItemCode").Cells.Item(Row_Num).Specific.Value = "Item_Code"
    Regards,
    Vítor Vieira

  • Filling alloction field for a subledger account by posting invoice by MIRO

    Hi, at this moment I am struggling with a problem concerning filling the field Allocation at line item of an GL account. When I am posting invoice by MIRO, I want to see certain information on line item of an GL Account. When I am posting an invoice by MIRO, this field is for P&L accounts and balancesheet accounts filled with the value such a determined in FS00, tab Control data, field Sort Key. So therefore all my accounts has the sort key Purchase order. When posting invoices by MIRO, the posting in FI, is showing me on line item level the PO-number in the field Allocation.
    However, when I am posting an invoce by MIRO on an reconcilliation account for asset, the allocation field is empty, MIRO is not filling this field automatically. Although the settings of the sort key is the same as for other balance or P&L accounts.
    Has anybody an idea how the allocation field can be filled automatically for an reconcilliation account for assets

    Hi
    Run the program RM07CUFA
    in SE38 Tcode and check the inconsistencies.
    Also in FS00 go to details of the GL account and double click on field status group under create bank interest tab and then double click material management/additional assignments.
    You can see the required or suppressed fields

  • Automatic filling of field in sel screen where match code obj is used

    Dear all.
    Suppose you have a selection screen with two fields:
    pa_usid  and  pa_name,
    both fields are obligatory.
    The user wants - as soon as field pa_usid is filled  from the list opened through the matchcode obj,
    default value  gets filled in  pa_name(based on the value he actually filled in
    pa_usid).
    How can i do that this.
    Below is my code ;
    parameters: pa_usid LIKE gs_leave-userid  MATCHCODE OBJECT zname_lp2 OBLIGATORY DEFAULT sy-uname,,
                        pa_name LIKE gs_leave-name   OBLIGATORY,
    Thank you all very much in advance.

    Please go through below links
    How to fill another parameter automatically on selection screen?
    http://www.sap-img.com/abap/value-request-for-parameter.htm

  • Call transaction skip first screen and fill a field

    Hi,
    I have got a requirement where need to call transaction VA01 by filling the fields on the first screen like order type, sales area using set parameter IDs and need to skip first screen. There is additional requirement apart from this where I need to fill the field 'Proforma' with some value 'X' in the header 'Additional data A' while calling transaction VA01.
    Is there any shortway to do this without using BDCdata?
    Thanks
    SD

    Hi,
    I had this kind of requirement earlier. But in my case I need to pre populate several values and then show the screen for user input. Here is my suggestion for you. Follow below code for filling BDC DATA internal table and call transaction in "E" error mode. This should show the screen finally for user input. In this code find for "?" and replace it with your field name and field value.  Remember to check validity of screen # and names with you system.
    Thanks,
    Amara.
    Moderator message - Please respect the 5,000 character maximum when posting. Post only the relevant portions of code. Do not use code tags to format text
    Edited by: Rob Burbank on Dec 22, 2010 6:08 PM

  • How to have a field automatically fill in another field when checked

    Does anyone know if there is a way to have a field automatically fill in another field with a specific dollar amount when a field is checked.
    I am doing a registration sheet for a charity event where we have to pay for each person that attends. I would like it set up so that when someone checks in the person at the registration table would just click the check box (E2) and then have it fill in the field next to it a dollar amount of $15.00 (F2) which would be owed to the place hosting the event.
    Attached is a picture of the spreadsheet: example: persons checks off E2 and the amount $15.00 would automatically fill in field F2. I would then do this for each line and have the F column total the amount owed to the place.
    I am VERY new to numbers and writing formulas so if you can be specfic with how to do the code would be greatly appreciated. THANK YOU!

    please remember to post the actual solution (equation in this case) so others that are searching for similar items see the solution, not just
    Got it, replaced 0 with '''.
    Thanks
    Jason

  • For creation of follow up transactions automatically through Actions do we require copy control?

    Hi All,
    I have to create folow up transactions automatically when quotation gets approved. My question is when we create a follow up transaction automatically through Action Profile is it required to have copy control settings or not?
    Thanks,
    Rao

    the idea of using copy control would be to copy the data as needed from the base transaction so that your follow up transaction data is consistent. You need to check your requirement and find attributes that needs to be copied over before you determine this.
    I hope this helps.
    Thanks,
    Aparna

  • Automatically fill in field from first letter of another field

    Hi,
    I have a situation where i would like to fill in a field automatically, dependant on the first letter entered in another field.
    Here's some examples:
    1. Field one - A6805B  Field two - 'UHF' (As A = UHF)
    2. Field one - E1234C  Feild two - 'VHF' (As E = VHF)
    3. Field one - S5673D  Field two - 'Error - No Frequency' (As S doesn't have an equivalent)
    Can anyone help?
    Cheers
    Rob

    Hi Rob,
    You can do this by assigning the first letter to a variable and then testing that variable.
    A sample is here: https://acrobat.com/#d=OoLUPLu1Qy1*8Uxz7*hG6Q
    Hope that helps,
    Niall

  • Filling Activity fields from the Interactive Script WinClient

    Hi Experts,
    I am working with Interactive Scripting (CRMM_TM_SCRIPT) and I already defined my interactive script. I am also creating Activities after I finish with the Script in order to register a case. I am doing this by defining an Action Type CIC-AB which calls an Action Box in the Interaction Center WinClient. In the Action field I define the name of the Activity I want to call from the Action Box of the Interaction Center.
    When the Agent receives a call, he navigates in the Interactive Script in order to clasify the case he is treating. At the end of the Script, the case needs to be register following the clasification made by the Agent, and that’s why we are calling an Activity. The thing is that we don’t want the Agent to fill again the information he just defined in the Script in the Activiy, so we want to fill certain fields of the Activiy I am calling with Information of the Interactive Script I used before, in order to save time to the Agent that Register the Case.
    Can anyome shed some light on this issue?
    Thanks to everyone.

    Alberto
    You can create an activity.i.e., you can create an Order from the Interactive Script if you already created the Script structurethen follow the below steps
    I think it would be helpful
    Procedure: 
    T-Code:  EWFC0
    Path: SPRO&#61664;IMG&#61664;Customer Relationship Management&#61664;Customer Interaction Center&#61664;Visible Components&#61664;Action Box Settings&#61664;Define Configuration Profile for Action Box.
    1. Choose F4 help to select one of the Action Box profiles you have created and you want to adapt and choose change.
    2. Mark the Action box Configuration and create a new Action Box Group by choosing Create transaction group.
    Enter a group ID, description and icon for the new transaction group and choose Continue.
    3. Mark the new transaction group and create a new Action Box transaction by choosing Create transaction.
    4. Enter a transaction ID.
    5. Enter a Transaction Definition section, select Workspace.
    6. In the Transaction Definition section, select Workspace.
    Two additional fields will appear.
    7 Choose F4 in the Workspace field to select the Script.
    8. Choose F4 in the profile field to select the Interactive Scripting profile that you created in the previous steps above.
    9. Enter a Slot Name if desired.
    10. Choose Continue.
    You are automatically taken to the Maintain Data Flow screen .No data flow parameters need to be maintained for the Interactive Scripting workspace.
    11. Choose Back.
    12 Choose Save.
    Note:  Since Only Workspace of this type can be open at once, you will need to close the Automatically Created Interactive Scripting Workspace before launching the Interactive Scripting Action Box call.
    Regards
    Surendra

  • SAP MM Purchase Order custom field pulling through to FI

    Hi
    I have no idea where to start.  I need to create a custom field in the Purchase order which has to pull through to FI.  I've created an Account Assignment category I - Insurance and need to have a field on the Purchase order where the users can fill in the Claim Number. (Reference field).
    I thought I could maybe use the Unloading point field as we don't use it currently, but it doesn't pull through to reports on FI.
    Secondly I would like to link my Account assignment category to a specific General Ledger account (when the user choses Aac I, I would like a G/L to automatically populate and be grey (no changes possible)
    Thanks so much!
    Carina

    I Actually think I found the answer here - http://www.bluemarlinsys.com/ns/0603-03.asp
    1) How to default a General Ledger account on a Purchase Order account assignment for an inventory item?
    When you create a standard Purchase Order using ‘K’ account assignment to expense an inventory item with GL account and cost center, the system expects you to key in GL account number and the cost center. In case you don’t want to use the account modification ‘VBR’ assigned GL account number, it is possible to default a separate GL account with standard configuration steps.
    a) Transaction: OME9 (Maintain account assignment categories)
    Create a new account assignment category ‘Z’ by making a copy of account assignment category ‘K’.  Change account modification to ‘ZBR’.
    b) Transaction: OMGO (Define combination of item categories/account assignment categories)
    Assign account assignment category created in previous step to an item category blank or space.
    Note:
    This is an optional step, if you don’t want to touch the standard ‘K’ cost center account assignment.
    c) Transaction: OBYC (Automatic account assignment configuration)
    Choose account transaction key ‘GBB’ by double clicking the existing entry and choose the appropriate chart of account for your company. Assign the GL account that needs to be defaulted for general modification ‘ZBR’ and valuation class ‘RAW’ (use appropriate valuation class set-up in your company).
    d) Transaction: ME21N to create a purchase order to test the configuration.
    When you create a PO with account assignment ‘Z’ for an inventory item, the system should default the above-configured GL account.
    2) How to default a GL account for a material group when a purchase order is created without a material master?
    If you want to create a purchase order without a material master (service/expense items), the standard SAP R/3 4.x and higher releases, offer functionality to assign a valuation class to a material group. This way automatic MM account assignment can be set-up to drive the appropriate GL account for a material group/valuation class in your company.
    a) Transaction: OMSK (Define valuation class):
    b) Transaction: OMQM (Entry aids for items without a material master):
    Assign the appropriate valuation class for a material group.
    c) Transaction: OME9 (Maintain account assignment categories)
    Create a new account assignment category ‘Z’ by making a copy of account assignment category ‘K’.  Change account modification to ‘ZBR’.
    d) Transaction: OMGO (Define the combination of item categories/account assignment categories)
    Assign the account assignment category created in previous step to an item category blank or space.
    Note:
    This is an optional step if you don’t want to touch the standard ‘K’ cost center account assignment.
    e) Transaction: OBYC:  (Automatic account assignment configuration)
    Choose account transaction key ‘GBB’ by double clicking the existing entry and choose appropriate chart of account for your company. Assign the GL account that needs to be defaulted for general modification ‘ZBR’ and valuation class ‘TRF’ (use the appropriate valuation class set-up in your company).
    f) Transaction: ME21N to create a purchase order to test the configuration.
    Standard order type, Account assignment category ‘Z’ and Material Group ‘TRAFFIC’.
    Account assignment screen:
    Note:
    Before configuring account assignment, please discuss this with your SAP FI/CO functional contact and Accounting department key user for mapping valuation class to General ledger account numbers etc.
    Some of my colleagues in MM Purchasing liked this configuration and I thought your company might also benefit from this in case you want to default the GL account in purchasing to avoid wrong account coding.  

  • Dynamic form str_replace add transaction fields

    Hi there, I have a dynamic form with a hidden field.
    Through the option "Add Transaction Fields" it is filled and saved to the
    database with the data of another field in the form. This is all working
    fine.
    What I want is that in the value of the add transaction fields the spaces
    are replaced with an _.
    For example that:
    "this is an example" is put in the database like "this_is_an_example".
    Hope I make myself clear.

    Hi Henk,
    that´s rather easy :: create a Custom Trigger, set it to BEFORE, and use the following code:
    $tNG->setColumnValue("column_name", str_replace(' ','_',$tNG->getColumnValue("column_name")));
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Transaction Variant for T. Code - FBL1N

    Hi,
    I want to create a Transaction Variant for T. Code - FBL1N.
    Actually, My requirement is that I want to give a Dynamic Selection "Reconciliation acct-XXXXXX"... After Create  the variant for this, i want to disable the Dynamic Selections Icon. I want both things at a time..
    Please tell...
    Regards....

    Hi,
    Even though question is already marked as answered, I think that Pince Kummar requirement was not fulfilled.
    Those are the steps that you should execute:
    1. Create a Selection Variant:
    In FBL1N transaction, enter your required field values, and click on the save icon. Maintain variant attributes as you need. Assign to your selection variant a name beginning with CUS&. With that prefix you specify that is a customer system variant.
    2. Assign the created selection variant as default for tcode FBL1N.
    Go to SE93 and change FBL1N, on "Start with variant" field select your created CUS& variant and save.
    At this time you can notice that FBL1N transaction always begin with your selection variant.
    3. If you also want to disable Dynamic selections function, you should create a Standard transaction variant.
    Go to SHD0, enter the transaction code name (FBL1N). In the Standard Variants tab enter a name and choose create function. Automatically FBL1N selection image will be showed, click back button to return. In the screen that now is showed, choose "Menu Functions" and enter Program "RSSYSTDB" and gui status "%_00" and click Menu Functions, then in the tree that come out, find and select Dyamic Selections function (%_00->Edit->DYNS), next click disable button and then continue button.
    Now you return to Transaction variants maintenance screen. Make sure that in deactive functions list, for Dynamic selections function is only active "For Transaction" check box. Now save and activate your transaction variant.

  • Purchase order service type through code

    Hi Experts,
    Can we create a purchase order of type service through code ?
    Please give me some sample codes
    Thanks in advance
    Regards
    Arun

    Hello,
    I think this is an userfield? Or a field that i don't know?
    purchaseOrder.Lines.LocationCode = 2
    For testing you must keep your code simple, first only fill the mandatory fields:
    And catch you errormessage as well.
    Dim purchaseOrder As SAPbobsCOM.Documents = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
                'Set values to the fields
                purchaseOrder.DocObjectCode = BoObjectTypes.oPurchaseOrders
                purchaseOrder.CardCode = "V0001"
                purchaseOrder.DocType = BoDocumentTypes.dDocument_Service
                purchaseOrder.DocDate = Today
                 purchaseOrder.DocDueDate = Today
                purchaseOrder.TaxDate = Today
                purchaseOrder.Lines.ItemDescription = "TESTPO"
                purchaseOrder.Lines.AccountCode = "500201"
                Dim lRetCode As Integer
                lRetCode = purchaseOrder.Add
                If lRetCode != 0 Then
                    B1Connections.theAppl.SetStatusBarMessage("Error occured.", SAPbouiCOM.BoMessageTime.bmt_Short, True)
                Else
                    B1Connections.theAppl.SetStatusBarMessage("Purchase order created.", SAPbouiCOM.BoMessageTime.bmt_Short, True)
                End If
    HTH Regards Teun
    Edited by: Teun Aben on Oct 22, 2010 3:54 PM

  • Starting SAP transaction in between ABAP code

    Hi,
    How can I start a particular transaction in between ABAP code if certain condition is true.
    Regards,
    Tushar.

    If a program has a transaction code, there are two ways of starting it from another program.
    If you do not want to return to the calling program at the end of the new transaction, use the statement:
    LEAVE TO TRANSACTION <tcod> [AND SKIP FIRST SCREEN].
    This statement ends the calling program and starts transaction <tcod>. This deletes the call stack (internal sessions) of all previous programs. At the end of the transaction, the system returns to the area menu from which the original program in the call stack was started.
    If, on the other hand, you do not want to return to the calling program at the end of the new transaction, use the statement:
    CALL TRANSACTION <tcod> [AND SKIP FIRST SCREEN] [USING <itab>].
    This statement saves the data of the calling program, and starts transaction <tcod>. At the end of the transaction, the system returns to the statement following the call in the calling report. If the LEAVE statement occurs within the called transaction, the transaction ends and control returns to the program in which the call occurred.
    You can use a variable to specify the transaction <tcod>. This allows you to call transactions statically as well as dynamically.
    The addition AND SKIP FIRST SCREEN allows you to prevent the initial screen of the new transaction from being displayed. The first screen to be displayed is then the specified Next screen in the screen attributes of the initial screen. If the first screen calls itself as the next screen, you cannot skip it.
    Furthermore, the AND SKIP FIRST SCREEN option works only if all mandatory fields on the initial screen of the new transaction are filled completely and correctly with input values from SPA/GPA parameters.
    The USING ITAB addition in the CALL TRANSACTION statement allows you to pass an internal table <itab> to the new transaction. <itab> has the form of a batch input table. For further information about batch input tables, refer to Importing Data With Batch Input.
    Cheers
    Nishanth

Maybe you are looking for

  • Magic Track Pad with Lion 10.7 and Safari zoom aA vs Pinch to zoom

    Hi, I enjoy a Mac Mini (early 2009) hooked to a 50 inch plasma and surf from my couch, stream etc... We browse with Safari 5.X and enjoyed the new Magic Track Pad with Snow Leopard. You could zoom / scale Safari with Snow Leopard beautifully, with a

  • Oracle Application Server 4081 don't raise.

    Hi !!! I installed OAS 4.0.8.1 on Windows NT Server 4.0 with Service Pack 5 (June 1999). I have a Oracle Database installed at the same machine (8.0.4 EE) because I installed OAS at other ORACLE_HOME. I follow the steps (workaround) showed at the doc

  • Instant Portal anonymous access?

    I'd like to make Instant Portal our web facing portal but I've been told by a few people at Oracle that you cannot allow anonymous access. I would have to use the full blown Portal, which I'm not opposed to doing, but having said that....is there any

  • Problem updating rating of documents using IRepositoryServiceFactory

    Hi, I am updating rating using the below code snippet. IRepositoryServiceFactory repServiceFactory =ResourceFactory.getInstance().getServiceFactory(); IResourceFactory aResourceFactory = ResourceFactory.getInstance(); IResource aResource = aResourceF

  • Get the url!help pl!

    Hi! Am doing a redirection to a page if the user gives the url directly in the browser.After redirecting I need to get the url which the user typed!Can anybody help pl!Thanks.