Not able to connect to DB2 using generic connectivity

Hi
We are trying to connect to DB2 using Oracle Generic connectivity and we are getting ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from ODB2
Log file is not even generated even though we set the parameter to debug. We are using Oracle 10g on Linux and Neon Shadow direct to connect to db2.
The following are the setup we had done in our oracle db side
initdb2.ora
HS_FDS_CONNECT_INFO=NEON_dev_conn
HS_FDS_TRACE_LEVEL=DEBUG
HS_FDS_SHAREABLE_NAME=/home/NEON/Shadow/lib/libscodbc_r.so
added below entry in listener.ora
(SID_DESC =
(PROGRAM = hsodbc)
(ENVS=LD_LIBRARY_PATH=/home/oracle/product/10.2.0/lib:/home/NEON/Shadow/lib)
(SID_NAME = db2)
(ORACLE_HOME = /home/oracle/product/10.2.0)
added below entry in tnsnames.ora
DB2ODBC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = test.db.com)(PORT =1523))
(CONNECT_DATA =
(SERVICE_NAME = db2)
(HS = OK)
Please suggest on this.
Regards
S. Senthil

No gateway log information generated even with setting trave level to DEBUG indcates that the listener cannot start the gateway process.
Please check the listener.log for details on the failure. Secondly, what kind of Linux is it? 32- or 64-bit?
Regards,
Ed

Similar Messages

  • I purchased a 3TB Airport Time Capsule After 8 hours been able to configure the box using Ethernet connection but now I want to move my current backups and it wants authentication but no box is available to provide my administrator name can anyone help ?

    I purchased a 3TB Airport Time Capsule to use with my Mac running latest Maverics. After 8 hours been able to configure the box using Ethernet connection but now I want to move my current backups from my small driveand it wants authentication but no box is available to provide my administrator name can anyone help ?

    I overcame the permissions by allowing both paths to have read and write access to anyone but that didnt solve it until I copied it into the DATA directory which I created on the Airport Time Capsule.
    I had already discovered the TIME MACHINE How to transfer backups but I am struggling still with the item and cannot currently get it to work. My setup seems to have created a wireless link to my router which is what I wanted and in that set up there are three options. I have simply gone for the extension of my network. I ignored the other option there which I cannot remember something like DNS? That may be the problem becasuse when I remove the Ethernet connector it just doesnt go anywhere.
    I have also found I cannot update my TIME MACHINE software (currently 1.3) as although Apple tell me I should be able to set backups hourly daily or weekly I have only ever been able to run it hourly when i would prefer longer intervals so thought an update might be necssary.
    Also tried to get an update for my Airport Utility (Currently 6.3.2 but cannot find one even though I have read there might be one available and again this might be the problem.
    Have reset the Time Capsule now about a dozen times.
    Following the instructions and trying to copy my existing backup it suggests you need to copy it to the root directory but that is when I get some sort of security issue and I found I could only get it to accept if I dragged my .backupdb to the DATA directory on the Time Capsule. I dont even know if I do this it will work when I come to use it.
    I therefore found your reply of no more help than i had discovered but I hope you return to read this note because I really do need some help.
    I am intending starting again in the next couple of days and fully documenting what I do and what I see and then as I suspect it will be no different and I will then seek an appointment at the Apple Store in Trafford Centre and if that proves unsuccessful then I still have time to return and become a dissatisfied customer with Apple for the first time in a long experience with Apple. I have noticed frightening notes on the conversations which point to problems of Mavericks working with Airport Time Machine!! So in the end it might not be me doing anything wrong. Unfortunately you do feel left out in the dark sometimes that is why I hope you can respond with a solution?

  • Using Generic Connectivity Agent on Linux

    Hello All,
    My dbms is Oracle 8i Release 3 (8.1.7), my OS is Linux RedHat 7.0. I want to establish a connection from Oracle to an ODBC data source. So, I know I have to use Generic Connectivity Agent, but I can't find execution file for this agent which the Listener will execute. The only file I have is hsodbc.o in $ORACLE_HOME/hs/lib path. Are there anybody who knows how can I link this object file, or where can I get a linked one?
    Best regards, Roman Zhirov ([email protected])
    null

    Note that the Oracle ODBC driver is not involved at all when you're trying to use Oracle's generic connectivity. Thus, this probably isn't the forum you want to ask this question in.
    Since there isn't a generic connectivity forum, you might try posting to the Linux group. Alternately, it may be necessary to contact Oracle Support.
    Justin

  • TS3276 I am not able to Mobile Me email account to connect with iCloud or my Apple Mail program. Don't know if my settings are correct or not. Can anyone help me with this please?

    I am not able to Mobile Me email account to connect with iCloud or my Apple Mail program. Don't know if my settings are correct or not. Can anyone help me with this please?

    http://support.apple.com/kb/HT5922
    If you want to mirror your desktop, see:
    http://support.apple.com/kb/HT5404
    Regards.

  • Not able to change the password using FNDCPASS

    I am not able to change password using FNDCPASS. I am getting follwoing error while executing following command with APPLMGR user ( before that I have source the .env file ) (OS-Linux)
    [applmgr@ora11 /]$ FNDCPASS apps/apps 0 Y system/manager SYSTEM APPLSYS WELCOME
    Log filename : L2741743.log
    Report filename : O2741743.out
    APP-FND-01630: Cannot open file L2741743.log for appending
    Cause: FDPFOP encountered an error when attempting to open file L2741743.log for appending.
    Action: Verify that the filename is correct and that the environment variables controlling that filename are correct.
    Action: If the file is opened in read mode, check that the file exists. Check that you have privileges to read the file in the file directory. Contact your system administrator to obtain read privileges.
    Action: If the file is opened in write or append mode, check that you have privileges to create and write files in the file directory. Contact your system administrator to obtain create and write privileges.
    Can some one pls guide me on this

    Duplicate post-
    Not able to change the password using FNDCPASS
    Please post only once.
    Thanks,

  • Certen user is not able to create the sc using sepecific vendor

    Hi,
    User is not able to create the SC entering specific  vendor .
    This vendor is in maintained in SRM for one pur.org (I have checked in PPOMA_BBP).
    Then why he is not able to creating the sc using this Vendor

    whether user is belong to same region of the Vendor or different. Is there any enhancements you have like that.
    Please check those things.
    Hope this will help.
    Thanks
    Venkatesh P

  • I am not able to print double side using HP 2015dn printer using imac

      I am not able to print double side using HP 2015dn printer using imac.

    I found this information on HP site, but the article was quite old. May still be relevant:
    1. Create a multi page document, or something that is more than one page.
    2. Go to File/Page Setup.
    3. Ensure the printer is listed in the Format for menu.
    4. Click OK.
    5. Go to File/Print but do not print yet.
    6. Change the Copies and Pages menu to 'Layout'.
    7. The Two-Sided option will be selectable only if the P2015 is listed in the Printer menu at the top of the print dialogue box.
    8. Once you have chosen Long-edged binding, for example, click Print.

  • HT4425 I was told by apple support the thunderbolt connection could be used to connect an 800 fire wire. Is that correct?

    I was told by apple support the thunderbolt connection could be used to connect an 800 fire wire. Is that correct?

    Only if you are able to find a Thunderbolt to Firewire adaptor.

  • Connecting Two PC using internet connection ??

    Hi,
    I want to develop one software so that I can connect two PC using internet connection means one is host and another is remote.So that I can access remote PC's Hard drive using internet connction.Can any one plz give me some guideline how I can start.Eagerly waiting for someone reply.
    Thanks & Regards
    Bikash

    This is not what you have in mind, but it will work.
    Create a server that listens for connections from a client. Create a list of commands that can be issued by client to view information. Such a list in your case would be similar to the following:
    Open
    ChageDir
    Rename
    CreateDir
    DeleteDir
    ListDir
    Next, you need to implement the processes that will actually do the command on the remote computer. When the client issues the "ListDir" command, then adds a line (the path of the directory to list) the server should then do this (vary simple, but you get the idea):
    File file = new File(theDirectory);
    if (file.isDirectory()) {
    String[] list = file.list();
    socketOutputStream.println("Directory " + theDirectory);
    for (int i=0; i<list.length;i++) {
    socketOutputStream.println(list);
    socketOutputStream.flush();
    So, you should get the idea from this. For each command, have a method to handle the actual work on the server-side, then have the server send the resulting data back to the client for display. Notice how much this looks like DOS. It's the same idea - a command line interface (called a CLI).

  • I am trying to authenticate at Filevault preboot using external Serial (RS232) to USB convertor where USB port is connected to my mac machine.But on preboot I am not able to type the password using console where my machine is connected.

    I am using an external keyboard which is actually a Device KeyAT who do the keyboard simulator kind of operation over Serial (RS232) to USB connector.
    I have a controller machine connected with Serial Port and MAC machine is connected by a USB port to that device.
    I am able to type the password on OS X login screen but on using the same device and set up on Filevault preboot I am not able to type the password.
    This connector is detected as a USB 2.0 composite device in System Hardware table.
    Can someone hints or point out a potential cause or to rectify this issue.
    Thanks in Advance.

    Which os version are you using? 
    Which iPod Nano model do you have?  iPod Models 
    iPod not recognized in iTunes and Mac desktop 

  • Not able to recieve calls on N70 when connected to...

    Hi all
    I am using N70 and connects my laptop to internet with bluetooth or usb cable .
    I am not sure if this is problem with my N70 or this is as designed that I am not able to receive any calls when connected to internet.
    Any idea guys how to fix this issue?
    Thanks

    Software issue maybe?
    Feel free to hit the KUDOS button if you think I deserved it.........

  • Not able to build osb jar using osb 10.3

    Hi All,
    I am working on developing an osb jar from workspace(osb 10.3) using ant scripts.When i am trying to invoke an ant with target "export" it show an error "Java returned :13".I went through the entire post sent by respected people over the forum but i am not able to solve it.
    Script which i am using :
    <project name="ConfigExport">
    <property file="./build.properties"/>
    <property name="eclipse.home"
    value="${bea.home}/tools/eclipse_pkgs/2.0/eclipse_3.3.2/eclipse"/>
    <property name="weblogic.home" value= "${bea.home}/wlserver_10.3"/>
    <property name="metadata.dir" value="${workspace.dir}/.metadata"/>
    <target name="export">
    <available file="${metadata.dir}" type="dir"
    property="metadata.dir.exists"/>
    <java dir="${eclipse.home}"
    jar="${eclipse.home}/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar"
    fork="true"
    failonerror="true"
    maxmemory="768m">
    <arg line="-data ${workspace.dir}"/>
    <arg line="-application com.bea.alsb.core.ConfigExport"/>
    <arg line="-configProject ${config.project}"/>
    <arg line="-configJar ${config.jar}"/>
    <sysproperty key="weblogic.home" value="${weblogic.home}"/>
    </java>
              <antcall target="deleteMetadata"/>
    </target>
         <target name="deleteMetadata" unless="metadata.dir.exists">
    <delete failonerror="false" includeemptydirs="true"
    dir="${metadata.dir}"/>
         </target>
    </project>
    It seems that on debugging the error in eclipse log say for ex: C:\bea\tools\eclipse_pkgs\2.0\eclipse_3.3.2\eclipse\configuration\
    show me an error saying : "java.lang.RuntimeException: Application "com.bea.alsb.core.ConfigExport" could not be found in the registry."
    It seems that com.bea.alsb.core.ConfigExport not able to find the class which is used to export an osb jar.Moreover in the thread posted basically talks about osb 11 so i am not able to find many folders like middleware,oracle,osb.home.
    Please let me know what is the possible solutions for this in osb 10.3.
    Regards,
    Rajeev Goel
    (Application Developer)

    see here Export from OEPE not working for an answer, that I copy/paste here:
    You have to verify if your OEPE instalation has the following file in the directory dropins (e.g C:\Oracle\middleware\oepe11.1.1.3\dropins)
    filename:
    oracle.osb.ide.link
    content:
    path=C:/Oracle/Middleware/Oracle_OSB1
    Under the Oracle_OSB1 you have an eclipse directory with needed plugins:
    e.g. C:/Oracle/Middleware/Oracle_OSB1/eclipse is not empty
    This is only a sample directory naming from Windows installation, I had a problem on RHEL 5.3 where installer did not put such files.
    Then I took the files from Windows installation.
    I suspect the files are installed "automatically" but I am not sure when.

  • Not able to create sales order  using BAPI - BAPI_SALESORDER_CREATEFROMDAT2

    Hi Experts,
    I am not able to create sales order . I am using BAPI - BAPI_SALESORDER_CREATEFROMDAT2
    to create sales order .I am passing external sales order number to the parameter
    SALESDOCUMENTIN.
    I am getting following error.
    "524   |Only quantity 1 EA is allowed (Item 00001"
    Here EA is UOM(Unit of measurement).
    Below is the sample program through which i am trying to create the sales order.
    *& Report  ZSDC_SALES_TEST
    report  zsdc_sales_test.
    *DATA: wa_bapi_header    TYPE bapisdhd1.
    Include Name    - ZSDC_SALES_ORD_UPLOAD_TOP
    Program Name    - ZSDC_SALES_ORD_UPLOAD_1393
    Program Title   - Include for Data Declaration  and selection screen
    Created by      - Lalitha W
    Created on      - 18-Nov-2008
    Object ID       - SD_C_1393_SALES_ORDER_UPLOAD
    Request Id      - SD3K905579
    Description - This is a common INCLUDE for data declarations and
    *selection screen details.
                            HISTORY
    Date    |Developer |Req by    | Description              |Reference ID
            |          |          |                          |
            |          |          |                          |
                               TYPE-POOLS
    *TYPE-POOLS: truxs, abap, slis.
                              TABLES
    *TABLES: t100.
                               TYPES
    types:begin of   ty_header,
            auart(4)    type c,    " Sales Order Type
            vkorg(4)    type c,    " Sales Organization
            vtweg(2)    type c,    " Distrubution Channel
            spart(2)    type c,    " Division
            kunnr_1(10) type c,    " Sold to Party
            kunnr_2(10) type c,    " Ship to Party
            augru(3)    type c,    " Order Reason
            bstkd(35)   type c,    " PO Number
            bstdk(10)   type c,    " PO Date
            ketdat(10)  type c,    " Required Delivery Date
            zterm(4)    type c,    " Payment Terms
            inco1(3)    type c,    " Inco Terms -1
            inco2(28)   type c,    " Inco Terms -2
            prsdt(10)   type c,    " pricing date
            waerk(5)    type c,    " Document Currency
            vkbur(4)    type c,    " Sales Office
            vkgrp(3)    type c,    " Sales group
            pltyp(2)    type c,    " Price List type
            kdgrp(2)    type c,    " Customer Group
            bstkd_e(35) type c,    " Ship-to-party PO number
            submi(10)   type c,    " Collective Number
            bname(35)   type c,    " Name
            ihrez(12)   type c,    " Your Reference
            kschl_1(4)   type c,    " Condition Type
            kbetr_1(11)  type c,    " Amount
            kschl_2(4)   type c,    " Condition Type
            kbetr_2(11)  type c,    " Amount
            kschl_3(4)   type c,    " Condition Type
            kbetr_3(11)  type c,    " Amount
           partner_1(25) TYPE c,    "  Partner(Bill To Party Number)
           partner_2(25) TYPE c,    "  Partner(Payer Number)
           partner_3(25) TYPE c,    "  Partner(Sales Responsible Number)
           partner_4(25) TYPE c,    "  Partner(Order admin)
           partner_5(25) TYPE c,    "  Partner(Contact person)
            partner_1(10) type c,    "  Partner(Bill To Party Number)
            partner_2(10) type c,    "  Partner(Payer Number)
            partner_3(10) type c,    "  Partner(Sales Responsible Number)
            partner_4(10) type c,    "  Partner(Order admin)
            partner_5(10) type c,    "  Partner(Contact person)
            tdspras_1(2)  type c,
            text_1(500)   type c,    " Text Before Items Z012
            tdspras_2(2)  type c,
            text_2(500)   type c,    " Invocie Up Z034
            tdspras_3(2)  type c,
            text_3(500)   type c,    " Invocie Down Z035
            tdspras_4(2)  type c,
            text_4(500)   type c,    " Customer Reference Continue Z018
            tdspras_5(2)  type c,
            text_5(500)   type c,    " Dispatch Marks/ Order Z019
            tdspras_6(2)  type c,
            text_6(500)   type c,    " Ordered By  Z003
            tdspras_7(2)  type c,
            text_7(500)   type c,    " Sales Parameters Z002
            kvgr1(3)      type c,    " Industry
            kvgr2(3)      type c,    " customer BU
    end of ty_header.
    types: begin of ty_item,
              bstkd(35)     type c,    " PO Number
              bstdk(10)     type c,    " PO Date
              bstkd_e(35)   type c,    " Ship-to-party PO number
              posnr(6)      type c,    " POSTION NUMBER
              matnr(18)     type c,    " Material Number
              kwmeng(18)    type c,    " Order Quantity
              pstyv(4)      type c,    " Sales doc. item categ
              kursk(18)     type c,    " EXCHANGE RATE****
              ffprf(8)      type c,    " DIP PROFILE
              werks(4)      type c,    " Delivering Plant
              vstel(4)      type c,    " SHIPPING POINT
              lgort(4)      type c,    " STORAGE LOCATION
              route(6)      type c,    " Route
              kurrf(18)     type c,    " EXCHANGE RATE-FI
              ntgew(18)     type c,    " Net Weight
              brgew(18)     type c,    " Gross Weight
              gewei(3)      type c,    " Weight Unit
              prctr(10)     type c,    " profit center
              abgrs(6)      type c,    " RESULT ANALYSIS KEY
              kalsm_k(4)    type c,    " COSTING SHEET
              kschl_1(4)    type c,    " Condition Type
              kbetr_1(11)   type c,    " Amount
              kschl_2(4)    type c,    " Condition Type
              kbetr_2(11)   type c,    " Amount
              kschl_3(4)    type c,    " Condition Type
              kbetr_3(11)   type c,    " Amount
              text_1(500)    type c,    " material Text 0001
              tdspras_1(1)   type c,
              text_2(500)    type c,    " Pr Text 9001
              tdspras_2(1)   type c,
           end of ty_item.
    types:  begin of ty_schedule_line,
             bstkd(35)       type c, "PO number
             bstdk(10)       type c, "PO date
             bstkd_e(35)     type c, "Ship-to-party PO number
             posnr(6)        type c, "sales doc.Item
             etdat(10)       type c, "Schedule line date
             wmeng(2)        type c, "Order Quantity
            end of ty_schedule_line.
    types: begin of ty_err  ,
            auart(4)    type c,    " Sales Order Type
            vkorg(4)    type c,    " Sales Organization
            vtweg(2)    type c,    " Distrubution Channel
            spart(2)    type c,    " Division
            kunnr_1(10) type c,    " Sold to Party
            kunnr_2(10) type c,    " Ship to Party
            augru(3)    type c,    " Order Reason
            bstkd(35)   type c,    " PO Number
            bstdk(10)   type c,    " PO Date
            ketdat(10)  type c,    " Required Delivery Date
            zterm(4)    type c,    " Payment Terms
            inco1(3)    type c,    " Inco Terms -1
            inco2(28)   type c,    " Inco Terms -2
            prsdt(10)   type c,    " pricing date
            waerk(5)    type c,    " Document Currency
            vkbur(2)    type c,    " Sales Office
            vkgrp(3)    type c,    " Sales group
            pltyp(2)    type c,    " Price List type
            kdgrp(2)    type c,    " Customer Group
            bstkd_e(35) type c,    " Ship-to-party PO number
            submi(10)   type c,    " Collective Number
            bname(35)   type c,    " Name
            ihrez(12)   type c,    " Your Reference
            kschl_1(4)   type c,    " Condition Type
            kbetr_1(11)  type c,    " Amount
            kschl_2(4)   type c,    " Condition Type
            kbetr_2(11)  type c,    " Amount
            kschl_3(4)   type c,    " Condition Type
            kbetr_3(11)  type c,    " Amount
            partner_1(25) type c,    "  Partner(Bill To Party Number)
            partner_2(25) type c,    "  Partner(Payer Number)
            partner_3(25) type c,    "  Partner(Sales Responsible Number)
            partner_4(25) type c,    "  Partner(Order admin)
            partner_5(25) type c,    "  Partner(Contact person)
            tdspras_1(2)  type c,
            text_1(500)   type c,    " Text Before Items Z012
            tdspras_2(2)  type c,
            text_2(500)   type c,    " Invocie Up Z034
            tdspras_3(2)  type c,
            text_3(500)   type c,    " Invocie Down Z035
            tdspras_4(2)  type c,
            text_4(500)   type c,    " Customer Reference Continue Z018
            tdspras_5(2)  type c,
            text_5(500)   type c,    " Dispatch Marks/ Order Z019
            tdspras_6(2)  type c,
            text_6(500)   type c,    " Ordered By  Z003
            tdspras_7(2)  type c,
            text_7(500)   type c,    " Sales Parameters Z002
            kvgr1(3)      type c,    " Industry
            kvgr2(3)      type c,    " customer BU
            message(600) type c,
      end of ty_err.
    types: begin of ty_t685a,
            kschl type kschl,
            krech type krech,
          end of ty_t685a.
                       INTERNAL TABLES
    ***header
    data:  g_krech_1(4)    type c,    " Calculation type for condition
           g_krech_2(4)    type c,    " Calculation type for condition
           g_krech_3(4)    type c.    " Calculation type for condition
          g_krech_4(4)    TYPE c,    " Calculation type for condition
          g_krech_5(4)    TYPE c,    " Calculation type for condition
          g_krech_6(4)    TYPE c,    " Calculation type for condition
          g_krech_7(4)    TYPE c,    " Calculation type for condition
          g_krech_8(4)    TYPE c,    " Calculation type for condition
          g_krech_9(4)    TYPE c,    " Calculation type for condition
          g_krech_10(4)   TYPE c,    " Calculation type for condition
          g_krech_11(4)   TYPE c,    " Calculation type for condition
          g_krech_12(4)   TYPE c,    " Calculation type for condition
          g_krech_13(4)   TYPE c,    " Calculation type for condition
          g_krech_14(4)   TYPE c,    " Calculation type for condition
          g_krech_15(4)   TYPE c,    " Calculation type for condition
          g_krech_16(4)   TYPE c,    " Calculation type for condition
          g_krech_17(4)   TYPE c,    " Calculation type for condition
          g_krech_18(4)   TYPE c,    " Calculation type for condition
          g_krech_19(4)   TYPE c,    " Calculation type for condition
          g_krech_20(4)   TYPE c.    " Calculation type for condition
    Items
    data:   g_krech_item_1(4)   type c,    " Calculation type for condition
            g_krech_item_2(4)   type c,    " Calculation type for condition
            g_krech_item_3(4)   type c.    " Calculation type for condition
           g_krech_item_4(4)   TYPE c,    " Calculation type for condition
           g_krech_item_5(4)   TYPE c,    " Calculation type for condition
           g_krech_item_6(4)   TYPE c,    " Calculation type for condition
           g_krech_item_7(4)   TYPE c,    " Calculation type for condition
           g_krech_item_8(4)   TYPE c,    " Calculation type for condition
           g_krech_item_9(4)   TYPE c,    " Calculation type for condition
           g_krech_item_10(4)  TYPE c,    " Calculation type for condition
           g_krech_item_11(4)  TYPE c,    " Calculation type for condition
           g_krech_item_12(4)  TYPE c,    " Calculation type for condition
           g_krech_item_13(4)  TYPE c,    " Calculation type for condition
           g_krech_item_14(4)  TYPE c,    " Calculation type for condition
           g_krech_item_15(4)  TYPE c,    " Calculation type for condition
           g_krech_item_16(4)  TYPE c.    " Calculation type for condition
    data: it_t685a  type standard table of ty_t685a.
    data: wa_bapi_header    type bapisdhd1,
         wa_bapi_headerx   TYPE bapisdhd1x,
          it_bapi_item      type table of bapisditm,
         it_bapi_itemx     TYPE TABLE OF bapisditmx,
          it_bapi_cond      type table of bapicond,
         it_bapi_condx     TYPE TABLE OF bapicondx,
          it_bapi_partner   type table of bapiparnr,
          it_bapi_shdl      type table of bapischdl,
         it_bapi_shdlx     TYPE TABLE OF bapischdlx,
         it_bapi_order_text type TABLE OF BAPISDTEXT,
          it_bapireturn     type table of bapiret2.
    data:  wa_bapi_item       like line of it_bapi_item,
          wa_bapi_itemx      LIKE LINE OF it_bapi_itemx,
           wa_bapi_cond       like line of it_bapi_cond,
          wa_bapi_condx      LIKE LINE OF it_bapi_condx,
           wa_bapi_partner    like line of it_bapi_partner,
           wa_bapi_shdl       like line of it_bapi_shdl,
          wa_bapi_shdlx      LIKE LINE OF it_bapi_shdlx,
          wa_bapi_order_text like LINE OF it_bapi_order_text,
           wa_bapireturn      like line of it_bapireturn.
    *DATA: zmode(1) VALUE 'N'.
    data: it_header      type standard table of ty_header.
    *DATA: it_temp_header TYPE STANDARD TABLE OF ty_header.
    data: it_item        type standard table of ty_item.
    *DATA: it_temp_item   TYPE STANDARD TABLE OF ty_item.
    data: it_err         type standard table of ty_err.
    data: it_fline1 type standard table of tline,
          wa_fline1 type tline.
    data: it_thead1 type thead.
    data: it_fline2 type standard table of tline,
          wa_fline2 type tline.
    data: it_thead2 type thead.
    data: it_fline3 type standard table of tline,
          wa_fline3 type tline.
    data: it_thead3 type thead.
    data: it_fline4 type standard table of tline,
          wa_fline4 type tline.
    data: it_thead4 type thead.
    data: it_fline5 type standard table of tline,
          wa_fline5 type tline.
    data: it_thead5 type thead.
    data: wa_header         like line of it_header,
          wa_item           like line of it_item,
          wa_err            type ty_err,
         wa_bill           LIKE LINE OF it_bill,
         wa_bill1          LIKE LINE OF it_bill,
          wa_iterr          like line of it_err,
          wa_t685a          like line of it_t685a.
         wa_bill_item TYPE ty_bill_item.
    data: it_schedule_line  type standard table of ty_schedule_line,
          wa_schedule_line type ty_schedule_line.
    data: sales_order_no     type bapivbeln-vbeln.
    data: ext_sales_order_no type bapivbeln-vbeln.
    Variable to be used to separate the fields which are concatenated by a
    runtime character
    *DATA: g_tabchar(1) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *DATA: wa_truxs_t_text_data TYPE truxs_t_text_data.
    *DATA: g_filename      TYPE string,
         g_path          TYPE string,
         g_fullpath      TYPE string,
         g_user_action   TYPE i,
         g_file_encoding TYPE abap_encoding.
    *DATA : g_text(8192),
    data : g_mstring1(100) type c,
          g_mstring2(100) type c,
          g_mstring3(100) type c,
          g_mstring4(100) type c,
          g_mstring5(100) type c.
    data: g_count1 type ebelp,
          g_str_count1(6) type c.
    data: g_count type ebelp,
          g_str_count(6) type c.
    *DATA: f_subrc      LIKE sy-subrc,
         f_subrc1     LIKE sy-subrc,
         f_error(500) TYPE c,
         item1(27)    TYPE c,
         item2(27)    TYPE c,
         item3(27)    TYPE c,
         item4(27)    TYPE c,
         i            TYPE ekpo-ebelp.
    *DATA: g_billplan_header TYPE c,
         g_billplan_item TYPE c.
    data : g_external_so type vbak-vbeln. "SO
                          SELECTION-SCREEN
    selection-screen begin of block frame1 with frame title text-001 .
    parameters:p_file1 type rlgrap-filename, "OBLIGATORY, "Header data.
               p_file2 type rlgrap-filename, "OBLIGATORY, "Item Data.
               p_file3 type rlgrap-filename,            "Schedule line.
               p_file4 type rlgrap-filename ."OBLIGATORY. "Error file.
    selection-screen end of block frame1.
    start-of-selection.
      wa_bapi_header-doc_type     =  'Z0MX'. "order type
      wa_bapi_header-sales_org    =  '0130'."sales org
      wa_bapi_header-distr_chan   =  '13'.  "distr channel
      wa_bapi_header-division     =  '13'.  "division
    Old code from copied program
    wa_bapi_header-purch_no_s   =  wa_header-kunnr_2.  " Ship to party
    New code as required in Finland project
    We are using to Header ->Order Tab -> Ship to Party -> Purchase order no (BSTKD_E) to store Old legacy SO number
      wa_bapi_header-purch_no_s   =  'MX100443'.  "External SO i.e Old legacey SO number
      wa_bapi_header-ref_1_s      = '0000666666'. "Sold to party
    wa_bapi_header-ord_reason   =  wa_header-augru.
      wa_bapi_header-purch_no_c   =  'ddr1234'.    " PO number
      wa_bapi_header-purch_date   =  sy-datum.    " PO date
      wa_bapi_header-req_date_h   =  sy-datum.   " Required Delivery Date
      wa_bapi_header-pmnttrms     =  '01'.    " Payment Terms
    wa_bapi_header-incoterms1   =  wa_header-inco1.
    wa_bapi_header-incoterms2   =  wa_header-inco2.
    wa_bapi_header-price_date   =  wa_header-prsdt.    " Pricing date
    wa_bapi_header-currency     =  wa_header-waerk.    " Document Currency
    wa_bapi_header-sales_grp  =  wa_header-vkgrp. " Sales group
    wa_bapi_header-price_list   =  wa_header-pltyp. " Price list type
    wa_bapi_header-cust_group   =  wa_header-kdgrp.   " Cust Group
    wa_bapi_header-ship_type    =  wa_header-vsart.   " Shipping Type
    wa_bapi_header-purch_no_s   =  wa_header-bstkd_e. " Ship-to-party po number
    wa_bapi_header-collect_no   =  wa_header-submi.   " Collective No.
    wa_bapi_header-name         =  wa_header-bname.   " Name
    wa_bapi_header-ref_1        =  wa_header-ihrez.   " Your Reference
    wa_bapi_header-cust_grp1    =  wa_header-kvgr1.   " Industry
    wa_bapi_header-cust_grp2    =  wa_header-kvgr2.   " Customer BU
    *ENDFORM.                    " f_header
    IF wa_header-partner_1 IS NOT INITIAL.
        wa_bapi_partner-partn_role = 'AG'.
        wa_bapi_partner-partn_numb = '0000666666'.
        wa_bapi_partner-itm_number = '000000'.
        append wa_bapi_partner to it_bapi_partner.
        clear wa_bapi_partner.
    ENDIF.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
        exporting
          input  = wa_header-partner_2
        importing
          output = wa_header-partner_2.
    IF wa_header-partner_2 IS NOT INITIAL.
        wa_bapi_partner-partn_role = 'WE'.
        wa_bapi_partner-partn_numb = '0000666666'.
        wa_bapi_partner-itm_number = '000000'.
        append wa_bapi_partner to it_bapi_partner.
        clear wa_bapi_partner.
    ENDIF.
      perform f_item.
    data : order_items_inx type table of bapisditmx with header line.
      order_items_inx-material          = 'X'.  "
      order_items_inx-target_qty        = 'X'.  "
      order_items_inx-comp_quant        = 'X'.  "
      order_items_inx-trgqty_den        = 'X'.
      order_items_inx-rnddlv_qty        = 'X'.
    order_items_inx-updateflag = 'I'.
    order_items_inx-target_qu = 'X'.
      order_items_inx-plant             = 'X'.  "
      append order_items_inx.
      call function 'BAPI_SALESORDER_CREATEFROMDAT2'
        exporting
          salesdocumentin = 'MX11111152'
      order_header_in      = wa_bapi_header
             order_header_inx     = wa_bapi_headerx
      importing
      salesdocument        = sales_order_no
      tables
      return               = it_bapireturn
      order_items_in       = it_bapi_item
      order_items_inx      =  order_items_inx
      order_partners       = it_bapi_partner
       order_conditions_in  = it_bapi_cond.
      if sy-subrc is initial.
      commit work.
      endif.
    *&      Form  f_item
          text
    form f_item .
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
        exporting
          input  = wa_item-posnr
        importing
          output = wa_item-posnr.
      wa_item-posnr = '000010'.
    IF sy-subrc EQ 0. "IS INITIAL.
      move wa_item-posnr to g_str_count."commented out by shakti
    ENDIF.
      wa_bapi_item-itm_number        =  wa_item-posnr.  " Line item
    WA_BAPI_ITEM-PO_ITM_NO         =  WA_ITEM-EBELP.
    wa_bapi_item-division          = wa_item-spart.
      wa_bapi_item-purch_no_c        = 'ddr1234'.   " po number
      wa_bapi_item-purch_date        = sy-datum.   " po date
      wa_bapi_item-purch_no_s        = 'MX11111112'. " Ship-to-party po number
      wa_item-matnr = 'MAXIMO_SERVICE'.
      call function 'CONVERSION_EXIT_MATN1_INPUT'
        exporting
          input        = wa_item-matnr
        importing
          output       = wa_item-matnr
        exceptions
          length_error = 1
          others       = 2.
      if sy-subrc is initial.
        wa_bapi_item-material        = wa_item-matnr.  "material
      endif.
      wa_bapi_item-target_qty        = '1'. " Order qty
      wa_bapi_item-comp_quant = '1'.
      wa_bapi_item-target_qu = 'EA'.
        wa_bapi_item-fixed_quan = '1'.
    wa_bapi_item-comp_quant        = wa_item-kwmeng.
    wa_bapi_item-trgqty_den        = '1'.
    wa_bapi_item-rnddlv_qty        = wa_item-kwmeng.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
       EXPORTING
         input  = wa_item-ps_psp_pnr
       IMPORTING
         output = wa_item-ps_psp_pnr.
    IF sy-subrc = 0.
       wa_bapi_item-wbs_elem          = wa_item-ps_psp_pnr.
    ENDIF.
      wa_bapi_item-item_categ        = 'ZMAX'.
    wa_bapi_item-ex_rate_fi        = wa_item-kurrf.
    wa_bapi_item-dli_profil        = wa_item-ffprf.   " Dynamic item processor profile
    wa_bapi_item-route             = wa_item-route.   " route
    wa_bapi_item-exchg_rate        = wa_item-kursk.
      wa_bapi_item-plant             = '2090'.   " Plant
      wa_bapi_item-ship_point        = 'FN11'.   " Shipping point
    wa_bapi_item-store_loc         = wa_item-lgort.   " stg loc
    REPLACE ALL OCCURRENCES OF  ',' IN wa_item-ntgew WITH '.'.
    REPLACE ALL OCCURRENCES OF  ',' IN wa_item-brgew WITH '.'.
    wa_bapi_item-net_weight        = wa_item-ntgew.  "
    wa_bapi_item-gross_wght        = wa_item-brgew.  "
      call function 'CONVERSION_EXIT_CUNIT_INPUT'
        exporting
          input    = wa_item-gewei
          language = sy-langu
        importing
          output   = wa_item-gewei.
       EXCEPTIONS
         unit_not_found = 1
         OTHERS         = 2.
    IF sy-subrc <> 0.
    ENDIF.
      wa_bapi_item-untof_wght        =  'KG'.  " weight unit
      replace all occurrences of  ',' in wa_item-kursk with '.'.
      replace all occurrences of  ',' in wa_item-kurrf with '.'.
    wa_bapi_item-profit_ctr        = wa_item-prctr.   " Profit center
    wa_bapi_item-resanalkey        = wa_item-abgrs.   " RESULT ANALYSIS KEY
    wa_bapi_item-cstg_sheet        = wa_item-kalsm_k. " COSTING SHEET
      append wa_bapi_item to it_bapi_item.
    endform.                    " f_item
    Thanks & regards,
    Chetan

    see the following to create sales order:-
    *& Report  ZSALESORDER
    *&DEVELOPED BY JANI KRUPA 4.10.2008
    REPORT  ZSALESORDER.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d .
    SELECTION-SCREEN END OF LINE.
    Complete Deliver
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text10 FOR FIELD p_autlf.
    PARAMETERS: p_autlf TYPE autlf DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    DATA: lt_schedules_ink    TYPE STANDARD TABLE OF bapisdhead1
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    v_text10 = 'Complete delivery'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    *Complete delivery
        header-COMPL_DLV = p_autlf.
        header-COMPL_DLV = 'X'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
    item category
      itemx-ITEM_CATEG = 'X'.
      APPEND item.
      APPEND itemx.
      ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000020'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000020'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000020'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.

  • Not able to update the project using 'BAPI_PROJECT_MAINTAIN'.

    I  want to create a project , with reference to an already existing project.
    I am using 'BAPI_PROJECT_GETINFO' to get the data of the existing project.
      The bapi gives the following:
    1)     e_project_definition.
    2)     e_wbs_element_table.
    3)     e_wbs_hierarchie_table
    I am passing the u2018e_project_definitionu2019 to 'BAPI_PROJECTDEF_CREATE' to create project.The project is created successfully.
    But I am not able to update the project with u2018e_wbs_element_tableu2019
    and u2018e_wbs_hierarchie_tableu2019. I am using 'BAPI_PROJECT_MAINTAIN' to update the project.
    The program is not giving an error, but it is also not updating the E_WBS_ELEMENT_TABLE and E_WBS_HIERARCHIE_TABLE.
    I am attaching the code below.
    *& Report  ZTEST_PC.
    DATA: project_definition   TYPE  bapipr-project_definition,
          with_activities      TYPE  bapipr-with_activities,
          with_milestones      TYPE  bapipr-with_milestones,
          with_subtree         TYPE  bapipr-with_subtree,
          e_project_definition TYPE  bapi_project_definition_ex,
          return               TYPE  bapireturn1.
    DATA: i_wbs_element_table         TYPE TABLE OF     bapi_wbs_elements,
          e_wbs_element_table         TYPE TABLE OF     bapi_wbs_element_exp,
          e_wbs_milestone_table   TYPE TABLE OF bapi_wbs_milestone_exp,
          e_wbs_hierarchie_table  TYPE TABLE OF bapi_wbs_hierarchie,
          e_activity_table        TYPE TABLE OF bapi_network_activity_exp,
          e_message_table         TYPE TABLE OF bapi_meth_message.
    DATA: wa_wbs_element_table    TYPE      bapi_wbs_element_exp,
          wa_wbs_hierarchie_table TYPE  bapi_wbs_hierarchie.
    DATA: l_new_proj_no TYPE  prpss-posid.
    DATA: l_project_definition        TYPE  bapi_project_definition.
    DATA: l_project_definition_upd    TYPE  bapi_project_definition_up.
    DATA: l_project_definition_stru   TYPE  bapi_project_definition.
    DATA :l_pspnr      TYPE ps_intnr,
          l_pspid      TYPE ps_pspid,
          l_pro_def(9) TYPE c.
    DATA :l_proj  TYPE proj.
    DATA :l_len TYPE i VALUE '0'.
    DATA: lt_dd03l TYPE TABLE OF dd03l,
          ls_dd03l TYPE dd03l.
    DATA: fieldname(50), fieldname1(50) TYPE c.
    DATA: p_ddic_name(40), struc(40), fun_struc(50) TYPE c.
    FIELD-SYMBOLS: <struc>, <c>, <sc>, <def_field> TYPE any.
    DATA : i_method_project    TYPE TABLE OF bapi_method_project,
           wa_method_project   TYPE  bapi_method_project.
    DATA : l_index TYPE bapi_method_project-refnumber.
    DATA : it_wbs_element_table         TYPE TABLE OF bapi_wbs_element,
           it_wbs_hierarchie_table      TYPE TABLE OF bapi_wbs_hierarchie.
    DATA : wl_wbs_element_table         TYPE bapi_wbs_element,
           wl_wbs_hierarchie_table      TYPE bapi_wbs_hierarchie.
    DATA : l_wbs_element_table_update   TYPE bapi_wbs_element_update.
    DATA : i_wbs_element_table_update   TYPE TABLE OF bapi_wbs_element_update.
    Get the project info of the Project 'C01.10995'
    CALL FUNCTION 'CONVERSION_EXIT_ABPSN_INPUT'
      EXPORTING
        input  = 'C01.10995'
      IMPORTING
        output = project_definition.
    CALL FUNCTION 'BAPI_PROJECT_GETINFO'
      EXPORTING
        project_definition     = project_definition
      IMPORTING
        e_project_definition   = e_project_definition
        return                 = return
      TABLES
        i_wbs_element_table    = i_wbs_element_table
        e_wbs_element_table    = e_wbs_element_table
        e_wbs_milestone_table  = e_wbs_milestone_table
        e_wbs_hierarchie_table = e_wbs_hierarchie_table
        e_activity_table       = e_activity_table
        e_message_table        = e_message_table.
    Automate the process the process to get the next number for the func module 'CN_SUCHE_FREIE_NUMMER'.
    CLEAR : l_pspnr, l_pspnr, l_pspid, l_pro_def.
    SELECT MAX( pspnr ) FROM proj INTO l_pspnr.
    SELECT SINGLE * FROM proj INTO l_proj WHERE pspnr EQ l_pspnr.
    l_pspid = l_proj-pspid.
    CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
      EXPORTING
        input  = l_pspid
      IMPORTING
        output = l_pspid.
    l_pro_def = l_pspid+4(5) + 1.
    CONDENSE l_pro_def.
    CONCATENATE 'C01.' l_pro_def INTO l_pspid .
    function module to generate the nect free number between the given range.
    CALL FUNCTION 'CN_SUCHE_FREIE_NUMMER'
      EXPORTING
        search_imp = '2'
        prps_s_imp = l_pspid
        prps_e_imp = 'C01.29999'
        no_dialog  = 'X'
      IMPORTING
        prps_exp   = l_new_proj_no.
    IF sy-subrc <> 0.
      EXIT.
    ENDIF.
    Update the fields of 'l_project_definition_upd' as 'X' for the fields which has values in 'E_PROJECT_DEFINITION'.
    Get the New Project Number.
    MOVE-CORRESPONDING e_project_definition TO l_project_definition.
    l_project_definition-project_definition = l_project_definition-project_definition+0(3).
    l_new_proj_no = l_new_proj_no+4(5).
    CONCATENATE l_project_definition-project_definition '.' l_new_proj_no INTO l_project_definition-project_definition.
    TRANSLATE l_project_definition-project_definition TO UPPER CASE.
    MOVE-CORRESPONDING l_project_definition TO l_project_definition_stru.
    Create the New project with the New project Number.
    CALL FUNCTION 'BAPI_PROJECTDEF_CREATE'
      EXPORTING
        project_definition_stru = l_project_definition_stru.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = ' '.
    Populate internal table i_method_project for the bapi_project_maintain func module.
    CLEAR : wa_wbs_element_table,wl_wbs_element_table,wa_wbs_hierarchie_table,
            wl_wbs_hierarchie_table, it_wbs_element_table, it_wbs_hierarchie_table.
    CLEAR : wa_method_project, i_method_project, l_index .
    l_index = 0.
    LOOP AT e_wbs_element_table INTO wa_wbs_element_table.
      MOVE-CORRESPONDING wa_wbs_element_table TO wl_wbs_element_table .
      APPEND  wl_wbs_element_table  TO it_wbs_element_table .
      wa_method_project-objecttype = 'WBS_ELEMENT'.
      wa_method_project-method     = 'CREATE'.
      wa_method_project-objectkey  = wa_wbs_element_table-wbs_element.
      l_len = strlen( wa_wbs_element_table-wbs_element ).
    Setting Levels as reference number.
      CASE l_len.
        WHEN '9'.
          l_index = 1.
        WHEN '12'.
          l_index = 2.
        WHEN '15'.
          l_index = 3.
        WHEN '18'.
          l_index = 4.
      ENDCASE.
      wa_method_project-refnumber  =  l_index .
      TRANSLATE wa_method_project-objectkey TO UPPER CASE.
      APPEND wa_method_project TO i_method_project.
      CLEAR :wa_method_project, l_index.
    ENDLOOP.
    l_index = l_index + 1.
    wa_method_project-refnumber  = ' '.  "l_index .
    wa_method_project-objecttype = ' '.  "'WBS_ELEMENT'.
    wa_method_project-method     = 'SAVE'.
    wa_method_project-objectkey  = ' '.
    APPEND wa_method_project TO i_method_project.
    CLEAR wa_method_project.
    LOOP AT e_wbs_hierarchie_table INTO wa_wbs_hierarchie_table.
      MOVE-CORRESPONDING wa_wbs_hierarchie_table TO wl_wbs_hierarchie_table.
      APPEND wl_wbs_hierarchie_table TO it_wbs_hierarchie_table.
    ENDLOOP.
    Update the fields of 'l_project_definition_upd' as 'X' for the fields which has values in 'E_PROJECT_DEFINITION' respectively.
    CLEAR : l_project_definition_upd.
    p_ddic_name = 'BAPI_PROJECT_DEFINITION_UP'.
    struc       = 'l_project_definition_upd'.
    fun_struc   = 'E_PROJECT_DEFINITION'.
    TRANSLATE: p_ddic_name TO UPPER CASE,
               struc       TO UPPER CASE.
    SELECT * FROM dd03l INTO TABLE lt_dd03l WHERE tabname = p_ddic_name.
    LOOP AT lt_dd03l INTO ls_dd03l.
      ASSIGN ls_dd03l-fieldname TO <c>.
      fieldname = ls_dd03l-fieldname .
      CONCATENATE fun_struc '-' fieldname INTO fieldname.
      ASSIGN (struc) TO <struc>.
      ASSIGN COMPONENT <c> OF STRUCTURE <struc> TO <sc>.
      ASSIGN (fieldname) TO <def_field>.
      IF NOT <def_field> IS INITIAL  .
        <sc> = 'X'.
      ENDIF.
    ENDLOOP.
    Update the fields of 'l_wbs_element_table_update' as 'X' for the fields which has values in 'e_wbs_element_table' respectively.
    READ TABLE e_wbs_element_table INTO wa_wbs_element_table INDEX '1'.
    CLEAR : l_wbs_element_table_update, fieldname1, p_ddic_name, struc, fun_struc .
    p_ddic_name = 'BAPI_WBS_ELEMENT_UPDATE'.
    struc       = 'l_wbs_element_table_update'.
    fun_struc   = 'WA_WBS_ELEMENT_TABLE'.
    TRANSLATE: p_ddic_name TO UPPER CASE,
               struc       TO UPPER CASE.
    SELECT * FROM dd03l INTO TABLE lt_dd03l WHERE tabname = p_ddic_name.
    LOOP AT lt_dd03l INTO ls_dd03l.
      ASSIGN ls_dd03l-fieldname TO <c>.
      fieldname = ls_dd03l-fieldname .
      CONCATENATE fun_struc '-' fieldname INTO fieldname.
      ASSIGN (struc) TO <struc>.
      ASSIGN COMPONENT <c> OF STRUCTURE <struc> TO <sc>.
      ASSIGN (fieldname) TO <def_field>.
      IF NOT <def_field> IS INITIAL  .
        <sc> = 'X'.
      ENDIF.
    ENDLOOP.
    Append the value of l_wbs_element_table_update TO the table i_wbs_element_table_update for Bapi_project_maintain.
    CLEAR i_wbs_element_table_update.
    APPEND l_wbs_element_table_update TO i_wbs_element_table_update.
    CALL FUNCTION 'BAPI_PROJECT_MAINTAIN'
      EXPORTING
        i_project_definition       = l_project_definition
        i_project_definition_upd   = l_project_definition_upd
      TABLES
        i_method_project           = i_method_project
        i_wbs_element_table_update = i_wbs_element_table_update
        i_wbs_element_table        = it_wbs_element_table.
       i_wbs_hierarchie_table     = it_wbs_hierarchie_table.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = ' '.
    Please help me to solve the issue.

    I am not sure why it is not working??  Try for any other alternate function modules.
    But i see one issue with your coding, always check the return table message type and use commit work, instead of sy-subrc check. This fails for BAPI's

  • Not able to process open items using F-53

    Hello All,
    I am trying to process open items using F-53, I  m getting error message as "Entry SAG1 is missing in table T043G". This was working fine for GL accounts, but failing for vendors.
    I checked the tolerance group for same and its fine and also tried checking table se16, but not able to find the root cause of issue. please let me know how can i resolve this.
    Thanks in advance.
    --Sagar

    HI,
    Check following...
    1. Make sure you have created one null (Blank) tolrance group using transaction OBA3 for your company code SAG1...
    2. If you do not want to create null tolerance group then make sure you have mapped the tolerance group created to the customer master and also see the use assignment...
    Regards,
    Chintan Joshi

Maybe you are looking for