To select the field dynamically while fetching th e data

Hi Experts,
We have fields like TKG001, TKG002, TKG003 etc in COST table...
My requirement is that we want the value present in the field TKG0** where ** is the month of system data.
Do we have any method to extract the field dynamically from the table.
Please suggest me how can i achieve the requirement.
Thank you,
Regards,
Kavya

Hello
You can use dynamic field specification
Check this :
REPORT x.
DATA :
      BEGIN OF lw_field,
        field(20),
      END OF lw_field,
      lt_field LIKE STANDARD TABLE OF lw_field.
START-OF-SELECTION.
  lw_field-field = 'BUKRS'.
  APPEND lw_field TO lt_field.
  lw_field-field = 'GJAHR'.
  APPEND lw_field TO lt_field.
  SELECT (lt_field)   "<-- Internal table contains your dynamically specified in parenthesis
  FROM bkpf
  INTO TABLE itab.
  BREAK-POINT.

Similar Messages

  • IPC:bute in the field catalogue while processing configuration or pricing i

    Hi,
    I get this error (Message Class: PRC_MESSAGES_EXT (Messages for Calling Public Pricing Modules), Message Type: E, Message Number 099, Message variables: Message variables 1-4: IPC:bute in the field catalogue while processing configuration or pricing in context spe.condmgnt.customizing.dba.imp.AttributeClassObjectManager.createAttributeClassAttributeClassObjectManager.java)
    when we ran IPC userexits. 
    We've added a field ZZPSTYV in the communication structure and modified the method to define this field like follows:
         public String[] determineRelevantAttributesForRequirement(
              boolean headerAttributes,
              int reqNo) {                         String[] relevantAttributes = new String[0];
         //Header?
         if (headerAttributes) {          }
         //Item
         else {
         //KOMP fields
         switch (reqNo){
              case 900:                              relevantAttributes = new String[] {"ZZPSTYV" };                                   break;
        return relevantAttributes;
    Running this code we get the above listed error.  Same error if we define unnecessarily a standard field, such as SOLD_TO_PARTY in place of ZZPSTYV.  
    Can anyone give us some advise as what we did wrong?  Appreciate it very much,
    Yanhui

    Hi Yanhui,
    Is it a item field?  Remember that mixed fields should be declared at the header in the IPC.
    Missing any other requirements?
    Cheers
    Andrew

  • Passing the fields dynamically by bdc prog to the infotype

    hi,
         I have a requirement to pass the fields dynamically to the infotype database through bdc program from flat file or data set.
                   Here I will give the field values in irregular way but it has to be sort before uploading to the data base of infotype.
            I hope any body can helpl me.
    thanks and regards,
    Sekhar.

    Hi Sekhar,
    1. define the type
    2. internal table & Work area declerations.
    3. use function modules KD_GET_FILENAME_ON_F4 & ALSM_EXCEL_TO_INTERNAL_TABLE to upload the data from excel file.
    4. Loop the internal table which is loaded from ALSM_EXCEL_TO_INTERNAL_TABLE fm and Sort the table based on the field which you required to sort.
    Thanks & Regards,
    Ganesh R K

  • Field symbols for fetching ME51N screen data

    Hi,
    I need to fetch ME51N or ME52N screen data.
    In old Transaction (ME51,ME52) there is this code that work:
    data:wa_eban like eban.
    data:wa_rm06b like rm06b.
    data:va_epstp like rm06b-epstp.
    data:va_knttp like eban-knttp.
    field-symbols <va_eban> structure eban default  wa_eban.
    field-symbols <va_rm06b> structure rm06b default wa_rm06b.
    assign ('(SAPMM06B)EBAN') to <va_eban>.
    assign ('(SAPMM06B)RM06B')  to <va_rm06b>.
    move <va_rm06b>-epstp to va_epstp.
    move <va_eban>-knttp to va_knttp.
    if not <va_eban>-loekz  is initial.
          exit.
    endif.
    This code is used in a FIELD EXIT for compare Data in some Fields.
    In the New Transaction i can't use this code because EBAN and RM06B is empty and return null.
    Can any one tell me if there are Program/Structure combination that return EBAN and RM06B Data?
    Or alternatively whether any better method available for fetching screen data?
    Thanks & Regards
    Angelo

    For more Info see this thread, similar problem is solved, but in ME52N change some things.
    Re: Field symbols for fetching ME21N screen data
    Thanks & Regards
    Angelo

  • Error while selecting the fields in creation of Look-Up

    Hi Experts,
    I am getting following error message when writing a lookup.
    Unknown column name "/BIC/XXXXXX" until runtime, you cannot specify a field list.
    Would like to know whats the cause and how to solve it.
    Regards
    Shubh Karan

    I think you dont have a field named /BIC/XXXXXX in the table from which you are trying to fetch the data. Chech the spelling of the field name and table name.

  • Query for selecting the field of VBRK

    Hi All,
      I have fetched the Ztable into it_bauch.
    In the loop of It_bauch i have to fetch the records of vbrk in which the field of zuonr is wrongly stored in xblnr.
    while fetching VBRK the zuonr0(8) should be comapred with it_zbauch-xblnr2(8).
    select single * from vbrk where fkart = 'F2'
                                      and fktyp = 'L'
                                      and vbtyp = 'M'
                                      and rfbsk = 'C'
                                      and fksto = space.
                                 <b>  and ZUONR0(8)  = it_wabuch-xblnr2(8).</b>
    ZUONR0(8)  = it_wabuch-xblnr2(8).</b>
    the above line cannot be return so the below code is given whether it would work or not or any other solution kindly do respond
          data : begin of it_vbrk occurs 0.
                  include structure vbrk.
          data :  end of it_vbrk.
          data vbrk_flag type c.
    data : begin of wa_vbrk,
              zuonr(8) type c,
              end of wa_vbrk.
    loop at it_bauch.
    select single * from vbrk into  it_vbrk where fkart = 'F2'
                                      and fktyp = 'L'
                                      and vbtyp = 'M'
                                      and rfbsk = 'C'
                                      and fksto = space.
    loop at it_vbrk.
            wa_vbrk-zuonr  = it_vbrk-ZUONR+0(8).
            read table it_wabuch with key xblnr+2(8) = wa_vbrk-zuonr.
            if sy-subrc = 0.
              clear vbrk_flag.
              vbrk_flag = 'X'.
            endif.
            clear wa_vbrk-zuonr.
          endloop.
    if vbrl-zuonr  =  'X'.
    After lot of select querey are there based on above condition would trigger.
    endif.
    endloop.

    data : vxblnr(9).
    vxblnr = it_wabuch-xblnr+2(8).
    concatenate vxblnr '%' into vxblnr.
    select single * from vbrk where fkart = 'F2'
    and fktyp = 'L'
    and vbtyp = 'M'
    and rfbsk = 'C'
    and fksto = space.
    and ZUONR like vxblnr.
    regards
    shiba dutta

  • How to display the fields dynamically in OAF

    Hi All,
    I have developed a OAF Page and it has one table region and has 5 rows on it.One of the field on the table is Message Choice.
    The requirement is,If I select "Parts" then Lov Field should be displayed and If I select "Services" then one text field should be appear on that perticular table row.
    I have created a PPR on Message Choice and done the coding as follows,but it is not working;
    Please help me to achive it.
    if("lineChange".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM)))
    String rowReference =pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    OARow row = (OARow)am.findRowByRef(rowReference);
    String claimCategory = (String)row.getAttribute("ClaimLineType");
    if ("Parts".equals(claimCategory))
    row.setAttribute("ClaimPartNoLovRender", Boolean.TRUE);
    row.setAttribute("ClaimPartNoRender", Boolean.FALSE);
    else
    row.setAttribute("ClaimPartNoRender", Boolean.TRUE);
    row.setAttribute("ClaimPartNoLovRender", Boolean.FALSE);
    Please let me know if there are any other ways to achive the same.
    Thanks in Advance..

    You might have the wrong forum. This forum is on IOP.

  • How can I select the existing worksheet while using OLE2 to open the template workboo

    Source:
    application:=ole2.create_obj('Excel.Application');
    workbooks:=ole2.get_obj_property(application,'Workbooks');
    args := ole2.create_arglist;
    ole2.add_arg(args, 'c:\RptTemplate.xlt');
    workbook:=ole2.invoke_obj(workbooks,'Open',args);
    ole2.destroy_arglist(args);
    worksheets:=ole2.get_obj_property(application,'Worksheets');
    args := ole2.create_arglist;
    ole2.add_arg(args, 'Sheet1');      
    worksheet     :=ole2.invoke_obj(worksheets,'Select',args);
    ole2.destroy_arglist(args);
    Problem:
    1. While executing the above code, error -305500 occurs after executing "worksheet := ole2.invoke_obj(worksheets','Select',args)". How can I select the sheet i wanted in the template ??
    2. As I refer to the forms on-line document, it stated that the ole2 programmers documentation can provide all object types and methods that can be used with the OLE2. Does any link can provided to download the specified documentation ??

    The error is probably that your Worksheets variable is actually empty. Looking at your code I think the problem is that you try and get the value of the worksheets collection from the application then you should try and get it from the Workbooks object.

  • Cannot select the fields for table view WB2_V_MKPF_MSEG2

    Hi, I have a program where the query is using join statement of MSEG and MKPF.  As part of the performance enhancement I use Table View WB2_V_MKPF_MSEG2 instead.
    Validation: Entries in MSEG and MKPF is the same as in  WB2_V_MKPF_MSEG2 = OK (via SE16)
    But upon debugging the program on SY-SUBRC breakpoint, I can see 5 rows appended in internal table T_MSEG "BUT" the entries are all blank.
    The entries in my SE16 are exact data that's appearing on the filter statement in my SQL query below.  SE16 is giving correct output, but using table view in my SQL does not give me the correct output.
    (Note: This is my first time to use table view in ABAP-SQL)
      SELECT MATNR_I BWART_I MENGE_I
        FROM  WB2_V_MKPF_MSEG2
          INTO CORRESPONDING FIELDS OF TABLE T_MSEG
      WHERE MATNR_I IN R_MATNR3
          AND  MATNR_I IN R_COMPNTS
          AND  WERKS_I EQ P_WERKS
          AND  BWART_I EQ '931'
         AND  BUDAT    IN S_GSTRP 
         AND  MJAHR    EQ W_DOC_YEAR.
    IF SY-SUBRC EQ 0.
    ENDIF.
    THANKS, appreciate your inputs.
    Regards,
    Jun

    Hi Suhas,
    I just did a short test just now:
    REPORT  ZTEST_SELVIEW.
    TABLES: WB2_V_MKPF_MSEG2.
    TYPES: BEGIN OF Y_MSEG,
             MATNR LIKE MSEG-MATNR,
             BWART LIKE MSEG-BWART,
             MENGE LIKE MSEG-MENGE,
           END   OF Y_MSEG.
    DATA: T_MSEG TYPE STANDARD TABLE OF Y_MSEG.
    SELECT MATNR_I
           BWART_I
           MENGE_I
      FROM WB2_V_MKPF_MSEG2
      INTO CORRESPONDING FIELDS OF TABLE T_MSEG
    WHERE MATNR_I EQ '000000000000004000'
       AND WERKS_I EQ '0288'
       AND BWART_I EQ '931'
    *   AND BUDAT   EQ '20071117'
       AND MJAHR   EQ '2007'.
    IF SY-SUBRC EQ 0.
    ENDIF.
    In my debug, T_MSEG contains the same number of rows that my SE16>WB2_V_MKPF_MSEG2(using the hard coded statement in my SQL) "BUT" each rows does not have any entries.  Bottomline, I can't only see blank entries in ITAB T_MSEG but the rows are being selected properly, so the itab contains x-number of rows with blank entries.
    Thanks.

  • Drop Down for Selecting the doc type while uploading?

    Hi all,
    Is it possible to create some document type in KM so that we can select the doc type and  upload the file to specific folder.
    What I mean from Doc type is like Doc for Meetings, Doc for activity report.
    Is it possible using standard KM features? Urgent help needed pls reply.
    Pls send the document regarding this to [email protected]

    Hi Karan,
    I'm not sure if I have understood your issue correctly, but let me try:
    1. You want to upload documents to KM
    2. Uploading them, you want to categorize them in some way, so that they can be identified as docs for meetings, docs for unit XYZ, etc..
    3. After upload, you want each doc to end up in a folder according to its category
    If this is what you want, try the following:
    1. Create a custom resource property called "category" or something similiar.
    2. You may define your possible values for that property. This makes it a drop down box containing the possible values in property view. (You can see property view when uploadinga document)
    3. Mark the property as searchable
    4. Create a taxonomy using TREX searching your repository for the given values of your custom property
    Now you can upload documents, fill the custom property, and some minutes later TREX will create a link to the document in the specified 'category folder'.
    If you need some more detailed assistance, please come back.
    HTH,
    Carsten

  • Re: Getting an error after selecting the install directory while installing odi 12c

    Hi,
    After I select the directory for installing ODI and click next,it gives me error saying :-
    INST-07545: Unexpected Error. sealing violation: can't seal package javax.xml.bind.annotation: already loaded
    I did some research and all I got is its an unexpected error from the below link.
    http://docs.oracle.com/middleware/1212/core/FMERR/chapter_inst_messages.htm
    Any help is much appreciated.
    Edit :
    I am using Windows 7 Professional (Service Pack 1 ) 64 bit operating system and am executing the following jar file odi_121200.jar.
    Thanks and Regards
    Sunil

    Please check level for JAVA:
    Java 2 Standard Edition 1.4.2 (J2SE) -- included with the Mozilla 1.4 Browser
    Using previous versions of the J2SE may result in some compatibility issues using the Mozilla 1.4 Browser. For more information on the Java platform compatibility with previous releases please visit: http://java.sun.com/j2se/1.4.2/compatibility.html

  • Field symbols for fetching ME21N screen data

    Hi,
    I need to fetch ME21N screen data,i.e,line item data( material number),for which i have written code as below:
    IF SY-TCODE = 'ME21N' OR
       SY-TCODE = 'ME22N'.
    ematn = '(SAPLMEGUI)MEPO1211-EMATN'.
    ENDIF.
    FIELD-SYMBOLS : <fs1> TYPE ANY.
    ASSIGN (ematn) TO <fs1>.
    But data is not coming to <fs1>.
    Can any one tell me whether any mistake in above statement.
    Or alternatively whether any better method available for fetching screen data?
    I need to use this data in a pricing routine.
    Thanks & Regards
    Seshagiri.

    Hi,
    The combination of both these can be used-
    we can read the screnn fields using this FM-
    DYNP_VALUES_READ
    ***TO READ VALUES
    CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                DYNAME                   = W_PROG
                DYNUMB                   = W_DYNP
                TRANSLATE_TO_UPPER       = 'X'
           TABLES
                DYNPFIELDS               =  T_DYNPRO.
      READ TABLE  T_DYNPRO INDEX 1 INTO FIELD_VALUE.
      W_CARRID = FIELD_VALUE-FIELDVALUE.
    Paricularly for Material numbers this aslo shoud be used -
    CONVERSION_EXIT_MATN1_INPUT
    Thanks & Regards,
    Chandralekha.

  • How do I select the AX green light to flash on data?

    I am using Airport Utility 6.2 on a MBA in a network consisting of a 4th Gen AE extended by a 1st Gen AX and I cannot seem to find the option to change the AX green light to flasj on data. What am I missing?

    AirPort Utility 6.2 does not provide this type of feature.
    If you install AirPort Utility 5.6, you could use that version to set up the AirPorts to flash green on activity. AirPort Utility 5.6 was designed to run on the Lion operating system.  You will need to use a workaround mentioned in the link below if you want to install AirPort Utility 5.6 on Mountain Lion, since Apple's installler will not allow you to do this.
    This is not supported by Apple. It does work for me as well as others, but there is no way to predict whether it might work for you.
    http://www.macworld.com/article/1167965/mountain_lion_and_the_ancient_airport_ba se_station.html

  • Field name while fetching its content from db table dynamically.

    Hi Experts,
    I am new to ABAP and I  have a situation as follows.
    I have a table say ztable where there are seven fields monday,tuesday,wednesday,thursday,friday and saturday.
    Depending on the current calender day i have to fetch the content.
    Suppose for monday, i have to fetch ztable-monday.
    Is there any other way other than using if statements 7 times ? Like i wanna capture the day and substitute it in the place of z_table-"day".
    Please help.
    Thanks,

    Hi,
    In the below code you can pass any field of the table in W_FIELD.... It will fetch the particular field from the table....
    w_block should be of same data element of your field in W_FIELD
    PARAMETER : w_field TYPE NAME_FELD.
    DATA w_block(1) TYPE c.
    Select single (w_field) FROM RSEG INTO w_block
      WHERE belnr EQ '5105701294'.
      IF sy-subrc EQ 0.
        WRITE / w_block.
      ENDIF.
    Thanks and regards,
    Senthil Kumar Anantham.
    Edited by: Senthil Kumar on Jul 2, 2010 5:37 PM

  • Error: Validation failed for the field - Status While creating Sales Order

    Hi,
    I am getting an error while trying to create sales order header.
    I have tried using provided in the metalink as well but it still doesn't seem to work.
    I am on R12.1.1
    Can somebody help me out on this?
    The code is
    set serveroutput on
    DECLARE
    l_header_rec OE_ORDER_PUB.Header_Rec_Type;
    l_header_rec1 OE_ORDER_PUB.Header_Rec_Type;
    l_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
    l_line_tbl1 OE_ORDER_PUB.Line_Tbl_Type;
    l_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type;
    l_header_adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type;
    l_line_adj_tbl OE_ORDER_PUB.line_adj_tbl_Type;
    l_header_scr_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type;
    l_line_scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type;
    l_request_rec OE_ORDER_PUB.Request_Rec_Type ;
    l_return_status VARCHAR2(1000);
    l_msg_count NUMBER;
    l_msg_data VARCHAR2(1000);
    p_api_version_number NUMBER :=1.0;
    p_init_msg_list VARCHAR2(10) := FND_API.G_FALSE;
    p_return_values VARCHAR2(10) := FND_API.G_FALSE;
    p_action_commit VARCHAR2(10) := FND_API.G_FALSE;
    x_return_status VARCHAR2(1);
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(100);
    p_header_rec OE_ORDER_PUB.Header_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_REC; 
    p_old_header_rec OE_ORDER_PUB.Header_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_REC;
    p_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_VAL_REC;
    p_old_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type := OE_ORDER_PUB.G_MISS_HEADER_VAL_REC;
    p_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_TBL;
    p_old_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_TBL;
    p_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_VAL_TBL;
    p_old_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_VAL_TBL;
    p_Header_price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_PRICE_ATT_TBL;
    p_old_Header_Price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_PRICE_ATT_TBL;
    p_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ATT_TBL;
    p_old_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ATT_TBL;
    p_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL;
    p_old_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL;
    p_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_TBL;
    p_old_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_TBL;
    p_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL;
    p_old_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL;
    p_line_tbl OE_ORDER_PUB.Line_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_TBL;
    p_old_line_tbl OE_ORDER_PUB.Line_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_TBL;
    p_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_VAL_TBL;
    p_old_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_VAL_TBL;
    p_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_TBL;
    p_old_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_TBL;
    p_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_VAL_TBL;
    p_old_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_VAL_TBL;
    p_Line_price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_PRICE_ATT_TBL;
    p_old_Line_Price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_PRICE_ATT_TBL;
    p_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ATT_TBL;
    p_old_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ATT_TBL;
    p_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ASSOC_TBL;
    p_old_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_ADJ_ASSOC_TBL;
    p_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_TBL;
    p_old_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_TBL;
    p_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_VAL_TBL;
    p_old_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LINE_SCREDIT_VAL_TBL;
    p_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_TBL;
    p_old_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_TBL;
    p_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_VAL_TBL;
    p_old_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type := OE_ORDER_PUB.G_MISS_LOT_SERIAL_VAL_TBL;
    p_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type := OE_ORDER_PUB.G_MISS_REQUEST_TBL;
    x_header_val_rec OE_ORDER_PUB.Header_Val_Rec_Type;
    x_Header_Adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type;
    x_Header_Adj_val_tbl OE_ORDER_PUB.Header_Adj_Val_Tbl_Type;
    x_Header_price_Att_tbl OE_ORDER_PUB.Header_Price_Att_Tbl_Type;
    x_Header_Adj_Att_tbl OE_ORDER_PUB.Header_Adj_Att_Tbl_Type;
    x_Header_Adj_Assoc_tbl OE_ORDER_PUB.Header_Adj_Assoc_Tbl_Type;
    x_Header_Scredit_tbl OE_ORDER_PUB.Header_Scredit_Tbl_Type;
    x_Header_Scredit_val_tbl OE_ORDER_PUB.Header_Scredit_Val_Tbl_Type; 
    x_line_val_tbl OE_ORDER_PUB.Line_Val_Tbl_Type;
    x_Line_Adj_tbl OE_ORDER_PUB.Line_Adj_Tbl_Type;
    x_Line_Adj_val_tbl OE_ORDER_PUB.Line_Adj_Val_Tbl_Type;
    x_Line_price_Att_tbl OE_ORDER_PUB.Line_Price_Att_Tbl_Type;
    x_Line_Adj_Att_tbl OE_ORDER_PUB.Line_Adj_Att_Tbl_Type;
    x_Line_Adj_Assoc_tbl OE_ORDER_PUB.Line_Adj_Assoc_Tbl_Type;
    x_Line_Scredit_tbl OE_ORDER_PUB.Line_Scredit_Tbl_Type;
    x_Line_Scredit_val_tbl OE_ORDER_PUB.Line_Scredit_Val_Tbl_Type;
    x_Lot_Serial_tbl OE_ORDER_PUB.Lot_Serial_Tbl_Type;
    x_Lot_Serial_val_tbl OE_ORDER_PUB.Lot_Serial_Val_Tbl_Type;
    x_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type; 
    X_DEBUG_FILE VARCHAR2(100);
    l_line_tbl_index NUMBER;
    l_msg_index_out NUMBER(10);
    BEGIN
    oe_debug_pub.debug_on;
    DBMS_APPLICATION_INFO.set_client_info (121);
    dbms_output.enable(1000000);
    fnd_global.apps_initialize(2787,50703,660); -- pass in user_id, responsibility_id, and application_id
    oe_msg_pub.initialize;
    oe_debug_pub.initialize;
    MO_GLOBAL.init('ONT');
    X_DEBUG_FILE := OE_DEBUG_PUB.Set_Debug_Mode('FILE');
    oe_debug_pub.SetDebugLevel(5); -- Use 5 for the most debuging output, I warn you its a lot of data
    dbms_output.put_line('START OF NEW DEBUG');
    --This is to CREATE an order header and an order line
    --Create Header record
    --Initialize header record to missing
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    l_header_rec.pricing_date := SYSDATE;
    l_header_rec.sold_to_org_id := 2096;
    l_header_rec.ordered_date := SYSDATE;
    l_header_rec.sold_from_org_id := 121     ;
    l_header_rec.salesrep_id := -3;
    l_header_rec.order_type_id := 1003;
    l_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
    l_line_tbl_index :=1;
    -- FIRST LINE RECORD
    -- Initialize record to missing
    l_line_tbl(l_line_tbl_index) := OE_ORDER_PUB.G_MISS_LINE_REC;
    -- Line attributes
    l_line_tbl(l_line_tbl_index).inventory_item_id := 124516;
    l_line_tbl(l_line_tbl_index).ordered_quantity := 500;
    l_line_tbl(l_line_tbl_index).ship_from_org_id := 563;
    l_line_tbl(l_line_tbl_index).operation := OE_GLOBALS.G_OPR_CREATE;
    -- CALL TO PROCESS ORDER Check the return status and then commit.
    OE_ORDER_PUB.process_order (
      p_api_version_number => 1.0
      , p_init_msg_list => fnd_api.g_false
      , p_return_values => fnd_api.g_false
      , p_action_commit => fnd_api.g_false
      , x_return_status => l_return_status
      , x_msg_count => l_msg_count
      , x_msg_data => l_msg_data
      , p_header_rec => l_header_rec
      , p_line_tbl => l_line_tbl
      , p_action_request_tbl => l_action_request_tbl
       -- OUT PARAMETERS
      , x_header_rec => l_header_rec1
      , x_header_val_rec => x_header_val_rec
      , x_Header_Adj_tbl => x_Header_Adj_tbl
      , x_Header_Adj_val_tbl => x_Header_Adj_val_tbl
      , x_Header_price_Att_tbl => x_Header_price_Att_tbl
      , x_Header_Adj_Att_tbl => x_Header_Adj_Att_tbl
      , x_Header_Adj_Assoc_tbl => x_Header_Adj_Assoc_tbl
      , x_Header_Scredit_tbl => x_Header_Scredit_tbl
      , x_Header_Scredit_val_tbl => x_Header_Scredit_val_tbl
      , x_line_tbl => l_line_tbl1
      , x_line_val_tbl => x_line_val_tbl
      , x_Line_Adj_tbl => x_Line_Adj_tbl
      , x_Line_Adj_val_tbl => x_Line_Adj_val_tbl
      , x_Line_price_Att_tbl => x_Line_price_Att_tbl
      , x_Line_Adj_Att_tbl => x_Line_Adj_Att_tbl
      , x_Line_Adj_Assoc_tbl => x_Line_Adj_Assoc_tbl
      , x_Line_Scredit_tbl => x_Line_Scredit_tbl
      , x_Line_Scredit_val_tbl => x_Line_Scredit_val_tbl
      , x_Lot_Serial_tbl => x_Lot_Serial_tbl
      , x_Lot_Serial_val_tbl => x_Lot_Serial_val_tbl
      , x_action_request_tbl => l_action_request_tbl
      dbms_output.put_line('OM Debug file: ' ||oe_debug_pub.G_DIR||'/'||oe_debug_pub.G_FILE); 
      oe_debug_pub.debug_off;
      -- Retrieve messages
      FOR i IN 1 .. l_msg_count
      LOOP
       Oe_Msg_Pub.get( p_msg_index => i
        , p_encoded => Fnd_Api.G_FALSE
        , p_data => l_msg_data
        , p_msg_index_out => l_msg_index_out);
       DBMS_OUTPUT.PUT_LINE('message is: ' || l_msg_data);
       DBMS_OUTPUT.PUT_LINE('message index is: ' || l_msg_index_out);
      END LOOP;
    -- Check the return status
    IF l_return_status = FND_API.G_RET_STS_SUCCESS
    THEN
      dbms_output.put_line('Process Order Sucess');
      dbms_output.put_line('new Header id:' || l_header_rec1.header_id);
    ELSE
      dbms_output.put_line('Failed');
    END IF;
    Commit;
    END; Regards
    knick

    Kinck
    The same script worked for me in vision (R12.1). You may have issues with your defaulting of a number of attributes that you are not passing in the API (like price list, line type and so on). You may want to check them.
    Thanks
    Nagamohan

Maybe you are looking for

  • In order to create a web service on SAP R/3 what are the prerequisites.

    Hi All I want to create a web service(for a bapi) on SAP R/3  which will be used by a third party application. I dont know anything about creating a web service. My question is <b>in order to create a web service do we need to run Sap R/3 on netweave

  • Japanese character appear rotated when applying a Formula on the field

    We have a problem where the japanese character appear well on the report when simply drag and drop a field that contained japanese data from the database BUT it display the japanese character rotated horizontally when we apply a simple formula on it.

  • Imposing a check constraint between 0 - 20

    I am having some trouble imposing a range check constraint on TOTALNOMS, I want for this number to be within 0 - 20. What is the SQL please? SQL> DESC MOVIE; Name Null? Type MOVIEID NOT NULL CHAR(3) TITLE CHAR(36) YEAR NUMBER COMPANY CHAR(50) TOTALNO

  • Cannot choose to sync Tones??? Help please

    Ok... hope this makes sense and that someone can give me some idea how to fix this problem please. I synced my phone to my laptop (which has been updated with latest version of itunes) and my music/ringtones etc have been synced with my phone but the

  • How to make 1x images from @2x

    Dumb question I guess, but I have a bunch of slices all made at 2x and now need to make the 1x versions. Can someone tell me how to do them? Thanks.