Code field management for MasterData UDO

I have created a MasterData object and I want to set the AutoManaged property of my form to true in order to get values from my bounded controls to the database automatically. The problem is the Code field  - i don't want it on the form, but adding values for the object doesn't work without it.
Is there a way to have Sap manage the Code on its own like the ManagedSeries for Document UDO?

Hi Tibi,
Is there a way to have Sap manage the Code on its own like the ManagedSeries for Document UDO?
No. You have to manage the code yourself.
My approach is to have the Code field hidden in the form and bounded to the DataBase code field. Then, in the ItemPressed event, when pVal.BeforeAction = True and pVal.ItemUID = "1" and oForm.Mode = ADD_MODE, I generate the next record code and I put it in the DBDataSource.
function to generate the next record code
    Private Function GetNextViaturaCode(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application) As String
        GetNextViaturaCode = "1"
        Dim oRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
        Try
            oRs.DoQuery("IF (SELECT COUNT(*) FROM [dbo].[@ADAT_VIATURA] T0) = 0 SELECT '1' AS 'Próximo Código de Viatura' ELSE SELECT MAX(CONVERT(INT, T0.Code)) + 1 AS 'Próximo Código de Viatura' FROM [dbo].[@ADAT_VIATURA] T0")
            If oRs.RecordCount > 0 Then GetNextViaturaCode = oRs.Fields.Item(0).Value
        Catch ex As Exception
            oApplication.MessageBox("GetNextViaturaCode(): " & oCompany.GetLastErrorCode.ToString & ", " & ex.ToString)
        Finally
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oRs)
            oRs = Nothing
            GC.Collect()
        End Try
    End Function
Regards,
Vítor Vieira

Similar Messages

  • Tax code field under INVOICE Tab to be Mandatory for Inter Company PO

    Dear All,
    In MIRO  Tax code field under INVOICE Tab to be Mandatory for Inter Company PO u2013 ZNB & ZRT for company code 0001.
    How do we set as mandatory fields for those two intercompany document types.
    Regards,
    Teja

    Hi
    If u want to maintain tax code as mandatory field in PO?
    Then SPRO- SAP IMG- MM- Purchasing - Purchase order- Define document types
    In this check the filed selection key for the document types.
    Then select the SPRO- SAP IMG- MM- Purchasing - Purchase order- Define svreen lay out at document level.
    In this for the field selection key select GR/IR control and click on tax as required. and then save
    It will not allow to create PO with out maintaoning tax code.
    If u want to do tax code as mandatory in MIRO
    Then Go to OLMRLIST and make changes accordingly.
    Thanks
    Raman

  • Usage of Company code field in the Change Request for Company

    Hi,
    Would like to know the usage of - Company code field in the UI for Change request for Company.
    1. If a new Company is created, can i assign the company code directly in the UI, will the assignment also replicated to backend in this case?
    2. In case of new Company creation, is it possible for multiple company code assignments?
    3. Is it possible to to pick the existing Company from the F4 list in the CR and assign the company code in the CR? How about the replication work in this case?
    Please share your comments, Thank you.

    Thanks Sanjay.
    Just to summarize and a bit more specific, here is my understanding:
    1. (a). You have mentioned that we can assign new company code also - does this mean i can select            a company code which is not in the F4 list? In such case, how will be the assignment                   replicated? It should ideally create a company code in the backend before the assignment is           processed.
        (b). Usually, if a new company code is created in backend, i need to load that in to MDG tables                 such that it will be active in MDG F4 list, for Company assignments in the Change request.
    2.      Understood
    3.      In the Change request, if i pick existing company from F4 values and edit company related data,          it will be replicated accordingly.
             In the same CR, if i give some value in the company code data, the replication will result in one          more assignment added to the company, so as on date, SAP has given the option of only                    additional assignments to the existing assignments.

  • Version Management for PO Fields

    Hi,
    Curently System is capturing the Version
    Management for PO with Fields, Incoterms, Total Net Order Value, Value Changes, Currency, Deletion indicator in purchasing document & Purchase order quantity.
    But the Requirement is to capture(display) only the Incoterms, Deletion indicator in purchasing document & Purchase order quantity.
    How to filter the other PO Fields in Version Management-  Total Net Order Value, Value Changes & Currency.

    Thank for ur smart reply...
    Here the Requirement is in Purchase Order to capture(display) only the Incoterms, Deletion indicator in purchasing document & Purchase order quantity.
    And to filter the other PO Fields in Version Management- Total Net Order Value, Value Changes & Currency.
    But you had given the suggestion for PR. psl guide me how to do this process for PO process.

  • Error ! No field defined for function Code

    Hello ,
    I have defined everything correctly but when i try to use the push button to go to next screen this message comes up 'No field defined for function Code' .Please advise .
    Thank you ,

    Make sure that you put define the name of the OK_CODE field in your screen.  Go to your screen,   click on the element list tab.  You should have a line which as a TYpe as  "OK".   Put the name as OK_CODE.
    Now in your program.....you need a DATA statement for OK_CODE, and you need to handle the OK_CODE in your PAI of the screen.
    data: ok_code type sy-ucomm.
    *      Module  USER_COMMAND_0100  INPUT
    module user_command_0100 input.
      case ok_code.
        when 'BACK' or 'EXIT' or 'CANCEL'.
          clear ok_code
          set screen 0.
          leave screen.
      endcase.
    endmodule.
    Regards,
    RIch Heilman

  • Field selction for PO at Plant or Company Code level

    Hi All
    We are using single customized document type for PO for all my three company codes.Each company code is having a single plant.My requirement is that certain fields fields to be mandatory for specific plant/company code and not for all plants.How do I achieve this?

    Dear satish Kumar
    If you want your forms should give different output for the same document type, I think it is possible. Tell your ABAPer to use conditions in smart forms based upon object -Company code or some other Cocd unique object to bring in the details of the respective company code details to the layout.
    But I have my doubts for the  fields making mandatory, in a single document type. If you wish your PO screen to behave differently for each Cocd i doubt whether it is possible in one Txn code. Instead of complicating by creating two more Txn codes and have independent screen entries for each Cocd, Keep the fields optional only for all the company codes, but tell the users to make specific entries related to each cocd. This will need  ME21N only but User descipline is must so that they get the required output.
    Regards

  • Error ! No field defined for function Code in MENU EXIT

    Hello All,
    I've created a project in CMOD for the MENU EXIT for handling one menu item in the SAP Standard Menu Bar .
    i.e  under the HELP MENU Item I've included one more sub menu item.
    I've activated the project and I'm able to se the newly added Sub-Menu Item in the activated mode.
    But when I press the newly created Sub Menu Item I'm getting a Message in the Status Bar saying :
    No field defined for the function code
    The Help of it says :
    Message no. 00125
    Diagnosis
    The function code field (OK code field) has not been defined on this screen. If the user selects an application function (not a system function), the system usually provides it in the function code field (OK code field) as well as in SY-UCOMM. This is no longer possible.
    System Response
    The system is unable to inform the application of the current function code. The application should not use field SY_COMM. This field always contains the code of the last function chosen, which is not always identical to the application-relevant code.
    Procedure
    You should always define a field for the function code on every screen. The Screen Painter always proposes such a field (OK category), you only need to assign a name and include the definition in the ABAP program.
    Please let me know what shud be done ?
    Regards,
    Deepu.K

    Don't use this scanrio ! Instead got Access Key and chamged the Std. Program.

  • Property "OK Code Field" for SAP Transaction iViews

    Hi there,
    I created an SAP Transaction iView which is accessing an ECC system using SAP GUI for Html. In the properties of the iView I found the property "OK Code Field" - has anybody a idea how this field is used?
    I hope that there is a possibility to hide the command field with this parameter. Haven't found a possibility to hide that field although I saw that obviously I'm not the first to deal with this issue...
    Any help is rewarded.
    Regards
    Gesine

    Hi,
    To disable OK Code field,
    - Go to SICF TCODE
    - Expand to /default_host/sap/bc/gui/sap/its/webgui service
    - double click to enter properties
    - On Service Data TAB, click Settings Button
    - You have to siwtch to change mode in order to change
    - there add the following parameter
    Parameter: ~NOHEADEROKCODE
    Value: 1

  • No ISO code passed on for field API6850_UOM-DIM_UOM_ISO

    Hi,
    Can anyone tell me the steps to find out which UOM is not having mapped in GTS vs ECC? It doesnot tell which UOM is not passing. It is in production so can't check in GTS.
    Thanks in advance.

    Hi
    The following knowledge Based article details the customising relating to this error:
    1740997 - KBA: No ISO code passed on for field API6850_UOM-DIM_UOM_ISO. Msg no.
    /SAPSLL/CORE_PRODUCT212
    Are you seeing this error with the transfer of a particular product?
    In the material master MM03 (and table marm)  you can see unit of measures defined.
    You would need to ensure that an ISO code exists in transaction CUNI for each uom defined relating to the material being transfered to GTS.
    Hope this helps
    Kind Regards
    Ann Marie

  • Table & Field Name for Tax Code

    Hi Guru,
    Our Client is looking for 1 report in which he wants Tax code & Its Description as per Sales Order No and Line Item No.
    Please let me know How I can fulfill this requirement. Its very urgent.
    Thansk in Advance.
    Dhanu

    Hi
    Sales Order Document
    Sales document header - VBAK and Sales document line item - VBAP     ( VBAK-VBELN = VBAP-VBELN )
    The line items comes from vbap-posnr
    Billing Document
    Billing Document Header - VBRK  Billing item Data VBRP  link   ( VBRK-VBELN = VBRP-VBELN )
    Condition Tables related to pricing - KONV
    VBRK-KNUMV = KONV-KNUMV
    For tax code - konv-mwsk1
    For condition type konv-kntyp
    if u want account doc then bseg-belnr  could be linked
    Thanks,
    Rajat Kumar Sharma

  • View Crystal Report Layout for my UDO Form

    Hi all,
    I try to view a report created for my UDO form. I set all settings in Administration -> Setup -> General -> Report and Layout Manager. Now I wonder what should be assigned to  eventInfo.LayoutKey. I tried assigned report's DocCode from RDOC, DocEntry of my UDO object or UDO Code but nothing works. Always get an error: Incorrect format of argument or something like that - I didn't get an error in English so I tried to translate it.
    How to show a report layout for my UDO form?
    Regards
    Szymon Lipnicki

    Hi and thanks for Your reply.
    Help file contains example how to open report layout prepare in Crystla Reports designer for UDO form.
    //Add Layout Key Event Handler
    SBO_Application.LayoutKeyEvent += new SAPbouiCOM._IApplicationEvents_LayoutKeyEventEventHandler(SBO_Application_LayoutKeyEvent);
    void SBO_Application_LayoutKeyEvent(ref SAPbouiCOM.LayoutKeyInfo eventInfo, out bool BubbleEvent)
        BubbleEvent = true;
        if (eventInfo.ReportTemplate == "A001" && eventInfo.ReportCode == "A001001")
            eventInfo.LayoutKey = 1; //Set the key of the layout
    I am using SAP 8.81.
    Regards
    Szymon

  • Set the default field value to transaction code field, when calling from WD

    Hi all,
    Can we pass the value in a input field of a standard transaction calling from WD application. Suppose we are calling a transaction VA03 in an external window, then how will be pass the value in the VBAK_VBELN screen field.
    Is there any way to pass the value to this transaction field. I have also tried out to set the parameter ID 'AUN' for VA03 transaction VBELN field. But it did not work for me.
    Is there any way to set the default field value to transaction code field, when calling from WD?
    Please suggest, if anyone have any idea.
    Thanks
    Sanket

    Hi,
    I am using the below code to open a standard transaction. It will help you to explain my point more easily.
    DATA: url TYPE string,
              host TYPE string,
              port TYPE string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
    *create URL
      CONCATENATE 'http'
      '://' host ':' port
      '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'VA03'
       INTO url.
    *get the window manager as we are opening t code in external window.
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_window TYPE REF TO if_wd_window.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
    call the url which we created above
      lo_window_manager->create_external_window(
      EXPORTING
      url = url
      RECEIVING
      window = lo_window ).
      lo_window->open( ).
    Note*
    One more query I want to add to this thread, that is there any possibility to call a custom transaction as well?

  • SMTP Error Code : 530 . For more information, see your SMTP server manual.

    Hello,
    I am Getting
    "SMTP Error Code : <530>. For more information, see your SMTP server manual" error, While configuring SMTP in Data Services 4.0 system. I have tried executing the SMTP_TO function on another DS machine which has 3.2 verion installed, but getting the same error.
    FYI,
    1) Able to telnet the Exchange server through Data service machine
    2) Maintained SMTP settings in Data services server manager
    3) using the same SMTP server host name in other SAP systems (ECC,BI,PI) etc and able to send mails.
    Regards
    Puneet

    Thanks for the reply Julian.
    There was a problem in SMTP relay rights on Exchange server. Able to send mails now. Thanks!
    Getting another problem wherein I am not able to send mails to multiple recipients i.e. If I specify 5 recipients in SMTP_TO function and execute the job then Every individual is getting E-Mail having there own ID in TO field, other Id's are not gettting displayed in TO field.
    I hve checked note "1276348 - smtp_to function - multiple recipients not displayed"
    Settings mentioned in the note have been done and job is getting executed without any error but the mails are not getting delivered.
    It would be great if anyone can suggest on how to proceed here.
    Thanks & Regards
    Puneet

  • Field control for Travel expense type

    Hi,
    How can we control "travel expense type"/"Trip type company code specific" field in PR05/employee portal?
    I want to make this as mandatory.
    This field you can see in "PD/FR reimbursement" header PR05 entry screen.
    I have checked in below configuration, but there is no effect if I make it as required input in below configuration.
    Define Schema and Individual Field Control
    Schema and Single Field Control for Web Dynpro
    Any solution will be highly appreciated.
    Regards
    SM

    Hi,
    This field control is not working in ESS portal. Working in PR05 (Travel expense manager).
    Could you please advice the configuration for making the field u201CTrip type, Co. specificu201D(PTP02-BEREI) as mandatory in
    ESS portal?
    If we have not entered any value in this field it is throwing below error.
    "Entry EN NZ does not exist, check your entry"
    Also please let me why this is mandatory to enter and why this is not a mandatory field in standard configuration?
    Note: NZ is Trip provision variant.
    Regards
    SM
    Edited by: shanumonu on Jan 27, 2012 5:37 AM

  • Error after transport: "User defined field Management hanged"

    i have create the document lines table through dot net code ,after creating tables user defined field management set up hanged .if it is possible the re solution please tell me.
    Srinivasan

    Hi S Thirumurugan ,
    You need to create the table using the SDK...if not the User defined field manangement setup cannot open it table will be inconsistant constraint with the table...
    For adding the table through SDK check the SDK Help...
    With regards,
    MadhuSudhana Rao.G

Maybe you are looking for

  • Dunning report difference in dev,testing and prod server in sap

    Hi all.. we are facing a problem while executing the tcode f150 in dev,tsting and production server. while giving the same run on and identification,the different parameters are coming and the status is geting changed. in ker,the process is getting c

  • Video Multipass Subscribtion Question

    i downloaded a subscribtion for 16 episodes to the Colbert Report, i didn't remember i wasn't going to be at home for 7 weeks and the email said reruns can't be downloaded, does this mean that when i come back all of those episodes won't be available

  • Jms sender parallelism

    Hi In the tunning guide i read that parallelism for jms adapter when you have sync calls can be implemented with 2 channels. But this is not possible because you can't create 2 sender agrrements with the same sender,interface but different channels.

  • Time origin of "Global Start Time" in Output Node of Time Loop

    Hi All, Please, do you know how the time returned by Global Time Start (after converting in milliseconds) in the Output Node of a Timed Loop is related to the time returned by "Tick Count (ms)" (if the latter is read at the very start of the loop)? T

  • Serious problem with text variables in table of contents

    I posted this in the regular InDesign forum -- seems that there's no easy solution that would work well in a production environment (only suggestion was to convert the variables to text). However, thought I'd post it here to see if anyone on the scri