REGARDING ABAP CODE IN ECATT

HI
   HOW TO WRITE ABAP CODE IN ECATT TESTING FOR IF VENDORNO DOES NOT EXIST IT SHOULD NOT DISPLAY THE VENDOR SCREEN.
        PLZ HELP ME I WILL BE THANKFUL

I wouldn't use ABAP for this (always remember that using inline ABAP reduces the readability of your script).
Instead, I would use the corresponding display transaction to attempt to display the vendor and use the MESSAGE...ENDMESSAGE construction in eCATT to catch any error messages that occur. With the MESSAGE command, you can specify that certain error messages - if they occur - should not cause the script to fail.

Similar Messages

  • Regarding Abap code in BW

    Hi Sapmates,
    Are any one in Bangalore teaching Abap with BW specific. please kindly let me know. points will be assigned for all help full answers.
    Regards
    Sujan

    Hi Siva ,
    if u want to take any training good institutes r in Hyderabad.

  • Regarding ABAP code to search city & replace it by corrected city name

    Hi,
    I have  city master data which has length 18 char
    I am using 2 other master data to read city & populate other fields.
    Now the problem is the other 2 Master data are of length 13
    city comes as truncated & the matching condition fails.
    now i need to write a program which will read city master data of 18 char
    then it will search pattern in other 2 masted data & populate a table or generate file
    with truncated city name & actual 18 char city name.
    I tried using CP i.e. Contains Pattern & CS i.e. Contains String but both are not working as per the requirement, even the combination is not working of both of them.
    Scenario:
    example
    city master data has
    CITY OF ALLAHABAD
    other 2 master data may contain
    CITY OF ALHBD
    Now I want output as
    Sr no      state        wrong city name            corrected city name
    1             UP            CITY OF ALHBD            CITY OF ALLAHABAD
    Please help me out with implementing the logic.
    Thanks & Regards,
    Rashmi.

    hi,
    Rashmi,
    Please try
    Reads 18 char long city from Correct City sources
    Stores in file as corrected city
    Then trims the city name to 13 char long & stores in truncated city
    Counter is initialized to 1 which increments by 1 each time loop passes
    Hope this helps.
    Thanks
    Mukesh
    Edited by: Mukesh Sharma on Aug 5, 2009 12:41 AM

  • ECATT/ABAP code to close a session while executing a chain script

    How to close the extra created session during the execution of chain script??
    Details of the problem:
    I'm using eCATT for automating different business flows in SAP,
    For a particular scenario I have to create a chain script,
    One chain script may contain up to 40 individual scripts,
    This chain script will contain around 7 report programs using SE38 transation,
    While executing SE38 script(report program), one extra session is opening (log display session),
    but, my script can close the original SE38 screen only, not the extra created session,
    So, after executing 5 scripts (SE38 scripts), then "sessions reached to its max" message is appearing, and the script is failing,
    As it is a automation test script, no manual interaction will be there,
    i.e - we should not close the extra session manually.
    Now, my question is:
    How to close the extra created session..??
    How the recording should be done to handle this problem..??
    or any extra code should be added to close the extra session..??
    Is there any ABAP code.. or eCATT command available to handle this problem..??
    If you have any idea to close the extra created session, please share it with me,
    my effort:
    I tried with "RESCON" command... this will close all the SAP sessions,
    This will not work for my scenario,
    and, I tried with "Close session after every RFC",
    this will work, but, after executing 5 SE38 scripts, I'm facing the above problem.
    Please suggest me a solution, Thanks in advance..
    Regards,
    Chandra shekhar.A
    Message was edited by:
            chandra shekhar
    Message was edited by:
            chandra shekhar

    user13490676 wrote:
    could it be a problem with jmf itself that the endofstream doesnt get generated for the datasource being read from a fileIn this instance, that would be the problem... more than likely, there's something weird about the file, perhaps it doesn't have a duration set in the header and JMF treats it like a live stream.
    You could always write a custom DataSource that just passes through the input of a normal data source, and then generate the EndOfStream event yourself... maybe based on a timeout or failure counter? I haven't received any data in x seconds or after x attempts, so I'm assuming the file is done... Or when you've read enough data that the file can't possibly have any more (read >= file header + file data)...

  • Help regarding calling BRFPLUS function through ABAP code

    Hi,
          I have  a situation where I have to input  data into a BRFPLUS function  as a table (i.e the data is input as select options where list or range of data can be provided).The corresponding output is also in the form a table .I've created this function in BRFPLUS and is working fine .Now I have to call it through ABAP code.Can someone kindly  provide me with the probable code for this scenario.
    E.g:
            ZT_MATNR  is the table in brfplus representing the list of MATNR values input along with other such inputs to function module Z_FM
            ZT_ATM   is the  resultant output table  of the function  which contains several fields.
    Now I have to call this BRFPLUS function with help of ABAP code.Could someone kindly help.

    Hello ,
    There should be a number of BRF+ tutorials available in SCN which discuss the FDT APIs. You can have a look at them to get an idea of the various APIs available and their uses.
    For your usecase, you should do the following.
            lo_fdt_function         TYPE REF TO if_fdt_function,
            lo_fdt_result           TYPE REF TO if_fdt_result,
    * Get function handle
          CALL METHOD lo_fdt_factory->get_function
            EXPORTING
              iv_id       = lv_function_id
            RECEIVING
              ro_function = lo_fdt_function.
    where lv_function_id is the GUID of the BRF+ function . You can either make it a constant , or you can use a FDT API to get the function GUID from the BRF+ application name and function name.
    *   Set function context
        TRY.
            CALL METHOD lo_fdt_context->set_value
              EXPORTING
                iv_id    =
                ia_value =
    This is one way to set the input context ( pass the input to the BRF+ function to process ). There are other ways to do this as well. Which one you use would depend on the kind of input you want to pass.
    * Execute BRFPLUS function
      TRY.
          CALL METHOD lo_fdt_function->process
            EXPORTING
              io_context = lo_fdt_context
            IMPORTING
              eo_result  = lo_fdt_result.
    * Get result output
      TRY.
          CALL METHOD lo_fdt_result->get_value
            IMPORTING
              ea_value =
    Another direct way of doing it would be to use the method PROCESS of the class CL_FDT_FUNCTION_PROCESS.
    I have not gone into much explaination here , but it should provide you an idea of how you can go about it.Read the SCN docs on the APIs to get a better idea , or better still if you can get hold of a copy of the BRF+ book by Carsten Ziegler , you will get an end to end explaination of all BRF+ APIs in it.
    Regards,
    Indranil.

  • Regarding Customer exit - ABAP Code

    Hi Friends,
    I have a scenario in one of the query and need to write a customer exit for the same. Here is the scenario:
    I am using one input variable XXX to get input from user which feeds value to one of the charateristic lets say "CHAR1" in query. I have one more characteristic "CHAR2" which has to get the value from the same variable XXX. This is not allowed in BI7.0 as the variable is Hierarchy Node type. It gives error that "Variable XXX is used for two different characteristics."
    So i need to create one more vaiable YYY which will get the value from XXX and then YYY will feed value to CHAR2. I would appreciate if some one could tell me step by step how to write customer exit and give me the piece of ABAP code i need to write in my case.
    Your help will be appreciated in terms of points.
    Thanks,

    Hi Manmit,
    The following link can guide you on how to write customer exits (this has example as well)
    [http://help.sap.com/saphelp_nw70/helpdata/EN/61/579b3c494d8e15e10000000a114084/frameset.htm]
    Hope this helps.
    Cheers,
    Sumit

  • What are the steps to optimise ABAP code

    What are the steps to optimise ABAP code, that is how to increase the performance of a code?

    Hi
    Welcome to SDN forum
    1) Dont use nested select statements
    2) If possible use for all entries in addition
    3) In the where addition make sure you give all the primary key
    4) Use Index for the selection criteria.
    5) You can also use inner joins
    6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.
    7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5d0db4c9-0e01-0010-b68f-9b1408d5f234
    ABAP performance depends upon various factors and in devicded in three parts:
    1. Database
    2. ABAP
    3. System
    Run Any program using SE30 (performance analys) to improve performance refer to tips and trics section of SE30, Always remember that ABAP perfirmance is improved when there is least load on Database.
    u can get an interactive grap in SE30 regarding this with a file.
    also if u find runtime of parts of codes then use :
    Switch on RTA Dynamically within ABAP Code
    *To turn runtim analysis on within ABAP code insert the following code
    SET RUN TIME ANALYZER ON.
    *To turn runtim analysis off within ABAP code insert the following code
    SET RUN TIME ANALYZER OFF.
    Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
    Avoid for all entries in JOINS
    Try to avoid joins and use FOR ALL ENTRIES.
    Try to restrict the joins to 1 level only ie only for tables
    Avoid using Select *.
    Avoid having multiple Selects from the same table in the same object.
    Try to minimize the number of variables to save memory.
    The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
    Avoid creation of index as far as possible
    Avoid operators like <>, > , < & like % in where clause conditions
    Avoid select/select single statements in loops.
    Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
    Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
    Avoid using ORDER BY in selects
    Avoid Nested Selects
    Avoid Nested Loops of Internal Tables
    Try to use FIELD SYMBOLS.
    Try to avoid into Corresponding Fields of
    Avoid using Select Distinct, Use DELETE ADJACENT
    Check the following Links
    Re: performance tuning
    Re: Performance tuning of program
    http://www.sapgenie.com/abap/performance.htm
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    check the below link
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    See the following link if it's any help:
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    Check also http://service.sap.com/performance
    and
    books like
    http://www.sap-press.com/product.cfm?account=&product=H951
    http://www.sap-press.com/product.cfm?account=&product=H973
    http://www.sap-img.com/abap/more-than-100-abap-interview-faqs.htm
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    Performance tuning for Data Selection Statement
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    Debugger
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    Run Time Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
    SQL trace
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
    CATT - Computer Aided Testing Too
    http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
    Test Workbench
    http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
    Coverage Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
    Runtime Monitor
    http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
    Memory Inspector
    http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
    ECATT - Extended Computer Aided testing tool.
    http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
    Just refer to these links...
    performance
    Performance
    Performance Guide
    performance issues...
    Performance Tuning
    Performance issues
    performance tuning
    performance tuning
    You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.
    1 Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
    2 Avoid for all entries in JOINS
    3 Try to avoid joins and use FOR ALL ENTRIES.
    4 Try to restrict the joins to 1 level only ie only for 2 tables
    5 Avoid using Select *.
    6 Avoid having multiple Selects from the same table in the same object.
    7 Try to minimize the number of variables to save memory.
    8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
    9 Avoid creation of index as far as possible
    10 Avoid operators like <>, > , < & like % in where clause conditions
    11 Avoid select/select single statements in loops.
    12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
    13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
    14 Avoid using ORDER BY in selects
    15 Avoid Nested Selects
    16 Avoid Nested Loops of Internal Tables
    17 Try to use FIELD SYMBOLS.
    18 Try to avoid into Corresponding Fields of
    19 Avoid using Select Distinct, Use DELETE ADJACENT.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • UNIX command in ABAP code

    Hi All,
    I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
    Can any one help with how to used unix commands in ABAP?
    Thanks in advance.
    Regards,
    Hemendra

    The recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc.  For example:
    Command name       OS         Type             OS command                                 Parameters for operating system command 
    Z_FILE_MOVE        SunOS      Customer    mv                                                 ? ?   
    You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
    Jonathan

  • Needs sample ABAP code for field routine

    Dear Expert,
    There is a field "Pay Scale Group" in my DSO which stores the data in the format
    AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
    InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
    I need to write a field routine on the transformation between DSO and Cube.
    Can any one please help me with the sample ABAP code for this scenario.
    Some more examples for better understanding of the requirement:-
    Data in DSO(Source)            Data in Cube(Target)
    ===================            ===================
    AA1/B1/CCC2/DD2/EEE1            EEE1
    AAA1/BB2/CC1/DDD3/EE2           EE2
    A2/BBB2/CC2/DDD3/EEE5           EEE5
    AA2/BB1/C1/DDD3/EE3             EE3
    A3/B1/CC2/DDD1/EE4              EE4
    Many thanks in advance.
    Regards,
    Prakash
    Please do not dump your code requirements in SDN
    Edited by: Pravender on May 18, 2011 11:37 AM

    Hi,
    You can use the following code :
    Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
    And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
    My assumption is that there will always be 4 '/'.
    In the field routine write the below code
    data: V1(5) type c,
              V2(5) type c,
             V3(5) type c,
              V4(5) type c,
             V5(5) type c.
    data : VAR1 TYPE /BIC/OIZPAY_SGRP.
    split VAR 1  at '/' into V1 V2 V3 V4 V5.
    result = V5.
    V5 will be having the characters after the last '/' .That is V5 = EEE1.
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh
    Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
    Edited by: Ashutosh Singh on May 17, 2011 4:17 PM

  • Sample ABAP code for userexits, and calling bapi's

    Hi,
    Can someone please send me sample ABAP code
    1) to do extractor enhancement using user exit.
    2) ABAP program to call BAPI to read live cache order series data in SNP and write to Idocs through some ports.
    3) ABAP routine to generate file name (based on date/country)in the infopackage to upload flatfiles.
    Thank you very much in advance and appreciate any help.
    Regards
    Prasad

    hai ,
    check this code...
    *& Tables
    tables : tstc,     "SAP Transaction Codes
             tadir,    "Directory of Repository Objects
             modsapt,  "SAP Enhancements - Short Texts
             modact,   "Modifications
             trdir,    "System table TRDIR
             tfdir,    "Function Module
             enlfdir,  "Additional Attributes for Function Modules
             tstct.    "Transaction Code Texts
    *& Variables
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    *& Selection Screen Parameters
    selection-screen begin of block a01 with frame title text-001.
    selection-screen skip.
    parameters : p_tcode like tstc-tcode obligatory.
    selection-screen skip.
    selection-screen end of block a01.
    *& Start of main program
    start-of-selection.
    Validate Transaction Code
      select single * from tstc
        where tcode eq p_tcode.
    Find Repository Objects for transaction code
      if sy-subrc eq 0.
        select single * from tadir
           where pgmid    = 'R3TR'
             and object   = 'PROG'
             and obj_name = tstc-pgmna.
        move : tadir-devclass to v_devclass.
        if sy-subrc ne 0.
          select single * from trdir
             where name = tstc-pgmna.
          if trdir-subc eq 'F'.
            select single * from tfdir
              where pname = tstc-pgmna.
            select single * from enlfdir
              where funcname = tfdir-funcname.
            select single * from tadir
              where pgmid    = 'R3TR'
                and object   = 'FUGR'
                and obj_name = enlfdir-area.
            move : tadir-devclass to v_devclass.
          endif.
        endif.
    Find SAP Modifactions
        select * from tadir
          into table jtab
          where pgmid    = 'R3TR'
            and object   = 'SMOD'
            and devclass = v_devclass.
        select single * from tstct
          where sprsl eq sy-langu
            and tcode eq p_tcode.
        format color col_positive intensified off.
        write:/(19) 'Transaction Code - ',
        20(20) p_tcode,
        45(50) tstct-ttext.
        skip.
        if not jtab[] is initial.
          write:/(95) sy-uline.
          format color col_heading intensified on.
          write:/1 sy-vline,
          2 'Exit Name',
          21 sy-vline ,
          22 'Description',
          95 sy-vline.
          write:/(95) sy-uline.
          loop at jtab.
            select single * from modsapt
            where sprsl = sy-langu and
            name = jtab-obj_name.
            format color col_normal intensified off.
            write:/1 sy-vline,
            2 jtab-obj_name hotspot on,
            21 sy-vline ,
            22 modsapt-modtext,
            95 sy-vline.
          endloop.
          write:/(95) sy-uline.
          describe table jtab.
          skip.
          format color col_total intensified on.
          write:/ 'No of Exits:' , sy-tfill.
        else.
          format color col_negative intensified on.
          write:/(95) 'No User Exit exists'.
        endif.
      else.
        format color col_negative intensified on.
        write:/(95) 'Transaction Code Does Not Exist'.
      endif.
    Take the user to SMOD for the Exit that was selected.
    at line-selection.
      get cursor field field1.
      check field1(4) eq 'JTAB'.
      set parameter id 'MON' field sy-lisel+1(10).
      call transaction 'SMOD' and skip first screen.

  • ABAP code for BI 7.0 transformations start routine

    Hi all,
    I am trying to update data from DSO1 (Source1: transaction data) to Infocube(TARGET)
    In the transformations Start routine, I have to read DSO2(Source2: Master data) for some fields.
    DSO1 has CUSTOMER as part of key
    DSO2 has CUSTOMER (key) and other fields....FIELD1, FILED2, FIELD3
    Infocube to be updated with FIELDS1,2 & 3 WHILE READING DSO2.
    WHERE DSO1 CUSTOMER matches with DSO2 CUSTOMER.
    Also, data NOT TO BE UPLOADED into Infocube if FIELD1 in DSO2= NULL
    Please give me the abap code for the above logic.
    Appreciate any help in this regard.
    Thanks.

    This is a doc from this site:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
    Ravi Thothadri

  • ABAP code needed to convert from 0calmonth2 & 0calyear to 0calmonth

    Hi SAP GURUS,
    Can anybody give me the ABAP code to convert from 0calmonth2 and 0calyear to 0calmonth.and please suggest me whether i have to write start routine or end routine in transformations.
    Thanks ALL.

    hi,
    in the transformation map 0calmonth2 and 0calyear to the 0calmonth field, and from drop down choose routine.
    there will be an area where it will be mentioned write your piece of code below this line.
    paste the below code:
    Concatenate source_fields-0calmonth2 source_fields-0calyear into result.
    also delete the line result = .
    save the routine and execute the package.
    regards,
    Arvind.

  • IDOC: How to create child segment with abap code.

    Hi,
    I'am trying to write an abap code to create segments for an Idoc which structure is the following:
    ZLE_00060_DLVY
    >  E1EDL20
    > Z1DEL_CONS
    >Z1DEL_MAT_HEADER
    > Z1DEL_MAT
    > E1EDL20RET2
    > E1EDL22
    > E1EDL21
    > E1EDL23
    > E1EDL51
    I receive a sintax error: Error in IDoc with status 26 .
    Checking the result I note all segment at the same level and an error about the segment E1EDL22
    EDI: Syntax error in IDoc (segment cannot be identified)
         Message no. E0078
    Diagnosis
         The segment E1EDL22 does not occur at the current level of the basic
         type DELVRY05 (extension ZLE_00060_DLVY).
         This error can have several reasons:
         o   The segment E1EDL22 is assigned to a group whose header segment does
             not occur.
         o   The segment E1EDL22 does not exist in the syntax description of the
             basic type DELVRY05 (extension ZLE_00060_DLVY).
         o   The sequence of segments in the group in which the segment appears
             is incorrect.
         Previous errors ('mandatory' segment or group missing) may be due to
         this error.
    Procedure
         Please check the IDoc or the syntax description of the basic type
         DELVRY05 (extension ZLE_00060_DLVY).
    After the error I have:
    data records
    E1EDL20
    Z1DEL_CONS
    Z1DEL_MAT_HEADER
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    Z1DEL_MAT
    E1EDL20RET2
    E1EDL22
    E1EDL21
    Abap code:
            idoc_data-segnam = 'Z1DEL_CONS'.
            idoc_data-sdata = s_z1del_cons.
            append idoc_data.
              idoc_data-segnam = 'Z1DEL_MAT_HEADER'.
              s_z1del_mat_header-tsegment = 'MATERIAL'.
              idoc_data-sdata = s_z1del_mat_header.
              append idoc_data.
            clear idoc_data-sdata.                            <<<<<<<<<<< how to indent the structure because this is a child.
             idoc_data-sdata = s_Z1DEL_MAT.
             idoc_data-segnam = 'Z1DEL_MAT'.
             append idoc_data.
             idoc_data-segnam = 'E1EDL20RET2'.
             idoc_data-sdata = s_E1EDL20RET2.
             append idoc_data.
             clear idoc_data.
             idoc_data-segnam = 'E1EDL22'.
             idoc_data-sdata = s_e1edl22.
             append idoc_data.
             clear idoc_data.
             idoc_data-segnam = 'E1EDL21'.
             idoc_data-sdata = s_e1edl21.
             append idoc_data.
    Any help will be well appreciated.
    Thanks in advance.
    Regards,
        Giovanni

    Hi,
    following in debugging mode the abap code of the INCLUDE ZXTRKU02 where is defined the TABLES IDOC_DATA STRUCTURE  EDIDD, I find that all field of the table IDOC_DATA are not set. More exactly my expectation is to find values for SEGNUM, HLEVEL, PSGNUM.
    In a few words I need to execute an enhancement, via abap code, of the struscure of the idoc before sending it out since I have a requirement to test this enhancement in my XI environment, receiving as input this ideoc modified.
    Then, I need to add a new segment and one child.
    Any suggestion will be well appreciated.
    Thanks in advance.
    Regards,
        Giovanni

  • Schedule a background job for a program using ABAP code.

    Hi,
    I have to write a program to schedule a background job for another program.
    Need your help to understand how we can achieve this functionality.Any example of an abap code would be of great help.
    Need it urgently.
    Thanks in advance.
    Sandeep.

    Hi Sandeep,
    Here is the demo program regarding the BDC For the background job.
    report zprprbdc1
           no standard page heading line-size 255.
    include bdcrecx1.
    parameters: dataset(132) lower case.
    ***    DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
    *   If it is nessesary to change the data section use the rules:
    *   1.) Each definition of a field exists of two lines
    *   2.) The first line shows exactly the comment
    *       '* data element: ' followed with the data element
    *       which describes the field.
    *       If you don't have a data element use the
    *       comment without a data element name
    *   3.) The second line shows the fieldname of the
    *       structure, the fieldname must consist of
    *       a fieldname and optional the character '_' and
    *       three numbers and the field length in brackets
    *   4.) Each field must be type C.
    *** Generated data section with specific formatting - DO NOT CHANGE  ***
    ***data: begin of itab occurs 0 ,
    ***       matnr(20) type c,
    ***       mbrsh(30) type c,
    ***       mtart(30) type c,
    ***       kzsel(20) type c,
    ***       maktx(40) type c,
    ***       meins(5) type c,
    ***       end of itab.
    data: begin of record occurs 0,
    * data element: MATNR
            matnr_001(018),
    * data element: MBRSH
            mbrsh_002(001),
    * data element: MTART
            mtart_003(004),
    * data element: XFELD
            kzsel_01_004(001),
    * data element: MAKTX
            maktx_005(040),
    * data element: MEINS
            meins_006(003),
    * data element: MTPOS_MARA
            mtpos_mara_007(004),
          end of record.
    *** End generated data section ***
    start-of-selection.
    *perform open_dataset using dataset.
    perform open_group.
    **do.
    **read dataset dataset into record.
    **if sy-subrc <> 0. exit. endif.
    call function 'GUI_UPLOAD'
      exporting
        filename                      = 'c:\jitu\bdc\10002.txt'
       filetype                      = 'ASC'
       has_field_separator           = 'x'
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      tables
        data_tab                      = record
    * EXCEPTIONS
    *   FILE_OPEN_ERROR               = 1
    *   FILE_READ_ERROR               = 2
    *   NO_BATCH                      = 3
    *   GUI_REFUSE_FILETRANSFER       = 4
    *   INVALID_TYPE                  = 5
    *   NO_AUTHORITY                  = 6
    *   UNKNOWN_ERROR                 = 7
    *   BAD_DATA_FORMAT               = 8
    *   HEADER_NOT_ALLOWED            = 9
    *   SEPARATOR_NOT_ALLOWED         = 10
    *   HEADER_TOO_LONG               = 11
    *   UNKNOWN_DP_ERROR              = 12
    *   ACCESS_DENIED                 = 13
    *   DP_OUT_OF_MEMORY              = 14
    *   DISK_FULL                     = 15
    *   DP_TIMEOUT                    = 16
    *   OTHERS                        = 17
    if sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    loop at record .
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  record-matnr_001.
    perform bdc_field       using 'RMMG1-MBRSH'
                                  record-mbrsh_002.
    perform bdc_field       using 'RMMG1-MTART'
                                  record-mtart_003.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  record-kzsel_01_004.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  record-maktx_005.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                  record-meins_006.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  record-mtpos_mara_007.
    perform bdc_transaction using 'MM01'.
    **enddo.
    endloop.
    perform close_group.
    *perform close_dataset using dataset.
    &*****************Reward point if helpful************&

  • How can I modify data from a Transparent Table without ABAP code.

    Hi,All
    How can I modify data from a Transparent Table (like TCURR),  and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
    I had fond that there is a way can do that:
    1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
    2, type '/h' and let debugging on
    3, select one of this data then click 'Display',enter in debugging system.
    4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
    and, My system is ECC6.
    thank you all
    Edited by: xuehui li on Aug 20, 2008 6:30 PM

    Hello,
    Your approach (with Vijay's suggestion) MAY work.  However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT.  This will be especially true if you are working in a Production environment.  Vijay's other comment is true as well.  This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment.  The auditors will not be impressed.
    Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
    Regards
    Greg Kern

Maybe you are looking for

  • Default Current year in select option field on selection Screen

    Dear Experts, I want to set current year as default value in fiscal year select-options field on selection screen. for this, i hv written following code DATA:VAR_DATE TYPE SY-DATUM. DATA VAR(4) TYPE C. VAR_DATE = SY-DATUM. VAR = VAR_DATE+0(4). this r

  • FI_DUPLICATE_INVOICE_CHECK

    I am trying to use this function call and am having trouble when the program comes back from the call. I use the debugging tool and it shows me the duplicate message - but within the program there is not a return code or anything that I see that will

  • TRANSPORT OF BIN STRUCTURE

    Hello all, I would like to know whether the bin structure created using LS10 can be transported from a development server to the next server or is it independent of transport and cannot be transported. pl. advise Thanks, Maxx

  • Change the document flow, table CRMD_BRELVONAI

    Hi experts, We are using CRM and ISU. For few cases the ISUCONTRACT displayed in the CIC0 is wrong. I would like to know if it's possible to change the document flow ? (the datas in table CRMD_BRELVONAI). By transaction ? by FM ? Thanks in advance if

  • Open the file extension .BBB for my Torch 9630

    I need the to open my backup files but the extension .BBB is not being recognized. Solved! Go to Solution.