How to assign a value for Unit of measure (like PC, KG...) in ABAP program?

Hi,
    How to assign a value for Unit of measure (like PC, KG...) in ABAP program?
    I want to assign PC in a field to execute the program, like wa-ENTRY_UOM = 'pc'.
    But the system returen a message that "Unit of measure  is not convertible to stockkeeping unit PC"
    Could anyone tell me how to assign the value??
    Thanks!

hi,
first convert the quantity in the same unit  ( like in you case ST to PC )  by using FM :    MD_CONVERT_MATERIAL_UNIT
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
    EXPORTING
      i_matnr                    = matnr
      i_in_me                    = entry_uom
      i_out_me                   = out_uom
      i_menge                    = quantity
   IMPORTING
     E_MENGE                     = fp_l_v_quant
   EXCEPTIONS
     ERROR_IN_APPLICATION       = 1
     ERROR                      = 2
     OTHERS                     = 3.
  IF sy-subrc <> 0.
          give error message here
   ENDIF.
bcoz in ur program somewhere the quantities etc are compared and there units may be different... so that is why it is showing such error.  so just convert convert the quantity in the same unit  .
regards
rahul
Edited by: RAHUL SHARMA on Jun 17, 2009 9:31 AM

Similar Messages

  • How to assign default values for a timestamp column in a table?

    Hi
    Thank you for reading my post
    how i can make a column in a table to be autofilled with current timestamp ?
    for example when i create a table i want its timestamp field to be autofilled with current time stamp whenever a record generated.
    Thanks

    TEST@db102 SQL> create table test(a number primary key, b timestamp default systimestamp);
    Table created.
    TEST@db102 SQL> insert into test(a) values(1);
    1 row created.
    TEST@db102 SQL> select * from test;
             A B
             1 03-SEP-06 05.56.34.995319 PM
    TEST@db102 SQL>                                                            

  • How to allows decimal place for unit of measure of order confirmation

    Hi Guys
    we have some special cases here that need to confirm the order quantity as decimal place,is that possible made some customizing in code CO11N? or have some ways support it .....
    ex. work order A   10 EA
    - operation 1   : colse 10 EA
    - operation 2   : close 4.5 EA
    Regards/Eric

    Hi,
    You can set a UoM to allow decimals in transaction CUNI. But i fail to understand why you would want to set EA to have decimals.
    If a material is to be managed in decimals then evaluate the usage of a different UoM which allows for decimals.
    Regards,
    Vivek

  • How to assigne multiple value in key of read table

    Hi gurus,
    I want read table xxxx with key field1 = ' xxx' or field1 = 'yyy'.
    how to assign multiple value as key for the same field while reading internal table.
    Regards
    sagar

    Hi ,
    You can loop the internal table like
    loop at  <table xxxx> where field1 = ' xxx' or field1 = 'yyy'
    or you can write two read statements to read the internal table in wrk area.
    read table   <table xxxx> with key field1 = ' xxx'.
    if sy-subrc <>0
    read table   <table xxxx> with key field1 = 'yyy'.
    if sy-subrc = 0
    endif.
    else.
    do your data processing.
    endif.
    Thans.

  • How to assign a value to a parameter {?MyParam} dynamically?

    How to assign a value to a parameter {?MyParam} dynamically?
    Example:
      {?One_Or_Two}  <- my first parameter
      {?MyParam}       <- My second parameter
    The Code:
    If ( {?One_Or_Two} = 'One'  then
        {?MyParam}  = 'One' ;
    else 
        {?MyParam}  = 'Two' ; 
    (THIS IS NOT WORKING FOR ME!  ANYONE KNOW WHY?)
      IT NEVER ASSIGN THE VALUE?
    My Command query looks like:
    SELECT * FROM MyTable
        WHERE MyTable.MyColumn = {?MyParam}
    THANKS

    Hi Joseph,
    I'm a bit unclear as to what you are doing and from what I see you're running in circles. 
    Your Command query is looking for a field that is equal to {?MyParam}. 
    Now you want to take {?MyParam} in the report and change the value after you've set it. 
    Parameters cannot be set from the Command, you can format it and manipulate it but they cannot be set except from the parameters window or from a front-end. 
    Thanks,
    Brian

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • A^b = n ,How to get the value for a ?

    a^b = n ===> n = Math.pow(a,b)
    How to get the value for a ?
    dose Java have API to get the value for a ?
    Thanks for help~~~

    a^b = n
    =>
    a = n^(1/b)
    So,
    a = Math.pow(n,1.0/b)

  • How to define a Value for an Attribute of an Class

    Hi,
    How to define a Value for an Attribute of a Class ...
    ( I need to change the value of an Attribute of a class in standard program ....
    Ex...
       cl_hrce_masterswitches=>infotype_framework_is_active
    Here infotype_framework_is_active is the attribute .. its value in standard program is 'X'... Now i need to change it as '  '.
    How to define it and set value as ' '.

    Hello Surendar
    The static attribute INFOTYPE_FRAMEWORK_IS_ACTIVE is read-only and there is not SETTER method to manipulate its value.
    However, the attribute is filled in the CLASS_CONSTRUCTOR:
    METHOD class_constructor.
        IF ce_is_active                 = true OR
           global_payroll_is_active     = true OR
           mngmt_global_empls_is_active = true.
          infotype_framework_is_active = true.
          perid_infotype_is_active     = true.
        ELSE.
          infotype_framework_is_active = false.
          perid_infotype_is_active     = false.
        ENDIF.
    ENDMETHOD.
    Thus, you need to analyze how attribute CE_IS_ACTIVE, GLOBAL_PAYROLL_IS_ACTIVE and MNGMT_GLOBAL_EMPLS_IS_ACTIVE are filled in the CLASS_CONSTRUCTOR.
    For sure you will find customizing settings that are responsible for this.
    Regards
      Uwe

  • How to insert / Update value for PFAKT in BP Relationship

    Hi Friends / Experts,
    How to insert the value for PFAKT ( Function value ) in BP Relationship in BP tcode , in SAP CRM.
    I have tried it but it BAPI_BUPR_CONTP_CREATE. But I need it with BAPI_BUPR_RELATIONSHIP_CREATE Function Module.
    Please help me out.
    Any Enhancement points in BAPI_BUPR_RELATIONSHIP_CREATE or any user exists. Please let me know.
    Regards,
    KMF.

    you can also acheive this using MERGE( available in sql 2008 and above).
    also, you are referring to DTS. DTS is legacy solution now..are you using sql 2000,  you can use ssis, if you want and it available in sql 2005. as said, there are multiple ways you can do this.. it find the below one a easy solution, since your are
    talking about only one table.. 
    try this example..
    create table test1(sno int primary key,sname varchar(20),scity varchar(20))
    go
    create table test2(sno int primary key,sname varchar(20),scity varchar(20))
    go
    insert into test1
    values(1,'stan','atlanta'),(2,'william','newyork')
    go
    insert into test2
    values(1,'robin','orlando')
    go
    --set this in you sql job and let it run for every half an hour
    MERGE test2 t2
    USING test1 t1
    ON t2.sno = t1.sno
    WHEN MATCHED THEN
    UPDATE
    SET t2.sname = t1.sname,t2.scity=t1.scity
    WHEN NOT MATCHED by target THEN
    Insert(sno,sname,scity)
    values (sno,sname,scity);
    go
    --check this table and clean up
    select * from test2
    go
    drop table test1
    go
    drop table test2
    Hope it Helps!!

  • How to calculate acquisition value for specified day

    Hi,
    in my z program I have a problem how to calculate acquisition value for my asset for specified day.
    Example:
    I have asset created 8.7.2008 with TTYPE 104 (External asset acquisition) with value 5950.
    30.11.2008 there is another TTYPE 272 (Retirement of current-yr acquis., w/o revenue) with value 950.
    So BEFORE 30.11.2008 acquisition value is 5950. After is 5000. Is there any function module (or something else) in SAP system where I can send asset number and date a it return to me acquisition value for that day?
    Many thanks for any answer!

    Hi,
    your suggestion means that I have to compute acquisition value by myself (sum all TTYPE 1** - sum all TTYPE 2**). So SAP does't provide such functionality (LDB ADA have it, because it can compute acquisitiob value for specific day)?
    Mant thanks for answer

  • How to assign NULL value to an ITEM in Forms Personalization?

    Hi,
    how to assign NULL value to an ITEM in Forms Personalization?
    please suggest me.
    Thanks

    I don't know what your form personalization does and maybe I misunderstand you ...
    Try
    :item_name := null;

  • How to select XML value for a namespace when multiple namespaces

    Hi,
    I'm a beginner with this, but I'm doing well with your help from this forum in a recent post selecting out all the detail from my xml
    out into my oracle relational tables. Stumped, though, on how to select a value for xml tag value referenced by a defined namespace.
    Version, XML, what I want to select, and attempted sql is below. Thanks in advance!
    select * from V$VERSION
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE 11.2.0.2.0 Production
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    drop table TRANSCRIPT;
    create table TRANSCRIPT (
    CONTENT xmltype
    <?xml version="1.0" encoding="UTF-8"?>
    <arb:AcademicRecordBatch xmlns:arb="urn:org:pesc:message:AcademicRecordBatch:v1.0.0">
      <hst:HighSchoolTranscript xmlns:hst="urn:org:pesc:message:HighSchoolTranscript:v1.0.0" xmlns:ct="http://ct.transcriptcenter.com">
       <TransmissionData>
          <DocumentID>2013-01-02T09:06:15|D123456789</DocumentID>
       </TransmissionData>
       <Student>
                <Person>
                    <Name>
                        <FirstName>John</FirstName>
                        <LastName>Doe</LastName>                   
                    </Name>
                </Person>
                <AcademicRecord> 
                    <AcademicSession>
                        <Course>
                            <CourseTitle>KEYBOARD 101</CourseTitle>
                            <UserDefinedExtensions>
                              <ct:TranscriptExtensions>
                                 <NCESCode>01001E010456</NCESCode>
                                 <CourseRigor>1</CourseRigor>
                              </ct:TranscriptExtensions>
                          </UserDefinedExtensions>
                        </Course>
                        <Course>
                            <CourseTitle>SCIENCE 101</CourseTitle>
                            <UserDefinedExtensions>
                              <ct:TranscriptExtensions>
                                 <NCESCode>01001E010457</NCESCode>
                                 <CourseRigor>2</CourseRigor>
                              </ct:TranscriptExtensions>
                          </UserDefinedExtensions>                       
                        </Course>
                    </AcademicSession>
                    <AcademicSession>
                        <Course>
                            <CourseTitle>MATH 201</CourseTitle>
                            <UserDefinedExtensions>
                              <ct:TranscriptExtensions>
                                 <NCESCode>01001E010458</NCESCode>
                                 <CourseRigor>2</CourseRigor>
                              </ct:TranscriptExtensions>
                          </UserDefinedExtensions>                                 
                        </Course>
                    </AcademicSession>
             </AcademicRecord>
       </Student>
      </hst:HighSchoolTranscript>
    </arb:AcademicRecordBatch>I want to be able to select the NESCODE associated to each coursetitle (01001E010456, 01001E010457, 01001E010458), with NESCode defined by namespace, but getting out NULL.
    DOCUMENTID     LASTNAME     COURSETITLE     NCESCODE
    2013-01-02T09:06:15|D123456789     Doe     KEYBOARD 101     
    2013-01-02T09:06:15|D123456789     Doe     SCIENCE 101     
    2013-01-02T09:06:15|D123456789     Doe     MATH 201     
    My SQL is below. You'll see where I commented out a couple failed alternatives too. Thanks again in advance for any guidance.
       select x0.DocumentID
             ,x1.LastName
             , x3.CourseTitle
             ,x3.NCESCode
      from TRANSCRIPT t
         , xmltable(                                                                                   
             xmlnamespaces(
               'urn:org:pesc:message:AcademicRecordBatch:v1.0.0' as "ns0"
             , 'urn:org:pesc:message:HighSchoolTranscript:v1.0.0' as "ns1"
            --, 'http://ct.transcriptcenter.com'                               as "ns1b" 
          , '/ns0:AcademicRecordBatch/ns1:HighSchoolTranscript' 
            passing t.content
            columns DocumentID       varchar2(40) path 'TransmissionData/DocumentID'
                       , Student xmltype      path 'Student'     
          ) x0
       , xmltable(
            '/Student'
            passing x0.Student
            columns LastName varchar2(20) path 'Person/Name/LastName'                       
                        ,AcademicRecord   xmltype      path 'AcademicRecord' 
          ) x1          
       , xmltable(
            '/AcademicRecord/AcademicSession' 
            passing x1.AcademicRecord
            columns GradeLevel varchar2(20) path 'StudentLevel/StudentLevelCode'
                  , Courses      xmltype      path 'Course'
          ) x2
              , xmltable(
              xmlnamespaces('http://ct.transcriptcenter.com'  as "ns2b")
              , '/Course'
            passing x2.Courses
            columns CourseTitle varchar2(40) path 'CourseTitle'
                         ,NCESCode  varchar2(20) path 'UserDefinedExtensions/ns2b:ct/NCESCode'
                         --,NCESCode  varchar2(20) path 'UserDefinedExtensions/ns2b:ct/TranscriptExtensions/NCESCode'                     
          ) x3
               

    <<I'm assuming there is more to your XML than you showed, since
    StudentLevel/StudentLevelCode
    is not in the XML, but is in your query. >>
    Yes, to simplify, I left out some of the additional XML data, which is typically present, sorry for any confusion. I should have removed those references to that data in my example which was failing to retrieve the NCESCode data which was denoted by that namespace.
    Thank you very much! Your correction worked. I was not understanding until your correction how to properly reference in the XPATH for that namespace value. I'm a newbie at this, and this is my second post. But I've been able to populate quite a few relational tables and that was the first of several namespace tags I will have to deal with next, and with that help, I should be good with that syntax now.
    Thanks again for your help on this.

  • How to assign the role for created user  thru dynpro App

    Hi All
    How to assign the role for currently created user from Webdynpro App.
    when i enter into the portal after creating the user
    i am getting the following messgae in the portal
    "No portal roles are assigned for this user.If this problem persists, contact your system administrator."
    how to assign the user defined role for the created user from dynpro App
    Regards
    Dhina  Kar J
    Edited by: Dhinakaran Jeyachandran on Feb 1, 2008 12:19 PM
    Edited by: Dhinakaran Jeyachandran on Feb 1, 2008 12:35 PM

    In the User Administration section of your portal find your newly created user and below select "Assigned Roles" tab then press <Modify> button and look through available roles on portal then just simply add and save. But if you want to do it programmatically see below:
    IUserAcountFactory userFactory = UMFactory.getUserAccountFactory();
    // IUser - read only but with IUserAccount is possible to set up user data
    IUserAccountSearchFilter userFilter = userFactory.getUserAccountSearchFilter();
    userFilter.setLogonUid("superuser", ISearchAttribute.LIKE_OPERATOR, false);
    ISearchResult sr = userFactory.search(userFilter);
    for (final Iterator i = new PrincipalIterator(sr); i.hasNext();) {
      IUserAccount user = (IUserAccount) i.next();
    Execute the same search for IRole (or IGroup if needed) get the unique id of them and use newRole(...) and addUserToRole(...) methods from IRoleFactory.
    Of course you don't need search for this principals if you know uniqueness of them. Use appropriate factories to get'em all by this unique id.
    All the features see in  [javadocs|http://help.sap.com/javadocs/NW04S/current/se/index.html]

  • How to assign the vendor for Pipeline material like Oil,power etc.

    Dear All,
    Can anybody tell me , how tp  assign the vendor for Pipeline material like Oil,power etc.

    Dear,
    Create source list ME01 maintain vendor here if vendors are multiple.
    Create Info record ME11for vendor and material combination
    Regards,
    R.Brahmankar

  • How to set defalut values for html:radio

    Hi all,
    can you please tell me how to set defalut values for radio buttons (html:radio) in struts?

    You may have more luck if you ask this Struts specific question in a forum devoted to Struts at their own homepage over there at apache.org. It may also help a lot to read its documentation and tutorials. I would really be surprised if they didn't even document such a trivial thing.

Maybe you are looking for

  • Oracle.apps.fnd.framework.OAException: Could not create Java class

    Hi, Have created a customization in one environment which works just fine. When I deploy it to the next environment I get the error message: oracle.apps.fnd.framework.OAException: Could not create Java class Things I have checked: 1) Imported the per

  • How to retrieve Retrieve document details

    Dear experts, I am looking for a function module to retrieve the details ( Like header , item info etc ) of the below document types. BID   ( RFQ ) BIDX ( RFP ) PCTR ( Contract ) Please help. Thanks & Regards, Murthy

  • Configure JNDI and deploy crystal report in Infoview

    Hi all, I am trying to create a JNDI context and use it while generating a crystal report.Now this report is deployed in Business Objects XI R3.1 Edge repository so users can view them through Infoview. The main reason I wanted to use JNDI is so I do

  • Quicktime finder preview

    I may just be overlooking something, but in older OS X versions, the finder would allow you to preview in quicktime. movie and audio files, you could jump forward and skip around to make sure you had the right file. leopard seems to have taken this a

  • Enter Key - not working in URL bar

    Since the last update to FF 31 (Ubuntu 14.04 64 bit), the ENTER key has stoped working -> when typing web adress in URL bar. Hitting ENter does nothing, as well as the GO arrow (nothing as well). All other applications are fine, only FF is not regist